checking in new files
authorbdemsky <bdemsky>
Wed, 15 Feb 2006 00:00:45 +0000 (00:00 +0000)
committerbdemsky <bdemsky>
Wed, 15 Feb 2006 00:00:45 +0000 (00:00 +0000)
16 files changed:
Robust/src/IR/Tree/AssignmentNode.java [new file with mode: 0644]
Robust/src/IR/Tree/BlockExpressionNode.java [new file with mode: 0644]
Robust/src/IR/Tree/BlockNode.java [new file with mode: 0644]
Robust/src/IR/Tree/BlockStatementNode.java [new file with mode: 0644]
Robust/src/IR/Tree/BuildIR.java
Robust/src/IR/Tree/ClassNode.java
Robust/src/IR/Tree/CreateObjectNode.java [new file with mode: 0644]
Robust/src/IR/Tree/DeclarationNode.java [new file with mode: 0644]
Robust/src/IR/Tree/FieldAccessNode.java [new file with mode: 0644]
Robust/src/IR/Tree/IfStatementNode.java [new file with mode: 0644]
Robust/src/IR/Tree/LoopNode.java [new file with mode: 0644]
Robust/src/IR/Tree/MethodInvokeNode.java [new file with mode: 0644]
Robust/src/IR/Tree/NameNode.java [new file with mode: 0644]
Robust/src/IR/Tree/ReturnNode.java [new file with mode: 0644]
Robust/src/IR/Tree/SubBlockNode.java [new file with mode: 0644]
Robust/src/Parse/java14.cup

diff --git a/Robust/src/IR/Tree/AssignmentNode.java b/Robust/src/IR/Tree/AssignmentNode.java
new file mode 100644 (file)
index 0000000..d2d6082
--- /dev/null
@@ -0,0 +1,18 @@
+package IR.Tree;
+import IR.AssignOperation;
+
+public class AssignmentNode extends ExpressionNode {
+    ExpressionNode left;
+    ExpressionNode right;
+    AssignOperation op;
+
+    public AssignmentNode(ExpressionNode l, ExpressionNode r, AssignOperation op) {
+       left=l;
+       right=r;
+       this.op=op;
+    }
+
+    public String printNode() {
+       return left.printNode()+" "+op.toString()+" "+right.printNode();
+    }
+}
diff --git a/Robust/src/IR/Tree/BlockExpressionNode.java b/Robust/src/IR/Tree/BlockExpressionNode.java
new file mode 100644 (file)
index 0000000..75824b1
--- /dev/null
@@ -0,0 +1,12 @@
+package IR.Tree;
+
+class BlockExpressionNode extends BlockStatementNode {
+    ExpressionNode en;
+    public BlockExpressionNode(ExpressionNode e) {
+       this.en=e;
+    }
+    
+    public String printNode() {
+       return en.printNode()+";";
+    }
+}
diff --git a/Robust/src/IR/Tree/BlockNode.java b/Robust/src/IR/Tree/BlockNode.java
new file mode 100644 (file)
index 0000000..b7d8719
--- /dev/null
@@ -0,0 +1,23 @@
+package IR.Tree;
+import java.util.Vector;
+
+class BlockNode extends TreeNode {
+    Vector blockstatements;
+    public BlockNode() {
+       blockstatements=new Vector();
+    }
+
+    public void addBlockStatement(BlockStatementNode bsn) {
+       blockstatements.add(bsn);
+    }
+
+    public String printNode() {
+       String st="{\n";
+       for(int i=0;i<blockstatements.size();i++) {
+           BlockStatementNode bsn=(BlockStatementNode)blockstatements.get(i);
+           st+=bsn.printNode()+"\n";
+       }
+       st+="}\n";
+       return st;
+    }
+}
diff --git a/Robust/src/IR/Tree/BlockStatementNode.java b/Robust/src/IR/Tree/BlockStatementNode.java
new file mode 100644 (file)
index 0000000..001b9b5
--- /dev/null
@@ -0,0 +1,11 @@
+package IR.Tree;
+
+class BlockStatementNode extends TreeNode {
+    public BlockStatementNode() {
+    }
+    
+    public String printNode() {
+       return null;
+    }
+
+}
index 01d313c640014befdb82e19dd3ca345537556e32..a4f7c5b6749c45a9520409746aea6f846c40dfe2 100644 (file)
@@ -1,5 +1,6 @@
 package IR.Tree;
 import IR.*;
