ParseTree

The basic parse tree, as used throughout the project. You can define your own parse tree node, but respect the basic layout.

Members

Functions

dup
ParseTree dup()
Undocumented in source. Be warned that the author may not have intended to support it.
failMsg
string failMsg(string delegate(Position, string, string, const ParseTree) @(safe) pure formatFailMsg, string successMsg)

Generates a generic error when a node fails

idup
immutable(ParseTree) idup()
Undocumented in source. Be warned that the author may not have intended to support it.
opDollar
size_t opDollar()
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
inout(ParseTree) opIndex(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
inout(ParseTree[]) opIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
opSlice
inout(ParseTree)[] opSlice(size_t i, size_t j)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString(string tabs)

Basic toString for easy pretty-printing.

Variables

begin
size_t begin;
Undocumented in source.
children
ParseTree[] children;

The sub-trees created by sub-rules parsing.

end
size_t end;

Indices for the matched part from the very beginning of the first match to the last char of the last match.

failEnd
size_t failEnd;
Undocumented in source.
failedChild
ParseTree[] failedChild;

The !successful child that could still be partially parsed.

input
string input;

The input string that generated the parse tree. Stored here for the parse tree to be passed to other expressions, as input.

matches
string[] matches;

The matched input's parts. Some expressions match at more than one place, hence matches is an array.

name
string name;

The node name

successful
bool successful;

Indicates whether a parsing was successful or not

Meta