Bug 5432 - compiler syntax error is incorrect
Summary: compiler syntax error is incorrect
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows 2000
: P4 minor (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-01 15:13 EST by Dave Dykstal CLA
Modified: 2002-01-14 11:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Dykstal CLA 2001-11-01 15:13:37 EST
I typed

static final String[] mylist {};

This is missing an "=".  The error I received said that the compiler
was expecting a "{", ";", or ",".
Comment 1 Olivier Thomann CLA 2001-12-11 14:13:52 EST
The problem is related to the fact that the rule VariableDeclarator is already 
reduced when the syntax error is found. So the two possibles completions are 
what you can have when a variable is completed. Which means it can be followed 
by another variable (',') or it terminates the variable declarations (';').
I don't see how it is possible to change the parser in order not to reduce the 
actions when the syntax error is found. The syntax error is reported when all 
possible reductions have been done. In the grammar, one possible reduction 
occurs when the variable has no initialization.
We know that the parser doesn't always return accurate error messages in case of 
syntax errors. I think we will have to live with it.
Comment 2 Olivier Thomann CLA 2001-12-12 12:40:48 EST
This problem is related to the parser technology we use. We won't change this 
now. So we should probably put somewhere in the release notes that the error 
messages on syntax errors are not always accurate.