예제 #1
0
        public override Expression VisitEXPR_ArrayLiteral([NotNull] S_ScriptParser.EXPR_ArrayLiteralContext context)
        {
            Expression x = new Expression.ArrayLiteral(this._Host, this._Master);

            foreach (S_ScriptParser.ExpressionContext y in context.expression())
            {
                Expression z = this.Visit(y);
                x.AddChild(z);
            }
            this._Master = x;
            return(x);
        }
예제 #2
0
 public Expression FromSPAGS(
     SPAGS.Function func,
     List<SPAGS.Expression> callParameters,
     List<SPAGS.Expression> callVarargs)
 {
     Expression funcRef = GetReference(func);
     List<Expression> parameters = new List<Expression>();
     for (int i = 0; i < callParameters.Count; i++)
     {
         PossibleValueTypes paramVT = GetValueTypes(func.Signature.Parameters[i].Type);
         parameters.Add(FromSPAGS(callParameters[i]).Cast(paramVT));
     }
     if (callVarargs != null && callVarargs.Count != 0)
     {
         Expression.ArrayLiteral arr = new Expression.ArrayLiteral();
         foreach (SPAGS.Expression callVararg in callVarargs)
         {
             arr.Entries.Add(FromSPAGS(callVararg));
         }
         parameters.Add(arr);
     }
     Expression call = funcRef.Call(parameters);
     return call;
 }