public Rule(TItem name, AstNode body, string ovr) { this.Name = name; this.Body = body; this.Override = ovr; Items = new List<TItem> { name }; Children = new List<AstNode> { body }; }
public Star(AstNode body) { this.Body = body; Children = new List<AstNode> { body }; }
public GrammarFile(AstNode preamble, AstNode grammar) { this.Preamble = preamble as Preamble; this.Grammar = grammar as Grammar; Children = new List<AstNode> { grammar }; }
public Or(AstNode left, AstNode right) { this.Left = left; this.Right = right; Children = new List<AstNode> { left, right }; }
public Fail(AstNode message) { if (message != null) this.Message = message.GetText().Trim(); }
public Cond(AstNode body, TItem exp) { this.Body = body; this.Expression = exp; Children = new List<AstNode> { body }; Items = new List<TItem> { exp }; }
public static char GetChar(AstNode node) { if (node != null) { string str = node.GetText().Trim('\'').Trim(); str = Regex.Unescape(str); foreach (char ch in str) return ch; } return (char)0; }
public Bind(AstNode body, TItem varname) { this.Body = body; this.VarName = varname; Children = new List<AstNode> { body }; Items = new List<TItem> { varname }; }
public Args(AstNode parms, AstNode body) { this.Parms = parms; this.Body = body; Children = new List<AstNode> { body }; }