org.metasyntactic.math.automata
Class AugmentedGrammar
java.lang.Object
|
+--org.metasyntactic.math.automata.ContextFreeGrammar
|
+--org.metasyntactic.math.automata.AugmentedGrammar
- All Implemented Interfaces:
- FiniteAutomata, java.io.Serializable
- public class AugmentedGrammar
- extends ContextFreeGrammar
If G is a grammar with start symbol S, then G', the augmented grammar
for G, is G with a new Start symbol S' and production S' → S. The purpose
of this new starting production is to indicate to the parser when it should
stop parsing and announce acceptance of the input. That is, acceptance
occurs when and only when the parser is about to reduce by S' → S.
- See Also:
ContextFreeGrammar
,
ContextFreeGrammar.augment()
,
Serialized Form
Methods inherited from class org.metasyntactic.math.automata.ContextFreeGrammar |
accept, augment, computeAux, computeFirst, computeFollow, computeNullable, first, first, follow, getProductions, getStartVariable, getTerminals, getVariables, isNullable, isNullable, main |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AugmentedGrammar
public AugmentedGrammar(ContextFreeGrammar augmented,
ContextFreeGrammar original)
getBaseGrammar
public ContextFreeGrammar getBaseGrammar()
toString
public java.lang.String toString()
- Overrides:
toString
in class ContextFreeGrammar