Bug 10703 - ast: no API to figure out the source range of 'super' keywords
Summary: ast: no API to figure out the source range of 'super' keywords
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 3354
Blocks:
  Show dependency tree
 
Reported: 2002-03-04 13:41 EST by Adam Kiezun CLA
Modified: 2003-03-17 11:58 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 Adam Kiezun CLA 2002-03-04 13:41:05 EST
there seems to be now easy way to compute the location of the 'super' keyword 
in the 3 nodes below:

SuperFieldAccess
SuperMethodInvocation
SuperConstructorInvocation
Comment 1 Adam Kiezun CLA 2002-03-04 13:41:50 EST
i need location and length (it can vary between locales i think (?))
Comment 2 Olivier Thomann CLA 2002-03-04 13:46:00 EST
Jim - Any comment? Even if the 'super' keyword is implicit, we might want to 
get its positions.
Comment 3 Adam Kiezun CLA 2002-03-04 14:00:33 EST
same is true for 'this' in ThisExpression,
the Operator in InfixExpression
the Operator in PrefixExpression
the Operator in PostfixExpression
the 'class' keyword in TypeLiteral

and so on ... - the problem is more general

for now - _i_ only need 'super' though
but all of the above will be asked for at some point

Comment 4 Jim des Rivieres CLA 2002-03-04 17:14:53 EST
The source coordinates of the 'super' keyword (and other keywords as well)
are not explicitly stored.

Additional source coordinates should be obtained by explicitly scanning.
For example, for a SuperFieldAccess with the qualifier non-null, the tokens
".", "super", and "." (plus arbitrary whitespace and comments) can be expected
to lie between the end of the qualifier and the start of the name.
Comment 5 Adam Kiezun CLA 2002-03-05 04:27:36 EST
fair enough - the scanner is not api yet, though :)
ok to close
Comment 6 Dirk Baeumer CLA 2002-03-05 08:36:38 EST
I agree that we should use the scanner for those extra positions since 
otherwise we end up having positions for every single token.

Two things:

- when will the scanner be API
- do you think it is of any use if the AST provides API to access a scanner ?
Comment 7 Philipe Mulet CLA 2002-03-07 07:05:00 EST
I am considering surfacing the scanner as well, but it is somewhat tricky given 
it is currently holding onto internal stuff as well. It is on the plan for 2.0, 
see bug 3354
Comment 8 Philipe Mulet CLA 2002-03-25 10:27:34 EST
Scanner API will be surfaced in next integration build.
Ok to close this one then ?
Comment 9 Adam Kiezun CLA 2002-03-25 10:33:17 EST
yes, thanks
Comment 10 Olivier Thomann CLA 2002-03-25 17:14:12 EST
The issue is about surfacing the scanner API and not providing new positions inside the existing 
DOM/AST nodes.
The scanner API will be surfaced next integration build, so we can close this 
one.
Closed.