コード例 #1
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xfor(For f)
 {
     initializer = parser(f.initializer);
     condition   = parser(f.condition);
     incrementer = parser(f.incrementer);
     body        = parser(f.body);
 }
コード例 #2
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xbinaryop(BinaryOp bo)
 {
     operand1 = parser(bo.operand1);
     operand2 = parser(bo.operand2);
     oper     = bo.operatorTok;
 }
コード例 #3
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xunaryop(UnaryOp uo)
 {
     operand = parser(uo.operand);
 }
コード例 #4
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xassing(Assign a)
 {
     lside = parser(a.lhside);
     rside = parser(a.rhside);
 }
コード例 #5
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xexpr(Expression e)
 {
     operand = parser(e.operand);
 }
コード例 #6
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xif(If i)
 {
     condition = parser(i.condition);
     operand1  = parser(i.operand1);
     operand2  = parser(i.operand2);
 }
コード例 #7
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xvardeclare(VariableDeclaration vd)
 {
     identifier  = (xlookup)parser(vd.identifier);
     initializer = parser(vd.initializer);
 }
コード例 #8
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xwhile(While w)
 {
     condition = parser(w.condition);
     body      = parser(w.body);
 }
コード例 #9
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
 internal xcall(Call c)
 {
     func = parser(c.func);
     args = parser(c.args) as xastlist;
 }
コード例 #10
0
ファイル: xblock.cs プロジェクト: blancosj/dodonet-framework
        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);
        }