public class SetCalculatorVisitor extends AbstractGrammarEntityVisitor
EpsilonRemovalVisitor
to remove
those before calculating first and follow sets. It is also simplified in the sense that the end of file symbol is not added
to the followsets. This is simply because we will not need it for this analysis.Modifier and Type | Field and Description |
---|---|
Grammar |
grammar |
marked
Constructor and Description |
---|
SetCalculatorVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
apply(Grammar g) |
LinkedSet<AlphabetSymbol> |
getFirstSet(AlphabetSymbol n) |
Map<AlphabetSymbol,LinkedSet<AlphabetSymbol>> |
getFirstSets() |
LinkedSet<AlphabetSymbol> |
getFollowSet(AlphabetSymbol n) |
Map<AlphabetSymbol,LinkedSet<AlphabetSymbol>> |
getFollowSets() |
Set<Production> |
getUsesSet(NonTerminal n) |
Map<NonTerminal,Set<Production>> |
getUsesSets() |
void |
out(Production production) |
void |
out(Terminal terminal) |
void |
reApply() |
apply, apply, apply, getLocation, getPath, in, in, in, isMarked, mark, out, print, shouldPrettyPrint
public Grammar grammar
public void apply(Grammar g)
apply
in interface GrammarEntityVisitor
apply
in class AbstractGrammarEntityVisitor
public LinkedSet<AlphabetSymbol> getFirstSet(AlphabetSymbol n)
public Map<AlphabetSymbol,LinkedSet<AlphabetSymbol>> getFirstSets()
public LinkedSet<AlphabetSymbol> getFollowSet(AlphabetSymbol n)
public Map<AlphabetSymbol,LinkedSet<AlphabetSymbol>> getFollowSets()
public Set<Production> getUsesSet(NonTerminal n)
public Map<NonTerminal,Set<Production>> getUsesSets()
public void out(Production production)
out
in interface GrammarEntityVisitor
out
in class AbstractGrammarEntityVisitor
public void out(Terminal terminal)
out
in interface GrammarEntityVisitor
out
in class AbstractGrammarEntityVisitor
public void reApply()
Copyright © 2008-2013 Mathias Schwarz.