public Rumor(Dictionary <string, List <Node> > nodes, RumorScope scope = null) { // Make a copy so our version does not change Nodes = new Dictionary <string, List <Node> >(nodes); Stack = new Stack <StackFrame>(); State = new RumorState(); Scope = scope ?? new RumorScope(); Bindings = new RumorBindings(); }
public override Value Evaluate(RumorScope scope) { var value = scope.Get(name); if (value == null) { throw new UndefinedVariableException( "Variable \"" + name + "\" has not been defined yet!" ); } return(value); }
public override Value Evaluate(RumorScope scope) { var value = scope.Get(name); if (value == null) { throw new UndefinedVariableException( "Variable \"" + name + "\" has not been defined yet!" ); } if (!(value is NumberValue)) { throw new VariableTypeException( "Variable is not a number!" ); } return((NumberValue)value); }
public override Value Evaluate(RumorScope scope) { return(l.Evaluate(scope).AsBoolean() && r.Evaluate(scope).AsBoolean()); }
public override Value Evaluate(RumorScope scope) { return(l.Evaluate(scope).AsNumber() - r.Evaluate(scope).AsNumber()); }
public override Value Evaluate(RumorScope scope) { var result = value.Evaluate(scope).InternalValue; return(new StringValue(result.ToString())); }
public override Value Evaluate(RumorScope scope) { return(new BooleanValue( l.Evaluate(scope).AsNumber() < r.Evaluate(scope).AsNumber() )); }
public override Value Evaluate(RumorScope scope) { return(new BooleanValue(l.Evaluate(scope) == r.Evaluate(scope))); }
public override Value Evaluate(RumorScope scope) { return(!expression.Evaluate(scope).AsBoolean()); }
public override Value Evaluate(RumorScope scope) { return(new StringValue(value.Evaluate(scope).ToString())); }
public override Value Evaluate(RumorScope scope) { return(l.Evaluate(scope).AsString() + r.Evaluate(scope).AsString()); }
public override Value Evaluate(RumorScope _) { return(Value); }
public abstract Value Evaluate(RumorScope scope);