if (superclassName == null) {
classDeclaration = new ClassDeclaration(currentSegment,
className.image.toCharArray(),
- superclassName.image.toCharArray(),
pos,
0);
} else {
classDeclaration = new ClassDeclaration(currentSegment,
className.image.toCharArray(),
+ superclassName.image.toCharArray(),
pos,
0);
}
FieldDeclaration FieldDeclaration() :
{
VariableDeclaration variableDeclaration;
+ final ArrayList list = new ArrayList();
+ final int pos = SimpleCharStream.getPosition();
}
{
<VAR> variableDeclaration = VariableDeclarator()
{
+ list.add(variableDeclaration);
outlineInfo.addVariable(new String(variableDeclaration.name));
- if (currentSegment != null) {
- currentSegment.add(variableDeclaration);
- }
+ currentSegment.add(variableDeclaration);
}
( <COMMA>
variableDeclaration = VariableDeclarator()
- {
- if (currentSegment != null) {
- currentSegment.add(variableDeclaration);
- }
- }
+ {list.add(variableDeclaration);
+ outlineInfo.addVariable(new String(variableDeclaration.name));
+ currentSegment.add(variableDeclaration);}
)*
try {
<SEMICOLON>
errorEnd = jj_input_stream.getPosition() + 1;
throw e;
}
+ {return new FieldDeclaration((VariableDeclaration[]) list.toArray(),
+ pos,
+ SimpleCharStream.getPosition());}
}
VariableDeclaration VariableDeclarator() :
throw e;
}
]
- {return new VariableDeclaration(currentSegment,
+ {
+ if (initializer == null) {
+ return new VariableDeclaration(currentSegment,
varName.toCharArray(),
- initializer,
- pos);}
+ pos,
+ jj_input_stream.getPosition());
+ }
+ return new VariableDeclaration(currentSegment,
+ varName.toCharArray(),
+ initializer,
+ pos);
+ }
}
/**
VariableDeclaration LocalVariableDeclarator() :
{
final String varName;
- Expression init = null;
+ Expression initializer = null;
final int pos = SimpleCharStream.getPosition();
}
{
- varName = VariableDeclaratorId() [ <ASSIGN> init = Expression() ]
- {return new VariableDeclaration(varName.toCharArray(),init,pos);}
+ varName = VariableDeclaratorId() [ <ASSIGN> initializer = Expression() ]
+ {
+ if (initializer == null) {
+ return new VariableDeclaration(currentSegment,
+ varName.toCharArray(),
+ pos,
+ jj_input_stream.getPosition());
+ }
+ return new VariableDeclaration(currentSegment,
+ varName.toCharArray(),
+ initializer,
+ pos);
+ }
}
EmptyStatement EmptyStatement() :