Bug 42660 - [parsing] cascading errors on some syntax mistakes
Summary: [parsing] cascading errors on some syntax mistakes
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.1.0   Edit
Hardware: PC Windows NT
: P3 enhancement (vote)
Target Milestone: 1.6.8   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 44736 128112 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-06 13:51 EDT by Wes Isberg CLA
Modified: 2010-01-26 12:44 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wes Isberg CLA 2003-09-06 13:51:47 EDT
I've noticed that some syntax mistakes result in a number of false errors so
large that it can be hard to detect the originating error.  It would be nice if
the compiler highlighted the originating error rather than misdetecting others.
 I realize this might have to be balanced against the contrary desire to show as
many independent errors as possible, so fixing the errors can result in a
compiling program.

This bug is to warn users about such mistakes and make a place where users can
add their own discoveries.  I expect that in a given release, some subset of
these mistakes might be fixed, so this bug may end up open but partially fixed
for some time.

Syntax mistakes I've seen cause cascades:

- failing to close '}' for a method body or type

- failing to terminate a pointcut with ';'

- using () after the return value in a method
  public String() toString() { ... }
Comment 1 Wes Isberg CLA 2003-09-06 18:13:52 EDT
Another one:

from: after() returning (Type) : ...
  to: after() returning (Type name) : ...
  
Comment 2 Wes Isberg CLA 2003-09-15 09:26:00 EDT
also:

from: aspect A B { ...
  to: aspect A extends B { ...

Comment 3 Jim Hugunin CLA 2004-01-07 04:37:59 EST
*** Bug 44736 has been marked as a duplicate of this bug. ***
Comment 4 Wes Isberg CLA 2004-02-10 15:16:56 EST
also...

from: after : logEntry() {
  to: after () : logEntry() {
Comment 5 Wes Isberg CLA 2004-02-23 23:44:10 EST
Unsure if related: the compiler reports

  Syntax error on token ";", invalid PseudoToken

on the pointcut below, though the issue is that the declare
are not permitted in a class.  Fix by commenting out declare.
----
public class ClassPointcut {
  pointcut anyPublicCall() : call(public * *(..));
  declare warning: anyPublicCall() : "illegal internal call";
}

Comment 6 Adrian Colyer CLA 2005-03-22 08:22:19 EST
It would be good to take a closer look at error productions in the parser during
the M4 milestone.
Comment 7 Adrian Colyer CLA 2005-10-28 05:54:28 EDT
The error detection has been improved in 1.5.0, but this is always an ongoing issue as there is always 
more that could be done. I'm keeping this open and moving to 1.5.1 - we've done all we intend to do for 
1.5.0.
Comment 8 Andrew Clement CLA 2006-02-16 03:02:09 EST
*** Bug 128112 has been marked as a duplicate of this bug. ***
Comment 9 Andrew Clement CLA 2006-03-27 03:45:44 EST
moving out of 1.5.1 - this is a good thing to look at when we open things up in a couple of months to integrate the 3.2 eclipse compiler.
Comment 10 Andrew Clement CLA 2008-01-22 13:56:11 EST
parser recovery is different now in AspectJ6 with the new compiler - but I don't know if we need to do more.  I need some real testcases to show cascade issues then we can try them.
Comment 11 Andrew Clement CLA 2010-01-26 12:44:55 EST
fixed as many things as planned to right now.  Fixing the problem discussed here: http://andrewclement.blogspot.com/2009/02/aspectj-fixing-reverse-cascade-errors.html will have improved things a great deal.  Will work on further issues on a case-by-case basis.