public static IToken Compile(this IParser parser, string expression) { Queue <IToken> queue = parser.Tokenize(expression); Stack <IToken> stack = parser.BuildStack(queue); return(parser.CreateTree(stack)); }
public void Build(IParser parser, ExecutionContext context, ISet<string> chain) { Tree = null; Queue<IToken> queue = parser.Tokenize(Convert.ToString(Value)); Dependees = context.NewSet(); foreach (IToken token in queue) { if (token.IsVariable) { Dependees.Add(token.Name); } } Stack<IToken> stack = parser.BuildStack(queue); Tree = parser.CreateTree(stack); }