Charj: allow multiple type definitions per file
[charm.git] / src / langs / charj / src / charj / translator / CharjASTModifier.g
index 11eb4568f6f0e3b4f53f1dd8985999ad8c70abaf..d1fe39684a9d39c0b8ea21093bf4c82fbd7538a6 100644 (file)
@@ -48,7 +48,7 @@ charjSource[SymbolTable _symtab] returns [ClassSymbol cs]
     :   ^(CHARJ_SOURCE 
         (packageDeclaration)? 
         (importDeclarations) 
-        (typeDeclaration[$importDeclarations.packageNames]))
+        (typeDeclaration[$importDeclarations.packageNames])*)
         { $cs = $typeDeclaration.sym; }
     ;
 
@@ -65,6 +65,7 @@ typeDeclaration[List<CharjAST> imports] returns [ClassSymbol sym]
         {
             $TYPE.tree.addChild(puper.getPupRoutineNode());
             $TYPE.tree.addChild(puper.getInitRoutineNode());
+            puper = new PupRoutineCreator();
         }
     |   ^(INTERFACE IDENT (^('extends' type+))?  interfaceScopeDeclaration*)
     |   ^(ENUM IDENT (^('implements' type+))? enumConstant+ classScopeDeclaration*)