public BlockExprFrame(EvalVisitor evaluator, BlockExpr e) : base(evaluator, e) { foreach (var local in ((BlockExpr)Expr).Locals) { Visitor.ScopeManager.Register(local); } }
public BlockExprFrame( EvalVisitor evaluator, BlockExpr e ) : base(evaluator, e) { foreach( var local in ((BlockExpr)Expr).Locals ) { _visitor.ScopeManager.Register( local ); } }
protected Frame( EvalVisitor visitor, Expr e ) { _visitor = visitor; _prev = visitor._currentFrame; if( _prev != null ) _prev._next = this; else visitor._firstFrame = this; visitor._currentFrame = this; _expr = e; }
/// <summary> /// Resets the current execution. This frees the <see cref="ScriptEngine"/>: new calls to its <see cref="G:ScriptEngine.Execute"/> can be made. /// </summary> public void Dispose() { if (_visitor != null) { _engine.StopExecution(); _error = null; _result = null; _status = ScriptEngineStatus.None; _visitor = null; } }
internal protected AccessorCallFrame(EvalVisitor visitor, AccessorCallExpr e) : base(visitor, e) { var declaredFunc = Expr.DeclaredFunctions; if (declaredFunc != null) { foreach (var df in declaredFunc) { Visitor.ScopeManager.Register(df); } } }
protected Frame(EvalVisitor visitor, Expr e) { Visitor = visitor; _prev = visitor._currentFrame; if (_prev != null) { _prev._next = this; } else { visitor._firstFrame = this; } visitor._currentFrame = this; _expr = e; }
internal protected AccessorMemberFrame(EvalVisitor visitor, AccessorMemberExpr e) : base(visitor, e) { }
public PrePostIncDecExprFrame(EvalVisitor evaluator, PrePostIncDecExpr e) : base(evaluator, e) { }
internal PExpr( EvalVisitor.Frame pending, DeferredKind status ) : this(pending, null, status) { }
public IfExprFrame(EvalVisitor evaluator, IfExpr e) : base(evaluator, e) { }
public WithExprFrame(EvalVisitor evaluator, WithExpr e) : base(evaluator, e) { }
public WhileExprFrame(EvalVisitor evaluator, WhileExpr e) : base(evaluator, e) { }
PExpr( EvalVisitor.Frame pending, RuntimeObj resultOrSignal, DeferredKind status ) { Frame = pending; Result = resultOrSignal; DeferredStatus = status; }
internal Result(ScriptEngine e) { _engine = e; _visitor = e._visitor; }
/// <summary> /// Initializes a new <see cref="ScriptEngine"/>, optionally bound to an existing <see cref="GlobalContext"/>. /// </summary> /// <param name="ctx">Optional global context to use.</param> /// <param name="breakPointManager">Optional <see cref="BreakpointManager"/> instance to use.</param> /// <param name="scopeManager">Optional <see cref="DynamicScope"/> to use.</param> public ScriptEngine(GlobalContext ctx = null, BreakpointManager breakPointManager = null, DynamicScope scopeManager = null) { _breakpoints = breakPointManager ?? new BreakpointManager(); _globalContext = ctx ?? new GlobalContext(); _visitor = new EvalVisitor(_globalContext, _breakpoints.MustBreak, scopeManager); }
/// <summary> /// Simple static helper to evaluate an expression (typically a pure expression without side effects). /// </summary> /// <param name="e">The expression to evaluate.</param> /// <param name="ctx">The <see cref="GlobalContext"/>. When null, a new default GlobalContext is used.</param> /// <returns>The result of the evaluation.</returns> public static RuntimeObj Evaluate(Expr e, GlobalContext ctx = null) { EvalVisitor v = new EvalVisitor(ctx ?? new GlobalContext()); return(v.VisitExpr(e).Result); }
public FlowBreakingExprFrame(EvalVisitor evaluator, FlowBreakingExpr e) : base(evaluator, e) { }
internal Result( ScriptEngine e ) { _engine = e; _visitor = e._visitor; }
/// <summary> /// Resets the current execution. This frees the <see cref="ScriptEngine"/>: new calls to its <see cref="G:ScriptEngine.Execute"/> can be made. /// </summary> public void Dispose() { if( _visitor != null ) { _engine.StopExecution(); _error = null; _result = null; _status = ScriptEngineStatus.None; _visitor = null; } }
/// <summary> /// Simple static helper to evaluate an expression (typically a pure expression without side effects). /// </summary> /// <param name="e">The expression to evaluate.</param> /// <param name="ctx">The <see cref="GlobalContext"/>. When null, a new default GlobalContext is used.</param> /// <returns>The result of the evaluation.</returns> public static RuntimeObj Evaluate( Expr e, GlobalContext ctx = null ) { EvalVisitor v = new EvalVisitor( ctx ?? new GlobalContext() ); return v.VisitExpr( e ).Result; }
/// <summary> /// Initializes a new <see cref="ScriptEngine"/>, optionally bound to an existing <see cref="GlobalContext"/>. /// </summary> /// <param name="ctx">Optional global context to use.</param> /// <param name="breakPointManager">Optional <see cref="BreakpointManager"/> instance to use.</param> /// <param name="scopeManager">Optional <see cref="DynamicScope"/> to use.</param> public ScriptEngine( GlobalContext ctx = null, BreakpointManager breakPointManager = null, DynamicScope scopeManager = null ) { _breakpoints = breakPointManager ?? new BreakpointManager(); _globalContext = ctx ?? new GlobalContext(); _visitor = new EvalVisitor( _globalContext, _breakpoints.MustBreak, scopeManager ); }
AccessorMemberFrameLookup(EvalVisitor visitor, RuntimeObj o, AccessorMemberFrame f) : base(visitor, f.Expr) { _o = o; _f = f; }
public ForeachExprFrame(EvalVisitor evaluator, ForeachExpr e) : base(evaluator, e) { }
public TryCatchExprFrame(EvalVisitor evaluator, TryCatchExpr e) : base(evaluator, e) { }
public AssignExprFrame(EvalVisitor evaluator, AssignExpr e) : base(evaluator, e) { }
public BinaryExprFrame(EvalVisitor evaluator, BinaryExpr e) : base(evaluator, e) { }
public ListOfExprFrame(EvalVisitor evaluator, ListOfExpr e) : base(evaluator, e) { _statements = new PExpr[e.List.Count]; }