Summary: | Clarifications of the DOM/AST API for VariableDeclarationExpression and VariableDeclarationStatement | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Jim des Rivieres <jeem> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.0 | ||
Target Milestone: | 3.1 M2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Olivier Thomann
2004-09-14 17:21:08 EDT
I've clarified the specs as follows: ForStatement - When variables are declared in the initializer of a for statement such as "<code>for (int a=1, b=2;;);</code>", they should be represented as a single <code>VariableDeclarationExpression</code> with two fragments, rather than being split up into a pair of expressions. VariableDeclarationExpression - This type of node can be used as the initializer of a <code>ForStatement</code>, or wrapped in an <code>ExpressionStatement</code> to form the equivalent of a <code>VariableDeclarationStatement</code>. VariableDeclarationStatement - This type of node is a convenience of sorts. An equivalent way to represent the same statement is to use a <code>VariableDeclarationExpression</code> wrapped in an <code>ExpressionStatement</code>. None of these clarification are API changes. In general, in numerous cases there is more than one way that a Java language fragment can be mapped to an AST tree. Clients learn to live with this ambiguity and not rely on the exact shape. Making use of ASTVisitor is a good way to do that. Build notes updated. Verified for 3.1 M2 with build I200409230010. |