public Parser(string exp, ICalcFunction calcFunc) { this.exp = exp; tree = null; scanner = new Scanner(exp); this.icalcfunc = calcFunc; }
public void AddChild(SyntaxTreeNode node) { children.Add(node); }
/// <summary> /// 分析表达式,生成token、列表和语法树。 /// </summary> public void Parse() { tree = null; curTok = scanner.GetToken(); if (null == CurToken) { return; } tree = Exp(); if (CurToken != null) { throw new ParseException("unexpected token:", CurToken); } }
public Parser(string exp) { this.exp = exp; tree = null; scanner = new Scanner(exp); }