|
Mercury library
1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
|
Represents a Context-Free Grammar rule. This is an immutable class. More...
Public Member Functions | |
| Rule (Symbol lhs, IEnumerable< Symbol > rhs) | |
| Creates a rule. If the constructor does not throw any exception, the rule is guaranteed to be valid. More... | |
| override bool | Equals (object obj) |
| override int | GetHashCode () |
| override string | ToString () |
| bool | Equals (Rule other) |
| int | CompareTo (Rule other) |
| Compares the rule with another rule. Defines a lexicographical order as follows: More... | |
Properties | |
| Symbol | LHS [get, set] |
| The Left-Hand Side (LHS) of the rule. More... | |
| IReadOnlyList< Symbol > | RHS [get, set] |
| The Right-Hand Side (RHS) of the rule. More... | |
| bool | IsEpsilon [get, set] |
| Determines whether the rule is an epsilon rule. More... | |
Represents a Context-Free Grammar rule. This is an immutable class.
Conditions for a symbol to be valid:
LHS:
a single NONTERMINAL symbol
RHS:
a) a non-empty list of Terminal and/or Nonterminal symbols
– OR –
b) a list of EXACTLY ONE epsilon symbol
Creates a rule. If the constructor does not throw any exception, the rule is guaranteed to be valid.
| lhs | The LHS symbol. |
| rhs | The RHS symbols. |
| System.ArgumentNullException | rhs |
| Mercury.Exceptions.InvalidRuleException | When the rule is not valid. |
| int Mercury.Syntax.Rule.CompareTo | ( | Rule | other | ) |
Compares the rule with another rule. Defines a lexicographical order as follows:
| other | Another rule |
|
getset |
|
getset |
|
getset |
1.8.7