DynamicParseTree

Base class for all tree nodes.

Members

Aliases

LocationDiff
alias LocationDiff = typeof(Location.init - Location.init)
Undocumented in source.
LocationRange
alias LocationRange = LocationRangeImpl!Location
Undocumented in source.

Functions

childByName
DynamicParseTree childByName(string name)

Gets a child of this subtree by name.

childIndexByName
size_t childIndexByName(string name)

Returns the index of a child by name or size_t.max.

childName
string childName(size_t index)

Gets the name of child with index index.

childs
inout(DynamicParseTree[]) childs()

Childs of this subtree. Will be empty for tokens.

content
string content()

Text content for tokens.

hasChildWithName
bool hasChildWithName(string name)

Checks if this subtree has a child with some name.

isToken
bool isToken()
Undocumented in source. Be warned that the author may not have intended to support it.
name
string name()

Name for nonterminals.

setStartEnd
void setStartEnd(typeof( ()()) start, typeof( ()()) end)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

grammarInfo
immutable(GrammarInfo)* grammarInfo;

Information about the grammar for this tree node.

location
LocationRange location;

Location of this tree node in the source file.

nodeType
NodeType nodeType;

Type of tree node. Should match the used subclass.

nonterminalID
SymbolID nonterminalID;

ID of nonterminal for this tree starting at grammarInfo.startNonterminalID or SymbolID.max if not applicable. See grammarInfo.allNonterminals[nonterminalID - grammarInfo.startNonterminalID] for details about the nonterminal.

productionID
ProductionID productionID;

ID of production for this tree starting at grammarInfo.startProductionID or ProductionID.max if not applicable. See grammarInfo.allProductions[productionID - grammarInfo.startProductionID] for details about the prodution.

Parameters

Location

Type of location in source file.

LocationRangeImpl

Template for determining how location ranges are stored (start + length, start + end, ...).

Meta