Exemple #1
0
        public WhileStatement(Expression condition, Statement statement)
        {
            Condition = condition;
            Statement = statement;

            AddChild(condition);
            AddChild(statement);
        }
Exemple #2
0
        public IfStatement(Expression condition, Statement trueStatement, Statement falseStatement)
        {
            Condition = condition;
            TrueStatement = trueStatement;
            FalseStatement = falseStatement;

            AddChild(condition);
            AddChild(trueStatement);
            AddChild(falseStatement);
        }
Exemple #3
0
        public ReturnStatement(Expression expression)
        {
            Expression = expression;

            AddChild(expression);
        }
Exemple #4
0
 private void CodeExpression(Expression expression, List<LocalVariable> locals, List<GlobalVariable> globals, FuncParam[] parameters, ILGenerator il, List<Function> allFuncs, LocalBuilder tmpVar)
 {
     if (expression is BinaryExpression)
         CodeBinary(expression as BinaryExpression, locals, globals, parameters, il, allFuncs, tmpVar);
     else if (expression is FuncCallExpression)
         CodeCall(expression as FuncCallExpression, locals, globals, parameters, il, allFuncs, tmpVar);
     else if (expression is GetArrayValueExpression)
         CodeGetArray(expression as GetArrayValueExpression, locals, globals, parameters, il, allFuncs, tmpVar);
     else if (expression is GetValueExpression)
         CodeGet(expression as GetValueExpression, locals, globals, parameters, il);
     else if (expression is NumberExpression)
         CodeNumber(expression as NumberExpression, locals, globals, parameters, il);
     else if (expression is SetArrayValueExpression)
         CodeSetArray(expression as SetArrayValueExpression, locals, globals, parameters, il, allFuncs, tmpVar);
     else if (expression is SetValueExpression)
         CodeSet(expression as SetValueExpression, locals, globals, parameters, il, allFuncs, tmpVar);
     else if (expression is UnaryExpression)
         CodeUnary(expression as UnaryExpression, locals, globals, parameters, il, allFuncs, tmpVar);
     else
         throw new InvalidDataException();
 }
Exemple #5
0
        public WriteStatement(Expression expression)
        {
            Expression = expression;

            AddChild(expression);
        }