Mar 13, 2010 at 8:02 AM
Edited Mar 14, 2010 at 7:44 AM
I've created a simple BNF for testing purpose:
Expr.Rule = Term | BinExpr;
Term.Rule = identifier | number | Expr;
BinExpr.Rule = Expr + BinOp + Expr;
BinOp.Rule = ToTerm(">") | "<";
Program.Rule = MakePlusRule(Program, NewLine, Expr);
I have successfully parsed "WIDTH > HEIGHT", but how do I evaluate the Ast (with the provided tree implementations for operators etc.) ?
I always get "Unknow vairable WIDTH" How do I push a symbol value name WIDTH with value to evaluation context?
context.SetValue(context.Symbols.TextToSymbol("WIDTH"), 10); <--- this doesn't work,
I'm getting error Is there something else one should do to be able to push values to context?
BTW. Awesome project :)