|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.cc.parser.lr.LRTableFactoryMethod
public class LRTableFactoryMethod
Constructor Summary | |
---|---|
LRTableFactoryMethod()
|
Method Summary | |
---|---|
Grammar |
buildGrammar(Collection<? extends ProductionDecl> productions,
Set<? extends NonTerminalDecl> starts,
TerminalDecl eof)
builds the augmented grammar |
LR1Item |
createStartItem(ProductionDecl production,
TerminalDecl eof)
Create the kernel item for the start states |
NodeClosureComputer<LR1Item> |
getClosureComputer(Grammar grammar,
GrammarSets grammarSets,
TerminalDecl eof)
Returns the closure computer for this method |
Set<TerminalDecl> |
getLookaheads(Grammar g,
GrammarSets sets,
LR1Item item,
NodeDecl<LR1Item> node)
returns the set of lookahead corresponding to a reduce action by item |
void |
initializeComputation(NodeFactory<LR1Item> factory,
Grammar grammar,
GrammarSets grammarSets,
TerminalDecl eof)
Initialize some computation (for LALR) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LRTableFactoryMethod()
Method Detail |
---|
public NodeClosureComputer<LR1Item> getClosureComputer(Grammar grammar, GrammarSets grammarSets, TerminalDecl eof)
TableFactoryMethod
getClosureComputer
in interface TableFactoryMethod<LR1Item>
grammar
- the grammargrammarSets
- the grammar setseof
- the end of file terminal
public Grammar buildGrammar(Collection<? extends ProductionDecl> productions, Set<? extends NonTerminalDecl> starts, TerminalDecl eof)
TableFactoryMethod
buildGrammar
in interface TableFactoryMethod<LR1Item>
productions
- list of productionsstarts
- list of startseof
- terminal eof
public Set<TerminalDecl> getLookaheads(Grammar g, GrammarSets sets, LR1Item item, NodeDecl<LR1Item> node)
TableFactoryMethod
getLookaheads
in interface TableFactoryMethod<LR1Item>
g
- the grammarsets
- nullable, first and follow sets corresponding to gitem
- the item to reduce bynode
- the node
public LR1Item createStartItem(ProductionDecl production, TerminalDecl eof)
TableFactoryMethod
createStartItem
in interface TableFactoryMethod<LR1Item>
production
- the starting productioneof
- the end of file terminal
public void initializeComputation(NodeFactory<LR1Item> factory, Grammar grammar, GrammarSets grammarSets, TerminalDecl eof)
TableFactoryMethod
initializeComputation
in interface TableFactoryMethod<LR1Item>
factory
- the factory used to build nodesgrammar
- the grammargrammarSets
- grammarSets first and follow sets corresponding the grammareof
- the end of file terminal
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |