Lines Matching +full:three +full:- +full:state

1 .\" Copyright (C) Caldera International Inc. 2001-2002.  All rights reserved.
52 of a finite state machine with a stack.
58 .I "current state"
60 The states of the finite state machine are given
61 small integer labels; initially, the machine is in state 0,
62 the stack contains only state 0, and no lookahead token has been read.
72 Based on its current state, the parser decides
79 Using the current state, and the lookahead token
91 For example, in state 56 there may be
96 which says, in state 56, if the lookahead token is IF,
97 the current state (56) is pushed down on the stack,
98 and state 34 becomes the current state (on the
130 .I state
139 symbols on the right hand side (three in this case).
140 To reduce, first pop off the top three states
151 After popping these states, a state is uncovered
152 which was the state the parser was in before beginning to
154 Using this uncovered state, and the symbol
157 A new state is obtained, pushed onto the stack, and parsing continues.
165 In any case, the uncovered state contains an entry such as:
169 causing state 20 to be pushed
170 onto the stack, and become the current state.
174 state where the right hand side of the rule was first seen.
177 no states are popped off of the stack: the uncovered state
178 is in fact the current state.
180 The reduce action is also important in the treatment of user-supplied
196 The pseudo-variables $1, $2, etc., refer to the value stack.
231 .B \-v
234 is produced, with a human-readable description of the parser.
240 state 0
249 state 1
255 state 2
263 state 3
269 state 4
274 state 5
279 state 6
284 Notice that, in addition to the actions for each state, there is a
286 state. The \_ character is used to indicate
295 Initially, the current state is state 0.
297 between the actions available in state 0, so
301 The action in state 0 on
304 is ``shift 3'', so state 3 is pushed onto the stack,
306 State 3 becomes the current state.
310 The action in state 3 on the token
313 so state 6 is pushed onto the stack, and the lookahead is cleared.
315 In state 6, without even consulting the lookahead,
321 two states, 6 and 3, are popped off of the stack, uncovering state 0.
322 Consulting the description of state 0, looking for a goto on
327 is obtained; thus state 2 is pushed onto the stack,
328 becoming the current state.
330 In state 2, the next token,
333 The action is ``shift 5'', so state 5 is pushed onto the stack, which now has
335 In state 5, the only action is to reduce by rule 3.
336 This has one symbol on the right hand side, so one state, 5,
337 is popped off, and state 2 is uncovered.
338 The goto in state 2 on
341 is state 4.
343 In state 4, the only action is to reduce by rule 1.
345 uncovering state 0 again.
346 In state 0, there is a goto on
348 causing the parser to enter state 1.
349 In state 1, the input is read; the endmarker is obtained,
353 The action in state 1 when the endmarker is seen is to accept,