|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.brics.grammar.operations.TerminalFinder
public class TerminalFinder
Finds terminals that may/must occur in derivable strings.
A "may" terminal is one that might occur in some derivation (so the set of derivable strings is included in the Kleene star of the union of the may-terminals). A "must" terminal is one that definitely occurs in every derivation of a string (so for every must-terminal, every derivable string contains a substring that matches the must-terminal). EOF terminals are excluded in both.
Constructor Summary | |
---|---|
TerminalFinder(Grammar g)
Finds the may/must terminals for the given grammar. |
Method Summary | |
---|---|
AutomataCollection |
getMayTerminals(Production p)
Returns the terminals that appear in some derivations from the given production. |
AutomataCollection |
getMayTerminals(String nt)
Returns the terminals that appear in some derivations from the given nonterminal. |
AutomataCollection |
getMustTerminals(Production p)
Returns the terminals that appear in all derivations from the given production. |
AutomataCollection |
getMustTerminals(String nt)
Returns the terminals that appear in all derivations from the given nonterminal. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerminalFinder(Grammar g)
Method Detail |
---|
public AutomataCollection getMayTerminals(Production p)
public AutomataCollection getMayTerminals(String nt)
public AutomataCollection getMustTerminals(Production p)
public AutomataCollection getMustTerminals(String nt)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |