Exemple #1
0
 internal xfor(For f)
 {
     initializer = parser(f.initializer);
     condition   = parser(f.condition);
     incrementer = parser(f.incrementer);
     body        = parser(f.body);
 }
Exemple #2
0
 internal xbinaryop(BinaryOp bo)
 {
     operand1 = parser(bo.operand1);
     operand2 = parser(bo.operand2);
     oper     = bo.operatorTok;
 }
Exemple #3
0
 internal xunaryop(UnaryOp uo)
 {
     operand = parser(uo.operand);
 }
Exemple #4
0
 internal xassing(Assign a)
 {
     lside = parser(a.lhside);
     rside = parser(a.rhside);
 }
Exemple #5
0
 internal xexpr(Expression e)
 {
     operand = parser(e.operand);
 }
Exemple #6
0
 internal xif(If i)
 {
     condition = parser(i.condition);
     operand1  = parser(i.operand1);
     operand2  = parser(i.operand2);
 }
Exemple #7
0
 internal xvardeclare(VariableDeclaration vd)
 {
     identifier  = (xlookup)parser(vd.identifier);
     initializer = parser(vd.initializer);
 }
Exemple #8
0
 internal xwhile(While w)
 {
     condition = parser(w.condition);
     body      = parser(w.body);
 }
Exemple #9
0
 internal xcall(Call c)
 {
     func = parser(c.func);
     args = parser(c.args) as xastlist;
 }
Exemple #10
0
        public xast parser(AST ast)
        {
            xast ret = null;

            if (ast == null)
            {
            }
            else if (ast is VariableDeclaration)
            {
                ret = new xvardeclare((VariableDeclaration)ast);
            }
            else if (ast is Assign)
            {
                ret = new xassing((Assign)ast);
            }
            else if (ast is If)
            {
                ret = new xif((If)ast);
            }
            else if (ast is While)
            {
                ret = new xwhile((While)ast);
            }
            else if (ast is Expression)
            {
                ret = new xexpr((Expression)ast);
            }
            else if (ast is Block)
            {
                ret = new xblock((Block)ast);
            }
            else if (ast is ConstantWrapper)
            {
                ret = new xconstantwrapper((ConstantWrapper)ast);
            }
            else if (ast is For)
            {
                ret = new xfor((For)ast);
            }
            else if (ast is Call)
            {
                ret = new xcall((Call)ast);
            }
            else if (ast is Equality)
            {
                ret = new xequality((Equality)ast);
            }
            else if (ast is Relational)
            {
                ret = new xrelational((Relational)ast);
            }
            else if (ast is PostOrPrefixOperator)
            {
                ret = new xpostorprefixoperator((PostOrPrefixOperator)ast);
            }
            else if (ast is Lookup)
            {
                ret = new xlookup((Lookup)ast);
            }
            else if (ast is Call)
            {
                ret = new xcall((Call)ast);
            }
            else if (ast is ASTList)
            {
                ret = new xastlist((ASTList)ast);
            }
            return(ret);
        }