/// <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> /// 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 ); }
public EvalVisitor(GlobalContext context, Func <Expr, bool> breakpoints = null, DynamicScope scopeManager = null) { if (context == null) { throw new ArgumentNullException("context"); } _global = context; _breakpoints = breakpoints ?? (e => false); ScopeManager = scopeManager ?? new DynamicScope(); }