+import java.util.Vector;
 
 public class BuildIR {
     State state;
@@ -93,27 +94,28 @@ public class BuildIR {
            return state.getTypeDescriptor(TypeDescriptor.DOUBLE);
        } else if(type_st.equals("class")) {
            ParseNode nn=tn.getChild("class");
-           return state.getTypeDescriptor(parseName(nn));
+           return state.getTypeDescriptor(parseName(nn.getChild("name")));
        } else {
            throw new Error();
        }
     }
 
-    private NameDescriptor parseName(ParseNode pn) {
-       ParseNode nn=pn.getChild("name");
+    private NameDescriptor parseName(ParseNode nn) {
        ParseNode base=nn.getChild("base");
        ParseNode id=nn.getChild("identifier");
        
        if (base==null)
            return new NameDescriptor(id.getTerminal());
 
-       return new NameDescriptor(parseName(base),id.getTerminal());
+       return new NameDescriptor(parseName(base.getChild("name")),id.getTerminal());
        
     }
 
     private void parseFieldDecl(ClassNode cn,ParseNode pn) {
        ParseNode mn=pn.getChild("modifier");
        Modifiers m=parseModifiersList(mn);
+
+
        ParseNode tn=pn.getChild("type");
        TypeDescriptor t=parseTypeDescriptor(tn);
        ParseNode vn=pn.getChild("variables").getChild("variable_declarators_list");
@@ -163,12 +165,66 @@ public class BuildIR {
            ParseNode literalnode=pn.getChild(literaltype);
            Object literal_obj=literalnode.getLiteral();
            return new LiteralNode(literaltype, literal_obj);
+       } else if (isNode(pn,"createobject")) {
+           TypeDescriptor td=parseTypeDescriptor(pn);
+           Vector args=parseArgumentList(pn);
+           CreateObjectNode con=new CreateObjectNode(td);
+           for(int i=0;i<args.size();i++) {
+               con.addArgument((ExpressionNode)args.get(i));
+           }
+           return con;
+       } else if (isNode(pn,"name")) {
+           NameDescriptor nd=parseName(pn);
+           return new NameNode(nd);
+       } else if (isNode(pn,"this")) {
+           NameDescriptor nd=new NameDescriptor("this");
+           return new NameNode(nd);
+       } else if (isNode(pn,"methodinvoke1")) {
+           NameDescriptor nd=parseName(pn.getChild("name"));
+           Vector args=parseArgumentList(pn);
+           MethodInvokeNode min=new MethodInvokeNode(nd);
+           for(int i=0;i<args.size();i++) {
+               min.addArgument((ExpressionNode)args.get(i));
+           }
+           return min;
+       } else if (isNode(pn,"methodinvoke2")) {
+           String methodid=pn.getChild("id").getTerminal();
+           ExpressionNode exp=parseExpression(pn.getChild("base").getFirstChild());
+           Vector args=parseArgumentList(pn);
+           MethodInvokeNode min=new MethodInvokeNode(methodid,exp);
+           for(int i=0;i<args.size();i++) {
+               min.addArgument((ExpressionNode)args.get(i));
+           }
+           return min;
+       } else if (isNode(pn,"fieldaccess")) { 
+           ExpressionNode en=parseExpression(pn.getChild("base").getFirstChild());
+           String fieldname=pn.getChild("field").getTerminal();
+           return new FieldAccessNode(en,fieldname);
+       } else {
+           System.out.println("---------------------");
+           System.out.println(pn.PPrint(3,true));
+           throw new Error();
        }
-       throw new Error();
+    }
+
+    private Vector parseArgumentList(ParseNode pn) {
+       Vector arglist=new Vector();
+       ParseNode an=pn.getChild("argument_list");
+       if (an==null)   /* No argument list */
+           return arglist;
+       ParseNodeVector anv=an.getChildren();
+       for(int i=0;i<anv.size();i++) {
+           arglist.add(parseExpression(anv.elementAt(i)));
+       }
+       return arglist;
     }
 
     private ExpressionNode parseAssignmentExpression(ParseNode pn) {
-       return null;
+       AssignOperation ao=new AssignOperation(pn.getChild("op").getTerminal());
+       ParseNodeVector pnv=pn.getChild("args").getChildren();
+       
+       AssignmentNode an=new AssignmentNode(parseExpression(pnv.elementAt(0)),parseExpression(pnv.elementAt(1)),ao);
+       return an;
     }
 
 
@@ -177,12 +233,80 @@ public class BuildIR {
        ParseNode bodyn=pn.getChild("body");
        MethodDescriptor md=parseMethodHeader(headern);
        BlockNode bn=parseBlock(bodyn);
-       cn.addMethod(md);
+       cn.addMethod(md,bn);
     }
 
     public BlockNode parseBlock(ParseNode pn) {
+       if (isEmpty(pn.getTerminal()))
+           return new BlockNode();
+       ParseNode bsn=pn.getChild("block_statement_list");
+       return parseBlockHelper(bsn);
+    }
+    
+    private BlockNode parseBlockHelper(ParseNode pn) {
+       ParseNodeVector pnv=pn.getChildren();
+       BlockNode bn=new BlockNode();
+       for(int i=0;i<pnv.size();i++) {
+           Vector bsv=parseBlockStatement(pnv.elementAt(i));
+           for(int j=0;j<bsv.size();j++) {
+               bn.addBlockStatement((BlockStatementNode)bsv.get(j));
+           }
+       }
+       return bn;
+    }
 
+    public BlockNode parseSingleBlock(ParseNode pn) {
+       BlockNode bn=new BlockNode();
+       Vector bsv=parseBlockStatement(pn);
+       for(int j=0;j<bsv.size();j++) {
+           bn.addBlockStatement((BlockStatementNode)bsv.get(j));
+       }
+       return bn;
+    }
 
+    public Vector parseBlockStatement(ParseNode pn) {
+       Vector blockstatements=new Vector();
+       if (isNode(pn,"local_variable_declaration")) {
+           TypeDescriptor t=parseTypeDescriptor(pn);
+           ParseNode vn=pn.getChild("variable_declarators_list");
+           ParseNodeVector pnv=vn.getChildren();
+           for(int i=0;i<pnv.size();i++) {
+               ParseNode vardecl=pnv.elementAt(i);
+               String identifier=vardecl.getChild("single").getTerminal();
+               ParseNode epn=vardecl.getChild("initializer");
+               
+               ExpressionNode en=null;
+               if (epn!=null)
+                   en=parseExpression(epn.getFirstChild());
+               
+               blockstatements.add(new DeclarationNode(new VarDescriptor(t,identifier, en)));
+           }
+       } else if (isNode(pn,"nop")) {
+           /* Do Nothing */
+       } else if (isNode(pn,"expression")) {
+           blockstatements.add(new BlockExpressionNode(parseExpression(pn.getFirstChild())));
+       } else if (isNode(pn,"ifstatement")) {
+           blockstatements.add(new IfStatementNode(parseExpression(pn.getChild("condition").getFirstChild()),
+                                      parseSingleBlock(pn.getChild("statement").getFirstChild()),
+                                      pn.getChild("else_statement")!=null?parseSingleBlock(pn.getChild("else_statement").getFirstChild()):null));
+       } else if (isNode(pn,"return")) {
+           if (isEmpty(pn.getTerminal()))
+               blockstatements.add(new ReturnNode());
+           else {
+               ExpressionNode en=parseExpression(pn.getFirstChild());
+               blockstatements.add(new ReturnNode(en));
+           }
+       } else if (isNode(pn,"block_statement_list")) {
+           BlockNode bn=parseBlockHelper(pn);
+           blockstatements.add(new SubBlockNode(bn));
+       } else if (isNode(pn,"empty")) {
+           /* nop */
+       } /*else {
+           System.out.println("---------------");
+           System.out.println(pn.PPrint(3,true));
+           throw new Error();
+           }*/
+       return blockstatements;
     }
 
     public MethodDescriptor parseMethodHeader(ParseNode pn) {
index ef6ffbf808ff084613b97f7c7bdbbd58b0e58aee..58e3f362f9a9a76f7e800304a801057977d7df67 100644 (file)
@@ -1,5 +1,6 @@
 package IR.Tree;
 import java.util.Vector;
+import java.util.Hashtable;
 import IR.FieldDescriptor;
 import IR.MethodDescriptor;
 import IR.NameDescriptor;
@@ -10,15 +11,17 @@ class ClassNode extends TreeNode {
        superclass=null;
        fields=new Vector();
        methods=new Vector();
+       methodmap=new Hashtable();
     }
     String classname;
     NameDescriptor superclass;
     Modifiers modifiers;
     Vector fields;
     Vector methods;
+    Hashtable methodmap;
     
     public String printNode() {
-       String st=modifiers.toString()+classname;
+       String st=modifiers.toString()+"class "+classname;
        if (superclass!=null) 
            st+="extends "+superclass.toString();
        st+=" {\n";
@@ -30,6 +33,8 @@ class ClassNode extends TreeNode {
        for(int i=0;i<methods.size();i++) {
            MethodDescriptor md=(MethodDescriptor)methods.get(i);
            st+=md.toString()+"\n";
+           BlockNode bn=(BlockNode)methodmap.get(md);
+           st+=bn.printNode();
        }
        st+="}\n";
        return st;
@@ -39,10 +44,11 @@ class ClassNode extends TreeNode {
        fields.add(fd);
     }
 
-    public void addMethod(MethodDescriptor md) {
+    public void addMethod(MethodDescriptor md, BlockNode b) {
        methods.add(md);
+       methodmap.put(md,b);
     }
-
+  
     public void setModifiers(Modifiers modifiers) {
        this.modifiers=modifiers;
     }
diff --git a/Robust/src/IR/Tree/CreateObjectNode.java b/Robust/src/IR/Tree/CreateObjectNode.java
new file mode 100644 (file)
index 0000000..e3a67db
--- /dev/null
@@ -0,0 +1,27 @@
+package IR.Tree;
+import java.util.Vector;
+import IR.TypeDescriptor;
+
+public class CreateObjectNode extends ExpressionNode {
+    TypeDescriptor td;
+    Vector argumentlist;
+
+    public CreateObjectNode(TypeDescriptor type) {
+       td=type;
+       argumentlist=new Vector();
+    }
+    public void addArgument(ExpressionNode en) {
+       argumentlist.add(en);
+    }
+
+    public String printNode() {
+       String st="new "+td.toString()+"(";
+       for(int i=0;i<argumentlist.size();i++) {
+           ExpressionNode en=(ExpressionNode)argumentlist.get(i);
+           st+=en.printNode();
+           if ((i+1)!=argumentlist.size())
+               st+=", ";
+       }
+       return st+")";
+    }
+}
diff --git a/Robust/src/IR/Tree/DeclarationNode.java b/Robust/src/IR/Tree/DeclarationNode.java
new file mode 100644 (file)
index 0000000..02b5d60
--- /dev/null
@@ -0,0 +1,14 @@
+package IR.Tree;
+import IR.VarDescriptor;
+
+class DeclarationNode extends BlockStatementNode {
+    VarDescriptor vd;
+    public DeclarationNode(VarDescriptor var) {
+       vd=var;
+    }
+    
+    public String printNode() {
+       return vd.toString();
+    }
+
+}
diff --git a/Robust/src/IR/Tree/FieldAccessNode.java b/Robust/src/IR/Tree/FieldAccessNode.java
new file mode 100644 (file)
index 0000000..960ce08
--- /dev/null
@@ -0,0 +1,15 @@
+package IR.Tree;
+
+public class FieldAccessNode extends ExpressionNode {
+    ExpressionNode left;
+    String fieldname;
+
+    public FieldAccessNode(ExpressionNode l, String field) {
+       fieldname=field;
+       left=l;
+    }
+
+    public String printNode() {
+       return left.printNode()+"."+fieldname;
+    }
+}
diff --git a/Robust/src/IR/Tree/IfStatementNode.java b/Robust/src/IR/Tree/IfStatementNode.java
new file mode 100644 (file)
index 0000000..b161a1c
--- /dev/null
@@ -0,0 +1,21 @@
+package IR.Tree;
+
+class IfStatementNode extends BlockStatementNode {
+    ExpressionNode cond;
+    BlockNode true_st;
+    BlockNode else_st;
+    
+    public IfStatementNode(ExpressionNode cond, BlockNode true_st, BlockNode else_st) {
+       this.cond=cond;
+       this.true_st=true_st;
+       this.else_st=else_st;
+    }
+    
+    public String printNode() {
+       if (else_st==null)
+           return "if("+cond.printNode()+") {\n"+true_st.printNode()+"\n}\n";
+       else 
+           return "if("+cond.printNode()+") {\n"+true_st.printNode()+"\n} else {\n"+
+               else_st.printNode()+"}\n";
+    }
+}
diff --git a/Robust/src/IR/Tree/LoopNode.java b/Robust/src/IR/Tree/LoopNode.java
new file mode 100644 (file)
index 0000000..2dcba8c
--- /dev/null
@@ -0,0 +1,11 @@
+package IR.Tree;
+
+class LoopNode extends BlockStatementNode {
+    public SubBlockNode() {
+    }
+    
+    public String printNode() {
+       return null;
+    }
+
+}
diff --git a/Robust/src/IR/Tree/MethodInvokeNode.java b/Robust/src/IR/Tree/MethodInvokeNode.java
new file mode 100644 (file)
index 0000000..51a7c5f
--- /dev/null
@@ -0,0 +1,44 @@
+package IR.Tree;
+import java.util.Vector;
+import IR.NameDescriptor;
+
+public class MethodInvokeNode extends ExpressionNode {
+    NameDescriptor nd;
+    Vector argumentlist;
+    String methodid;
+    ExpressionNode en;
+
+    public MethodInvokeNode(NameDescriptor name) {
+       nd=name;
+       argumentlist=new Vector();
+       methodid=null;
+       en=null;
+    }
+
+    public MethodInvokeNode(String methodid, ExpressionNode exp) {
+       this.methodid=methodid;
+       this.en=exp;
+       nd=null;
+       argumentlist=new Vector();
+    }
+
+    public void addArgument(ExpressionNode en) {
+       argumentlist.add(en);
+    }
+
+    public String printNode() {
+       String st;
+       if (nd==null) {
+           st=en.printNode()+"."+methodid+"(";
+       } else {
+           st=nd.toString()+"(";
+       }
+       for(int i=0;i<argumentlist.size();i++) {
+           ExpressionNode en=(ExpressionNode)argumentlist.get(i);
+           st+=en.printNode();
+           if ((i+1)!=argumentlist.size())
+               st+=", ";
+       }
+       return st+")";
+    }
+}
diff --git a/Robust/src/IR/Tree/NameNode.java b/Robust/src/IR/Tree/NameNode.java
new file mode 100644 (file)
index 0000000..be2f986
--- /dev/null
@@ -0,0 +1,13 @@
+package IR.Tree;
+import IR.NameDescriptor;
+
+public class NameNode extends ExpressionNode {
+    NameDescriptor name;
+    public NameNode(NameDescriptor nd) {
+       this.name=nd;
+    }
+
+    public String printNode() {
+       return name.toString();
+    }
+}
diff --git a/Robust/src/IR/Tree/ReturnNode.java b/Robust/src/IR/Tree/ReturnNode.java
new file mode 100644 (file)
index 0000000..8499e52
--- /dev/null
@@ -0,0 +1,21 @@
+package IR.Tree;
+
+class ReturnNode extends BlockStatementNode {
+    ExpressionNode en;
+
+    public ReturnNode() {
+       en=null;
+    }
+
+    public ReturnNode(ExpressionNode en) {
+       this.en=en;
+    }
+
+    public String printNode() {
+       if (en==null)
+           return "return";
+       else
+           return "return "+en.printNode();
+    }
+
+}
diff --git a/Robust/src/IR/Tree/SubBlockNode.java b/Robust/src/IR/Tree/SubBlockNode.java
new file mode 100644 (file)
index 0000000..85bdc1d
--- /dev/null
@@ -0,0 +1,13 @@
+package IR.Tree;
+
+class SubBlockNode extends BlockStatementNode {
+    BlockNode bn;
+    public SubBlockNode(BlockNode bn) {
+       this.bn=bn;
+    }
+    
+    public String printNode() {
+       return bn.printNode();
+    }
+
+}
index b88bd254e30aa7cd1331e6102e45121d14a18516..483f01f852c8494e87fa84df486b4c00be65e2f0 100644 (file)
@@ -709,17 +709,13 @@ constructor_body ::=
 
 // 19.11) Blocks and Statements
 block ::=      LBRACE block_statements_opt:bso RBRACE {: 
-       ParseNode pn=new ParseNode("block");
-       pn.addChild("block_statements_opt").addChild(bso);
-       RESULT=pn;
+       RESULT=bso;
        :}
        ;
 block_statements_opt ::=
        {: RESULT=new ParseNode("empty"); :}
        |       block_statements:bs {: 
-       ParseNode pn=new ParseNode("block_statements_opt");
-       pn.addChild("block_statements").addChild(bs);
-       RESULT=pn;
+       RESULT=bs;
        :}
        ;
 block_statements ::=
@@ -730,19 +726,15 @@ block_statements ::=
        :}
        |       block_statements:bss block_statement:bs {: 
        bss.addChild(bs);
-       RESULT=bs;
+       RESULT=bss;
        :}
        ;
 block_statement ::=
                local_variable_declaration_statement:lvds {: 
-               ParseNode pn=new ParseNode("block_statement");
-               pn.addChild("local_variable_declaration").addChild(lvds);
-               RESULT=pn;
+               RESULT=lvds;
        :}
        |       statement:statement {: 
-               ParseNode pn=new ParseNode("statement");
-               pn.addChild("statement").addChild(statement);
-               RESULT=pn;
+               RESULT=statement;
        :}
 //     |       class_declaration
 //     |       interface_declaration
@@ -753,10 +745,10 @@ local_variable_declaration_statement ::=
        :}
        ;
 local_variable_declaration ::=
-               type:type variable_declarators:var_decls {: 
+               type:type variable_declarators:var {: 
                ParseNode pn=new ParseNode("local_variable_declaration");
-               pn.addChild("type").addChild(type);
-               pn.addChild("variables").addChild(var_decls);
+               pn.addChild(type);
+               pn.addChild(var);
                RESULT=pn;
 :}
 //     |       FINAL type variable_declarators
@@ -801,7 +793,10 @@ empty_statement ::=
 //             IDENTIFIER COLON statement_no_short_if
 //     ;
 expression_statement ::=
-               statement_expression:se SEMICOLON {: RESULT=se; :}
+               statement_expression:se SEMICOLON {: 
+               ParseNode pn=new ParseNode("expression");
+               pn.addChild(se);
+               RESULT=pn; :}
        ;
 statement_expression ::=
                assignment:st {: RESULT=st; :}
@@ -947,7 +942,7 @@ SEMICOLON
        ;
 return_statement ::=
                RETURN expression_opt:exp SEMICOLON {: 
-       RESULT=(new ParseNode("return")).addChild("retvalue").addChild(exp).getRoot(); :}
+       RESULT=(new ParseNode("return")).addChild(exp).getRoot(); :}
        ;
 //throw_statement ::=
 //             THROW expression SEMICOLON
@@ -998,8 +993,8 @@ primary_no_new_array ::=
 class_instance_creation_expression ::=
                NEW class_or_interface_type:type LPAREN argument_list_opt:args RPAREN {: 
                ParseNode pn=new ParseNode("createobject");
-               pn.addChild("type").addChild(type);
-               pn.addChild("args").addChild(args);
+               pn.addChild(type);
+               pn.addChild(args);
                RESULT=pn;
        :}
 //     |       NEW class_or_interface_type LPAREN argument_list_opt RPAREN class_body
@@ -1060,16 +1055,16 @@ field_access ::=
        ;
 method_invocation ::=
                name:name LPAREN argument_list_opt:args RPAREN {: 
-               ParseNode pn=new ParseNode("methodinvoke");
-               pn.addChild("name").addChild(name);
-               pn.addChild("args").addChild(args);
+               ParseNode pn=new ParseNode("methodinvoke1");
+               pn.addChild(name);
+               pn.addChild(args);
                RESULT=pn;
        :}
        |       primary:base DOT IDENTIFIER:name LPAREN argument_list_opt:args RPAREN {: 
-               ParseNode pn=new ParseNode("methodinvoke");
+               ParseNode pn=new ParseNode("methodinvoke2");
                pn.addChild("base").addChild(base);
-               pn.addChild("name").addChild(name);
-               pn.addChild("args").addChild(args);
+               pn.addChild("id").addChild(name);
+               pn.addChild(args);
                RESULT=pn;
        :}
 //     |       SUPER DOT IDENTIFIER LPAREN argument_list_opt RPAREN
@@ -1316,18 +1311,18 @@ assignment ::=  postfix_expression:lvalue assignment_operator:op assignment_expre
         :}
        ;
 assignment_operator ::=
-               EQ {: RESULT=(new ParseNode("assignment_operator")).addChild("eq"); :}
-       |       MULTEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("multeq"); :}
-       |       DIVEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("diveq"); :}
-       |       MODEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("modeq"); :}
-       |       PLUSEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("pluseq"); :}
-       |       MINUSEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("minuseq"); :}
-       |       LSHIFTEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("lshifteq"); :}
-       |       RSHIFTEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("rshifteq"); :}
-//     |       URSHIFTEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("urshifteq"); :}
-       |       ANDEQ {: RESULT=(new ParseNode("assignment_operator")).addChild("andeq"); :}
-       |       XOREQ {: RESULT=(new ParseNode("assignment_operator")).addChild("xoreq"); :}
-       |       OREQ {: RESULT=(new ParseNode("assignment_operator")).addChild("oreq"); :}
+               EQ {: RESULT=new ParseNode("eq"); :}
+       |       MULTEQ {: RESULT=new ParseNode("multeq"); :}
+       |       DIVEQ {: RESULT=new ParseNode("diveq"); :}
+       |       MODEQ {: RESULT=new ParseNode("modeq"); :}
+       |       PLUSEQ {: RESULT=new ParseNode("pluseq"); :}
+       |       MINUSEQ {: RESULT=new ParseNode("minuseq"); :}
+       |       LSHIFTEQ {: RESULT=new ParseNode("lshifteq"); :}
+       |       RSHIFTEQ {: RESULT=new ParseNode("rshifteq"); :}
+//     |       URSHIFTEQ {: RESULT=new ParseNode("urshifteq"); :}
+       |       ANDEQ {: RESULT=new ParseNode("andeq"); :}
+       |       XOREQ {: RESULT=new ParseNode("xoreq"); :}
+       |       OREQ {: RESULT=new ParseNode("oreq"); :}
        ;
 expression_opt ::=
        {:      RESULT=new ParseNode("empty"); :}