메소드 | 설명 | |
---|---|---|
ContextFreeGrammar ( |
||
Display ( |
Writes the productions 'E -> alpha_1 | alpha_2 | ... | alpha_n' to tw with the set of productions for each nonterminal E (variable) per line.
|
|
GetNonVariableSymbols ( ) : IEnumerable |
||
GetProductions ( ) : IEnumerable |
||
GetProductions ( |
||
GetUsefulNonterminals ( ) : HashSet |
Return all useful nonterminal symbols.
|
|
GetUsefulNonterminals ( bool checkBackwardsOnly ) : HashSet |
Return all useful nonterminal symbols. If checkBackwardsOnly is true, assume that all symbols are reachable from the start symbol.
|
|
IsValidVariable ( |
||
MkCNF ( |
Returns MkCNF(g, true)
|
|
MkCNF ( |
Produces the CNF (Chomsky Normal Form) for the grammar g. It first eliminates epsilons, useless symbols, and unit productions. If Assumes that there are no epsilons, useless symbols or unit productions
|
|
MkEGNF ( |
Produces the EGNF (Extended Greibach Normal Form) for the grammar g. The grammar g can be arbitrary. First removes epsilons and useless symbols from g. Implements a variation of the Blum-Koch algorithm. (Inf. and Comp. vol.150, pp.112-118, 1999)
|
|
MkEGNF ( |
Produces the EGNF (Extended Greibach Normal Form) for the grammar g. Implements a variation of the Blum-Koch algorithm. (Inf. and Comp. vol.150, pp.112-118, 1999)
|
|
MkGNF ( |
Returns MkGNF(g, true)
|
|
MkGNF ( |
Produces the GNF (Greibach Normal Form) for the grammar g. If g is not already in GNF, first makes CNF. Implements a variation of the Koch-Blum algorithm. (STACS 97, pp. 47-54)
|
|
RemoveEpsilonsAndUselessSymbols ( ) : |
Removes epsilon productions and then removes useless symbols. Assumes that the grammar does not accept the empty string and that the language is nonempty.
|
|
RemoveUnitProductions ( ) : |
Removes all productions of the form A->B where A and B are variables. Removes also all the useless symbols after the unit production elimination. Assumes that the grammar has no epsilon productions.
|
|
RemoveUselessSymbols ( ) : |
Removes useless symbols from the grammar. Assumes that the language is nonempty.
|
|
RestrictToVariables ( HashSet |
Restrict the grammar to the given variables.
|
|
ToString ( ) : string |
Returns the value of Description
|
메소드 | 설명 | |
---|---|---|
AllVariablesExceptTheStartSymbol ( ) : IEnumerable |
||
ContextFreeGrammar ( List |
||
DescribeProductions ( |
||
EliminateNullables ( |
||
EnumerateNullableFreeVariations ( ConsList |
||
FinalStateHasVariableMoves ( Automaton |
||
GetNullables ( ) : HashSet |
||
GetUnitClosure ( |
||
IsInCNF ( ) : bool | ||
IsInGNF ( ) : bool | ||
Lookup ( Nonterminal>.Dictionary |
||
StartSymbolAppearsInRhs ( ) : bool |
public ContextFreeGrammar ( |
||
startSymbol | ||
productions | IEnumerable |
|
리턴 | System |
public GetUsefulNonterminals ( bool checkBackwardsOnly ) : HashSet |
||
checkBackwardsOnly | bool | |
리턴 | HashSet |
public static MkCNF ( |
||
g | ||
리턴 |
public static MkCNF ( |
||
g | ||
removeEpsilonsUselessSymbolsUnitsProductions | bool | |
리턴 |
public static MkEGNF ( |
||
g | the grammar to be normalized | |
리턴 |
public static MkEGNF ( |
||
g | the grammar to be normalized | |
removeEpsilonsAndUselessSymbols | bool | if true, first removes epsilons and useless symbols, otherwise assumes that epsilons do not occur |
리턴 |
public static MkGNF ( |
||
g | ||
리턴 |
public static MkGNF ( |
||
g | ||
removeEpsilonsUselessSymbolsUnitsProductions | bool | |
리턴 |
public RemoveEpsilonsAndUselessSymbols ( ) : |
||
리턴 |
public RemoveUnitProductions ( ) : |
||
리턴 |
public RemoveUselessSymbols ( ) : |
||
리턴 |
public RestrictToVariables ( HashSet |
||
varSet | HashSet |
|
리턴 |