Esempio n. 1
0
        public override IAstNode VisitRepl([NotNull] ReplContext context)
        {
            var children = from child in context.children
                           select child.Accept(this);

            return(new RootNode(context.GetSourceSpan( ), children));
        }
Esempio n. 2
0
        public static ReplContext NewInstance(IActivationStrategy <ReplContext> strategy)
        {
            if (strategy == null)
            {
                throw new InvalidOperationException("Activation strategy cannot be null.");
            }

            var engine = Container.GetInstance()
                         .Kernel.Get <ScriptEngine>();

            var ctx = new ReplContext()
            {
                Id      = Guid.NewGuid(),
                Session = engine.CreateSession()
            };

            strategy.Activate(ctx);
            return(ctx);
        }