public void Execute(Dictionary <string, string> variables, out string result, out TokenType resultType, Tokenizer tokenizer = null) { resultType = TokenType.IfKeyword; result = string.Empty; if (condition.Evaluate(variables)) { expression.Execute(variables, out result, out resultType, tokenizer); } }
public bool Evaluate(Dictionary <string, string> variables) { switch (op.tokens.First().type) { case TokenType.AndLogicalOperator: return(left.Evaluate(variables) && right.Evaluate(variables)); case TokenType.NotLogicalOperator: return(!right.Evaluate(variables)); case TokenType.OrLogicalOperator: return(left.Evaluate(variables) || right.Evaluate(variables)); default: return(false); } throw new NotImplementedException(); }