|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.umlv.tatoo.cc.parser.slr.SLRTableFactoryMethod
public class SLRTableFactoryMethod
Constructor Summary | |
---|---|
SLRTableFactoryMethod()
|
Method Summary | |
---|---|
Grammar |
buildGrammar(Collection<? extends ProductionDecl> productions,
Set<? extends NonTerminalDecl> starts,
TerminalDecl eof)
builds the augmented grammar |
LR0Item |
createStartItem(ProductionDecl production,
TerminalDecl eof)
Create the kernel item for the start states |
LR0ClosureComputer |
getClosureComputer(Grammar grammar,
GrammarSets grammarSets,
TerminalDecl eof)
Returns the closure computer for this method |
Set<TerminalDecl> |
getLookaheads(Grammar g,
GrammarSets sets,
LR0Item item,
NodeDecl<LR0Item> node)
returns the set of lookahead corresponding to a reduce action by item |
void |
initializeComputation(NodeFactory<LR0Item> 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 SLRTableFactoryMethod()
Method Detail |
---|
public LR0ClosureComputer getClosureComputer(Grammar grammar, GrammarSets grammarSets, TerminalDecl eof)
TableFactoryMethod
getClosureComputer
in interface TableFactoryMethod<LR0Item>
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<LR0Item>
productions
- list of productionsstarts
- list of startseof
- terminal eof
public Set<TerminalDecl> getLookaheads(Grammar g, GrammarSets sets, LR0Item item, NodeDecl<LR0Item> node)
TableFactoryMethod
getLookaheads
in interface TableFactoryMethod<LR0Item>
g
- the grammarsets
- nullable, first and follow sets corresponding to gitem
- the item to reduce bynode
- the node
public LR0Item createStartItem(ProductionDecl production, TerminalDecl eof)
TableFactoryMethod
createStartItem
in interface TableFactoryMethod<LR0Item>
production
- the starting productioneof
- the end of file terminal
public void initializeComputation(NodeFactory<LR0Item> factory, Grammar grammar, GrammarSets grammarSets, TerminalDecl eof)
TableFactoryMethod
initializeComputation
in interface TableFactoryMethod<LR0Item>
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 |