IExpression[] subscripts = (third instanceof IExpression[])? (IExpression[])third : null;\r
int declarationStart = (third instanceof IExpression[]) ? 3 : 2;\r
ArrayList<Object> clauses = new ArrayList<Object>();\r
- for(int i=declarationStart;i<n.jjtGetNumChildren();i++) {\r
+ \r
+ ArrayList<Declaration> declarations2 = new ArrayList<Declaration>();\r
+ if(third instanceof ArrayList) {\r
+ ArrayList<Declaration> decls = (ArrayList<Declaration>)third;\r
+ declarations2.addAll(decls);\r
+ } else {\r
+ for(int i=declarationStart;i<n.jjtGetNumChildren();i++) {\r
+ Declaration decl = (Declaration)walk((SimpleNode)n.jjtGetChild(i), indent+2, frame);\r
+ declarations2.add(decl);\r
+ }\r
+ }\r
+ \r
+ for(Declaration decl : declarations2) {\r
\r
- Declaration decl = (Declaration)walk((SimpleNode)n.jjtGetChild(i), indent+2, frame);\r
if(subscripts != null)\r
decl.variable.subscripts = subscripts;\r
\r
}\r
}\r
return clauses;\r
+ case component_list:\r
+ if(n.jjtGetNumChildren() == 1)\r
+ return walk((SimpleNode)n.jjtGetChild(0), indent+2, frame);\r
+ else {\r
+ ArrayList<Declaration> result = new ArrayList<Declaration>();\r
+ for(int i=0;i<n.jjtGetNumChildren();i++) {\r
+ result.add((Declaration)walk((SimpleNode)n.jjtGetChild(i),indent+2, frame));\r
+ }\r
+ return result;\r
+ }\r
case component_declaration:\r
return (Declaration)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame);\r
case array_subscripts:\r