Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        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();
        }