14 using System.Collections.Generic;
55 Term = token.Terminal;
67 ReduceProduction = reduceProduction;
69 Term = ReduceProduction.LValue;
85 return Term.GetParseNodeCaption(
this);
89 var tkn = FindToken();
90 return tkn == null ? null : tkn.Text;
93 return FindFirstChildTokenRec(
this);
96 if (node.
Token != null)
return node.Token;
98 var tkn = FindFirstChildTokenRec(child);
99 if (tkn != null)
return tkn;
104 get {
return ChildNodes[0]; }
107 get {
return ChildNodes[ChildNodes.Count -1]; }
132 SourceText = sourceText;
134 Status = ParseTreeStatus.Parsing;
138 if (ParserMessages.Count == 0)
return false;
139 foreach (var err
in ParserMessages)
145 foreach(var other
in others)
146 this.ParserMessages.Add(
new ParserMessage(other.Level, baseLocation + other.Location, messagePrefix + other.Message, other.ParserState));
string FindTokenAndGetText()
ParseTreeNode(ParserState initialState)
ParseTreeNode(BnfTerm term)
readonly string SourceText
ParseTree(string sourceText, string fileName)
Currently ignored by Parser, may be used in the future to set specific precedence value of the follow...
readonly SourceLocation Location
Location in the source code.
ParseTreeNode(object node, BnfTerm term, int precedence, Associativity associativity, SourceSpan span)
override string ToString()
ParseTreeNodeList ChildNodes
Associativity Associativity
ParseTreeNode(Token token)
SiliconStudio.Shaders.Ast.SourceSpan SourceSpan
Production ReduceProduction
Tokens are produced by scanner and fed to parser, optionally passing through Token filters in between...
ParseTreeNode(Production reduceProduction, SourceSpan span)
Tokens
Summary Canonical example of MPLEX automaton
void CopyMessages(ParserMessageList others, SourceLocation baseLocation, string messagePrefix)
int Length
Gets the length.