ExpectedNode
An expectation that expects another node to be present at this point.
For example:
x = (1 + 2) + 3
You could define an "assignment" node with three expectations:
For the first operand and the equals sign, a simple ExpectedToken
For the right operand, an
ExpectedNode(ExpressionNode)
.
This expectation is the main way of composing nodes.
Functions
Check if this expectation matches the given context at the given index among the context's tokens list.
Properties
The name of the argument where the result of this expectation should be stored, or null
if the matched value of this expectation should not or cannot be stored.
Title of this expectation. This should be a shortened description of what this expectation is. For example, an expectation for a node could have the title expect(SomeNode)
. If possible and legible, this title should be similar to the DSL expression for creating the expectation