Lines Matching full:state
8 /** This class represents a state in the LALR viable prefix recognition machine.
9 * A state consists of an LALR item set and a set of transitions to other
10 * states under terminal and non-terminal symbols. Each state represents
11 * a potential configuration of the parser. If the item set of a state
15 * this indicates that when the parser is in this state it is currently
19 * by several items). In our example above, the state would also include
30 * In a shift, it consumes one token and makes a transition to a new state.
32 * in the state (these new shifted items will then be found in the state at
37 * production. This leaves the machine in the same state is was in when the
38 * parser first attempted to find the RHS. From this state it makes a
57 /** Constructor for building a state from a set of items.
58 * @param itms the set of items that makes up this state.
65 "Attempt to construct an LALR state from a null item set");
69 "Attempt to construct a duplicate LALR state");
99 * unclosed, set of items -- which uniquely define the state). This table
100 * stores state objects using (a copy of) their kernel item sets as keys.
106 /** Find and return state with a given a kernel item set (or null if not
108 * originally create the state. These items are formed by "shifting the
110 * The remaining elements of this state's item set are added during closure.
111 * @param itms the kernel set of the state we are looking for.
123 /** Static counter for assigning unique state indexes. */
130 /** The item set for this state. */
133 /** The item set for this state. */
138 /** List of transitions out of this state. */
141 /** List of transitions out of this state. */
146 /** Index of this state in the parse tables */
149 /** Index of this state in the parse tables */
156 /** Helper routine for debugging -- produces a dump of the given state
208 /* propagate lookaheads out of that state */
217 /** Add a transition out of this state to another.
219 * @param to_st the state the transition goes to.
234 * production. This method operates by first building a start state
236 * the beginning and EOF as expected lookahead). Then for each state
238 * the state to new or existing states. When considering extension
239 * from a state we make a transition on each symbol that appears before
244 * in some state, then we would be making a transition under X to a new
245 * state. This new state would be formed by a "kernel" of items
250 * The full state would then be formed by "closing" this kernel set of
254 * next when in this state (see lalr_item_set.compute_closure() for details
259 * states (i.e., corresponding to LALR rather than canonical LR) the state
303 /* build a state out of that item set and put it in our work set */
307 /* enter the state using the kernel as the key */
313 /* remove a state from the work set */
346 /* add to the kernel of the new state */
354 /* use new items as state kernel */
360 /* if we haven't, build a new state out of the item set */
366 /* build the new state */
369 /* add the new state to our work set */
375 /* otherwise relink propagation to items in existing state */
378 /* walk through the items that have links to the new state */
386 /* pull out item linked to in the new state */
390 /* find corresponding item in the existing state */
400 /* add a transition from current state to that state */
415 /** Propagate lookahead sets out of this state. This recursively
417 * in this state.
421 /* recursively propagate out from each item in the state */
428 state. There are two
433 * out of the state (shift entries) or reductions from the state to some
434 * previous state saved on the stack (reduce entries). All entries in the
437 * out of a state on that non-terminal.<p>
465 /* consider each item in our state */
548 /** Produce warning messages for all conflicts found in this state. */
627 System.err.println("*** Reduce/Reduce conflict found in state #"+index());
669 System.err.println("*** Shift/Reduce conflict found in state #"+index());