Beispiel #1
0
        public override Statement VisitSTMR_CreateStatement([NotNull] S_ScriptParser.STMR_CreateStatementContext context)
        {
            string Library = this.GetLibrary(context.name()[0], SystemNameSpaces.BASE);
            string Name    = this.GetName(context.name()[0]);

            this._Context.AddSpool(Name);
            //this._expr.DefaultContext.Push(Name);

            ScriptedStatement y = new ScriptedStatement(this._Host, null, Name);

            for (int i = 1; i < context.name().Length; i++)
            {
                string PName = this.GetName(context.name()[i]);
                //this._Context[Name].Add(PName);
                y.ParameterNames.Add(PName);
                y.Parameters.Add(PName, new Expression.Literal(null, null, CellValues.NullINT));
            }

            foreach (S_ScriptParser.StatementContext ctx in context.statement())
            {
                y.AddChild(this.Visit(ctx));
            }

            CompileStatement x = new CompileStatement(this._Host, this._Master, Library, Name);

            x.Statement = y;

            this._Context.DropSpool(Name);
            //this._expr.DefaultContext.Pop();

            this._Master = x;
            return(x);
        }
Beispiel #2
0
 public void AddScriptedStatement(string Name, ScriptedStatement Value)
 {
     this._ScriptedStatements.Reallocate(Name, Value);
 }