public Expression Visit(NumBinaryOp op) { var left = (NumExpression)op.Left.Accept(this); var right = (NumExpression)op.Right.Accept(this); return(new NumBinaryOp(op.Operation, left, right)); }
public SortedSet <string> Visit(NumBinaryOp op) { var vars = Run(op.Left); vars.UnionWith(Run(op.Right)); return(vars); }
public async Task <Value> Visit(NumBinaryOp op) { Value[] results = await Task.WhenAll <Value>(op.Left.Accept(this), op.Right.Accept(this)); switch (op.Operation) { case NumBinOps.Add: return((results[0] as NumValue) + (results[1] as NumValue)); case NumBinOps.Mul: return((results[0] as NumValue) * (results[1] as NumValue)); default: throw new ArgumentException(); } throw new NotImplementedException(); }
public T Visit(NumBinaryOp op) { op.Left.Accept(this); op.Right.Accept(this); return(default(T)); }