|
Mercury library
1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
|
Represents an edge in the chart created by the ChartParser. This is an immutable class.
The Edge contains four values:
More...
Public Member Functions | |
| Edge (Rule rule, int dot, int left, int right) | |
| Creates a new edge. If the constructor does not throw any exception, the edge is guaranteed to be valid. More... | |
| bool | IsValid () |
| Determines whether this edge is valid. More... | |
| override bool | Equals (object obj) |
| override int | GetHashCode () |
| override string | ToString () |
| bool | Equals (Edge other) |
| int | CompareTo (Edge other) |
| Compares the edge with another edge. Defines a lexicographical order as follows: More... | |
Properties | |
| Rule | Rule [get, set] |
| The source rule. More... | |
| int | Dot [get, set] |
| Position of the dot. More... | |
| int | Left [get, set] |
| Left node number. More... | |
| int | Right [get, set] |
| Right node number. More... | |
| bool | IsActive [get, set] |
| Determines whether the edge is active. More... | |
| bool | IsPassive [get, set] |
Complement of IsActive (convenience property). More... | |
| Symbol | NextSymbol [get, set] |
Returns the next symbol after the dot. The edge must be active, otherwise is null. More... | |
Represents an edge in the chart created by the ChartParser. This is an immutable class.
The Edge contains four values:
source rule- rule that possibly created a part of sentence
dot- position in the rule
left- number of left node in the chart
right- number of right node in the chart
Edge is usually written in the form (l, r) A -> alpha . beta which means that this edge "covers" tokens l to r in the input (alpha) and is yet to cover beta.
Edge is said to be active iff beta is not empty (that is, dot < n). Otherwise the rule is said to be passive.
For an edge to be valid the following conditions must hold:
| Mercury.Syntax.Edge.Edge | ( | Rule | rule, |
| int | dot, | ||
| int | left, | ||
| int | right | ||
| ) |
Creates a new edge. If the constructor does not throw any exception, the edge is guaranteed to be valid.
| rule | The source rule. |
| dot | Position of the dot. |
| left | Left node number. |
| right | Right node number. |
| System.ArgumentNullException | When the source rule is null. |
| Mercury.Exceptions.InvalidEdgeException | When the edge is not valid. |
| int Mercury.Syntax.Edge.CompareTo | ( | Edge | other | ) |
Compares the edge with another edge. Defines a lexicographical order as follows:
| other | Another edge |
| bool Mercury.Syntax.Edge.IsValid | ( | ) |
|
getset |
|
getset |
|
getset |
1.8.7