Méthode | Description | |
---|---|---|
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
|
Méthode | 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 |
|
Résultat | System |
public Display ( |
||
tw | ||
Résultat | void |
public GetNonVariableSymbols ( ) : IEnumerable |
||
Résultat | IEnumerable |
public GetProductions ( |
||
v | ||
Résultat | IList |
public GetUsefulNonterminals ( bool checkBackwardsOnly ) : HashSet |
||
checkBackwardsOnly | bool | |
Résultat | HashSet |
public IsValidVariable ( |
||
v | ||
Résultat | bool |
public static MkCNF ( |
||
g | ||
Résultat |
public static MkCNF ( |
||
g | ||
removeEpsilonsUselessSymbolsUnitsProductions | bool | |
Résultat |
public static MkEGNF ( |
||
g | the grammar to be normalized | |
Résultat |
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 |
Résultat |
public static MkGNF ( |
||
g | ||
Résultat |
public static MkGNF ( |
||
g | ||
removeEpsilonsUselessSymbolsUnitsProductions | bool | |
Résultat |
public RemoveEpsilonsAndUselessSymbols ( ) : |
||
Résultat |
public RemoveUnitProductions ( ) : |
||
Résultat |
public RemoveUselessSymbols ( ) : |
||
Résultat |
public RestrictToVariables ( HashSet |
||
varSet | HashSet |
|
Résultat |