public class LalrAlgorithmicSupport extends BaseAlgorithmicSupport
environment, runtimeData| Constructor and Description |
|---|
LalrAlgorithmicSupport(Environment environment)
Construct the supporting utility algorithm class for LALR
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllLookaheads(Dot marker,
Dot auxiliary)
Simply put lookaheads of auxiliary into marker
|
boolean |
addLookaheadsToState(State[] I,
int state,
List<Dot> dots)
For algorithms that support look ahead per state, this method will
add all the lookaheads of the passed dots into the state's dots.
|
LookAhead |
computeLookAhead(Rule rule,
RuleItem item)
Compute the lookahead set of a rule on a specific item
|
boolean |
dotContains(Dot dot,
int terminalId)
Checks a dot to see if it contains the symbol
|
String |
getPrintableLookahead(Dot dot)
Print the lookaheads in a dot
|
boolean |
hasFollows()
Does this algorithm support follow sets?
|
void |
initializeDot(Dot dot)
This dot is brand new, and used for a state.
|
boolean |
isMultiPass() |
void |
mergeLookaheads(Dot from,
Dot to)
Merge one marker dot's lookaheads into a destination.
|
boolean |
supportsLookahead()
Does this algorithm support lookaheads
|
public LalrAlgorithmicSupport(Environment environment)
environment - is the calling environmentpublic boolean supportsLookahead()
AlgorithmicSupportpublic boolean addLookaheadsToState(State[] I, int state, List<Dot> dots)
AlgorithmicSupportI - is the array of statesstate - is the state numberdots - is the list of marker Dotspublic LookAhead computeLookAhead(Rule rule, RuleItem item)
AlgorithmicSupportrule - is the rule where the lookahead beginsitem - is the dot position to start lookahead computations.public void mergeLookaheads(Dot from, Dot to)
AlgorithmicSupportfrom - is the source of the lookaheadsto - is the second auxiliary dotpublic void addAllLookaheads(Dot marker, Dot auxiliary)
AlgorithmicSupportmarker - is the receiving markerauxiliary - is the originating set of lookaheadspublic String getPrintableLookahead(Dot dot)
AlgorithmicSupportdot - is the dot to printpublic boolean dotContains(Dot dot, int terminalId)
AlgorithmicSupportdot - the dot to checkterminalId - is the symbolpublic boolean isMultiPass()
public void initializeDot(Dot dot)
AlgorithmicSupportdot - is the dot to initializepublic boolean hasFollows()
AlgorithmicSupportCopyright © 2017. All rights reserved.