public object PrecedenceTesting(string expression) { IParser parser = Factory.Instance.Create(); IToken token = parser.Compile(expression); return(token.EvalValue(null)); }
public void ParsingFailure(string expression, Type errType) { TestDelegate handler = new TestDelegate(() => { IParser parser = Factory.Instance.Create(); IToken token = parser.Compile(expression); token.EvalValue(null); }); Assert.Throws(errType, handler); }
public object StringLiteralEvalTest(string text, int start, string className) { IToken token = (IToken)Activator.CreateInstance(Type.GetType(className)); int next; if (token.Match(text, start, out next)) { return(token.EvalValue(null)); } else { return(null); } }
public object Eval(IToken token, Func <string, object> context) { return(token.EvalValue(context)); }
public object Eval(IToken token, Func<string, object> context) { return token.EvalValue(context); }