DescribedTypeBuilder
Builder for the description of a node. This typically should be used like this:
MyNodeType {
expect(TokenType)
expect(MyOtherNodeType)
}
Functions
Builds this as a described type
Build an "either" construct, with different branches the parsing process can take.
Adds an expectation that always succeeds and emits the provided value.
Adds an expectation to this node descriptor based on a node
Adds an expectation to this node descriptor based on a token type.
Expect the end-of-file to be reached at this point.
Create a lookahead expectation.
Create an optional branch. If the optional branch matches, what it stores will is passed transparently, just like if the optional { }
was not there. If the optional branch does not match, nothing happens, just like if the entire optional branch was not there.
Add an expectation that will be built when the description gets built.
Add an expectation directly instead of a builder. This is a shortcut for this += Buildable.of(expectation)
Repeatedly runs the provided expectations without storing anything.
Used with storeIn self()
, provides the actual value of a node declaration that is implemented with by subtype()
Concise notation for the expect function.
Properties
Used with storeIn
, allows placing some state as the item of the output list.