Changeset 19246

Show
Ignore:
Timestamp:
11/20/08 19:43:57 (7 weeks ago)
Author:
stephan
Message:

more heuristic to cope with std-java code: support '.' 'team'.
See 8.12.1-otjld-scoped-keyword-1

Location:
trunk/src/plugins/org.eclipse.jdt.core
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java

    r18591 r19246  
    9494    protected boolean _calloutSeen = false;  
    9595    protected boolean _callinSeen = false; 
     96     
     97    // after a '.' even 'team' can be an identifier: 
     98    private int _dotSeen = 0; // 0: no, 1: previos, 2: this token 
    9699     
    97100    // only within a joinpoint query '#' is a special token! 
     
    11631166} 
    11641167public int getNextToken() throws InvalidInputException { 
     1168//{ObjectTeams: support '.' 'team': 
     1169        if (this._dotSeen > 0) 
     1170                this._dotSeen--; // "aging" 
     1171// SH} 
    11651172        this.wasAcr = false; 
    11661173        if (this.diet) { 
     
    12861293                                                                this.currentPosition = temp2; 
    12871294                                                                return TokenNameDOT_DOT; 
    1288                                                         }  
     1295                                                        } 
     1296                                                        this._dotSeen = 2; // now 
    12891297//SH} 
    12901298                                                        this.currentPosition = temp; 
     
    12921300                                                } 
    12931301                                        } else { 
     1302//{ObjectTeams: record the one '.': 
     1303                                                this._dotSeen = 2; // now 
     1304// SH} 
    12941305                                                this.currentPosition = temp; 
    12951306                                                return TokenNameDOT; 
     
    40254036                                                        return TokenNametrue; 
    40264037                                                else 
    4027 //{ObjectTeams: check for team keyword (always checked, if seen set isOTsource           
     4038//{ObjectTeams: check for team keyword (always checked except after '.' -- if seen set isOTsource)               
    40284039                                                        if ((data[index] == 'e') 
    40294040                                                                && (data[++index] == 'a') 
    4030                                                                 && (data[++index] == 'm'))  
     4041                                                                && (data[++index] == 'm') 
     4042                                                                && (this._isOTSource || this._dotSeen == 0))  
    40314043                                                        { 
    40324044                                                                _teamKeywordSeen = true; 
  • trunk/src/plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/PublicScanner.java

    r18591 r19246  
    8282    protected boolean _calloutSeen = false;  
    8383    protected boolean _callinSeen = false; 
     84     
     85    // after a '.' even 'team' can be an identifier: 
     86    private int _dotSeen = 0; // 0: no, 1: previos, 2: this token 
    8487     
    8588    // only within a joinpoint query '#' is a special token! 
     
    11511154} 
    11521155public int getNextToken() throws InvalidInputException { 
     1156//{ObjectTeams: support '.' 'team': 
     1157        if (this._dotSeen > 0) 
     1158                this._dotSeen--; // "aging" 
     1159// SH} 
    11531160        this.wasAcr = false; 
    11541161        if (this.diet) { 
     
    12741281                                                                this.currentPosition = temp2; 
    12751282                                                                return TokenNameDOT_DOT; 
    1276                                                         }  
     1283                                                        } 
     1284                                                        this._dotSeen = 2; // now 
    12771285//SH} 
    12781286                                                        this.currentPosition = temp; 
     
    12801288                                                } 
    12811289                                        } else { 
     1290//{ObjectTeams: record the one '.': 
     1291                                                this._dotSeen = 2; // now 
     1292// SH} 
    12821293                                                this.currentPosition = temp; 
    12831294                                                return TokenNameDOT; 
     
    36333644                                                        return TokenNametrue; 
    36343645                                                else 
    3635 //{ObjectTeams: check for team keyword (always checked, if seen set isOTsource           
     3646//{ObjectTeams: check for team keyword (always checked except after '.' -- if seen set isOTsource)               
    36363647                                                        if ((data[index] == 'e') 
    36373648                                                                && (data[++index] == 'a') 
    3638                                                                 && (data[++index] == 'm'))  
     3649                                                                && (data[++index] == 'm') 
     3650                                                                && (this._isOTSource || this._dotSeen == 0))  
    36393651                                                        { 
    36403652                                                                _teamKeywordSeen = true;