Bug 46058 - AST didn't visit EmptyStatement node
Summary: AST didn't visit EmptyStatement node
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Jim des Rivieres CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-04 15:17 EST by Kelvin CLA
Modified: 2003-11-05 16:57 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelvin CLA 2003-11-04 15:17:26 EST
test case

public class Test {

    int i;
     ;  // <--- AST didn't visit this node

}
Comment 1 Olivier Thomann CLA 2003-11-04 21:45:12 EST
I will investigate. The problem can be that this empty class body declaration
doesn't appear at all in the resulting AST.
Comment 2 Olivier Thomann CLA 2003-11-05 09:32:32 EST
Just to be clear, this semi-colon is not an empty statement, but an empty class
body declaration. For now we don't have a corresponding node in the tree,
because this semi-colon is useless. I'll see what it takes to add it into the tree.
Comment 3 Olivier Thomann CLA 2003-11-05 11:30:11 EST
Add CC'
Comment 4 Jim des Rivieres CLA 2003-11-05 12:51:40 EST
There are a few places in the Java language where syntactic constructs are not 
rendered in the AST (e.g., position of "[]" for method return type; extra "," 
after the last expression in an array initializer). The reason there is no 
node for empty class body declarations is, as Olivier points out, they are 
semantically useless and play no role in how programs are interpreted. 
Like whitespace, it is a lexical fact of the program that is simply not 
accounted for at the AST level.
Comment 5 Olivier Thomann CLA 2003-11-05 16:57:32 EST
Change milestone.