Exemple #1
0
 public bool Set(string name, Expression expr, bool is_const = false)
 {
     if (!consts.Contains(name)) {
         locals[name] = expr;
         if (is_const) {
             consts.Add(name);
             return true;
         }
         return true;
     }
     return false;
 }
 public AssignmentExpression(string name, Expression expr)
 {
     this.name = name;
     this.expr = expr;
 }
Exemple #3
0
 public OperatorExpression(char op, Expression a, Expression b)
 {
     this.op = op;
     this.a = a;
     this.b = b;
 }
Exemple #4
0
 public ReturnValue calculate(Expression expr)
 {
     return expr.Value(binding);
 }