Hi all!
In terms of Java source code, what is the distinction between a FieldDeclaration and a FieldSpecification? I write a visitor class (that extends SourceVisitor). When I visit a class declaration and want to get at the fields declared in the class I would have thought I was to use the class FieldDeclaration. But it appears that FieldSpecification is the one to use. So what does a FieldDeclaration look like in terms of Java code?
Thanks for any hint!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hej,
if you look at something like
int a = 0, b = 1;
a FieldDeclaration is "the whole" (from "int" to ";"), while there are 2 FieldSpecifications: "a = 0" and "b = 1". Same goes for LocalVariableDeclaration/~Specification and ParameterDeclaration/~Specification. A special case for the latter is that only 1 FieldSpecification per ParameterDeclaration is allowed (Java Syntax forbids otherwise).
Hope that helps!
Regards,
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all!
In terms of Java source code, what is the distinction between a FieldDeclaration and a FieldSpecification? I write a visitor class (that extends SourceVisitor). When I visit a class declaration and want to get at the fields declared in the class I would have thought I was to use the class FieldDeclaration. But it appears that FieldSpecification is the one to use. So what does a FieldDeclaration look like in terms of Java code?
Thanks for any hint!
Hej,
if you look at something like
int a = 0, b = 1;
a FieldDeclaration is "the whole" (from "int" to ";"), while there are 2 FieldSpecifications: "a = 0" and "b = 1". Same goes for LocalVariableDeclaration/~Specification and ParameterDeclaration/~Specification. A special case for the latter is that only 1 FieldSpecification per ParameterDeclaration is allowed (Java Syntax forbids otherwise).
Hope that helps!
Regards,
Tobias