<s> package org . eclipse . jdt . internal . compiler . parser ; import java . io . * ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Iterator ; import java . util . List ; import java . util . Properties ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . compiler . InvalidInputException ; import org . eclipse . jdt . internal . compiler . ASTVisitor ; import org . eclipse . jdt . internal . compiler . CompilationResult ; import org . eclipse . jdt . internal . compiler . ast . * ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . ICompilationUnit ; import org . eclipse . jdt . internal . compiler . impl . CompilerOptions ; import org . eclipse . jdt . internal . compiler . impl . ReferenceContext ; import org . eclipse . jdt . internal . compiler . lookup . BlockScope ; import org . eclipse . jdt . internal . compiler . lookup . ClassScope ; import org . eclipse . jdt . internal . compiler . lookup . Binding ; import org . eclipse . jdt . internal . compiler . lookup . ExtraCompilerModifiers ; import org . eclipse . jdt . internal . compiler . lookup . MethodScope ; import org . eclipse . jdt . internal . compiler . lookup . TypeIds ; import org . eclipse . jdt . internal . compiler . parser . diagnose . DiagnoseParser ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilation ; import org . eclipse . jdt . internal . compiler . problem . AbortCompilationUnit ; import org . eclipse . jdt . internal . compiler . problem . ProblemReporter ; import org . eclipse . jdt . internal . compiler . problem . ProblemSeverities ; import org . eclipse . jdt . internal . compiler . util . Messages ; import org . eclipse . jdt . internal . compiler . util . Util ; public class Parser implements ParserBasicInformation , TerminalTokens , OperatorIds , TypeIds { protected static final int THIS_CALL = ExplicitConstructorCall . This ; protected static final int SUPER_CALL = ExplicitConstructorCall . Super ; public static final char [ ] FALL_THROUGH_TAG = "" . toCharArray ( ) ; public static final char [ ] CASES_OMITTED_TAG = "" . toCharArray ( ) ; public static char asb [ ] = null ; public static char asr [ ] = null ; protected final static int AstStackIncrement = 100 ; public static char base_action [ ] = null ; public static final int BracketKinds = 3 ; public static short check_table [ ] = null ; public static final int CurlyBracket = 2 ; private static final boolean DEBUG = false ; private static final boolean DEBUG_AUTOMATON = false ; private static final String EOF_TOKEN = "$eof" ; private static final String ERROR_TOKEN = "$error" ; protected final static int ExpressionStackIncrement = 100 ; protected final static int GenericsStackIncrement = 10 ; private final static String FILEPREFIX = "parser" ; public static char in_symb [ ] = null ; private static final String INVALID_CHARACTER = "" ; public static char lhs [ ] = null ; public static String name [ ] = null ; public static char nasb [ ] = null ; public static char nasr [ ] = null ; public static char non_terminal_index [ ] = null ; private final static String READABLE_NAMES_FILE = "" ; public static String readableName [ ] = null ; public static byte rhs [ ] = null ; public static int [ ] reverse_index = null ; public static char [ ] recovery_templates_index = null ; public static char [ ] recovery_templates = null ; public static char [ ] statements_recovery_filter = null ; public static long rules_compliance [ ] = null ; public static final int RoundBracket = 0 ; public static byte scope_la [ ] = null ; public static char scope_lhs [ ] = null ; public static char scope_prefix [ ] = null ; public static char scope_rhs [ ] = null ; public static char scope_state [ ] = null ; public static char scope_state_set [ ] = null ; public static char scope_suffix [ ] = null ; public static final int SquareBracket = 1 ; protected final static int StackIncrement = 255 ; public static char term_action [ ] = null ; public static byte term_check [ ] = null ; public static char terminal_index [ ] = null ; private static final String UNEXPECTED_EOF = "" ; public static boolean VERBOSE_RECOVERY = false ; static { try { initTables ( ) ; } catch ( java . io . IOException ex ) { throw new ExceptionInInitializerError ( ex . getMessage ( ) ) ; } } public static int asi ( int state ) { return asb [ original_state ( state ) ] ; } public final static short base_check ( int i ) { return check_table [ i - ( NUM_RULES + 1 ) ] ; } private final static void buildFile ( String filename , List listToDump ) { BufferedWriter writer = null ; try { writer = new BufferedWriter ( new FileWriter ( filename ) ) ; for ( Iterator iterator = listToDump . iterator ( ) ; iterator . hasNext ( ) ; ) { writer . write ( String . valueOf ( iterator . next ( ) ) ) ; } writer . flush ( ) ; } catch ( IOException e ) { } finally { if ( writer != null ) { try { writer . close ( ) ; } catch ( IOException e1 ) { } } } System . out . println ( filename + "" ) ; } private static void buildFileForCompliance ( String file , int length , String [ ] tokens ) { byte [ ] result = new byte [ length * 8 ] ; for ( int i = 0 ; i < tokens . length ; i = i + 3 ) { if ( "2" . equals ( tokens [ i ] ) ) { int index = Integer . parseInt ( tokens [ i + 1 ] ) ; String token = tokens [ i + 2 ] . trim ( ) ; long compliance = 0 ; if ( "1.4" . equals ( token ) ) { compliance = ClassFileConstants . JDK1_4 ; } else if ( "1.5" . equals ( token ) ) { compliance = ClassFileConstants . JDK1_5 ; } else if ( "recovery" . equals ( token ) ) { compliance = ClassFileConstants . JDK_DEFERRED ; } int j = index * 8 ; result [ j ] = ( byte ) ( compliance >>> 56 ) ; result [ j + 1 ] = ( byte ) ( compliance >>> 48 ) ; result [ j + 2 ] = ( byte ) ( compliance >>> 40 ) ; result [ j + 3 ] = ( byte ) ( compliance >>> 32 ) ; result [ j + 4 ] = ( byte ) ( compliance >>> 24 ) ; result [ j + 5 ] = ( byte ) ( compliance >>> 16 ) ; result [ j + 6 ] = ( byte ) ( compliance >>> 8 ) ; result [ j + 7 ] = ( byte ) ( compliance ) ; } } buildFileForTable ( file , result ) ; } private final static String [ ] buildFileForName ( String filename , String contents ) { String [ ] result = new String [ contents . length ( ) ] ; result [ 0 ] = null ; int resultCount = 1 ; StringBuffer buffer = new StringBuffer ( ) ; int start = contents . indexOf ( "name[]" ) ; start = contents . indexOf ( '\"' , start ) ; int end = contents . indexOf ( "};" , start ) ; contents = contents . substring ( start , end ) ; boolean addLineSeparator = false ; int tokenStart = - 1 ; StringBuffer currentToken = new StringBuffer ( ) ; for ( int i = 0 ; i < contents . length ( ) ; i ++ ) { char c = contents . charAt ( i ) ; if ( c == '\"' ) { if ( tokenStart == - 1 ) { tokenStart = i + 1 ; } else { if ( addLineSeparator ) { buffer . append ( '\n' ) ; result [ resultCount ++ ] = currentToken . toString ( ) ; currentToken = new StringBuffer ( ) ; } String token = contents . substring ( tokenStart , i ) ; if ( token . equals ( ERROR_TOKEN ) ) { token = INVALID_CHARACTER ; } else if ( token . equals ( EOF_TOKEN ) ) { token = UNEXPECTED_EOF ; } buffer . append ( token ) ; currentToken . append ( token ) ; addLineSeparator = true ; tokenStart = - 1 ; } } if ( tokenStart == - 1 && c == '+' ) { addLineSeparator = false ; } } if ( currentToken . length ( ) > 0 ) { result [ resultCount ++ ] = currentToken . toString ( ) ; } buildFileForTable ( filename , buffer . toString ( ) . toCharArray ( ) ) ; System . arraycopy ( result , 0 , result = new String [ resultCount ] , 0 , resultCount ) ; return result ; } private static void buildFileForReadableName ( String file , char [ ] newLhs , char [ ] newNonTerminalIndex , String [ ] newName , String [ ] tokens ) { ArrayList entries = new ArrayList ( ) ; boolean [ ] alreadyAdded = new boolean [ newName . length ] ; for ( int i = 0 ; i < tokens . length ; i = i + 3 ) { if ( "1" . equals ( tokens [ i ] ) ) { int index = newNonTerminalIndex [ newLhs [ Integer . parseInt ( tokens [ i + 1 ] ) ] ] ; StringBuffer buffer = new StringBuffer ( ) ; if ( ! alreadyAdded [ index ] ) { alreadyAdded [ index ] = true ; buffer . append ( newName [ index ] ) ; buffer . append ( '=' ) ; buffer . append ( tokens [ i + 2 ] . trim ( ) ) ; buffer . append ( '\n' ) ; entries . add ( String . valueOf ( buffer ) ) ; } } } int i = 1 ; while ( ! INVALID_CHARACTER . equals ( newName [ i ] ) ) i ++ ; i ++ ; for ( ; i < alreadyAdded . length ; i ++ ) { if ( ! alreadyAdded [ i ] ) { System . out . println ( newName [ i ] + "" ) ; } } Collections . sort ( entries ) ; buildFile ( file , entries ) ; } private final static void buildFileForTable ( String filename , byte [ ] bytes ) { java . io . FileOutputStream stream = null ; try { stream = new java . io . FileOutputStream ( filename ) ; stream . write ( bytes ) ; } catch ( IOException e ) { } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } System . out . println ( filename + "" ) ; } private final static void buildFileForTable ( String filename , char [ ] chars ) { byte [ ] bytes = new byte [ chars . length * 2 ] ; for ( int i = 0 ; i < chars . length ; i ++ ) { bytes [ 2 * i ] = ( byte ) ( chars [ i ] >>> 8 ) ; bytes [ 2 * i + 1 ] = ( byte ) ( chars [ i ] & 0xFF ) ; } java . io . FileOutputStream stream = null ; try { stream = new java . io . FileOutputStream ( filename ) ; stream . write ( bytes ) ; } catch ( IOException e ) { } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { } } } System . out . println ( filename + "" ) ; } private final static byte [ ] buildFileOfByteFor ( String filename , String tag , String [ ] tokens ) { int i = 0 ; while ( ! tokens [ i ++ ] . equals ( tag ) ) { } byte [ ] bytes = new byte [ tokens . length ] ; int ic = 0 ; String token ; while ( ! ( token = tokens [ i ++ ] ) . equals ( "}" ) ) { int c = Integer . parseInt ( token ) ; bytes [ ic ++ ] = ( byte ) c ; } System . arraycopy ( bytes , 0 , bytes = new byte [ ic ] , 0 , ic ) ; buildFileForTable ( filename , bytes ) ; return bytes ; } private final static char [ ] buildFileOfIntFor ( String filename , String tag , String [ ] tokens ) { int i = 0 ; while ( ! tokens [ i ++ ] . equals ( tag ) ) { } char [ ] chars = new char [ tokens . length ] ; int ic = 0 ; String token ; while ( ! ( token = tokens [ i ++ ] ) . equals ( "}" ) ) { int c = Integer . parseInt ( token ) ; chars [ ic ++ ] = ( char ) c ; } System . arraycopy ( chars , 0 , chars = new char [ ic ] , 0 , ic ) ; buildFileForTable ( filename , chars ) ; return chars ; } private final static void buildFileOfShortFor ( String filename , String tag , String [ ] tokens ) { int i = 0 ; while ( ! tokens [ i ++ ] . equals ( tag ) ) { } char [ ] chars = new char [ tokens . length ] ; int ic = 0 ; String token ; while ( ! ( token = tokens [ i ++ ] ) . equals ( "}" ) ) { int c = Integer . parseInt ( token ) ; chars [ ic ++ ] = ( char ) ( c + 32768 ) ; } System . arraycopy ( chars , 0 , chars = new char [ ic ] , 0 , ic ) ; buildFileForTable ( filename , chars ) ; } private static void buildFilesForRecoveryTemplates ( String indexFilename , String templatesFilename , char [ ] newTerminalIndex , char [ ] newNonTerminalIndex , String [ ] newName , char [ ] newLhs , String [ ] tokens ) { int [ ] newReverse = computeReverseTable ( newTerminalIndex , newNonTerminalIndex , newName ) ; char [ ] newRecoveyTemplatesIndex = new char [ newNonTerminalIndex . length ] ; char [ ] newRecoveyTemplates = new char [ newNonTerminalIndex . length ] ; int newRecoveyTemplatesPtr = 0 ; for ( int i = 0 ; i < tokens . length ; i = i + 3 ) { if ( "3" . equals ( tokens [ i ] ) ) { int length = newRecoveyTemplates . length ; if ( length == newRecoveyTemplatesPtr + 1 ) { System . arraycopy ( newRecoveyTemplates , 0 , newRecoveyTemplates = new char [ length * 2 ] , 0 , length ) ; } newRecoveyTemplates [ newRecoveyTemplatesPtr ++ ] = 0 ; int index = newLhs [ Integer . parseInt ( tokens [ i + 1 ] ) ] ; newRecoveyTemplatesIndex [ index ] = ( char ) newRecoveyTemplatesPtr ; String token = tokens [ i + 2 ] . trim ( ) ; java . util . StringTokenizer st = new java . util . StringTokenizer ( token , " " ) ; String [ ] terminalNames = new String [ st . countTokens ( ) ] ; int t = 0 ; while ( st . hasMoreTokens ( ) ) { terminalNames [ t ++ ] = st . nextToken ( ) ; } for ( int j = 0 ; j < terminalNames . length ; j ++ ) { int symbol = getSymbol ( terminalNames [ j ] , newName , newReverse ) ; if ( symbol > - 1 ) { length = newRecoveyTemplates . length ; if ( length == newRecoveyTemplatesPtr + 1 ) { System . arraycopy ( newRecoveyTemplates , 0 , newRecoveyTemplates = new char [ length * 2 ] , 0 , length ) ; } newRecoveyTemplates [ newRecoveyTemplatesPtr ++ ] = ( char ) symbol ; } } } } newRecoveyTemplates [ newRecoveyTemplatesPtr ++ ] = 0 ; System . arraycopy ( newRecoveyTemplates , 0 , newRecoveyTemplates = new char [ newRecoveyTemplatesPtr ] , 0 , newRecoveyTemplatesPtr ) ; buildFileForTable ( indexFilename , newRecoveyTemplatesIndex ) ; buildFileForTable ( templatesFilename , newRecoveyTemplates ) ; } private static void buildFilesForStatementsRecoveryFilter ( String filename , char [ ] newNonTerminalIndex , char [ ] newLhs , String [ ] tokens ) { char [ ] newStatementsRecoveryFilter = new char [ newNonTerminalIndex . length ] ; for ( int i = 0 ; i < tokens . length ; i = i + 3 ) { if ( "4" . equals ( tokens [ i ] ) ) { int index = newLhs [ Integer . parseInt ( tokens [ i + 1 ] ) ] ; newStatementsRecoveryFilter [ index ] = 1 ; } } buildFileForTable ( filename , newStatementsRecoveryFilter ) ; } public final static void buildFilesFromLPG ( String dataFilename , String dataFilename2 ) { char [ ] contents = CharOperation . NO_CHAR ; try { contents = Util . getFileCharContent ( new File ( dataFilename ) , null ) ; } catch ( IOException ex ) { System . out . println ( Messages . parser_incorrectPath ) ; return ; } java . util . StringTokenizer st = new java . util . StringTokenizer ( new String ( contents ) , " tnr[]={,;" ) ; String [ ] tokens = new String [ st . countTokens ( ) ] ; int j = 0 ; while ( st . hasMoreTokens ( ) ) { tokens [ j ++ ] = st . nextToken ( ) ; } final String prefix = FILEPREFIX ; int i = 0 ; char [ ] newLhs = buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "lhs" , tokens ) ; buildFileOfShortFor ( prefix + ( ++ i ) + ".rsc" , "check_table" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "asb" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "asr" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "nasb" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "nasr" , tokens ) ; char [ ] newTerminalIndex = buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "" , tokens ) ; char [ ] newNonTerminalIndex = buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "term_action" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "scope_prefix" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "scope_suffix" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "scope_lhs" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "scope_rhs" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "scope_state" , tokens ) ; buildFileOfIntFor ( prefix + ( ++ i ) + ".rsc" , "in_symb" , tokens ) ; byte [ ] newRhs = buildFileOfByteFor ( prefix + ( ++ i ) + ".rsc" , "rhs" , tokens ) ; buildFileOfByteFor ( prefix + ( ++ i ) + ".rsc" , "term_check" , tokens ) ; buildFileOfByteFor ( prefix + ( ++ i ) + ".rsc" , "scope_la" , tokens ) ; String [ ] newName = buildFileForName ( prefix + ( ++ i ) + ".rsc" , new String ( contents ) ) ; contents = CharOperation . NO_CHAR ; try { contents = Util . getFileCharContent ( new File ( dataFilename2 ) , null ) ; } catch ( IOException ex ) { System . out . println ( Messages . parser_incorrectPath ) ; return ; } st = new java . util . StringTokenizer ( new String ( contents ) , "tnr#" ) ; tokens = new String [ st . countTokens ( ) ] ; j = 0 ; while ( st . hasMoreTokens ( ) ) { tokens [ j ++ ] = st . nextToken ( ) ; } buildFileForCompliance ( prefix + ( ++ i ) + ".rsc" , newRhs . length , tokens ) ; buildFileForReadableName ( READABLE_NAMES_FILE + ".props" , newLhs , newNonTerminalIndex , newName , tokens ) ; buildFilesForRecoveryTemplates ( prefix + ( ++ i ) + ".rsc" , prefix + ( ++ i ) + ".rsc" , newTerminalIndex , newNonTerminalIndex , newName , newLhs , tokens ) ; buildFilesForStatementsRecoveryFilter ( prefix + ( ++ i ) + ".rsc" , newNonTerminalIndex , newLhs , tokens ) ; System . out . println ( Messages . parser_moveFiles ) ; } protected static int [ ] computeReverseTable ( char [ ] newTerminalIndex , char [ ] newNonTerminalIndex , String [ ] newName ) { int [ ] newReverseTable = new int [ newName . length ] ; for ( int j = 0 ; j < newName . length ; j ++ ) { found : { for ( int k = 0 ; k < newTerminalIndex . length ; k ++ ) { if ( newTerminalIndex [ k ] == j ) { newReverseTable [ j ] = k ; break found ; } } for ( int k = 0 ; k < newNonTerminalIndex . length ; k ++ ) { if ( newNonTerminalIndex [ k ] == j ) { newReverseTable [ j ] = - k ; break found ; } } } } return newReverseTable ; } private static int getSymbol ( String terminalName , String [ ] newName , int [ ] newReverse ) { for ( int j = 0 ; j < newName . length ; j ++ ) { if ( terminalName . equals ( newName [ j ] ) ) { return newReverse [ j ] ; } } return - 1 ; } public static int in_symbol ( int state ) { return in_symb [ original_state ( state ) ] ; } public final static void initTables ( ) throws java . io . IOException { final String prefix = FILEPREFIX ; int i = 0 ; lhs = readTable ( prefix + ( ++ i ) + ".rsc" ) ; char [ ] chars = readTable ( prefix + ( ++ i ) + ".rsc" ) ; check_table = new short [ chars . length ] ; for ( int c = chars . length ; c -- > 0 ; ) { check_table [ c ] = ( short ) ( chars [ c ] - 32768 ) ; } asb = readTable ( prefix + ( ++ i ) + ".rsc" ) ; asr = readTable ( prefix + ( ++ i ) + ".rsc" ) ; nasb = readTable ( prefix + ( ++ i ) + ".rsc" ) ; nasr = readTable ( prefix + ( ++ i ) + ".rsc" ) ; terminal_index = readTable ( prefix + ( ++ i ) + ".rsc" ) ; non_terminal_index = readTable ( prefix + ( ++ i ) + ".rsc" ) ; term_action = readTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_prefix = readTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_suffix = readTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_lhs = readTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_state_set = readTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_rhs = readTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_state = readTable ( prefix + ( ++ i ) + ".rsc" ) ; in_symb = readTable ( prefix + ( ++ i ) + ".rsc" ) ; rhs = readByteTable ( prefix + ( ++ i ) + ".rsc" ) ; term_check = readByteTable ( prefix + ( ++ i ) + ".rsc" ) ; scope_la = readByteTable ( prefix + ( ++ i ) + ".rsc" ) ; name = readNameTable ( prefix + ( ++ i ) + ".rsc" ) ; rules_compliance = readLongTable ( prefix + ( ++ i ) + ".rsc" ) ; readableName = readReadableNameTable ( READABLE_NAMES_FILE + ".props" ) ; reverse_index = computeReverseTable ( terminal_index , non_terminal_index , name ) ; recovery_templates_index = readTable ( prefix + ( ++ i ) + ".rsc" ) ; recovery_templates = readTable ( prefix + ( ++ i ) + ".rsc" ) ; statements_recovery_filter = readTable ( prefix + ( ++ i ) + ".rsc" ) ; base_action = lhs ; } public static int nasi ( int state ) { return nasb [ original_state ( state ) ] ; } public static int ntAction ( int state , int sym ) { return base_action [ state + sym ] ; } protected static int original_state ( int state ) { return - base_check ( state ) ; } protected static byte [ ] readByteTable ( String filename ) throws java . io . IOException { InputStream stream = Parser . class . getResourceAsStream ( filename ) ; if ( stream == null ) { throw new java . io . IOException ( Messages . bind ( Messages . parser_missingFile , filename ) ) ; } byte [ ] bytes = null ; try { stream = new BufferedInputStream ( stream ) ; bytes = Util . getInputStreamAsByteArray ( stream , - 1 ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } return bytes ; } protected static long [ ] readLongTable ( String filename ) throws java . io . IOException { InputStream stream = Parser . class . getResourceAsStream ( filename ) ; if ( stream == null ) { throw new java . io . IOException ( Messages . bind ( Messages . parser_missingFile , filename ) ) ; } byte [ ] bytes = null ; try { stream = new BufferedInputStream ( stream ) ; bytes = Util . getInputStreamAsByteArray ( stream , - 1 ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } int length = bytes . length ; if ( length % 8 != 0 ) throw new java . io . IOException ( Messages . bind ( Messages . parser_corruptedFile , filename ) ) ; long [ ] longs = new long [ length / 8 ] ; int i = 0 ; int longIndex = 0 ; while ( true ) { longs [ longIndex ++ ] = ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 56 ) + ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 48 ) + ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 40 ) + ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 32 ) + ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 24 ) + ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 16 ) + ( ( ( long ) ( bytes [ i ++ ] & 0xFF ) ) << 8 ) + ( bytes [ i ++ ] & 0xFF ) ; if ( i == length ) break ; } return longs ; } protected static String [ ] readNameTable ( String filename ) throws java . io . IOException { char [ ] contents = readTable ( filename ) ; char [ ] [ ] nameAsChar = CharOperation . splitOn ( '\n' , contents ) ; String [ ] result = new String [ nameAsChar . length + 1 ] ; result [ 0 ] = null ; for ( int i = 0 ; i < nameAsChar . length ; i ++ ) { result [ i + 1 ] = new String ( nameAsChar [ i ] ) ; } return result ; } protected static String [ ] readReadableNameTable ( String filename ) { String [ ] result = new String [ name . length ] ; InputStream is = Parser . class . getResourceAsStream ( filename ) ; Properties props = new Properties ( ) ; try { props . load ( is ) ; } catch ( IOException e ) { result = name ; return result ; } for ( int i = 0 ; i < NT_OFFSET + 1 ; i ++ ) { result [ i ] = name [ i ] ; } for ( int i = NT_OFFSET ; i < name . length ; i ++ ) { String n = props . getProperty ( name [ i ] ) ; if ( n != null && n . length ( ) > 0 ) { result [ i ] = n ; } else { result [ i ] = name [ i ] ; } } return result ; } protected static char [ ] readTable ( String filename ) throws java . io . IOException { InputStream stream = Parser . class . getResourceAsStream ( filename ) ; if ( stream == null ) { throw new java . io . IOException ( Messages . bind ( Messages . parser_missingFile , filename ) ) ; } byte [ ] bytes = null ; try { stream = new BufferedInputStream ( stream ) ; bytes = Util . getInputStreamAsByteArray ( stream , - 1 ) ; } finally { try { stream . close ( ) ; } catch ( IOException e ) { } } int length = bytes . length ; if ( ( length & 1 ) != 0 ) throw new java . io . IOException ( Messages . bind ( Messages . parser_corruptedFile , filename ) ) ; char [ ] chars = new char [ length / 2 ] ; int i = 0 ; int charIndex = 0 ; while ( true ) { chars [ charIndex ++ ] = ( char ) ( ( ( bytes [ i ++ ] & 0xFF ) << 8 ) + ( bytes [ i ++ ] & 0xFF ) ) ; if ( i == length ) break ; } return chars ; } public static int tAction ( int state , int sym ) { return term_action [ term_check [ base_action [ state ] + sym ] == sym ? base_action [ state ] + sym : base_action [ state ] ] ; } protected int astLengthPtr ; protected int [ ] astLengthStack ; protected int astPtr ; protected ASTNode [ ] astStack = new ASTNode [ AstStackIncrement ] ; public CompilationUnitDeclaration compilationUnit ; protected RecoveredElement currentElement ; public int currentToken ; protected boolean diet = false ; protected int dietInt = 0 ; protected int endPosition ; protected int endStatementPosition ; protected int expressionLengthPtr ; protected int [ ] expressionLengthStack ; protected int expressionPtr ; protected Expression [ ] expressionStack = new Expression [ ExpressionStackIncrement ] ; public int firstToken ; protected int genericsIdentifiersLengthPtr ; protected int [ ] genericsIdentifiersLengthStack = new int [ GenericsStackIncrement ] ; protected int genericsLengthPtr ; protected int [ ] genericsLengthStack = new int [ GenericsStackIncrement ] ; protected int genericsPtr ; protected ASTNode [ ] genericsStack = new ASTNode [ GenericsStackIncrement ] ; protected boolean hasError ; protected boolean hasReportedError ; protected int identifierLengthPtr ; protected int [ ] identifierLengthStack ; protected long [ ] identifierPositionStack ; protected int identifierPtr ; protected char [ ] [ ] identifierStack ; protected boolean ignoreNextOpeningBrace ; protected int intPtr ; protected int [ ] intStack ; public int lastAct ; protected int lastCheckPoint ; protected int lastErrorEndPosition ; protected int lastErrorEndPositionBeforeRecovery = - 1 ; protected int lastIgnoredToken , nextIgnoredToken ; protected int listLength ; protected int listTypeParameterLength ; protected int lParenPos , rParenPos ; protected int modifiers ; protected int modifiersSourceStart ; protected int [ ] nestedMethod ; protected int nestedType , dimensions ; ASTNode [ ] noAstNodes = new ASTNode [ AstStackIncrement ] ; Expression [ ] noExpressions = new Expression [ ExpressionStackIncrement ] ; protected boolean optimizeStringLiterals = true ; protected CompilerOptions options ; protected ProblemReporter problemReporter ; protected int rBraceStart , rBraceEnd , rBraceSuccessorStart ; protected int realBlockPtr ; protected int [ ] realBlockStack ; protected int recoveredStaticInitializerStart ; public ReferenceContext referenceContext ; public boolean reportOnlyOneSyntaxError = false ; public boolean reportSyntaxErrorIsRequired = true ; protected boolean restartRecovery ; protected boolean annotationRecoveryActivated = true ; protected int lastPosistion ; public boolean methodRecoveryActivated = false ; protected boolean statementRecoveryActivated = false ; protected TypeDeclaration [ ] recoveredTypes ; protected int recoveredTypePtr ; protected int nextTypeStart ; protected TypeDeclaration pendingRecoveredType ; public RecoveryScanner recoveryScanner ; public Scanner scanner ; protected int [ ] stack = new int [ StackIncrement ] ; protected int stateStackTop ; protected int synchronizedBlockSourceStart ; protected int [ ] variablesCounter ; protected boolean checkExternalizeStrings ; protected boolean recordStringLiterals ; public Javadoc javadoc ; public JavadocParser javadocParser ; protected int lastJavadocEnd ; public org . eclipse . jdt . internal . compiler . ReadManager readManager ; private boolean shouldDeferRecovery = false ; public Parser ( ProblemReporter problemReporter , boolean optimizeStringLiterals ) { this . problemReporter = problemReporter ; this . options = problemReporter . options ; this . optimizeStringLiterals = optimizeStringLiterals ; initializeScanner ( ) ; this . astLengthStack = new int [ 50 ] ; this . expressionLengthStack = new int [ 30 ] ; this . intStack = new int [ 50 ] ; this . identifierStack = new char [ 30 ] [ ] ; this . identifierLengthStack = new int [ 30 ] ; this . nestedMethod = new int [ 30 ] ; this . realBlockStack = new int [ 30 ] ; this . identifierPositionStack = new long [ 30 ] ; this . variablesCounter = new int [ 30 ] ; this . javadocParser = createJavadocParser ( ) ; } protected void annotationRecoveryCheckPoint ( int start , int end ) { if ( this . lastCheckPoint < end ) { this . lastCheckPoint = end + 1 ; } } public void arrayInitializer ( int length ) { ArrayInitializer ai = new ArrayInitializer ( ) ; if ( length != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , ai . expressions = new Expression [ length ] , 0 , length ) ; } pushOnExpressionStack ( ai ) ; ai . sourceEnd = this . endStatementPosition ; ai . sourceStart = this . intStack [ this . intPtr -- ] ; } protected void blockReal ( ) { this . realBlockStack [ this . realBlockPtr ] ++ ; } public RecoveredElement buildInitialRecoveryState ( ) { this . lastCheckPoint = 0 ; this . lastErrorEndPositionBeforeRecovery = this . scanner . currentPosition ; RecoveredElement element = null ; if ( this . referenceContext instanceof CompilationUnitDeclaration ) { element = new RecoveredUnit ( this . compilationUnit , 0 , this ) ; this . compilationUnit . currentPackage = null ; this . compilationUnit . imports = null ; this . compilationUnit . types = null ; this . currentToken = 0 ; this . listLength = 0 ; this . listTypeParameterLength = 0 ; this . endPosition = 0 ; this . endStatementPosition = 0 ; return element ; } else { if ( this . referenceContext instanceof AbstractMethodDeclaration ) { element = new RecoveredMethod ( ( AbstractMethodDeclaration ) this . referenceContext , null , 0 , this ) ; this . lastCheckPoint = ( ( AbstractMethodDeclaration ) this . referenceContext ) . bodyStart ; if ( this . statementRecoveryActivated ) { element = element . add ( new Block ( 0 ) , 0 ) ; } } else { if ( this . referenceContext instanceof TypeDeclaration ) { TypeDeclaration type = ( TypeDeclaration ) this . referenceContext ; FieldDeclaration [ ] fieldDeclarations = type . fields ; int length = fieldDeclarations == null ? 0 : fieldDeclarations . length ; for ( int i = 0 ; i < length ; i ++ ) { FieldDeclaration field = fieldDeclarations [ i ] ; if ( field != null && field . getKind ( ) == AbstractVariableDeclaration . INITIALIZER && ( ( Initializer ) field ) . block != null && field . declarationSourceStart <= this . scanner . initialPosition && this . scanner . initialPosition <= field . declarationSourceEnd && this . scanner . eofPosition <= field . declarationSourceEnd + 1 ) { element = new RecoveredInitializer ( field , null , 1 , this ) ; this . lastCheckPoint = field . declarationSourceStart ; break ; } } } } } if ( element == null ) return element ; for ( int i = 0 ; i <= this . astPtr ; i ++ ) { ASTNode node = this . astStack [ i ] ; if ( node instanceof AbstractMethodDeclaration ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) node ; if ( method . declarationSourceEnd == 0 ) { element = element . add ( method , 0 ) ; this . lastCheckPoint = method . bodyStart ; } else { element = element . add ( method , 0 ) ; this . lastCheckPoint = method . declarationSourceEnd + 1 ; } continue ; } if ( node instanceof Initializer ) { Initializer initializer = ( Initializer ) node ; if ( initializer . block == null ) continue ; if ( initializer . declarationSourceEnd == 0 ) { element = element . add ( initializer , 1 ) ; this . lastCheckPoint = initializer . sourceStart ; } else { element = element . add ( initializer , 0 ) ; this . lastCheckPoint = initializer . declarationSourceEnd + 1 ; } continue ; } if ( node instanceof FieldDeclaration ) { FieldDeclaration field = ( FieldDeclaration ) node ; if ( field . declarationSourceEnd == 0 ) { element = element . add ( field , 0 ) ; if ( field . initialization == null ) { this . lastCheckPoint = field . sourceEnd + 1 ; } else { this . lastCheckPoint = field . initialization . sourceEnd + 1 ; } } else { element = element . add ( field , 0 ) ; this . lastCheckPoint = field . declarationSourceEnd + 1 ; } continue ; } if ( node instanceof TypeDeclaration ) { TypeDeclaration type = ( TypeDeclaration ) node ; if ( ( type . modifiers & ClassFileConstants . AccEnum ) != 0 ) { continue ; } if ( type . declarationSourceEnd == 0 ) { element = element . add ( type , 0 ) ; this . lastCheckPoint = type . bodyStart ; } else { element = element . add ( type , 0 ) ; this . lastCheckPoint = type . declarationSourceEnd + 1 ; } continue ; } if ( node instanceof ImportReference ) { ImportReference importRef = ( ImportReference ) node ; element = element . add ( importRef , 0 ) ; this . lastCheckPoint = importRef . declarationSourceEnd + 1 ; } if ( this . statementRecoveryActivated ) { if ( node instanceof Block ) { Block block = ( Block ) node ; element = element . add ( block , 0 ) ; this . lastCheckPoint = block . sourceEnd + 1 ; } else if ( node instanceof LocalDeclaration ) { LocalDeclaration statement = ( LocalDeclaration ) node ; element = element . add ( statement , 0 ) ; this . lastCheckPoint = statement . sourceEnd + 1 ; } else if ( node instanceof Expression ) { if ( node instanceof Assignment || node instanceof PrefixExpression || node instanceof PostfixExpression || node instanceof MessageSend || node instanceof AllocationExpression ) { Expression statement = ( Expression ) node ; element = element . add ( statement , 0 ) ; if ( statement . statementEnd != - 1 ) { this . lastCheckPoint = statement . statementEnd + 1 ; } else { this . lastCheckPoint = statement . sourceEnd + 1 ; } } } else if ( node instanceof Statement ) { Statement statement = ( Statement ) node ; element = element . add ( statement , 0 ) ; this . lastCheckPoint = statement . sourceEnd + 1 ; } } } if ( this . statementRecoveryActivated ) { if ( this . pendingRecoveredType != null && this . scanner . startPosition - 1 <= this . pendingRecoveredType . declarationSourceEnd ) { element = element . add ( this . pendingRecoveredType , 0 ) ; this . lastCheckPoint = this . pendingRecoveredType . declarationSourceEnd + 1 ; this . pendingRecoveredType = null ; } } return element ; } protected void checkAndSetModifiers ( int flag ) { if ( ( this . modifiers & flag ) != 0 ) { this . modifiers |= ExtraCompilerModifiers . AccAlternateModifierProblem ; } this . modifiers |= flag ; if ( this . modifiersSourceStart < 0 ) this . modifiersSourceStart = this . scanner . startPosition ; if ( this . currentElement != null && this . annotationRecoveryActivated ) { this . currentElement . addModifier ( flag , this . modifiersSourceStart ) ; } } public void checkComment ( ) { if ( ! ( this . diet && this . dietInt == 0 ) && this . scanner . commentPtr >= 0 ) { flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } int lastComment = this . scanner . commentPtr ; if ( this . modifiersSourceStart >= 0 ) { while ( lastComment >= 0 ) { int commentSourceStart = this . scanner . commentStarts [ lastComment ] ; if ( commentSourceStart < 0 ) commentSourceStart = - commentSourceStart ; if ( commentSourceStart <= this . modifiersSourceStart ) break ; lastComment -- ; } } if ( lastComment >= 0 ) { this . modifiersSourceStart = this . scanner . commentStarts [ 0 ] ; if ( this . modifiersSourceStart < 0 ) this . modifiersSourceStart = - this . modifiersSourceStart ; while ( lastComment >= 0 && this . scanner . commentStops [ lastComment ] < 0 ) lastComment -- ; if ( lastComment >= 0 && this . javadocParser != null ) { int commentEnd = this . scanner . commentStops [ lastComment ] - 1 ; if ( this . javadocParser . shouldReportProblems ) { this . javadocParser . reportProblems = this . currentElement == null || commentEnd > this . lastJavadocEnd ; } else { this . javadocParser . reportProblems = false ; } if ( this . javadocParser . checkDeprecation ( lastComment ) ) { checkAndSetModifiers ( ClassFileConstants . AccDeprecated ) ; } this . javadoc = this . javadocParser . docComment ; if ( this . currentElement == null ) this . lastJavadocEnd = commentEnd ; } } } protected void checkNonNLSAfterBodyEnd ( int declarationEnd ) { if ( this . scanner . currentPosition - 1 <= declarationEnd ) { this . scanner . eofPosition = declarationEnd < Integer . MAX_VALUE ? declarationEnd + 1 : declarationEnd ; try { while ( this . scanner . getNextToken ( ) != TokenNameEOF ) { } } catch ( InvalidInputException e ) { } } } protected void classInstanceCreation ( boolean isQualified ) { AllocationExpression alloc ; int length ; if ( ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == 1 ) && ( this . astStack [ this . astPtr ] == null ) ) { this . astPtr -- ; if ( isQualified ) { alloc = new QualifiedAllocationExpression ( ) ; } else { alloc = new AllocationExpression ( ) ; } alloc . sourceEnd = this . endPosition ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , alloc . arguments = new Expression [ length ] , 0 , length ) ; } alloc . type = getTypeReference ( 0 ) ; checkForDiamond ( alloc . type ) ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; } else { dispatchDeclarationInto ( length ) ; TypeDeclaration anonymousTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; anonymousTypeDeclaration . declarationSourceEnd = this . endStatementPosition ; anonymousTypeDeclaration . bodyEnd = this . endStatementPosition ; if ( anonymousTypeDeclaration . allocation != null ) { anonymousTypeDeclaration . allocation . sourceEnd = this . endStatementPosition ; checkForDiamond ( anonymousTypeDeclaration . allocation . type ) ; } if ( length == 0 && ! containsComment ( anonymousTypeDeclaration . bodyStart , anonymousTypeDeclaration . bodyEnd ) ) { anonymousTypeDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } this . astPtr -- ; this . astLengthPtr -- ; } } protected void checkForDiamond ( TypeReference allocType ) { if ( allocType instanceof ParameterizedSingleTypeReference ) { ParameterizedSingleTypeReference type = ( ParameterizedSingleTypeReference ) allocType ; if ( type . typeArguments == TypeReference . NO_TYPE_ARGUMENTS ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . diamondNotBelow17 ( allocType ) ; } if ( this . options . sourceLevel > ClassFileConstants . JDK1_4 ) { type . bits |= ASTNode . IsDiamond ; } } } else if ( allocType instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference type = ( ParameterizedQualifiedTypeReference ) allocType ; if ( type . typeArguments [ type . typeArguments . length - 1 ] == TypeReference . NO_TYPE_ARGUMENTS ) { if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . diamondNotBelow17 ( allocType , type . typeArguments . length - 1 ) ; } if ( this . options . sourceLevel > ClassFileConstants . JDK1_4 ) { type . bits |= ASTNode . IsDiamond ; } } } } protected ParameterizedQualifiedTypeReference computeQualifiedGenericsFromRightSide ( TypeReference rightSide , int dim ) { int nameSize = this . identifierLengthStack [ this . identifierLengthPtr ] ; int tokensSize = nameSize ; if ( rightSide instanceof ParameterizedSingleTypeReference ) { tokensSize ++ ; } else if ( rightSide instanceof SingleTypeReference ) { tokensSize ++ ; } else if ( rightSide instanceof ParameterizedQualifiedTypeReference ) { tokensSize += ( ( QualifiedTypeReference ) rightSide ) . tokens . length ; } else if ( rightSide instanceof QualifiedTypeReference ) { tokensSize += ( ( QualifiedTypeReference ) rightSide ) . tokens . length ; } TypeReference [ ] [ ] typeArguments = new TypeReference [ tokensSize ] [ ] ; char [ ] [ ] tokens = new char [ tokensSize ] [ ] ; long [ ] positions = new long [ tokensSize ] ; if ( rightSide instanceof ParameterizedSingleTypeReference ) { ParameterizedSingleTypeReference singleParameterizedTypeReference = ( ParameterizedSingleTypeReference ) rightSide ; tokens [ nameSize ] = singleParameterizedTypeReference . token ; positions [ nameSize ] = ( ( ( long ) singleParameterizedTypeReference . sourceStart ) << 32 ) + singleParameterizedTypeReference . sourceEnd ; typeArguments [ nameSize ] = singleParameterizedTypeReference . typeArguments ; } else if ( rightSide instanceof SingleTypeReference ) { SingleTypeReference singleTypeReference = ( SingleTypeReference ) rightSide ; tokens [ nameSize ] = singleTypeReference . token ; positions [ nameSize ] = ( ( ( long ) singleTypeReference . sourceStart ) << 32 ) + singleTypeReference . sourceEnd ; } else if ( rightSide instanceof ParameterizedQualifiedTypeReference ) { ParameterizedQualifiedTypeReference parameterizedTypeReference = ( ParameterizedQualifiedTypeReference ) rightSide ; TypeReference [ ] [ ] rightSideTypeArguments = parameterizedTypeReference . typeArguments ; System . arraycopy ( rightSideTypeArguments , 0 , typeArguments , nameSize , rightSideTypeArguments . length ) ; char [ ] [ ] rightSideTokens = parameterizedTypeReference . tokens ; System . arraycopy ( rightSideTokens , 0 , tokens , nameSize , rightSideTokens . length ) ; long [ ] rightSidePositions = parameterizedTypeReference . sourcePositions ; System . arraycopy ( rightSidePositions , 0 , positions , nameSize , rightSidePositions . length ) ; } else if ( rightSide instanceof QualifiedTypeReference ) { QualifiedTypeReference qualifiedTypeReference = ( QualifiedTypeReference ) rightSide ; char [ ] [ ] rightSideTokens = qualifiedTypeReference . tokens ; System . arraycopy ( rightSideTokens , 0 , tokens , nameSize , rightSideTokens . length ) ; long [ ] rightSidePositions = qualifiedTypeReference . sourcePositions ; System . arraycopy ( rightSidePositions , 0 , positions , nameSize , rightSidePositions . length ) ; } int currentTypeArgumentsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] currentTypeArguments = new TypeReference [ currentTypeArgumentsLength ] ; this . genericsPtr -= currentTypeArgumentsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , currentTypeArguments , 0 , currentTypeArgumentsLength ) ; if ( nameSize == 1 ) { tokens [ 0 ] = this . identifierStack [ this . identifierPtr ] ; positions [ 0 ] = this . identifierPositionStack [ this . identifierPtr -- ] ; typeArguments [ 0 ] = currentTypeArguments ; } else { this . identifierPtr -= nameSize ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , nameSize ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , nameSize ) ; typeArguments [ nameSize - 1 ] = currentTypeArguments ; } this . identifierLengthPtr -- ; return new ParameterizedQualifiedTypeReference ( tokens , typeArguments , dim , positions ) ; } protected void concatExpressionLists ( ) { this . expressionLengthStack [ -- this . expressionLengthPtr ] ++ ; } protected void concatGenericsLists ( ) { this . genericsLengthStack [ this . genericsLengthPtr - 1 ] += this . genericsLengthStack [ this . genericsLengthPtr -- ] ; } protected void concatNodeLists ( ) { this . astLengthStack [ this . astLengthPtr - 1 ] += this . astLengthStack [ this . astLengthPtr -- ] ; } protected void consumeAdditionalBound ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeAdditionalBound1 ( ) { } protected void consumeAdditionalBoundList ( ) { concatGenericsLists ( ) ; } protected void consumeAdditionalBoundList1 ( ) { concatGenericsLists ( ) ; } protected void consumeAllocationHeader ( ) { if ( this . currentElement == null ) { return ; } if ( this . currentToken == TokenNameLBRACE ) { TypeDeclaration anonymousType = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; anonymousType . name = CharOperation . NO_CHAR ; anonymousType . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; anonymousType . sourceStart = this . intStack [ this . intPtr -- ] ; anonymousType . declarationSourceStart = anonymousType . sourceStart ; anonymousType . sourceEnd = this . rParenPos ; QualifiedAllocationExpression alloc = new QualifiedAllocationExpression ( anonymousType ) ; alloc . type = getTypeReference ( 0 ) ; alloc . sourceStart = anonymousType . sourceStart ; alloc . sourceEnd = anonymousType . sourceEnd ; this . lastCheckPoint = anonymousType . bodyStart = this . scanner . currentPosition ; this . currentElement = this . currentElement . add ( anonymousType , 0 ) ; this . lastIgnoredToken = - 1 ; this . currentToken = 0 ; return ; } this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; } protected void consumeAnnotationAsModifier ( ) { Expression expression = this . expressionStack [ this . expressionPtr ] ; int sourceStart = expression . sourceStart ; if ( this . modifiersSourceStart < 0 ) { this . modifiersSourceStart = sourceStart ; } } protected void consumeAnnotationName ( ) { if ( this . currentElement != null ) { int start = this . intStack [ this . intPtr ] ; int end = ( int ) ( this . identifierPositionStack [ this . identifierPtr ] & 0x00000000FFFFFFFFL ) ; annotationRecoveryCheckPoint ( start , end ) ; if ( this . annotationRecoveryActivated ) { this . currentElement = this . currentElement . addAnnotationName ( this . identifierPtr , this . identifierLengthPtr , start , 0 ) ; } } this . recordStringLiterals = false ; } protected void consumeAnnotationTypeDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { dispatchDeclarationInto ( length ) ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; typeDecl . checkConstructors ( this ) ; if ( this . scanner . containsAssertKeyword ) { typeDecl . bits |= ASTNode . ContainsAssertion ; } typeDecl . addClinit ( ) ; typeDecl . bodyEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( typeDecl . bodyStart , typeDecl . bodyEnd ) ) { typeDecl . bits |= ASTNode . UndocumentedEmptyBlock ; } typeDecl . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeAnnotationTypeDeclarationHeader ( ) { TypeDeclaration annotationTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { annotationTypeDeclaration . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - 1 ; } protected void consumeAnnotationTypeDeclarationHeaderName ( ) { TypeDeclaration annotationTypeDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == 0 ) { if ( this . nestedType != 0 ) { annotationTypeDeclaration . bits |= ASTNode . IsMemberType ; } } else { annotationTypeDeclaration . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; annotationTypeDeclaration . sourceEnd = ( int ) pos ; annotationTypeDeclaration . sourceStart = ( int ) ( pos >>> 32 ) ; annotationTypeDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; this . intPtr -- ; this . intPtr -- ; annotationTypeDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccAnnotation | ClassFileConstants . AccInterface ; if ( annotationTypeDeclaration . modifiersSourceStart >= 0 ) { annotationTypeDeclaration . declarationSourceStart = annotationTypeDeclaration . modifiersSourceStart ; this . intPtr -- ; } else { int atPosition = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . declarationSourceStart = atPosition ; } if ( ( annotationTypeDeclaration . bits & ASTNode . IsMemberType ) == 0 && ( annotationTypeDeclaration . bits & ASTNode . IsLocalType ) == 0 ) { if ( this . compilationUnit != null && ! CharOperation . equals ( annotationTypeDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { annotationTypeDeclaration . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , annotationTypeDeclaration . annotations = new Annotation [ length ] , 0 , length ) ; } annotationTypeDeclaration . bodyStart = annotationTypeDeclaration . sourceEnd + 1 ; annotationTypeDeclaration . javadoc = this . javadoc ; this . javadoc = null ; pushOnAstStack ( annotationTypeDeclaration ) ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotationDeclarations ( annotationTypeDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = annotationTypeDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( annotationTypeDeclaration , 0 ) ; this . lastIgnoredToken = - 1 ; } } protected void consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) { TypeDeclaration annotationTypeDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , annotationTypeDeclaration . typeParameters = new TypeParameter [ length ] , 0 , length ) ; problemReporter ( ) . invalidUsageOfTypeParametersForAnnotationDeclaration ( annotationTypeDeclaration ) ; annotationTypeDeclaration . bodyStart = annotationTypeDeclaration . typeParameters [ length - 1 ] . declarationSourceEnd + 1 ; this . listTypeParameterLength = 0 ; if ( this . nestedMethod [ this . nestedType ] == 0 ) { if ( this . nestedType != 0 ) { annotationTypeDeclaration . bits |= ASTNode . IsMemberType ; } } else { annotationTypeDeclaration . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; annotationTypeDeclaration . sourceEnd = ( int ) pos ; annotationTypeDeclaration . sourceStart = ( int ) ( pos >>> 32 ) ; annotationTypeDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; this . intPtr -- ; this . intPtr -- ; annotationTypeDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccAnnotation | ClassFileConstants . AccInterface ; if ( annotationTypeDeclaration . modifiersSourceStart >= 0 ) { annotationTypeDeclaration . declarationSourceStart = annotationTypeDeclaration . modifiersSourceStart ; this . intPtr -- ; } else { int atPosition = this . intStack [ this . intPtr -- ] ; annotationTypeDeclaration . declarationSourceStart = atPosition ; } if ( ( annotationTypeDeclaration . bits & ASTNode . IsMemberType ) == 0 && ( annotationTypeDeclaration . bits & ASTNode . IsLocalType ) == 0 ) { if ( this . compilationUnit != null && ! CharOperation . equals ( annotationTypeDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { annotationTypeDeclaration . bits |= ASTNode . IsSecondaryType ; } } if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , annotationTypeDeclaration . annotations = new Annotation [ length ] , 0 , length ) ; } annotationTypeDeclaration . javadoc = this . javadoc ; this . javadoc = null ; pushOnAstStack ( annotationTypeDeclaration ) ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotationDeclarations ( annotationTypeDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = annotationTypeDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( annotationTypeDeclaration , 0 ) ; this . lastIgnoredToken = - 1 ; } } protected void consumeAnnotationTypeMemberDeclaration ( ) { AnnotationMethodDeclaration annotationTypeMemberDeclaration = ( AnnotationMethodDeclaration ) this . astStack [ this . astPtr ] ; annotationTypeMemberDeclaration . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; int declarationEndPosition = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; annotationTypeMemberDeclaration . bodyStart = this . endStatementPosition ; annotationTypeMemberDeclaration . bodyEnd = declarationEndPosition ; annotationTypeMemberDeclaration . declarationSourceEnd = declarationEndPosition ; } protected void consumeAnnotationTypeMemberDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeAnnotationTypeMemberDeclarationsopt ( ) { this . nestedType -- ; } protected void consumeArgumentList ( ) { concatExpressionLists ( ) ; } protected void consumeArguments ( ) { pushOnIntStack ( this . rParenPos ) ; } protected void consumeArrayAccess ( boolean unspecifiedReference ) { Expression exp ; if ( unspecifiedReference ) { exp = this . expressionStack [ this . expressionPtr ] = new ArrayReference ( getUnspecifiedReferenceOptimized ( ) , this . expressionStack [ this . expressionPtr ] ) ; } else { this . expressionPtr -- ; this . expressionLengthPtr -- ; exp = this . expressionStack [ this . expressionPtr ] = new ArrayReference ( this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + 1 ] ) ; } exp . sourceEnd = this . endStatementPosition ; } protected void consumeArrayCreationExpressionWithInitializer ( ) { int length ; ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression ( ) ; this . expressionLengthPtr -- ; arrayAllocation . initializer = ( ArrayInitializer ) this . expressionStack [ this . expressionPtr -- ] ; arrayAllocation . type = getTypeReference ( 0 ) ; arrayAllocation . type . bits |= ASTNode . IgnoreRawTypeCheck ; length = ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , arrayAllocation . dimensions = new Expression [ length ] , 0 , length ) ; arrayAllocation . sourceStart = this . intStack [ this . intPtr -- ] ; if ( arrayAllocation . initializer == null ) { arrayAllocation . sourceEnd = this . endStatementPosition ; } else { arrayAllocation . sourceEnd = arrayAllocation . initializer . sourceEnd ; } pushOnExpressionStack ( arrayAllocation ) ; } protected void consumeArrayCreationExpressionWithoutInitializer ( ) { int length ; ArrayAllocationExpression arrayAllocation = new ArrayAllocationExpression ( ) ; arrayAllocation . type = getTypeReference ( 0 ) ; arrayAllocation . type . bits |= ASTNode . IgnoreRawTypeCheck ; length = ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , arrayAllocation . dimensions = new Expression [ length ] , 0 , length ) ; arrayAllocation . sourceStart = this . intStack [ this . intPtr -- ] ; if ( arrayAllocation . initializer == null ) { arrayAllocation . sourceEnd = this . endStatementPosition ; } else { arrayAllocation . sourceEnd = arrayAllocation . initializer . sourceEnd ; } pushOnExpressionStack ( arrayAllocation ) ; } protected void consumeArrayCreationHeader ( ) { } protected void consumeArrayInitializer ( ) { arrayInitializer ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; } protected void consumeArrayTypeWithTypeArgumentsName ( ) { this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr ] += this . identifierLengthStack [ this . identifierLengthPtr ] ; pushOnGenericsLengthStack ( 0 ) ; } protected void consumeAssertStatement ( ) { this . expressionLengthPtr -= 2 ; pushOnAstStack ( new AssertStatement ( this . expressionStack [ this . expressionPtr -- ] , this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeAssignment ( ) { int op = this . intStack [ this . intPtr -- ] ; this . expressionPtr -- ; this . expressionLengthPtr -- ; Expression expression = this . expressionStack [ this . expressionPtr + 1 ] ; this . expressionStack [ this . expressionPtr ] = ( op != EQUAL ) ? new CompoundAssignment ( this . expressionStack [ this . expressionPtr ] , expression , op , expression . sourceEnd ) : new Assignment ( this . expressionStack [ this . expressionPtr ] , expression , expression . sourceEnd ) ; if ( this . pendingRecoveredType != null ) { if ( this . pendingRecoveredType . allocation != null && this . scanner . startPosition - 1 <= this . pendingRecoveredType . declarationSourceEnd ) { this . expressionStack [ this . expressionPtr ] = this . pendingRecoveredType . allocation ; this . pendingRecoveredType = null ; return ; } this . pendingRecoveredType = null ; } } protected void consumeAssignmentOperator ( int pos ) { pushOnIntStack ( pos ) ; } protected void consumeBinaryExpression ( int op ) { this . expressionPtr -- ; this . expressionLengthPtr -- ; Expression expr1 = this . expressionStack [ this . expressionPtr ] ; Expression expr2 = this . expressionStack [ this . expressionPtr + 1 ] ; switch ( op ) { case OR_OR : this . expressionStack [ this . expressionPtr ] = new OR_OR_Expression ( expr1 , expr2 , op ) ; break ; case AND_AND : this . expressionStack [ this . expressionPtr ] = new AND_AND_Expression ( expr1 , expr2 , op ) ; break ; case PLUS : if ( this . optimizeStringLiterals ) { if ( expr1 instanceof StringLiteral ) { if ( ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) >> ASTNode . ParenthesizedSHIFT ) == 0 ) { if ( expr2 instanceof CharLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( CharLiteral ) expr2 ) ; } else if ( expr2 instanceof StringLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof CombinedBinaryExpression ) { CombinedBinaryExpression cursor ; if ( ( cursor = ( CombinedBinaryExpression ) expr1 ) . arity < cursor . arityMax ) { cursor . left = new BinaryExpression ( cursor ) ; cursor . arity ++ ; } else { cursor . left = new CombinedBinaryExpression ( cursor ) ; cursor . arity = 0 ; cursor . tuneArityMax ( ) ; } cursor . right = expr2 ; cursor . sourceEnd = expr2 . sourceEnd ; this . expressionStack [ this . expressionPtr ] = cursor ; } else if ( expr1 instanceof BinaryExpression && ( ( expr1 . bits & ASTNode . OperatorMASK ) >> ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) { this . expressionStack [ this . expressionPtr ] = new CombinedBinaryExpression ( expr1 , expr2 , PLUS , 1 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof StringLiteral ) { if ( expr2 instanceof StringLiteral && ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) >> ASTNode . ParenthesizedSHIFT ) == 0 ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendsWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof CombinedBinaryExpression ) { CombinedBinaryExpression cursor ; if ( ( cursor = ( CombinedBinaryExpression ) expr1 ) . arity < cursor . arityMax ) { cursor . left = new BinaryExpression ( cursor ) ; cursor . bits &= ~ ASTNode . ParenthesizedMASK ; cursor . arity ++ ; } else { cursor . left = new CombinedBinaryExpression ( cursor ) ; cursor . bits &= ~ ASTNode . ParenthesizedMASK ; cursor . arity = 0 ; cursor . tuneArityMax ( ) ; } cursor . right = expr2 ; cursor . sourceEnd = expr2 . sourceEnd ; this . expressionStack [ this . expressionPtr ] = cursor ; } else if ( expr1 instanceof BinaryExpression && ( ( expr1 . bits & ASTNode . OperatorMASK ) >> ASTNode . OperatorSHIFT ) == OperatorIds . PLUS ) { this . expressionStack [ this . expressionPtr ] = new CombinedBinaryExpression ( expr1 , expr2 , PLUS , 1 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } break ; case LESS : case MULTIPLY : this . intPtr -- ; this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; break ; default : this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } } protected void consumeBinaryExpressionWithName ( int op ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; this . expressionPtr -- ; this . expressionLengthPtr -- ; Expression expr1 = this . expressionStack [ this . expressionPtr + 1 ] ; Expression expr2 = this . expressionStack [ this . expressionPtr ] ; switch ( op ) { case OR_OR : this . expressionStack [ this . expressionPtr ] = new OR_OR_Expression ( expr1 , expr2 , op ) ; break ; case AND_AND : this . expressionStack [ this . expressionPtr ] = new AND_AND_Expression ( expr1 , expr2 , op ) ; break ; case PLUS : if ( this . optimizeStringLiterals ) { if ( expr1 instanceof StringLiteral && ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) >> ASTNode . ParenthesizedSHIFT ) == 0 ) { if ( expr2 instanceof CharLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( CharLiteral ) expr2 ) ; } else if ( expr2 instanceof StringLiteral ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , PLUS ) ; } } else if ( expr1 instanceof StringLiteral ) { if ( expr2 instanceof StringLiteral && ( ( expr1 . bits & ASTNode . ParenthesizedMASK ) >> ASTNode . ParenthesizedSHIFT ) == 0 ) { this . expressionStack [ this . expressionPtr ] = ( ( StringLiteral ) expr1 ) . extendsWith ( ( StringLiteral ) expr2 ) ; } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } } else { this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } break ; case LESS : case MULTIPLY : this . intPtr -- ; this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; break ; default : this . expressionStack [ this . expressionPtr ] = new BinaryExpression ( expr1 , expr2 , op ) ; } } protected void consumeBlock ( ) { int statementsLength = this . astLengthStack [ this . astLengthPtr -- ] ; Block block ; if ( statementsLength == 0 ) { block = new Block ( 0 ) ; block . sourceStart = this . intStack [ this . intPtr -- ] ; block . sourceEnd = this . endStatementPosition ; if ( ! containsComment ( block . sourceStart , block . sourceEnd ) ) { block . bits |= ASTNode . UndocumentedEmptyBlock ; } this . realBlockPtr -- ; } else { block = new Block ( this . realBlockStack [ this . realBlockPtr -- ] ) ; this . astPtr -= statementsLength ; System . arraycopy ( this . astStack , this . astPtr + 1 , block . statements = new Statement [ statementsLength ] , 0 , statementsLength ) ; block . sourceStart = this . intStack [ this . intPtr -- ] ; block . sourceEnd = this . endStatementPosition ; } pushOnAstStack ( block ) ; } protected void consumeBlockStatements ( ) { concatNodeLists ( ) ; } protected void consumeCaseLabel ( ) { this . expressionLengthPtr -- ; Expression expression = this . expressionStack [ this . expressionPtr -- ] ; CaseStatement caseStatement = new CaseStatement ( expression , expression . sourceEnd , this . intStack [ this . intPtr -- ] ) ; if ( hasLeadingTagComment ( FALL_THROUGH_TAG , caseStatement . sourceStart ) ) { caseStatement . bits |= ASTNode . DocumentedFallthrough ; } pushOnAstStack ( caseStatement ) ; } protected void consumeCastExpressionLL1 ( ) { Expression cast ; Expression exp ; this . expressionPtr -- ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr + 1 ] , ( TypeReference ) this . expressionStack [ this . expressionPtr ] ) ; this . expressionLengthPtr -- ; updateSourcePosition ( cast ) ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithGenericsArray ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; int dim = this . intStack [ this . intPtr -- ] ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = getTypeReference ( dim ) ) ; this . intPtr -- ; castType . sourceEnd = end - 1 ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + 1 ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithNameArray ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; pushOnGenericsLengthStack ( 0 ) ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; castType . sourceEnd = end - 1 ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + 1 ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithPrimitiveType ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; castType . sourceEnd = end - 1 ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + 1 ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCastExpressionWithQualifiedGenericsArray ( ) { Expression exp ; Expression cast ; TypeReference castType ; int end = this . intStack [ this . intPtr -- ] ; int dim = this . intStack [ this . intPtr -- ] ; TypeReference rightSide = getTypeReference ( 0 ) ; ParameterizedQualifiedTypeReference qualifiedParameterizedTypeReference = computeQualifiedGenericsFromRightSide ( rightSide , dim ) ; this . intPtr -- ; this . expressionStack [ this . expressionPtr ] = cast = new CastExpression ( exp = this . expressionStack [ this . expressionPtr ] , castType = qualifiedParameterizedTypeReference ) ; castType . sourceEnd = end - 1 ; castType . sourceStart = ( cast . sourceStart = this . intStack [ this . intPtr -- ] ) + 1 ; cast . sourceEnd = exp . sourceEnd ; } protected void consumeCatches ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeCatchFormalParameter ( ) { this . identifierLengthPtr -- ; char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePositions = this . identifierPositionStack [ this . identifierPtr -- ] ; int extendedDimensions = this . intStack [ this . intPtr -- ] ; TypeReference type = ( TypeReference ) this . astStack [ this . astPtr -- ] ; if ( extendedDimensions > 0 ) { type = type . copyDims ( type . dimensions ( ) + extendedDimensions ) ; type . sourceEnd = this . endPosition ; } this . astLengthPtr -- ; int modifierPositions = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; Argument arg = new Argument ( identifierName , namePositions , type , this . intStack [ this . intPtr + 1 ] & ~ ClassFileConstants . AccDeprecated ) ; arg . bits &= ~ ASTNode . IsArgument ; arg . declarationSourceStart = modifierPositions ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , arg . annotations = new Annotation [ length ] , 0 , length ) ; } pushOnAstStack ( arg ) ; this . listLength ++ ; } protected void consumeCatchHeader ( ) { if ( this . currentElement == null ) { return ; } if ( ! ( this . currentElement instanceof RecoveredBlock ) ) { if ( ! ( this . currentElement instanceof RecoveredMethod ) ) { return ; } RecoveredMethod rMethod = ( RecoveredMethod ) this . currentElement ; if ( ! ( rMethod . methodBody == null && rMethod . bracketBalance > 0 ) ) { return ; } } Argument arg = ( Argument ) this . astStack [ this . astPtr -- ] ; LocalDeclaration localDeclaration = new LocalDeclaration ( arg . name , arg . sourceStart , arg . sourceEnd ) ; localDeclaration . type = arg . type ; localDeclaration . declarationSourceStart = arg . declarationSourceStart ; localDeclaration . declarationSourceEnd = arg . declarationSourceEnd ; this . currentElement = this . currentElement . add ( localDeclaration , 0 ) ; this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; this . lastIgnoredToken = - 1 ; } protected void consumeCatchType ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; if ( length != 1 ) { TypeReference [ ] typeReferences ; System . arraycopy ( this . astStack , ( this . astPtr -= length ) + 1 , ( typeReferences = new TypeReference [ length ] ) , 0 , length ) ; UnionTypeReference typeReference = new UnionTypeReference ( typeReferences ) ; pushOnAstStack ( typeReference ) ; if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . multiCatchNotBelow17 ( typeReference ) ; } } else { pushOnAstLengthStack ( 1 ) ; } } protected void consumeClassBodyDeclaration ( ) { this . nestedMethod [ this . nestedType ] -- ; Block block = ( Block ) this . astStack [ this . astPtr -- ] ; this . astLengthPtr -- ; if ( this . diet ) block . bits &= ~ ASTNode . UndocumentedEmptyBlock ; Initializer initializer = ( Initializer ) this . astStack [ this . astPtr ] ; initializer . declarationSourceStart = initializer . sourceStart = block . sourceStart ; initializer . block = block ; this . intPtr -- ; initializer . bodyStart = this . intStack [ this . intPtr -- ] ; this . realBlockPtr -- ; int javadocCommentStart = this . intStack [ this . intPtr -- ] ; if ( javadocCommentStart != - 1 ) { initializer . declarationSourceStart = javadocCommentStart ; initializer . javadoc = this . javadoc ; this . javadoc = null ; } initializer . bodyEnd = this . endPosition ; initializer . sourceEnd = this . endStatementPosition ; initializer . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeClassBodyDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeClassBodyDeclarationsopt ( ) { this . nestedType -- ; } protected void consumeClassBodyopt ( ) { pushOnAstStack ( null ) ; this . endPosition = this . rParenPos ; this . shouldDeferRecovery = false ; } protected void consumeClassDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { dispatchDeclarationInto ( length ) ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; boolean hasConstructor = typeDecl . checkConstructors ( this ) ; if ( ! hasConstructor ) { switch ( TypeDeclaration . kind ( typeDecl . modifiers ) ) { case TypeDeclaration . CLASS_DECL : case TypeDeclaration . ENUM_DECL : boolean insideFieldInitializer = false ; if ( this . diet ) { for ( int i = this . nestedType ; i > 0 ; i -- ) { if ( this . variablesCounter [ i ] > 0 ) { insideFieldInitializer = true ; break ; } } } typeDecl . createDefaultConstructor ( ! this . diet || insideFieldInitializer , true ) ; } } if ( this . scanner . containsAssertKeyword ) { typeDecl . bits |= ASTNode . ContainsAssertion ; } typeDecl . addClinit ( ) ; typeDecl . bodyEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( typeDecl . bodyStart , typeDecl . bodyEnd ) ) { typeDecl . bits |= ASTNode . UndocumentedEmptyBlock ; } typeDecl . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeClassHeader ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { typeDecl . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - 1 ; } protected void consumeClassHeaderExtends ( ) { TypeReference superClass = getTypeReference ( 0 ) ; TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; typeDecl . superclass = superClass ; superClass . bits |= ASTNode . IsSuperType ; typeDecl . bodyStart = typeDecl . superclass . sourceEnd + 1 ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; } } protected void consumeClassHeaderImplements ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; System . arraycopy ( this . astStack , this . astPtr + 1 , typeDecl . superInterfaces = new TypeReference [ length ] , 0 , length ) ; for ( int i = 0 , max = typeDecl . superInterfaces . length ; i < max ; i ++ ) { typeDecl . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } typeDecl . bodyStart = typeDecl . superInterfaces [ length - 1 ] . sourceEnd + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; } } protected void consumeClassHeaderName1 ( ) { TypeDeclaration typeDecl = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == 0 ) { if ( this . nestedType != 0 ) { typeDecl . bits |= ASTNode . IsMemberType ; } } else { typeDecl . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; typeDecl . sourceEnd = ( int ) pos ; typeDecl . sourceStart = ( int ) ( pos >>> 32 ) ; typeDecl . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; typeDecl . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; typeDecl . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiers = this . intStack [ this . intPtr -- ] ; if ( typeDecl . modifiersSourceStart >= 0 ) { typeDecl . declarationSourceStart = typeDecl . modifiersSourceStart ; } if ( ( typeDecl . bits & ASTNode . IsMemberType ) == 0 && ( typeDecl . bits & ASTNode . IsLocalType ) == 0 ) { if ( this . compilationUnit != null && ! CharOperation . equals ( typeDecl . name , this . compilationUnit . getMainTypeName ( ) ) ) { typeDecl . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , typeDecl . annotations = new Annotation [ length ] , 0 , length ) ; } typeDecl . bodyStart = typeDecl . sourceEnd + 1 ; pushOnAstStack ( typeDecl ) ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; this . currentElement = this . currentElement . add ( typeDecl , 0 ) ; this . lastIgnoredToken = - 1 ; } typeDecl . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeClassInstanceCreationExpression ( ) { classInstanceCreation ( false ) ; } protected void consumeClassInstanceCreationExpressionName ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; } protected void consumeClassInstanceCreationExpressionQualified ( ) { classInstanceCreation ( true ) ; QualifiedAllocationExpression qae = ( QualifiedAllocationExpression ) this . expressionStack [ this . expressionPtr ] ; if ( qae . anonymousType == null ) { this . expressionLengthPtr -- ; this . expressionPtr -- ; qae . enclosingInstance = this . expressionStack [ this . expressionPtr ] ; this . expressionStack [ this . expressionPtr ] = qae ; } qae . sourceStart = qae . enclosingInstance . sourceStart ; } protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) { QualifiedAllocationExpression alloc ; int length ; if ( ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == 1 ) && ( this . astStack [ this . astPtr ] == null ) ) { this . astPtr -- ; alloc = new QualifiedAllocationExpression ( ) ; alloc . sourceEnd = this . endPosition ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , alloc . arguments = new Expression [ length ] , 0 , length ) ; } alloc . type = getTypeReference ( 0 ) ; checkForDiamond ( alloc . type ) ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , alloc . typeArguments = new TypeReference [ length ] , 0 , length ) ; this . intPtr -- ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; } else { dispatchDeclarationInto ( length ) ; TypeDeclaration anonymousTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; anonymousTypeDeclaration . declarationSourceEnd = this . endStatementPosition ; anonymousTypeDeclaration . bodyEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( anonymousTypeDeclaration . bodyStart , anonymousTypeDeclaration . bodyEnd ) ) { anonymousTypeDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } this . astPtr -- ; this . astLengthPtr -- ; QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration . allocation ; if ( allocationExpression != null ) { allocationExpression . sourceEnd = this . endStatementPosition ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , allocationExpression . typeArguments = new TypeReference [ length ] , 0 , length ) ; allocationExpression . sourceStart = this . intStack [ this . intPtr -- ] ; checkForDiamond ( allocationExpression . type ) ; } } QualifiedAllocationExpression qae = ( QualifiedAllocationExpression ) this . expressionStack [ this . expressionPtr ] ; if ( qae . anonymousType == null ) { this . expressionLengthPtr -- ; this . expressionPtr -- ; qae . enclosingInstance = this . expressionStack [ this . expressionPtr ] ; this . expressionStack [ this . expressionPtr ] = qae ; } qae . sourceStart = qae . enclosingInstance . sourceStart ; } protected void consumeClassInstanceCreationExpressionWithTypeArguments ( ) { AllocationExpression alloc ; int length ; if ( ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == 1 ) && ( this . astStack [ this . astPtr ] == null ) ) { this . astPtr -- ; alloc = new AllocationExpression ( ) ; alloc . sourceEnd = this . endPosition ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , alloc . arguments = new Expression [ length ] , 0 , length ) ; } alloc . type = getTypeReference ( 0 ) ; checkForDiamond ( alloc . type ) ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , alloc . typeArguments = new TypeReference [ length ] , 0 , length ) ; this . intPtr -- ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; } else { dispatchDeclarationInto ( length ) ; TypeDeclaration anonymousTypeDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; anonymousTypeDeclaration . declarationSourceEnd = this . endStatementPosition ; anonymousTypeDeclaration . bodyEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( anonymousTypeDeclaration . bodyStart , anonymousTypeDeclaration . bodyEnd ) ) { anonymousTypeDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } this . astPtr -- ; this . astLengthPtr -- ; QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration . allocation ; if ( allocationExpression != null ) { allocationExpression . sourceEnd = this . endStatementPosition ; length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , allocationExpression . typeArguments = new TypeReference [ length ] , 0 , length ) ; allocationExpression . sourceStart = this . intStack [ this . intPtr -- ] ; checkForDiamond ( allocationExpression . type ) ; } } } protected void consumeClassOrInterface ( ) { this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr ] += this . identifierLengthStack [ this . identifierLengthPtr ] ; pushOnGenericsLengthStack ( 0 ) ; } protected void consumeClassOrInterfaceName ( ) { pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( 0 ) ; } protected void consumeClassTypeElt ( ) { pushOnAstStack ( getTypeReference ( 0 ) ) ; this . listLength ++ ; } protected void consumeClassTypeList ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeCompilationUnit ( ) { } protected void consumeConditionalExpression ( int op ) { this . intPtr -= 2 ; this . expressionPtr -= 2 ; this . expressionLengthPtr -= 2 ; this . expressionStack [ this . expressionPtr ] = new ConditionalExpression ( this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + 1 ] , this . expressionStack [ this . expressionPtr + 2 ] ) ; } protected void consumeConditionalExpressionWithName ( int op ) { this . intPtr -= 2 ; pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; this . expressionPtr -= 2 ; this . expressionLengthPtr -= 2 ; this . expressionStack [ this . expressionPtr ] = new ConditionalExpression ( this . expressionStack [ this . expressionPtr + 2 ] , this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + 1 ] ) ; } protected void consumeConstructorBlockStatements ( ) { concatNodeLists ( ) ; } protected void consumeConstructorBody ( ) { this . nestedMethod [ this . nestedType ] -- ; } protected void consumeConstructorDeclaration ( ) { int length ; this . intPtr -- ; this . intPtr -- ; this . realBlockPtr -- ; ExplicitConstructorCall constructorCall = null ; Statement [ ] statements = null ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { this . astPtr -= length ; if ( ! this . options . ignoreMethodBodies ) { if ( this . astStack [ this . astPtr + 1 ] instanceof ExplicitConstructorCall ) { System . arraycopy ( this . astStack , this . astPtr + 2 , statements = new Statement [ length - 1 ] , 0 , length - 1 ) ; constructorCall = ( ExplicitConstructorCall ) this . astStack [ this . astPtr + 1 ] ; } else { System . arraycopy ( this . astStack , this . astPtr + 1 , statements = new Statement [ length ] , 0 , length ) ; constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } } else { boolean insideFieldInitializer = false ; if ( this . diet ) { for ( int i = this . nestedType ; i > 0 ; i -- ) { if ( this . variablesCounter [ i ] > 0 ) { insideFieldInitializer = true ; break ; } } } if ( ! this . diet || insideFieldInitializer ) { constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } ConstructorDeclaration cd = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; cd . constructorCall = constructorCall ; cd . statements = statements ; if ( constructorCall != null && cd . constructorCall . sourceEnd == 0 ) { cd . constructorCall . sourceEnd = cd . sourceEnd ; cd . constructorCall . sourceStart = cd . sourceStart ; } if ( ! ( this . diet && this . dietInt == 0 ) && statements == null && ( constructorCall == null || constructorCall . isImplicitSuper ( ) ) && ! containsComment ( cd . bodyStart , this . endPosition ) ) { cd . bits |= ASTNode . UndocumentedEmptyBlock ; } cd . bodyEnd = this . endPosition ; cd . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeConstructorHeader ( ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { method . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { if ( this . currentToken == TokenNameSEMICOLON ) { method . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; method . declarationSourceEnd = this . scanner . currentPosition - 1 ; method . bodyEnd = this . scanner . currentPosition - 1 ; if ( this . currentElement . parseTree ( ) == method && this . currentElement . parent != null ) { this . currentElement = this . currentElement . parent ; } } this . restartRecovery = true ; } } protected void consumeConstructorHeaderName ( ) { if ( this . currentElement != null ) { if ( this . lastIgnoredToken == TokenNamenew ) { this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; return ; } } ConstructorDeclaration cd = new ConstructorDeclaration ( this . compilationUnit . compilationResult ) ; cd . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; cd . declarationSourceStart = this . intStack [ this . intPtr -- ] ; cd . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , cd . annotations = new Annotation [ length ] , 0 , length ) ; } cd . javadoc = this . javadoc ; this . javadoc = null ; cd . sourceStart = ( int ) ( selectorSource >>> 32 ) ; pushOnAstStack ( cd ) ; cd . sourceEnd = this . lParenPos ; cd . bodyStart = this . lParenPos + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = cd . bodyStart ; if ( ( this . currentElement instanceof RecoveredType && this . lastIgnoredToken != TokenNameDOT ) || cd . modifiers != 0 ) { this . currentElement = this . currentElement . add ( cd , 0 ) ; this . lastIgnoredToken = - 1 ; } } } protected void consumeConstructorHeaderNameWithTypeParameters ( ) { if ( this . currentElement != null ) { if ( this . lastIgnoredToken == TokenNamenew ) { this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; return ; } } ConstructorDeclaration cd = new ConstructorDeclaration ( this . compilationUnit . compilationResult ) ; cd . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , cd . typeParameters = new TypeParameter [ length ] , 0 , length ) ; cd . declarationSourceStart = this . intStack [ this . intPtr -- ] ; cd . modifiers = this . intStack [ this . intPtr -- ] ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , cd . annotations = new Annotation [ length ] , 0 , length ) ; } cd . javadoc = this . javadoc ; this . javadoc = null ; cd . sourceStart = ( int ) ( selectorSource >>> 32 ) ; pushOnAstStack ( cd ) ; cd . sourceEnd = this . lParenPos ; cd . bodyStart = this . lParenPos + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = cd . bodyStart ; if ( ( this . currentElement instanceof RecoveredType && this . lastIgnoredToken != TokenNameDOT ) || cd . modifiers != 0 ) { this . currentElement = this . currentElement . add ( cd , 0 ) ; this . lastIgnoredToken = - 1 ; } } } protected void consumeCreateInitializer ( ) { pushOnAstStack ( new Initializer ( null , 0 ) ) ; } protected void consumeDefaultLabel ( ) { CaseStatement defaultStatement = new CaseStatement ( null , this . intStack [ this . intPtr -- ] , this . intStack [ this . intPtr -- ] ) ; if ( hasLeadingTagComment ( FALL_THROUGH_TAG , defaultStatement . sourceStart ) ) { defaultStatement . bits |= ASTNode . DocumentedFallthrough ; } if ( hasLeadingTagComment ( CASES_OMITTED_TAG , defaultStatement . sourceStart ) ) { defaultStatement . bits |= ASTNode . DocumentedCasesOmitted ; } pushOnAstStack ( defaultStatement ) ; } protected void consumeDefaultModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart >= 0 ? this . modifiersSourceStart : this . scanner . startPosition ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumeDiet ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; jumpOverMethodBody ( ) ; } protected void consumeDims ( ) { pushOnIntStack ( this . dimensions ) ; this . dimensions = 0 ; } protected void consumeDimWithOrWithOutExpr ( ) { pushOnExpressionStack ( null ) ; if ( this . currentElement != null && this . currentToken == TokenNameLBRACE ) { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } } protected void consumeDimWithOrWithOutExprs ( ) { concatExpressionLists ( ) ; } protected void consumeUnionType ( ) { pushOnAstStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; optimizedConcatNodeLists ( ) ; } protected void consumeUnionTypeAsClassType ( ) { pushOnAstStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeEmptyAnnotationTypeMemberDeclarationsopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyArgumentListopt ( ) { pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumeEmptyArguments ( ) { final FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; pushOnIntStack ( fieldDeclaration . sourceEnd ) ; pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumeEmptyArrayInitializer ( ) { arrayInitializer ( 0 ) ; } protected void consumeEmptyArrayInitializeropt ( ) { pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumeEmptyBlockStatementsopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyCatchesopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyClassBodyDeclarationsopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyDimsopt ( ) { pushOnIntStack ( 0 ) ; } protected void consumeEmptyEnumDeclarations ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyExpression ( ) { pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumeEmptyForInitopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyForUpdateopt ( ) { pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumeEmptyInterfaceMemberDeclarationsopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyInternalCompilationUnit ( ) { if ( this . compilationUnit . isPackageInfo ( ) ) { this . compilationUnit . types = new TypeDeclaration [ 1 ] ; this . compilationUnit . createPackageInfoType ( ) ; } } protected void consumeEmptyMemberValueArrayInitializer ( ) { arrayInitializer ( 0 ) ; } protected void consumeEmptyMemberValuePairsopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyMethodHeaderDefaultValue ( ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; if ( method . isAnnotationMethod ( ) ) { pushOnExpressionStackLengthStack ( 0 ) ; } this . recordStringLiterals = true ; } protected void consumeEmptyStatement ( ) { char [ ] source = this . scanner . source ; if ( source [ this . endStatementPosition ] == ';' ) { pushOnAstStack ( new EmptyStatement ( this . endStatementPosition , this . endStatementPosition ) ) ; } else { if ( source . length > 5 ) { int c1 = 0 , c2 = 0 , c3 = 0 , c4 = 0 ; int pos = this . endStatementPosition - 4 ; while ( source [ pos ] == 'u' ) { pos -- ; } if ( source [ pos ] == '\\' && ! ( ( c1 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition - 3 ] ) ) > 15 || c1 < 0 || ( c2 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition - 2 ] ) ) > 15 || c2 < 0 || ( c3 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition - 1 ] ) ) > 15 || c3 < 0 || ( c4 = ScannerHelper . getHexadecimalValue ( source [ this . endStatementPosition ] ) ) > 15 || c4 < 0 ) && ( ( char ) ( ( ( c1 * 16 + c2 ) * 16 + c3 ) * 16 + c4 ) ) == ';' ) { pushOnAstStack ( new EmptyStatement ( pos , this . endStatementPosition ) ) ; return ; } } pushOnAstStack ( new EmptyStatement ( this . endPosition + 1 , this . endStatementPosition ) ) ; } } protected void consumeEmptySwitchBlock ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeEmptyTypeDeclaration ( ) { pushOnAstLengthStack ( 0 ) ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . superfluousSemicolon ( this . endPosition + 1 , this . endStatementPosition ) ; flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeEnhancedForStatement ( ) { this . astLengthPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr -- ] ; ForeachStatement foreachStatement = ( ForeachStatement ) this . astStack [ this . astPtr ] ; foreachStatement . action = statement ; if ( statement instanceof EmptyStatement ) statement . bits |= ASTNode . IsUsefulEmptyStatement ; foreachStatement . sourceEnd = this . endStatementPosition ; } protected void consumeEnhancedForStatementHeader ( ) { final ForeachStatement statement = ( ForeachStatement ) this . astStack [ this . astPtr ] ; this . expressionLengthPtr -- ; final Expression collection = this . expressionStack [ this . expressionPtr -- ] ; statement . collection = collection ; statement . sourceEnd = this . rParenPos ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfForeachStatements ( statement . elementVariable , collection ) ; } } protected void consumeEnhancedForStatementHeaderInit ( boolean hasModifiers ) { TypeReference type ; char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePosition = this . identifierPositionStack [ this . identifierPtr ] ; LocalDeclaration localDeclaration = createLocalDeclaration ( identifierName , ( int ) ( namePosition >>> 32 ) , ( int ) namePosition ) ; localDeclaration . declarationSourceEnd = localDeclaration . declarationEnd ; int extraDims = this . intStack [ this . intPtr -- ] ; this . identifierPtr -- ; this . identifierLengthPtr -- ; int declarationSourceStart = 0 ; int modifiersValue = 0 ; if ( hasModifiers ) { declarationSourceStart = this . intStack [ this . intPtr -- ] ; modifiersValue = this . intStack [ this . intPtr -- ] ; } else { this . intPtr -= 2 ; } type = getTypeReference ( this . intStack [ this . intPtr -- ] + extraDims ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , localDeclaration . annotations = new Annotation [ length ] , 0 , length ) ; } if ( hasModifiers ) { localDeclaration . declarationSourceStart = declarationSourceStart ; localDeclaration . modifiers = modifiersValue ; } else { localDeclaration . declarationSourceStart = type . sourceStart ; } localDeclaration . type = type ; ForeachStatement iteratorForStatement = new ForeachStatement ( localDeclaration , this . intStack [ this . intPtr -- ] ) ; pushOnAstStack ( iteratorForStatement ) ; iteratorForStatement . sourceEnd = localDeclaration . declarationSourceEnd ; } protected void consumeEnterAnonymousClassBody ( boolean qualified ) { this . shouldDeferRecovery = false ; TypeReference typeReference = getTypeReference ( 0 ) ; TypeDeclaration anonymousType = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; anonymousType . name = CharOperation . NO_CHAR ; anonymousType . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; QualifiedAllocationExpression alloc = new QualifiedAllocationExpression ( anonymousType ) ; markEnclosingMemberWithLocalType ( ) ; pushOnAstStack ( anonymousType ) ; alloc . sourceEnd = this . rParenPos ; int argumentLength ; if ( ( argumentLength = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= argumentLength ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , alloc . arguments = new Expression [ argumentLength ] , 0 , argumentLength ) ; } if ( qualified ) { this . expressionLengthPtr -- ; alloc . enclosingInstance = this . expressionStack [ this . expressionPtr -- ] ; } alloc . type = typeReference ; anonymousType . sourceEnd = alloc . sourceEnd ; anonymousType . sourceStart = anonymousType . declarationSourceStart = alloc . type . sourceStart ; alloc . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnExpressionStack ( alloc ) ; anonymousType . bodyStart = this . scanner . currentPosition ; this . listLength = 0 ; this . scanner . commentPtr = - 1 ; if ( this . currentElement != null ) { this . lastCheckPoint = anonymousType . bodyStart ; this . currentElement = this . currentElement . add ( anonymousType , 0 ) ; if ( ! ( this . currentElement instanceof RecoveredAnnotation ) ) { this . currentToken = 0 ; } else { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } this . lastIgnoredToken = - 1 ; } } protected void consumeEnterCompilationUnit ( ) { } protected void consumeEnterMemberValue ( ) { if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . hasPendingMemberValueName = true ; } } protected void consumeEnterMemberValueArrayInitializer ( ) { if ( this . currentElement != null ) { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } } protected void consumeEnterVariable ( ) { char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePosition = this . identifierPositionStack [ this . identifierPtr ] ; int extendedDimension = this . intStack [ this . intPtr -- ] ; AbstractVariableDeclaration declaration ; boolean isLocalDeclaration = this . nestedMethod [ this . nestedType ] != 0 ; if ( isLocalDeclaration ) { declaration = createLocalDeclaration ( identifierName , ( int ) ( namePosition >>> 32 ) , ( int ) namePosition ) ; } else { declaration = createFieldDeclaration ( identifierName , ( int ) ( namePosition >>> 32 ) , ( int ) namePosition ) ; } this . identifierPtr -- ; this . identifierLengthPtr -- ; TypeReference type ; int variableIndex = this . variablesCounter [ this . nestedType ] ; int typeDim = 0 ; if ( variableIndex == 0 ) { if ( isLocalDeclaration ) { declaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , declaration . annotations = new Annotation [ length ] , 0 , length ) ; } type = getTypeReference ( typeDim = this . intStack [ this . intPtr -- ] ) ; if ( declaration . declarationSourceStart == - 1 ) { declaration . declarationSourceStart = type . sourceStart ; } pushOnAstStack ( type ) ; } else { type = getTypeReference ( typeDim = this . intStack [ this . intPtr -- ] ) ; pushOnAstStack ( type ) ; declaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; declaration . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , declaration . annotations = new Annotation [ length ] , 0 , length ) ; } FieldDeclaration fieldDeclaration = ( FieldDeclaration ) declaration ; fieldDeclaration . javadoc = this . javadoc ; } this . javadoc = null ; } else { type = ( TypeReference ) this . astStack [ this . astPtr - variableIndex ] ; typeDim = type . dimensions ( ) ; AbstractVariableDeclaration previousVariable = ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ; declaration . declarationSourceStart = previousVariable . declarationSourceStart ; declaration . modifiers = previousVariable . modifiers ; final Annotation [ ] annotations = previousVariable . annotations ; if ( annotations != null ) { final int annotationsLength = annotations . length ; System . arraycopy ( annotations , 0 , declaration . annotations = new Annotation [ annotationsLength ] , 0 , annotationsLength ) ; } } if ( extendedDimension == 0 ) { declaration . type = type ; } else { int dimension = typeDim + extendedDimension ; declaration . type = copyDims ( type , dimension ) ; } this . variablesCounter [ this . nestedType ] ++ ; pushOnAstStack ( declaration ) ; if ( this . currentElement != null ) { if ( ! ( this . currentElement instanceof RecoveredType ) && ( this . currentToken == TokenNameDOT || ( Util . getLineNumber ( declaration . type . sourceStart , this . scanner . lineEnds , 0 , this . scanner . linePtr ) != Util . getLineNumber ( ( int ) ( namePosition >>> 32 ) , this . scanner . lineEnds , 0 , this . scanner . linePtr ) ) ) ) { this . lastCheckPoint = ( int ) ( namePosition >>> 32 ) ; this . restartRecovery = true ; return ; } if ( isLocalDeclaration ) { LocalDeclaration localDecl = ( LocalDeclaration ) this . astStack [ this . astPtr ] ; this . lastCheckPoint = localDecl . sourceEnd + 1 ; this . currentElement = this . currentElement . add ( localDecl , 0 ) ; } else { FieldDeclaration fieldDecl = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; this . lastCheckPoint = fieldDecl . sourceEnd + 1 ; this . currentElement = this . currentElement . add ( fieldDecl , 0 ) ; } this . lastIgnoredToken = - 1 ; } } protected void consumeEnumBodyNoConstants ( ) { } protected void consumeEnumBodyWithConstants ( ) { concatNodeLists ( ) ; } protected void consumeEnumConstantHeader ( ) { FieldDeclaration enumConstant = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; boolean foundOpeningBrace = this . currentToken == TokenNameLBRACE ; if ( foundOpeningBrace ) { TypeDeclaration anonymousType = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; anonymousType . name = CharOperation . NO_CHAR ; anonymousType . bits |= ( ASTNode . IsAnonymousType | ASTNode . IsLocalType ) ; final int start = this . scanner . startPosition ; anonymousType . declarationSourceStart = start ; anonymousType . sourceStart = start ; anonymousType . sourceEnd = start ; anonymousType . modifiers = 0 ; anonymousType . bodyStart = this . scanner . currentPosition ; markEnclosingMemberWithLocalType ( ) ; consumeNestedType ( ) ; this . variablesCounter [ this . nestedType ] ++ ; pushOnAstStack ( anonymousType ) ; QualifiedAllocationExpression allocationExpression = new QualifiedAllocationExpression ( anonymousType ) ; allocationExpression . enumConstant = enumConstant ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , allocationExpression . arguments = new Expression [ length ] , 0 , length ) ; } enumConstant . initialization = allocationExpression ; } else { AllocationExpression allocationExpression = new AllocationExpression ( ) ; allocationExpression . enumConstant = enumConstant ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , allocationExpression . arguments = new Expression [ length ] , 0 , length ) ; } enumConstant . initialization = allocationExpression ; } enumConstant . initialization . sourceStart = enumConstant . declarationSourceStart ; if ( this . currentElement != null ) { if ( foundOpeningBrace ) { TypeDeclaration anonymousType = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; this . currentElement = this . currentElement . add ( anonymousType , 0 ) ; this . lastCheckPoint = anonymousType . bodyStart ; this . lastIgnoredToken = - 1 ; this . currentToken = 0 ; } else { if ( this . currentToken == TokenNameSEMICOLON ) { RecoveredType currentType = currentRecoveryType ( ) ; if ( currentType != null ) { currentType . insideEnumConstantPart = false ; } } this . lastCheckPoint = this . scanner . startPosition ; this . lastIgnoredToken = - 1 ; this . restartRecovery = true ; } } } protected void consumeEnumConstantHeaderName ( ) { if ( this . currentElement != null ) { if ( ! ( this . currentElement instanceof RecoveredType || ( this . currentElement instanceof RecoveredField && ( ( RecoveredField ) this . currentElement ) . fieldDeclaration . type == null ) ) || ( this . lastIgnoredToken == TokenNameDOT ) ) { this . lastCheckPoint = this . scanner . startPosition ; this . restartRecovery = true ; return ; } } long namePosition = this . identifierPositionStack [ this . identifierPtr ] ; char [ ] constantName = this . identifierStack [ this . identifierPtr ] ; final int sourceEnd = ( int ) namePosition ; FieldDeclaration enumConstant = createFieldDeclaration ( constantName , ( int ) ( namePosition >>> 32 ) , sourceEnd ) ; this . identifierPtr -- ; this . identifierLengthPtr -- ; enumConstant . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; enumConstant . modifiers = this . intStack [ this . intPtr -- ] ; enumConstant . declarationSourceStart = enumConstant . modifiersSourceStart ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , enumConstant . annotations = new Annotation [ length ] , 0 , length ) ; } pushOnAstStack ( enumConstant ) ; if ( this . currentElement != null ) { this . lastCheckPoint = enumConstant . sourceEnd + 1 ; this . currentElement = this . currentElement . add ( enumConstant , 0 ) ; } enumConstant . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeEnumConstantNoClassBody ( ) { int endOfEnumConstant = this . intStack [ this . intPtr -- ] ; final FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr ] ; fieldDeclaration . declarationEnd = endOfEnumConstant ; fieldDeclaration . declarationSourceEnd = endOfEnumConstant ; ASTNode initialization = fieldDeclaration . initialization ; if ( initialization != null ) { initialization . sourceEnd = endOfEnumConstant ; } } protected void consumeEnumConstants ( ) { concatNodeLists ( ) ; } protected void consumeEnumConstantWithClassBody ( ) { dispatchDeclarationInto ( this . astLengthStack [ this . astLengthPtr -- ] ) ; TypeDeclaration anonymousType = ( TypeDeclaration ) this . astStack [ this . astPtr -- ] ; this . astLengthPtr -- ; anonymousType . bodyEnd = this . endPosition ; anonymousType . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; final FieldDeclaration fieldDeclaration = ( ( FieldDeclaration ) this . astStack [ this . astPtr ] ) ; fieldDeclaration . declarationEnd = this . endStatementPosition ; int declarationSourceEnd = anonymousType . declarationSourceEnd ; fieldDeclaration . declarationSourceEnd = declarationSourceEnd ; this . intPtr -- ; this . variablesCounter [ this . nestedType ] = 0 ; this . nestedType -- ; ASTNode initialization = fieldDeclaration . initialization ; if ( initialization != null ) { initialization . sourceEnd = declarationSourceEnd ; } } protected void consumeEnumDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { dispatchDeclarationIntoEnumDeclaration ( length ) ; } TypeDeclaration enumDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; boolean hasConstructor = enumDeclaration . checkConstructors ( this ) ; if ( ! hasConstructor ) { boolean insideFieldInitializer = false ; if ( this . diet ) { for ( int i = this . nestedType ; i > 0 ; i -- ) { if ( this . variablesCounter [ i ] > 0 ) { insideFieldInitializer = true ; break ; } } } enumDeclaration . createDefaultConstructor ( ! this . diet || insideFieldInitializer , true ) ; } if ( this . scanner . containsAssertKeyword ) { enumDeclaration . bits |= ASTNode . ContainsAssertion ; } enumDeclaration . addClinit ( ) ; enumDeclaration . bodyEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( enumDeclaration . bodyStart , enumDeclaration . bodyEnd ) ) { enumDeclaration . bits |= ASTNode . UndocumentedEmptyBlock ; } enumDeclaration . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeEnumDeclarations ( ) { } protected void consumeEnumHeader ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { typeDecl . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - 1 ; } protected void consumeEnumHeaderName ( ) { TypeDeclaration enumDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == 0 ) { if ( this . nestedType != 0 ) { enumDeclaration . bits |= ASTNode . IsMemberType ; } } else { blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; enumDeclaration . sourceEnd = ( int ) pos ; enumDeclaration . sourceStart = ( int ) ( pos >>> 32 ) ; enumDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; enumDeclaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; enumDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; enumDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccEnum ; if ( enumDeclaration . modifiersSourceStart >= 0 ) { enumDeclaration . declarationSourceStart = enumDeclaration . modifiersSourceStart ; } if ( ( enumDeclaration . bits & ASTNode . IsMemberType ) == 0 && ( enumDeclaration . bits & ASTNode . IsLocalType ) == 0 ) { if ( this . compilationUnit != null && ! CharOperation . equals ( enumDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { enumDeclaration . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , enumDeclaration . annotations = new Annotation [ length ] , 0 , length ) ; } enumDeclaration . bodyStart = enumDeclaration . sourceEnd + 1 ; pushOnAstStack ( enumDeclaration ) ; this . listLength = 0 ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfEnumDeclarations ( enumDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = enumDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( enumDeclaration , 0 ) ; this . lastIgnoredToken = - 1 ; } enumDeclaration . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeEnumHeaderNameWithTypeParameters ( ) { TypeDeclaration enumDeclaration = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , enumDeclaration . typeParameters = new TypeParameter [ length ] , 0 , length ) ; problemReporter ( ) . invalidUsageOfTypeParametersForEnumDeclaration ( enumDeclaration ) ; enumDeclaration . bodyStart = enumDeclaration . typeParameters [ length - 1 ] . declarationSourceEnd + 1 ; this . listTypeParameterLength = 0 ; if ( this . nestedMethod [ this . nestedType ] == 0 ) { if ( this . nestedType != 0 ) { enumDeclaration . bits |= ASTNode . IsMemberType ; } } else { blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; enumDeclaration . sourceEnd = ( int ) pos ; enumDeclaration . sourceStart = ( int ) ( pos >>> 32 ) ; enumDeclaration . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; enumDeclaration . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; enumDeclaration . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; enumDeclaration . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccEnum ; if ( enumDeclaration . modifiersSourceStart >= 0 ) { enumDeclaration . declarationSourceStart = enumDeclaration . modifiersSourceStart ; } if ( ( enumDeclaration . bits & ASTNode . IsMemberType ) == 0 && ( enumDeclaration . bits & ASTNode . IsLocalType ) == 0 ) { if ( this . compilationUnit != null && ! CharOperation . equals ( enumDeclaration . name , this . compilationUnit . getMainTypeName ( ) ) ) { enumDeclaration . bits |= ASTNode . IsSecondaryType ; } } if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , enumDeclaration . annotations = new Annotation [ length ] , 0 , length ) ; } enumDeclaration . bodyStart = enumDeclaration . sourceEnd + 1 ; pushOnAstStack ( enumDeclaration ) ; this . listLength = 0 ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfEnumDeclarations ( enumDeclaration ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = enumDeclaration . bodyStart ; this . currentElement = this . currentElement . add ( enumDeclaration , 0 ) ; this . lastIgnoredToken = - 1 ; } enumDeclaration . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeEqualityExpression ( int op ) { this . expressionPtr -- ; this . expressionLengthPtr -- ; this . expressionStack [ this . expressionPtr ] = new EqualExpression ( this . expressionStack [ this . expressionPtr ] , this . expressionStack [ this . expressionPtr + 1 ] , op ) ; } protected void consumeEqualityExpressionWithName ( int op ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; this . expressionPtr -- ; this . expressionLengthPtr -- ; this . expressionStack [ this . expressionPtr ] = new EqualExpression ( this . expressionStack [ this . expressionPtr + 1 ] , this . expressionStack [ this . expressionPtr ] , op ) ; } protected void consumeExitMemberValue ( ) { if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . hasPendingMemberValueName = false ; recoveredAnnotation . memberValuPairEqualEnd = - 1 ; } } protected void consumeExitTryBlock ( ) { if ( this . currentElement != null ) { this . restartRecovery = true ; } } protected void consumeExitVariableWithInitialization ( ) { this . expressionLengthPtr -- ; AbstractVariableDeclaration variableDecl = ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ; variableDecl . initialization = this . expressionStack [ this . expressionPtr -- ] ; variableDecl . declarationSourceEnd = variableDecl . initialization . sourceEnd ; variableDecl . declarationEnd = variableDecl . initialization . sourceEnd ; recoveryExitFromVariable ( ) ; } protected void consumeExitVariableWithoutInitialization ( ) { AbstractVariableDeclaration variableDecl = ( AbstractVariableDeclaration ) this . astStack [ this . astPtr ] ; variableDecl . declarationSourceEnd = variableDecl . declarationEnd ; if ( this . currentElement != null && this . currentElement instanceof RecoveredField ) { if ( this . endStatementPosition > variableDecl . sourceEnd ) { this . currentElement . updateSourceEndIfNecessary ( this . endStatementPosition ) ; } } recoveryExitFromVariable ( ) ; } protected void consumeExplicitConstructorInvocation ( int flag , int recFlag ) { int startPosition = this . intStack [ this . intPtr -- ] ; ExplicitConstructorCall ecc = new ExplicitConstructorCall ( recFlag ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , ecc . arguments = new Expression [ length ] , 0 , length ) ; } switch ( flag ) { case 0 : ecc . sourceStart = startPosition ; break ; case 1 : this . expressionLengthPtr -- ; ecc . sourceStart = ( ecc . qualification = this . expressionStack [ this . expressionPtr -- ] ) . sourceStart ; break ; case 2 : ecc . sourceStart = ( ecc . qualification = getUnspecifiedReferenceOptimized ( ) ) . sourceStart ; break ; } pushOnAstStack ( ecc ) ; ecc . sourceEnd = this . endStatementPosition ; } protected void consumeExplicitConstructorInvocationWithTypeArguments ( int flag , int recFlag ) { int startPosition = this . intStack [ this . intPtr -- ] ; ExplicitConstructorCall ecc = new ExplicitConstructorCall ( recFlag ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , ecc . arguments = new Expression [ length ] , 0 , length ) ; } length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , ecc . typeArguments = new TypeReference [ length ] , 0 , length ) ; ecc . typeArgumentsSourceStart = this . intStack [ this . intPtr -- ] ; switch ( flag ) { case 0 : ecc . sourceStart = startPosition ; break ; case 1 : this . expressionLengthPtr -- ; ecc . sourceStart = ( ecc . qualification = this . expressionStack [ this . expressionPtr -- ] ) . sourceStart ; break ; case 2 : ecc . sourceStart = ( ecc . qualification = getUnspecifiedReferenceOptimized ( ) ) . sourceStart ; break ; } pushOnAstStack ( ecc ) ; ecc . sourceEnd = this . endStatementPosition ; } protected void consumeExpressionStatement ( ) { this . expressionLengthPtr -- ; Expression expression = this . expressionStack [ this . expressionPtr -- ] ; expression . statementEnd = this . endStatementPosition ; expression . bits |= ASTNode . InsideExpressionStatement ; pushOnAstStack ( expression ) ; } protected void consumeFieldAccess ( boolean isSuperAccess ) { FieldReference fr = new FieldReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; this . identifierLengthPtr -- ; if ( isSuperAccess ) { fr . sourceStart = this . intStack [ this . intPtr -- ] ; fr . receiver = new SuperReference ( fr . sourceStart , this . endPosition ) ; pushOnExpressionStack ( fr ) ; } else { fr . receiver = this . expressionStack [ this . expressionPtr ] ; fr . sourceStart = fr . receiver . sourceStart ; this . expressionStack [ this . expressionPtr ] = fr ; } } protected void consumeFieldDeclaration ( ) { int variableDeclaratorsCounter = this . astLengthStack [ this . astLengthPtr ] ; for ( int i = variableDeclaratorsCounter - 1 ; i >= 0 ; i -- ) { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr - i ] ; fieldDeclaration . declarationSourceEnd = this . endStatementPosition ; fieldDeclaration . declarationEnd = this . endStatementPosition ; } updateSourceDeclarationParts ( variableDeclaratorsCounter ) ; int endPos = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; if ( endPos != this . endStatementPosition ) { for ( int i = 0 ; i < variableDeclaratorsCounter ; i ++ ) { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) this . astStack [ this . astPtr - i ] ; fieldDeclaration . declarationSourceEnd = endPos ; } } int startIndex = this . astPtr - this . variablesCounter [ this . nestedType ] + 1 ; System . arraycopy ( this . astStack , startIndex , this . astStack , startIndex - 1 , variableDeclaratorsCounter ) ; this . astPtr -- ; this . astLengthStack [ -- this . astLengthPtr ] = variableDeclaratorsCounter ; if ( this . currentElement != null ) { this . lastCheckPoint = endPos + 1 ; if ( this . currentElement . parent != null && this . currentElement instanceof RecoveredField ) { if ( ! ( this . currentElement instanceof RecoveredInitializer ) ) { this . currentElement = this . currentElement . parent ; } } this . restartRecovery = true ; } this . variablesCounter [ this . nestedType ] = 0 ; } protected void consumeForceNoDiet ( ) { this . dietInt ++ ; } protected void consumeForInit ( ) { pushOnAstLengthStack ( - 1 ) ; } protected void consumeFormalParameter ( boolean isVarArgs ) { this . identifierLengthPtr -- ; char [ ] identifierName = this . identifierStack [ this . identifierPtr ] ; long namePositions = this . identifierPositionStack [ this . identifierPtr -- ] ; int extendedDimensions = this . intStack [ this . intPtr -- ] ; int endOfEllipsis = 0 ; if ( isVarArgs ) { endOfEllipsis = this . intStack [ this . intPtr -- ] ; } int firstDimensions = this . intStack [ this . intPtr -- ] ; final int typeDimensions = firstDimensions + extendedDimensions ; TypeReference type = getTypeReference ( typeDimensions ) ; if ( isVarArgs ) { type = copyDims ( type , typeDimensions + 1 ) ; if ( extendedDimensions == 0 ) { type . sourceEnd = endOfEllipsis ; } type . bits |= ASTNode . IsVarArgs ; } int modifierPositions = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; Argument arg = new Argument ( identifierName , namePositions , type , this . intStack [ this . intPtr + 1 ] & ~ ClassFileConstants . AccDeprecated ) ; arg . declarationSourceStart = modifierPositions ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , arg . annotations = new Annotation [ length ] , 0 , length ) ; RecoveredType currentRecoveryType = this . currentRecoveryType ( ) ; if ( currentRecoveryType != null ) currentRecoveryType . annotationsConsumed ( arg . annotations ) ; } pushOnAstStack ( arg ) ; this . listLength ++ ; if ( isVarArgs ) { if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfVarargs ( arg ) ; } else if ( ! this . statementRecoveryActivated && extendedDimensions > 0 ) { problemReporter ( ) . illegalExtendedDimensions ( arg ) ; } } } protected void consumeFormalParameterList ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeFormalParameterListopt ( ) { pushOnAstLengthStack ( 0 ) ; } protected void consumeGenericType ( ) { } protected void consumeGenericTypeArrayType ( ) { } protected void consumeGenericTypeNameArrayType ( ) { } protected void consumeGenericTypeWithDiamond ( ) { pushOnGenericsLengthStack ( - 1 ) ; concatGenericsLists ( ) ; this . intPtr -- ; } protected void consumeImportDeclaration ( ) { ImportReference impt = ( ImportReference ) this . astStack [ this . astPtr ] ; impt . declarationEnd = this . endStatementPosition ; impt . declarationSourceEnd = flushCommentsDefinedPriorTo ( impt . declarationSourceEnd ) ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . currentElement = this . currentElement . add ( impt , 0 ) ; this . lastIgnoredToken = - 1 ; this . restartRecovery = true ; } } protected void consumeImportDeclarations ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeInsideCastExpression ( ) { } protected void consumeInsideCastExpressionLL1 ( ) { pushOnGenericsLengthStack ( 0 ) ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnExpressionStack ( getTypeReference ( 0 ) ) ; } protected void consumeInsideCastExpressionWithQualifiedGenerics ( ) { } protected void consumeInstanceOfExpression ( ) { Expression exp ; this . expressionStack [ this . expressionPtr ] = exp = new InstanceOfExpression ( this . expressionStack [ this . expressionPtr ] , getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; if ( exp . sourceEnd == 0 ) { exp . sourceEnd = this . scanner . startPosition - 1 ; } } protected void consumeInstanceOfExpressionWithName ( ) { TypeReference reference = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; Expression exp ; this . expressionStack [ this . expressionPtr ] = exp = new InstanceOfExpression ( this . expressionStack [ this . expressionPtr ] , reference ) ; if ( exp . sourceEnd == 0 ) { exp . sourceEnd = this . scanner . startPosition - 1 ; } } protected void consumeInterfaceDeclaration ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { dispatchDeclarationInto ( length ) ; } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; typeDecl . checkConstructors ( this ) ; FieldDeclaration [ ] fields = typeDecl . fields ; int fieldCount = fields == null ? 0 : fields . length ; for ( int i = 0 ; i < fieldCount ; i ++ ) { FieldDeclaration field = fields [ i ] ; if ( field instanceof Initializer ) { problemReporter ( ) . interfaceCannotHaveInitializers ( typeDecl . name , field ) ; } } if ( this . scanner . containsAssertKeyword ) { typeDecl . bits |= ASTNode . ContainsAssertion ; } typeDecl . addClinit ( ) ; typeDecl . bodyEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( typeDecl . bodyStart , typeDecl . bodyEnd ) ) { typeDecl . bits |= ASTNode . UndocumentedEmptyBlock ; } typeDecl . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeInterfaceHeader ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { typeDecl . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { this . restartRecovery = true ; } this . scanner . commentPtr = - 1 ; } protected void consumeInterfaceHeaderExtends ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; System . arraycopy ( this . astStack , this . astPtr + 1 , typeDecl . superInterfaces = new TypeReference [ length ] , 0 , length ) ; for ( int i = 0 , max = typeDecl . superInterfaces . length ; i < max ; i ++ ) { typeDecl . superInterfaces [ i ] . bits |= ASTNode . IsSuperType ; } typeDecl . bodyStart = typeDecl . superInterfaces [ length - 1 ] . sourceEnd + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; } } protected void consumeInterfaceHeaderName1 ( ) { TypeDeclaration typeDecl = new TypeDeclaration ( this . compilationUnit . compilationResult ) ; if ( this . nestedMethod [ this . nestedType ] == 0 ) { if ( this . nestedType != 0 ) { typeDecl . bits |= ASTNode . IsMemberType ; } } else { typeDecl . bits |= ASTNode . IsLocalType ; markEnclosingMemberWithLocalType ( ) ; blockReal ( ) ; } long pos = this . identifierPositionStack [ this . identifierPtr ] ; typeDecl . sourceEnd = ( int ) pos ; typeDecl . sourceStart = ( int ) ( pos >>> 32 ) ; typeDecl . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; typeDecl . declarationSourceStart = this . intStack [ this . intPtr -- ] ; this . intPtr -- ; typeDecl . modifiersSourceStart = this . intStack [ this . intPtr -- ] ; typeDecl . modifiers = this . intStack [ this . intPtr -- ] | ClassFileConstants . AccInterface ; if ( typeDecl . modifiersSourceStart >= 0 ) { typeDecl . declarationSourceStart = typeDecl . modifiersSourceStart ; } if ( ( typeDecl . bits & ASTNode . IsMemberType ) == 0 && ( typeDecl . bits & ASTNode . IsLocalType ) == 0 ) { if ( this . compilationUnit != null && ! CharOperation . equals ( typeDecl . name , this . compilationUnit . getMainTypeName ( ) ) ) { typeDecl . bits |= ASTNode . IsSecondaryType ; } } int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , typeDecl . annotations = new Annotation [ length ] , 0 , length ) ; } typeDecl . bodyStart = typeDecl . sourceEnd + 1 ; pushOnAstStack ( typeDecl ) ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = typeDecl . bodyStart ; this . currentElement = this . currentElement . add ( typeDecl , 0 ) ; this . lastIgnoredToken = - 1 ; } typeDecl . javadoc = this . javadoc ; this . javadoc = null ; } protected void consumeInterfaceMemberDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeInterfaceMemberDeclarationsopt ( ) { this . nestedType -- ; } protected void consumeInterfaceType ( ) { pushOnAstStack ( getTypeReference ( 0 ) ) ; this . listLength ++ ; } protected void consumeInterfaceTypeList ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeInternalCompilationUnit ( ) { if ( this . compilationUnit . isPackageInfo ( ) ) { this . compilationUnit . types = new TypeDeclaration [ 1 ] ; this . compilationUnit . createPackageInfoType ( ) ; } } protected void consumeInternalCompilationUnitWithTypes ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { if ( this . compilationUnit . isPackageInfo ( ) ) { this . compilationUnit . types = new TypeDeclaration [ length + 1 ] ; this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + 1 , this . compilationUnit . types , 1 , length ) ; this . compilationUnit . createPackageInfoType ( ) ; } else { this . compilationUnit . types = new TypeDeclaration [ length ] ; this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + 1 , this . compilationUnit . types , 0 , length ) ; } } } protected void consumeInvalidAnnotationTypeDeclaration ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . illegalLocalTypeDeclaration ( typeDecl ) ; this . astPtr -- ; pushOnAstLengthStack ( - 1 ) ; concatNodeLists ( ) ; } protected void consumeInvalidConstructorDeclaration ( ) { ConstructorDeclaration cd = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; cd . bodyEnd = this . endPosition ; cd . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; cd . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } protected void consumeInvalidConstructorDeclaration ( boolean hasBody ) { if ( hasBody ) { this . intPtr -- ; } if ( hasBody ) { this . realBlockPtr -- ; } int length ; if ( hasBody && ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) ) { this . astPtr -= length ; } ConstructorDeclaration constructorDeclaration = ( ConstructorDeclaration ) this . astStack [ this . astPtr ] ; constructorDeclaration . bodyEnd = this . endStatementPosition ; constructorDeclaration . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; if ( ! hasBody ) { constructorDeclaration . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } } protected void consumeInvalidEnumDeclaration ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . illegalLocalTypeDeclaration ( typeDecl ) ; this . astPtr -- ; pushOnAstLengthStack ( - 1 ) ; concatNodeLists ( ) ; } protected void consumeInvalidInterfaceDeclaration ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . illegalLocalTypeDeclaration ( typeDecl ) ; this . astPtr -- ; pushOnAstLengthStack ( - 1 ) ; concatNodeLists ( ) ; } protected void consumeInvalidMethodDeclaration ( ) { this . intPtr -- ; this . realBlockPtr -- ; int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { this . astPtr -= length ; } MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; md . bodyEnd = this . endPosition ; md . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . abstractMethodNeedingNoBody ( md ) ; } protected void consumeLabel ( ) { } protected void consumeLeftParen ( ) { pushOnIntStack ( this . lParenPos ) ; } protected void consumeLocalVariableDeclaration ( ) { int variableDeclaratorsCounter = this . astLengthStack [ this . astLengthPtr ] ; int startIndex = this . astPtr - this . variablesCounter [ this . nestedType ] + 1 ; System . arraycopy ( this . astStack , startIndex , this . astStack , startIndex - 1 , variableDeclaratorsCounter ) ; this . astPtr -- ; this . astLengthStack [ -- this . astLengthPtr ] = variableDeclaratorsCounter ; this . variablesCounter [ this . nestedType ] = 0 ; } protected void consumeLocalVariableDeclarationStatement ( ) { this . realBlockStack [ this . realBlockPtr ] ++ ; int variableDeclaratorsCounter = this . astLengthStack [ this . astLengthPtr ] ; for ( int i = variableDeclaratorsCounter - 1 ; i >= 0 ; i -- ) { LocalDeclaration localDeclaration = ( LocalDeclaration ) this . astStack [ this . astPtr - i ] ; localDeclaration . declarationSourceEnd = this . endStatementPosition ; localDeclaration . declarationEnd = this . endStatementPosition ; } } protected void consumeMarkerAnnotation ( ) { MarkerAnnotation markerAnnotation = null ; int oldIndex = this . identifierPtr ; TypeReference typeReference = getAnnotationType ( ) ; markerAnnotation = new MarkerAnnotation ( typeReference , this . intStack [ this . intPtr -- ] ) ; markerAnnotation . declarationSourceEnd = markerAnnotation . sourceEnd ; pushOnExpressionStack ( markerAnnotation ) ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotation ( markerAnnotation ) ; } this . recordStringLiterals = true ; if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { this . currentElement = ( ( RecoveredAnnotation ) this . currentElement ) . addAnnotation ( markerAnnotation , oldIndex ) ; } } protected void consumeMemberValueArrayInitializer ( ) { arrayInitializer ( this . expressionLengthStack [ this . expressionLengthPtr -- ] ) ; } protected void consumeMemberValueAsName ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; } protected void consumeMemberValuePair ( ) { char [ ] simpleName = this . identifierStack [ this . identifierPtr ] ; long position = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int end = ( int ) position ; int start = ( int ) ( position >>> 32 ) ; Expression value = this . expressionStack [ this . expressionPtr -- ] ; this . expressionLengthPtr -- ; MemberValuePair memberValuePair = new MemberValuePair ( simpleName , start , end , value ) ; pushOnAstStack ( memberValuePair ) ; if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . setKind ( RecoveredAnnotation . NORMAL ) ; } } protected void consumeMemberValuePairs ( ) { concatNodeLists ( ) ; } protected void consumeMemberValues ( ) { concatExpressionLists ( ) ; } protected void consumeMethodBody ( ) { this . nestedMethod [ this . nestedType ] -- ; } protected void consumeMethodDeclaration ( boolean isNotAbstract ) { int length ; if ( isNotAbstract ) { this . intPtr -- ; this . intPtr -- ; } int explicitDeclarations = 0 ; Statement [ ] statements = null ; if ( isNotAbstract ) { explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; if ( ! this . options . ignoreMethodBodies ) { if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + 1 , statements = new Statement [ length ] , 0 , length ) ; } } else { length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; } } MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; md . statements = statements ; md . explicitDeclarations = explicitDeclarations ; if ( ! isNotAbstract ) { md . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; } else if ( ! ( this . diet && this . dietInt == 0 ) && statements == null && ! containsComment ( md . bodyStart , this . endPosition ) ) { md . bits |= ASTNode . UndocumentedEmptyBlock ; } md . bodyEnd = this . endPosition ; md . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; } protected void consumeMethodHeader ( ) { AbstractMethodDeclaration method = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; if ( this . currentToken == TokenNameLBRACE ) { method . bodyStart = this . scanner . currentPosition ; } if ( this . currentElement != null ) { if ( this . currentToken == TokenNameSEMICOLON ) { method . modifiers |= ExtraCompilerModifiers . AccSemicolonBody ; method . declarationSourceEnd = this . scanner . currentPosition - 1 ; method . bodyEnd = this . scanner . currentPosition - 1 ; if ( this . currentElement . parseTree ( ) == method && this . currentElement . parent != null ) { this . currentElement = this . currentElement . parent ; } } else if ( this . currentToken == TokenNameLBRACE ) { if ( this . currentElement instanceof RecoveredMethod && ( ( RecoveredMethod ) this . currentElement ) . methodDeclaration != method ) { this . ignoreNextOpeningBrace = true ; this . currentElement . bracketBalance ++ ; } } this . restartRecovery = true ; } } protected void consumeMethodHeaderDefaultValue ( ) { MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; int length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ; if ( length == 1 ) { this . intPtr -- ; this . intPtr -- ; if ( md . isAnnotationMethod ( ) ) { ( ( AnnotationMethodDeclaration ) md ) . defaultValue = this . expressionStack [ this . expressionPtr ] ; md . modifiers |= ClassFileConstants . AccAnnotationDefault ; } this . expressionPtr -- ; this . recordStringLiterals = true ; } if ( this . currentElement != null ) { if ( md . isAnnotationMethod ( ) ) { this . currentElement . updateSourceEndIfNecessary ( ( ( AnnotationMethodDeclaration ) md ) . defaultValue . sourceEnd ) ; } } } protected void consumeMethodHeaderExtendedDims ( ) { MethodDeclaration md = ( MethodDeclaration ) this . astStack [ this . astPtr ] ; int extendedDims = this . intStack [ this . intPtr -- ] ; if ( md . isAnnotationMethod ( ) ) { ( ( AnnotationMethodDeclaration ) md ) . extendedDimensions = extendedDims ; } if ( extendedDims != 0 ) { TypeReference returnType = md . returnType ; md . sourceEnd = this . endPosition ; int dims = returnType . dimensions ( ) + extendedDims ; md . returnType = copyDims ( returnType , dims ) ; if ( this . currentToken == TokenNameLBRACE ) { md . bodyStart = this . endPosition + 1 ; } if ( this . currentElement != null ) { this . lastCheckPoint = md . bodyStart ; } } } protected void consumeMethodHeaderName ( boolean isAnnotationMethod ) { MethodDeclaration md = null ; if ( isAnnotationMethod ) { md = new AnnotationMethodDeclaration ( this . compilationUnit . compilationResult ) ; this . recordStringLiterals = false ; } else { md = new MethodDeclaration ( this . compilationUnit . compilationResult ) ; } md . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; md . returnType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; md . declarationSourceStart = this . intStack [ this . intPtr -- ] ; md . modifiers = this . intStack [ this . intPtr -- ] ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , md . annotations = new Annotation [ length ] , 0 , length ) ; } md . javadoc = this . javadoc ; this . javadoc = null ; md . sourceStart = ( int ) ( selectorSource >>> 32 ) ; pushOnAstStack ( md ) ; md . sourceEnd = this . lParenPos ; md . bodyStart = this . lParenPos + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType || ( Util . getLineNumber ( md . returnType . sourceStart , this . scanner . lineEnds , 0 , this . scanner . linePtr ) == Util . getLineNumber ( md . sourceStart , this . scanner . lineEnds , 0 , this . scanner . linePtr ) ) ) { this . lastCheckPoint = md . bodyStart ; this . currentElement = this . currentElement . add ( md , 0 ) ; this . lastIgnoredToken = - 1 ; } else { this . lastCheckPoint = md . sourceStart ; this . restartRecovery = true ; } } } protected void consumeMethodHeaderNameWithTypeParameters ( boolean isAnnotationMethod ) { MethodDeclaration md = null ; if ( isAnnotationMethod ) { md = new AnnotationMethodDeclaration ( this . compilationUnit . compilationResult ) ; this . recordStringLiterals = false ; } else { md = new MethodDeclaration ( this . compilationUnit . compilationResult ) ; } md . selector = this . identifierStack [ this . identifierPtr ] ; long selectorSource = this . identifierPositionStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; md . returnType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , md . typeParameters = new TypeParameter [ length ] , 0 , length ) ; md . declarationSourceStart = this . intStack [ this . intPtr -- ] ; md . modifiers = this . intStack [ this . intPtr -- ] ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , md . annotations = new Annotation [ length ] , 0 , length ) ; } md . javadoc = this . javadoc ; this . javadoc = null ; md . sourceStart = ( int ) ( selectorSource >>> 32 ) ; pushOnAstStack ( md ) ; md . sourceEnd = this . lParenPos ; md . bodyStart = this . lParenPos + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { boolean isType ; if ( ( isType = this . currentElement instanceof RecoveredType ) || ( Util . getLineNumber ( md . returnType . sourceStart , this . scanner . lineEnds , 0 , this . scanner . linePtr ) == Util . getLineNumber ( md . sourceStart , this . scanner . lineEnds , 0 , this . scanner . linePtr ) ) ) { if ( isType ) { ( ( RecoveredType ) this . currentElement ) . pendingTypeParameters = null ; } this . lastCheckPoint = md . bodyStart ; this . currentElement = this . currentElement . add ( md , 0 ) ; this . lastIgnoredToken = - 1 ; } else { this . lastCheckPoint = md . sourceStart ; this . restartRecovery = true ; } } } protected void consumeMethodHeaderRightParen ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; AbstractMethodDeclaration md = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; md . sourceEnd = this . rParenPos ; if ( length != 0 ) { System . arraycopy ( this . astStack , this . astPtr + 1 , md . arguments = new Argument [ length ] , 0 , length ) ; } md . bodyStart = this . rParenPos + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = md . bodyStart ; if ( this . currentElement . parseTree ( ) == md ) return ; if ( md . isConstructor ( ) ) { if ( ( length != 0 ) || ( this . currentToken == TokenNameLBRACE ) || ( this . currentToken == TokenNamethrows ) ) { this . currentElement = this . currentElement . add ( md , 0 ) ; this . lastIgnoredToken = - 1 ; } } } } protected void consumeMethodHeaderThrowsClause ( ) { int length = this . astLengthStack [ this . astLengthPtr -- ] ; this . astPtr -= length ; AbstractMethodDeclaration md = ( AbstractMethodDeclaration ) this . astStack [ this . astPtr ] ; System . arraycopy ( this . astStack , this . astPtr + 1 , md . thrownExceptions = new TypeReference [ length ] , 0 , length ) ; md . sourceEnd = md . thrownExceptions [ length - 1 ] . sourceEnd ; md . bodyStart = md . thrownExceptions [ length - 1 ] . sourceEnd + 1 ; this . listLength = 0 ; if ( this . currentElement != null ) { this . lastCheckPoint = md . bodyStart ; } } protected void consumeMethodInvocationName ( ) { MessageSend m = newMessageSend ( ) ; m . sourceEnd = this . rParenPos ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) >>> 32 ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; if ( this . identifierLengthStack [ this . identifierLengthPtr ] == 1 ) { m . receiver = ThisReference . implicitThis ( ) ; this . identifierLengthPtr -- ; } else { this . identifierLengthStack [ this . identifierLengthPtr ] -- ; m . receiver = getUnspecifiedReference ( ) ; m . sourceStart = m . receiver . sourceStart ; } pushOnExpressionStack ( m ) ; } protected void consumeMethodInvocationNameWithTypeArguments ( ) { MessageSend m = newMessageSendWithTypeArguments ( ) ; m . sourceEnd = this . rParenPos ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) >>> 32 ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , m . typeArguments = new TypeReference [ length ] , 0 , length ) ; this . intPtr -- ; m . receiver = getUnspecifiedReference ( ) ; m . sourceStart = m . receiver . sourceStart ; pushOnExpressionStack ( m ) ; } protected void consumeMethodInvocationPrimary ( ) { MessageSend m = newMessageSend ( ) ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) >>> 32 ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; m . receiver = this . expressionStack [ this . expressionPtr ] ; m . sourceStart = m . receiver . sourceStart ; m . sourceEnd = this . rParenPos ; this . expressionStack [ this . expressionPtr ] = m ; } protected void consumeMethodInvocationPrimaryWithTypeArguments ( ) { MessageSend m = newMessageSendWithTypeArguments ( ) ; m . sourceStart = ( int ) ( ( m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ) >>> 32 ) ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , m . typeArguments = new TypeReference [ length ] , 0 , length ) ; this . intPtr -- ; m . receiver = this . expressionStack [ this . expressionPtr ] ; m . sourceStart = m . receiver . sourceStart ; m . sourceEnd = this . rParenPos ; this . expressionStack [ this . expressionPtr ] = m ; } protected void consumeMethodInvocationSuper ( ) { MessageSend m = newMessageSend ( ) ; m . sourceStart = this . intStack [ this . intPtr -- ] ; m . sourceEnd = this . rParenPos ; m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; m . receiver = new SuperReference ( m . sourceStart , this . endPosition ) ; pushOnExpressionStack ( m ) ; } protected void consumeMethodInvocationSuperWithTypeArguments ( ) { MessageSend m = newMessageSendWithTypeArguments ( ) ; this . intPtr -- ; m . sourceEnd = this . rParenPos ; m . nameSourcePosition = this . identifierPositionStack [ this . identifierPtr ] ; m . selector = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , m . typeArguments = new TypeReference [ length ] , 0 , length ) ; m . sourceStart = this . intStack [ this . intPtr -- ] ; m . receiver = new SuperReference ( m . sourceStart , this . endPosition ) ; pushOnExpressionStack ( m ) ; } protected void consumeModifiers ( ) { int savedModifiersSourceStart = this . modifiersSourceStart ; checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; if ( this . modifiersSourceStart >= savedModifiersSourceStart ) { this . modifiersSourceStart = savedModifiersSourceStart ; } pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; } protected void consumeModifiers2 ( ) { this . expressionLengthStack [ this . expressionLengthPtr - 1 ] += this . expressionLengthStack [ this . expressionLengthPtr -- ] ; } protected void consumeMultipleResources ( ) { concatNodeLists ( ) ; } protected void consumeNameArrayType ( ) { pushOnGenericsLengthStack ( 0 ) ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; } protected void consumeNestedMethod ( ) { jumpOverMethodBody ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnIntStack ( this . scanner . currentPosition ) ; consumeOpenBlock ( ) ; } protected void consumeNestedType ( ) { int length = this . nestedMethod . length ; if ( ++ this . nestedType >= length ) { System . arraycopy ( this . nestedMethod , 0 , this . nestedMethod = new int [ length + 30 ] , 0 , length ) ; System . arraycopy ( this . variablesCounter , 0 , this . variablesCounter = new int [ length + 30 ] , 0 , length ) ; } this . nestedMethod [ this . nestedType ] = 0 ; this . variablesCounter [ this . nestedType ] = 0 ; } protected void consumeNormalAnnotation ( ) { NormalAnnotation normalAnnotation = null ; int oldIndex = this . identifierPtr ; TypeReference typeReference = getAnnotationType ( ) ; normalAnnotation = new NormalAnnotation ( typeReference , this . intStack [ this . intPtr -- ] ) ; int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + 1 , normalAnnotation . memberValuePairs = new MemberValuePair [ length ] , 0 , length ) ; } normalAnnotation . declarationSourceEnd = this . rParenPos ; pushOnExpressionStack ( normalAnnotation ) ; if ( this . currentElement != null ) { annotationRecoveryCheckPoint ( normalAnnotation . sourceStart , normalAnnotation . declarationSourceEnd ) ; if ( this . currentElement instanceof RecoveredAnnotation ) { this . currentElement = ( ( RecoveredAnnotation ) this . currentElement ) . addAnnotation ( normalAnnotation , oldIndex ) ; } } if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotation ( normalAnnotation ) ; } this . recordStringLiterals = true ; } protected void consumeOneDimLoop ( ) { this . dimensions ++ ; } protected void consumeOnlySynchronized ( ) { pushOnIntStack ( this . synchronizedBlockSourceStart ) ; resetModifiers ( ) ; this . expressionLengthPtr -- ; } protected void consumeOnlyTypeArguments ( ) { if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; problemReporter ( ) . invalidUsageOfTypeArguments ( ( TypeReference ) this . genericsStack [ this . genericsPtr - length + 1 ] , ( TypeReference ) this . genericsStack [ this . genericsPtr ] ) ; } } protected void consumeOnlyTypeArgumentsForCastExpression ( ) { } protected void consumeOpenBlock ( ) { pushOnIntStack ( this . scanner . startPosition ) ; int stackLength = this . realBlockStack . length ; if ( ++ this . realBlockPtr >= stackLength ) { System . arraycopy ( this . realBlockStack , 0 , this . realBlockStack = new int [ stackLength + StackIncrement ] , 0 , stackLength ) ; } this . realBlockStack [ this . realBlockPtr ] = 0 ; } protected void consumePackageComment ( ) { if ( this . options . sourceLevel >= ClassFileConstants . JDK1_5 ) { checkComment ( ) ; resetModifiers ( ) ; } } protected void consumePackageDeclaration ( ) { ImportReference impt = this . compilationUnit . currentPackage ; this . compilationUnit . javadoc = this . javadoc ; this . javadoc = null ; impt . declarationEnd = this . endStatementPosition ; impt . declarationSourceEnd = flushCommentsDefinedPriorTo ( impt . declarationSourceEnd ) ; } protected void consumePackageDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , ++ this . identifierPtr , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr -- , positions , 0 , length ) ; impt = new ImportReference ( tokens , positions , false , ClassFileConstants . AccDefault ) ; this . compilationUnit . currentPackage = impt ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - 1 ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . javadoc != null ) { impt . declarationSourceStart = this . javadoc . sourceStart ; } if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . restartRecovery = true ; } } protected void consumePackageDeclarationNameWithModifiers ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , ++ this . identifierPtr , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr -- , positions , 0 , length ) ; int packageModifiersSourceStart = this . intStack [ this . intPtr -- ] ; int packageModifiers = this . intStack [ this . intPtr -- ] ; impt = new ImportReference ( tokens , positions , false , packageModifiers ) ; this . compilationUnit . currentPackage = impt ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( this . expressionPtr -= length ) + 1 , impt . annotations = new Annotation [ length ] , 0 , length ) ; impt . declarationSourceStart = packageModifiersSourceStart ; this . intPtr -- ; } else { impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . javadoc != null ) { impt . declarationSourceStart = this . javadoc . sourceStart ; } } if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - 1 ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . restartRecovery = true ; } } protected void consumePostfixExpression ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; } protected void consumePrimaryNoNewArray ( ) { final Expression parenthesizedExpression = this . expressionStack [ this . expressionPtr ] ; updateSourcePosition ( parenthesizedExpression ) ; int numberOfParenthesis = ( parenthesizedExpression . bits & ASTNode . ParenthesizedMASK ) >> ASTNode . ParenthesizedSHIFT ; parenthesizedExpression . bits &= ~ ASTNode . ParenthesizedMASK ; parenthesizedExpression . bits |= ( numberOfParenthesis + 1 ) << ASTNode . ParenthesizedSHIFT ; } protected void consumePrimaryNoNewArrayArrayType ( ) { this . intPtr -- ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( 0 ) ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ) ; } protected void consumePrimaryNoNewArrayName ( ) { this . intPtr -- ; pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( 0 ) ; TypeReference typeReference = getTypeReference ( 0 ) ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , typeReference ) ) ; } protected void consumePrimaryNoNewArrayNameSuper ( ) { pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( 0 ) ; TypeReference typeReference = getTypeReference ( 0 ) ; pushOnExpressionStack ( new QualifiedSuperReference ( typeReference , this . intStack [ this . intPtr -- ] , this . endPosition ) ) ; } protected void consumePrimaryNoNewArrayNameThis ( ) { pushOnGenericsIdentifiersLengthStack ( this . identifierLengthStack [ this . identifierLengthPtr ] ) ; pushOnGenericsLengthStack ( 0 ) ; TypeReference typeReference = getTypeReference ( 0 ) ; pushOnExpressionStack ( new QualifiedThisReference ( typeReference , this . intStack [ this . intPtr -- ] , this . endPosition ) ) ; } protected void consumePrimaryNoNewArrayPrimitiveArrayType ( ) { this . intPtr -- ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ) ; } protected void consumePrimaryNoNewArrayPrimitiveType ( ) { this . intPtr -- ; pushOnExpressionStack ( new ClassLiteralAccess ( this . intStack [ this . intPtr -- ] , getTypeReference ( 0 ) ) ) ; } protected void consumePrimaryNoNewArrayThis ( ) { pushOnExpressionStack ( new ThisReference ( this . intStack [ this . intPtr -- ] , this . endPosition ) ) ; } protected void consumePrimaryNoNewArrayWithName ( ) { pushOnExpressionStack ( getUnspecifiedReferenceOptimized ( ) ) ; final Expression parenthesizedExpression = this . expressionStack [ this . expressionPtr ] ; updateSourcePosition ( parenthesizedExpression ) ; int numberOfParenthesis = ( parenthesizedExpression . bits & ASTNode . ParenthesizedMASK ) >> ASTNode . ParenthesizedSHIFT ; parenthesizedExpression . bits &= ~ ASTNode . ParenthesizedMASK ; parenthesizedExpression . bits |= ( numberOfParenthesis + 1 ) << ASTNode . ParenthesizedSHIFT ; } protected void consumePrimitiveArrayType ( ) { } protected void consumePrimitiveType ( ) { pushOnIntStack ( 0 ) ; } protected void consumePushLeftBrace ( ) { pushOnIntStack ( this . endPosition ) ; } protected void consumePushModifiers ( ) { pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumePushModifiersForHeader ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; pushOnExpressionStackLengthStack ( 0 ) ; } protected void consumePushPosition ( ) { pushOnIntStack ( this . endPosition ) ; } protected void consumePushRealModifiers ( ) { checkComment ( ) ; pushOnIntStack ( this . modifiers ) ; pushOnIntStack ( this . modifiersSourceStart ) ; resetModifiers ( ) ; } protected void consumeQualifiedName ( ) { this . identifierLengthStack [ -- this . identifierLengthPtr ] ++ ; } protected void consumeRecoveryMethodHeaderName ( ) { boolean isAnnotationMethod = false ; if ( this . currentElement instanceof RecoveredType ) { isAnnotationMethod = ( ( ( RecoveredType ) this . currentElement ) . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != 0 ; } else { RecoveredType recoveredType = this . currentElement . enclosingType ( ) ; if ( recoveredType != null ) { isAnnotationMethod = ( recoveredType . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != 0 ; } } consumeMethodHeaderName ( isAnnotationMethod ) ; } protected void consumeRecoveryMethodHeaderNameWithTypeParameters ( ) { boolean isAnnotationMethod = false ; if ( this . currentElement instanceof RecoveredType ) { isAnnotationMethod = ( ( ( RecoveredType ) this . currentElement ) . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != 0 ; } else { RecoveredType recoveredType = this . currentElement . enclosingType ( ) ; if ( recoveredType != null ) { isAnnotationMethod = ( recoveredType . typeDeclaration . modifiers & ClassFileConstants . AccAnnotation ) != 0 ; } } consumeMethodHeaderNameWithTypeParameters ( isAnnotationMethod ) ; } protected void consumeReduceImports ( ) { int length ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + 1 , this . compilationUnit . imports = new ImportReference [ length ] , 0 , length ) ; } } protected void consumeReferenceType ( ) { pushOnIntStack ( 0 ) ; } protected void consumeReferenceType1 ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeReferenceType2 ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeReferenceType3 ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeResourceAsLocalVariableDeclaration ( ) { consumeLocalVariableDeclaration ( ) ; } protected void consumeResourceSpecification ( ) { } protected void consumeResourceOptionalTrailingSemiColon ( boolean punctuated ) { LocalDeclaration localDeclaration = ( LocalDeclaration ) this . astStack [ this . astPtr ] ; if ( punctuated ) { localDeclaration . declarationSourceEnd = this . endStatementPosition ; } } protected void consumeRestoreDiet ( ) { this . dietInt -- ; } protected void consumeRightParen ( ) { pushOnIntStack ( this . rParenPos ) ; } protected void consumeRule ( int act ) { switch ( act ) { case 30 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimitiveType ( ) ; break ; case 44 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeReferenceType ( ) ; break ; case 48 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassOrInterfaceName ( ) ; break ; case 49 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassOrInterface ( ) ; break ; case 50 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeGenericType ( ) ; break ; case 51 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeGenericTypeWithDiamond ( ) ; break ; case 52 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayTypeWithTypeArgumentsName ( ) ; break ; case 53 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimitiveArrayType ( ) ; break ; case 54 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeNameArrayType ( ) ; break ; case 55 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeGenericTypeNameArrayType ( ) ; break ; case 56 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeGenericTypeArrayType ( ) ; break ; case 61 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeQualifiedName ( ) ; break ; case 62 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCompilationUnit ( ) ; break ; case 63 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnit ( ) ; break ; case 64 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnit ( ) ; break ; case 65 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case 66 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case 67 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnit ( ) ; break ; case 68 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case 69 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInternalCompilationUnitWithTypes ( ) ; break ; case 70 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyInternalCompilationUnit ( ) ; break ; case 71 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeReduceImports ( ) ; break ; case 72 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterCompilationUnit ( ) ; break ; case 88 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCatchHeader ( ) ; break ; case 90 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeImportDeclarations ( ) ; break ; case 92 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeDeclarations ( ) ; break ; case 93 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePackageDeclaration ( ) ; break ; case 94 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePackageDeclarationNameWithModifiers ( ) ; break ; case 95 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePackageDeclarationName ( ) ; break ; case 96 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePackageComment ( ) ; break ; case 101 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeImportDeclaration ( ) ; break ; case 102 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSingleTypeImportDeclarationName ( ) ; break ; case 103 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeImportDeclaration ( ) ; break ; case 104 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeImportOnDemandDeclarationName ( ) ; break ; case 107 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyTypeDeclaration ( ) ; break ; case 111 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeModifiers2 ( ) ; break ; case 123 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationAsModifier ( ) ; break ; case 124 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassDeclaration ( ) ; break ; case 125 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassHeader ( ) ; break ; case 126 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeHeaderNameWithTypeParameters ( ) ; break ; case 128 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassHeaderName1 ( ) ; break ; case 129 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassHeaderExtends ( ) ; break ; case 130 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassHeaderImplements ( ) ; break ; case 132 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceTypeList ( ) ; break ; case 133 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceType ( ) ; break ; case 136 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassBodyDeclarations ( ) ; break ; case 140 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassBodyDeclaration ( ) ; break ; case 141 : if ( DEBUG ) { System . out . println ( "Diet ::=" ) ; } consumeDiet ( ) ; break ; case 142 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassBodyDeclaration ( ) ; break ; case 143 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCreateInitializer ( ) ; break ; case 150 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyTypeDeclaration ( ) ; break ; case 153 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFieldDeclaration ( ) ; break ; case 155 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeVariableDeclarators ( ) ; break ; case 158 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterVariable ( ) ; break ; case 159 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExitVariableWithInitialization ( ) ; break ; case 160 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExitVariableWithoutInitialization ( ) ; break ; case 161 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeForceNoDiet ( ) ; break ; case 162 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeRestoreDiet ( ) ; break ; case 167 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodDeclaration ( true ) ; break ; case 168 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodDeclaration ( false ) ; break ; case 169 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeader ( ) ; break ; case 170 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderNameWithTypeParameters ( false ) ; break ; case 171 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderName ( false ) ; break ; case 172 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderRightParen ( ) ; break ; case 173 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderExtendedDims ( ) ; break ; case 174 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderThrowsClause ( ) ; break ; case 175 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConstructorHeader ( ) ; break ; case 176 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConstructorHeaderNameWithTypeParameters ( ) ; break ; case 177 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConstructorHeaderName ( ) ; break ; case 179 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFormalParameterList ( ) ; break ; case 180 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFormalParameter ( false ) ; break ; case 181 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFormalParameter ( true ) ; break ; case 182 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCatchFormalParameter ( ) ; break ; case 183 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCatchType ( ) ; break ; case 184 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnionTypeAsClassType ( ) ; break ; case 185 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnionType ( ) ; break ; case 187 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassTypeList ( ) ; break ; case 188 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassTypeElt ( ) ; break ; case 189 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodBody ( ) ; break ; case 190 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeNestedMethod ( ) ; break ; case 191 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStaticInitializer ( ) ; break ; case 192 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStaticOnly ( ) ; break ; case 193 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConstructorDeclaration ( ) ; break ; case 194 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidConstructorDeclaration ( ) ; break ; case 195 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocation ( 0 , THIS_CALL ) ; break ; case 196 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( 0 , THIS_CALL ) ; break ; case 197 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocation ( 0 , SUPER_CALL ) ; break ; case 198 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( 0 , SUPER_CALL ) ; break ; case 199 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocation ( 1 , SUPER_CALL ) ; break ; case 200 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( 1 , SUPER_CALL ) ; break ; case 201 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocation ( 2 , SUPER_CALL ) ; break ; case 202 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( 2 , SUPER_CALL ) ; break ; case 203 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocation ( 1 , THIS_CALL ) ; break ; case 204 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( 1 , THIS_CALL ) ; break ; case 205 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocation ( 2 , THIS_CALL ) ; break ; case 206 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExplicitConstructorInvocationWithTypeArguments ( 2 , THIS_CALL ) ; break ; case 207 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceDeclaration ( ) ; break ; case 208 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceHeader ( ) ; break ; case 209 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeHeaderNameWithTypeParameters ( ) ; break ; case 211 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceHeaderName1 ( ) ; break ; case 212 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceHeaderExtends ( ) ; break ; case 215 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceMemberDeclarations ( ) ; break ; case 216 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyTypeDeclaration ( ) ; break ; case 218 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidMethodDeclaration ( ) ; break ; case 219 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidConstructorDeclaration ( true ) ; break ; case 220 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidConstructorDeclaration ( false ) ; break ; case 231 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePushLeftBrace ( ) ; break ; case 232 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyArrayInitializer ( ) ; break ; case 233 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayInitializer ( ) ; break ; case 234 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayInitializer ( ) ; break ; case 236 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeVariableInitializers ( ) ; break ; case 237 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBlock ( ) ; break ; case 238 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeOpenBlock ( ) ; break ; case 240 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBlockStatements ( ) ; break ; case 244 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidInterfaceDeclaration ( ) ; break ; case 245 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidAnnotationTypeDeclaration ( ) ; break ; case 246 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInvalidEnumDeclaration ( ) ; break ; case 247 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeLocalVariableDeclarationStatement ( ) ; break ; case 248 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeLocalVariableDeclaration ( ) ; break ; case 249 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeLocalVariableDeclaration ( ) ; break ; case 250 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePushModifiers ( ) ; break ; case 251 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePushModifiersForHeader ( ) ; break ; case 252 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePushRealModifiers ( ) ; break ; case 279 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyStatement ( ) ; break ; case 280 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementLabel ( ) ; break ; case 281 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementLabel ( ) ; break ; case 282 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeLabel ( ) ; break ; case 283 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExpressionStatement ( ) ; break ; case 292 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementIfNoElse ( ) ; break ; case 293 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementIfWithElse ( ) ; break ; case 294 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementIfWithElse ( ) ; break ; case 295 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementSwitch ( ) ; break ; case 296 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptySwitchBlock ( ) ; break ; case 299 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSwitchBlock ( ) ; break ; case 301 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSwitchBlockStatements ( ) ; break ; case 302 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSwitchBlockStatement ( ) ; break ; case 304 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSwitchLabels ( ) ; break ; case 305 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCaseLabel ( ) ; break ; case 306 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeDefaultLabel ( ) ; break ; case 307 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementWhile ( ) ; break ; case 308 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementWhile ( ) ; break ; case 309 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementDo ( ) ; break ; case 310 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementFor ( ) ; break ; case 311 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementFor ( ) ; break ; case 312 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeForInit ( ) ; break ; case 316 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementExpressionList ( ) ; break ; case 317 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSimpleAssertStatement ( ) ; break ; case 318 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssertStatement ( ) ; break ; case 319 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementBreak ( ) ; break ; case 320 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementBreakWithLabel ( ) ; break ; case 321 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementContinue ( ) ; break ; case 322 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementContinueWithLabel ( ) ; break ; case 323 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementReturn ( ) ; break ; case 324 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementThrow ( ) ; break ; case 325 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementSynchronized ( ) ; break ; case 326 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeOnlySynchronized ( ) ; break ; case 327 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementTry ( false , false ) ; break ; case 328 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementTry ( true , false ) ; break ; case 329 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementTry ( false , true ) ; break ; case 330 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementTry ( true , true ) ; break ; case 331 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeResourceSpecification ( ) ; break ; case 332 : if ( DEBUG ) { System . out . println ( ";opt ::=" ) ; } consumeResourceOptionalTrailingSemiColon ( false ) ; break ; case 333 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeResourceOptionalTrailingSemiColon ( true ) ; break ; case 334 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSingleResource ( ) ; break ; case 335 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMultipleResources ( ) ; break ; case 336 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeResourceOptionalTrailingSemiColon ( true ) ; break ; case 337 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeResourceAsLocalVariableDeclaration ( ) ; break ; case 338 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeResourceAsLocalVariableDeclaration ( ) ; break ; case 340 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExitTryBlock ( ) ; break ; case 342 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCatches ( ) ; break ; case 343 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStatementCatch ( ) ; break ; case 345 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeLeftParen ( ) ; break ; case 346 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeRightParen ( ) ; break ; case 351 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayThis ( ) ; break ; case 352 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArray ( ) ; break ; case 353 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayWithName ( ) ; break ; case 356 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayNameThis ( ) ; break ; case 357 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayNameSuper ( ) ; break ; case 358 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayName ( ) ; break ; case 359 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayArrayType ( ) ; break ; case 360 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayPrimitiveArrayType ( ) ; break ; case 361 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePrimaryNoNewArrayPrimitiveType ( ) ; break ; case 364 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAllocationHeader ( ) ; break ; case 365 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpressionWithTypeArguments ( ) ; break ; case 366 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpression ( ) ; break ; case 367 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) ; break ; case 368 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpressionQualified ( ) ; break ; case 369 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpressionQualified ( ) ; break ; case 370 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpressionQualifiedWithTypeArguments ( ) ; break ; case 371 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterInstanceCreationArgumentList ( ) ; break ; case 372 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassInstanceCreationExpressionName ( ) ; break ; case 373 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassBodyopt ( ) ; break ; case 375 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterAnonymousClassBody ( false ) ; break ; case 376 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassBodyopt ( ) ; break ; case 378 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterAnonymousClassBody ( true ) ; break ; case 380 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArgumentList ( ) ; break ; case 381 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayCreationHeader ( ) ; break ; case 382 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayCreationHeader ( ) ; break ; case 383 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayCreationExpressionWithoutInitializer ( ) ; break ; case 384 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayCreationExpressionWithInitializer ( ) ; break ; case 385 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayCreationExpressionWithoutInitializer ( ) ; break ; case 386 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayCreationExpressionWithInitializer ( ) ; break ; case 388 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeDimWithOrWithOutExprs ( ) ; break ; case 390 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeDimWithOrWithOutExpr ( ) ; break ; case 391 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeDims ( ) ; break ; case 394 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeOneDimLoop ( ) ; break ; case 395 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFieldAccess ( false ) ; break ; case 396 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFieldAccess ( true ) ; break ; case 397 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodInvocationName ( ) ; break ; case 398 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodInvocationNameWithTypeArguments ( ) ; break ; case 399 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodInvocationPrimaryWithTypeArguments ( ) ; break ; case 400 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodInvocationPrimary ( ) ; break ; case 401 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodInvocationSuperWithTypeArguments ( ) ; break ; case 402 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodInvocationSuper ( ) ; break ; case 403 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayAccess ( true ) ; break ; case 404 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayAccess ( false ) ; break ; case 405 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArrayAccess ( false ) ; break ; case 407 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePostfixExpression ( ) ; break ; case 410 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . PLUS , true ) ; break ; case 411 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . MINUS , true ) ; break ; case 412 : if ( DEBUG ) { System . out . println ( "" ) ; } consumePushPosition ( ) ; break ; case 415 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . PLUS ) ; break ; case 416 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . MINUS ) ; break ; case 418 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . PLUS , false ) ; break ; case 419 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . MINUS , false ) ; break ; case 421 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . TWIDDLE ) ; break ; case 422 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . NOT ) ; break ; case 424 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCastExpressionWithPrimitiveType ( ) ; break ; case 425 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCastExpressionWithGenericsArray ( ) ; break ; case 426 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCastExpressionWithQualifiedGenericsArray ( ) ; break ; case 427 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCastExpressionLL1 ( ) ; break ; case 428 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeCastExpressionWithNameArray ( ) ; break ; case 429 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeOnlyTypeArgumentsForCastExpression ( ) ; break ; case 430 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInsideCastExpression ( ) ; break ; case 431 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInsideCastExpressionLL1 ( ) ; break ; case 432 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInsideCastExpressionWithQualifiedGenerics ( ) ; break ; case 434 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . MULTIPLY ) ; break ; case 435 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . DIVIDE ) ; break ; case 436 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . REMAINDER ) ; break ; case 438 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . PLUS ) ; break ; case 439 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . MINUS ) ; break ; case 441 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . LEFT_SHIFT ) ; break ; case 442 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . RIGHT_SHIFT ) ; break ; case 443 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . UNSIGNED_RIGHT_SHIFT ) ; break ; case 445 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . LESS ) ; break ; case 446 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . GREATER ) ; break ; case 447 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . LESS_EQUAL ) ; break ; case 448 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . GREATER_EQUAL ) ; break ; case 450 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInstanceOfExpression ( ) ; break ; case 452 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEqualityExpression ( OperatorIds . EQUAL_EQUAL ) ; break ; case 453 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEqualityExpression ( OperatorIds . NOT_EQUAL ) ; break ; case 455 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . AND ) ; break ; case 457 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . XOR ) ; break ; case 459 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . OR ) ; break ; case 461 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . AND_AND ) ; break ; case 463 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . OR_OR ) ; break ; case 465 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConditionalExpression ( OperatorIds . QUESTIONCOLON ) ; break ; case 468 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignment ( ) ; break ; case 470 : if ( DEBUG ) { System . out . println ( "" ) ; } ignoreExpressionAssignment ( ) ; break ; case 471 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( EQUAL ) ; break ; case 472 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( MULTIPLY ) ; break ; case 473 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( DIVIDE ) ; break ; case 474 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( REMAINDER ) ; break ; case 475 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( PLUS ) ; break ; case 476 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( MINUS ) ; break ; case 477 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( LEFT_SHIFT ) ; break ; case 478 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( RIGHT_SHIFT ) ; break ; case 479 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( UNSIGNED_RIGHT_SHIFT ) ; break ; case 480 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( AND ) ; break ; case 481 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( XOR ) ; break ; case 482 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAssignmentOperator ( OR ) ; break ; case 486 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyExpression ( ) ; break ; case 491 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyClassBodyDeclarationsopt ( ) ; break ; case 492 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeClassBodyDeclarationsopt ( ) ; break ; case 493 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeDefaultModifiers ( ) ; break ; case 494 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeModifiers ( ) ; break ; case 495 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyBlockStatementsopt ( ) ; break ; case 497 : if ( DEBUG ) { System . out . println ( "Dimsopt ::=" ) ; } consumeEmptyDimsopt ( ) ; break ; case 499 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyArgumentListopt ( ) ; break ; case 503 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeFormalParameterListopt ( ) ; break ; case 507 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyInterfaceMemberDeclarationsopt ( ) ; break ; case 508 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInterfaceMemberDeclarationsopt ( ) ; break ; case 509 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeNestedType ( ) ; break ; case 510 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyForInitopt ( ) ; break ; case 512 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyForUpdateopt ( ) ; break ; case 516 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyCatchesopt ( ) ; break ; case 518 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumDeclaration ( ) ; break ; case 519 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumHeader ( ) ; break ; case 520 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumHeaderName ( ) ; break ; case 521 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumHeaderNameWithTypeParameters ( ) ; break ; case 522 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumBodyNoConstants ( ) ; break ; case 523 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumBodyNoConstants ( ) ; break ; case 524 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumBodyWithConstants ( ) ; break ; case 525 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumBodyWithConstants ( ) ; break ; case 527 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumConstants ( ) ; break ; case 528 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumConstantHeaderName ( ) ; break ; case 529 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumConstantHeader ( ) ; break ; case 530 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumConstantWithClassBody ( ) ; break ; case 531 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumConstantNoClassBody ( ) ; break ; case 532 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeArguments ( ) ; break ; case 533 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyArguments ( ) ; break ; case 535 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnumDeclarations ( ) ; break ; case 536 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyEnumDeclarations ( ) ; break ; case 538 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnhancedForStatement ( ) ; break ; case 539 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnhancedForStatement ( ) ; break ; case 540 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnhancedForStatementHeaderInit ( false ) ; break ; case 541 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnhancedForStatementHeaderInit ( true ) ; break ; case 542 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnhancedForStatementHeader ( ) ; break ; case 543 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeImportDeclaration ( ) ; break ; case 544 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSingleStaticImportDeclarationName ( ) ; break ; case 545 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeImportDeclaration ( ) ; break ; case 546 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeStaticImportOnDemandDeclarationName ( ) ; break ; case 547 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArguments ( ) ; break ; case 548 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeOnlyTypeArguments ( ) ; break ; case 550 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgumentList1 ( ) ; break ; case 552 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgumentList ( ) ; break ; case 553 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgument ( ) ; break ; case 557 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeReferenceType1 ( ) ; break ; case 558 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgumentReferenceType1 ( ) ; break ; case 560 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgumentList2 ( ) ; break ; case 563 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeReferenceType2 ( ) ; break ; case 564 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgumentReferenceType2 ( ) ; break ; case 566 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeArgumentList3 ( ) ; break ; case 569 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeReferenceType3 ( ) ; break ; case 570 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard ( ) ; break ; case 571 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardWithBounds ( ) ; break ; case 572 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBoundsExtends ( ) ; break ; case 573 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBoundsSuper ( ) ; break ; case 574 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard1 ( ) ; break ; case 575 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard1WithBounds ( ) ; break ; case 576 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBounds1Extends ( ) ; break ; case 577 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBounds1Super ( ) ; break ; case 578 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard2 ( ) ; break ; case 579 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard2WithBounds ( ) ; break ; case 580 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBounds2Extends ( ) ; break ; case 581 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBounds2Super ( ) ; break ; case 582 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard3 ( ) ; break ; case 583 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcard3WithBounds ( ) ; break ; case 584 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBounds3Extends ( ) ; break ; case 585 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeWildcardBounds3Super ( ) ; break ; case 586 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameterHeader ( ) ; break ; case 587 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameters ( ) ; break ; case 589 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameterList ( ) ; break ; case 591 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameterWithExtends ( ) ; break ; case 592 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameterWithExtendsAndBounds ( ) ; break ; case 594 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAdditionalBoundList ( ) ; break ; case 595 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAdditionalBound ( ) ; break ; case 597 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameterList1 ( ) ; break ; case 598 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameter1 ( ) ; break ; case 599 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameter1WithExtends ( ) ; break ; case 600 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeTypeParameter1WithExtendsAndBounds ( ) ; break ; case 602 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAdditionalBoundList1 ( ) ; break ; case 603 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAdditionalBound1 ( ) ; break ; case 609 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . PLUS ) ; break ; case 610 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . MINUS ) ; break ; case 613 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . TWIDDLE ) ; break ; case 614 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeUnaryExpression ( OperatorIds . NOT ) ; break ; case 617 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . MULTIPLY ) ; break ; case 618 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . MULTIPLY ) ; break ; case 619 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . DIVIDE ) ; break ; case 620 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . DIVIDE ) ; break ; case 621 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . REMAINDER ) ; break ; case 622 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . REMAINDER ) ; break ; case 624 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . PLUS ) ; break ; case 625 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . PLUS ) ; break ; case 626 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . MINUS ) ; break ; case 627 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . MINUS ) ; break ; case 629 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . LEFT_SHIFT ) ; break ; case 630 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . LEFT_SHIFT ) ; break ; case 631 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . RIGHT_SHIFT ) ; break ; case 632 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . RIGHT_SHIFT ) ; break ; case 633 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . UNSIGNED_RIGHT_SHIFT ) ; break ; case 634 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . UNSIGNED_RIGHT_SHIFT ) ; break ; case 636 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . LESS ) ; break ; case 637 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . LESS ) ; break ; case 638 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . GREATER ) ; break ; case 639 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . GREATER ) ; break ; case 640 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . LESS_EQUAL ) ; break ; case 641 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . LESS_EQUAL ) ; break ; case 642 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . GREATER_EQUAL ) ; break ; case 643 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . GREATER_EQUAL ) ; break ; case 645 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInstanceOfExpressionWithName ( ) ; break ; case 646 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeInstanceOfExpression ( ) ; break ; case 648 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEqualityExpression ( OperatorIds . EQUAL_EQUAL ) ; break ; case 649 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEqualityExpressionWithName ( OperatorIds . EQUAL_EQUAL ) ; break ; case 650 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEqualityExpression ( OperatorIds . NOT_EQUAL ) ; break ; case 651 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEqualityExpressionWithName ( OperatorIds . NOT_EQUAL ) ; break ; case 653 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . AND ) ; break ; case 654 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . AND ) ; break ; case 656 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . XOR ) ; break ; case 657 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . XOR ) ; break ; case 659 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . OR ) ; break ; case 660 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . OR ) ; break ; case 662 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . AND_AND ) ; break ; case 663 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . AND_AND ) ; break ; case 665 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpression ( OperatorIds . OR_OR ) ; break ; case 666 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeBinaryExpressionWithName ( OperatorIds . OR_OR ) ; break ; case 668 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConditionalExpression ( OperatorIds . QUESTIONCOLON ) ; break ; case 669 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeConditionalExpressionWithName ( OperatorIds . QUESTIONCOLON ) ; break ; case 673 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeDeclarationHeaderName ( ) ; break ; case 674 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) ; break ; case 675 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters ( ) ; break ; case 676 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeDeclarationHeaderName ( ) ; break ; case 677 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeDeclarationHeader ( ) ; break ; case 678 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeDeclaration ( ) ; break ; case 680 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyAnnotationTypeMemberDeclarationsopt ( ) ; break ; case 681 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeMemberDeclarationsopt ( ) ; break ; case 683 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeMemberDeclarations ( ) ; break ; case 684 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderNameWithTypeParameters ( true ) ; break ; case 685 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderName ( true ) ; break ; case 686 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyMethodHeaderDefaultValue ( ) ; break ; case 687 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeaderDefaultValue ( ) ; break ; case 688 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeader ( ) ; break ; case 689 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationTypeMemberDeclaration ( ) ; break ; case 697 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeAnnotationName ( ) ; break ; case 698 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeNormalAnnotation ( ) ; break ; case 699 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyMemberValuePairsopt ( ) ; break ; case 702 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMemberValuePairs ( ) ; break ; case 703 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMemberValuePair ( ) ; break ; case 704 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterMemberValue ( ) ; break ; case 705 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeExitMemberValue ( ) ; break ; case 707 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMemberValueAsName ( ) ; break ; case 710 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMemberValueArrayInitializer ( ) ; break ; case 711 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMemberValueArrayInitializer ( ) ; break ; case 712 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyMemberValueArrayInitializer ( ) ; break ; case 713 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEmptyMemberValueArrayInitializer ( ) ; break ; case 714 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeEnterMemberValueArrayInitializer ( ) ; break ; case 716 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMemberValues ( ) ; break ; case 717 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMarkerAnnotation ( ) ; break ; case 718 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSingleMemberAnnotationMemberValue ( ) ; break ; case 719 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeSingleMemberAnnotation ( ) ; break ; case 720 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeRecoveryMethodHeaderNameWithTypeParameters ( ) ; break ; case 721 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeRecoveryMethodHeaderName ( ) ; break ; case 722 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeader ( ) ; break ; case 723 : if ( DEBUG ) { System . out . println ( "" ) ; } consumeMethodHeader ( ) ; break ; } } protected void consumeEnterInstanceCreationArgumentList ( ) { this . shouldDeferRecovery = true ; } protected void consumeSimpleAssertStatement ( ) { this . expressionLengthPtr -- ; pushOnAstStack ( new AssertStatement ( this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeSingleMemberAnnotation ( ) { SingleMemberAnnotation singleMemberAnnotation = null ; int oldIndex = this . identifierPtr ; TypeReference typeReference = getAnnotationType ( ) ; singleMemberAnnotation = new SingleMemberAnnotation ( typeReference , this . intStack [ this . intPtr -- ] ) ; singleMemberAnnotation . memberValue = this . expressionStack [ this . expressionPtr -- ] ; this . expressionLengthPtr -- ; singleMemberAnnotation . declarationSourceEnd = this . rParenPos ; pushOnExpressionStack ( singleMemberAnnotation ) ; if ( this . currentElement != null ) { annotationRecoveryCheckPoint ( singleMemberAnnotation . sourceStart , singleMemberAnnotation . declarationSourceEnd ) ; if ( this . currentElement instanceof RecoveredAnnotation ) { this . currentElement = ( ( RecoveredAnnotation ) this . currentElement ) . addAnnotation ( singleMemberAnnotation , oldIndex ) ; } } if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { problemReporter ( ) . invalidUsageOfAnnotation ( singleMemberAnnotation ) ; } this . recordStringLiterals = true ; } protected void consumeSingleMemberAnnotationMemberValue ( ) { if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; recoveredAnnotation . setKind ( RecoveredAnnotation . SINGLE_MEMBER ) ; } } protected void consumeSingleResource ( ) { } protected void consumeSingleStaticImportDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , false , ClassFileConstants . AccStatic ) ) ; this . modifiers = ClassFileConstants . AccDefault ; this . modifiersSourceStart = - 1 ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - 1 ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { impt . modifiers = ClassFileConstants . AccDefault ; problemReporter ( ) . invalidUsageOfStaticImports ( impt ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . currentElement = this . currentElement . add ( impt , 0 ) ; this . lastIgnoredToken = - 1 ; this . restartRecovery = true ; } } protected void consumeSingleTypeImportDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , false , ClassFileConstants . AccDefault ) ) ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - 1 ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . currentElement = this . currentElement . add ( impt , 0 ) ; this . lastIgnoredToken = - 1 ; this . restartRecovery = true ; } } protected void consumeStatementBreak ( ) { pushOnAstStack ( new BreakStatement ( null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; if ( this . pendingRecoveredType != null ) { if ( this . pendingRecoveredType . allocation == null && this . endPosition <= this . pendingRecoveredType . declarationSourceEnd ) { this . astStack [ this . astPtr ] = this . pendingRecoveredType ; this . pendingRecoveredType = null ; return ; } this . pendingRecoveredType = null ; } } protected void consumeStatementBreakWithLabel ( ) { pushOnAstStack ( new BreakStatement ( this . identifierStack [ this . identifierPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; this . identifierLengthPtr -- ; } protected void consumeStatementCatch ( ) { this . astLengthPtr -- ; this . listLength = 0 ; } protected void consumeStatementContinue ( ) { pushOnAstStack ( new ContinueStatement ( null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } protected void consumeStatementContinueWithLabel ( ) { pushOnAstStack ( new ContinueStatement ( this . identifierStack [ this . identifierPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; this . identifierLengthPtr -- ; } protected void consumeStatementDo ( ) { this . intPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr ] ; this . expressionLengthPtr -- ; this . astStack [ this . astPtr ] = new DoStatement ( this . expressionStack [ this . expressionPtr -- ] , statement , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStatementExpressionList ( ) { concatExpressionLists ( ) ; } protected void consumeStatementFor ( ) { int length ; Expression cond = null ; Statement [ ] inits , updates ; boolean scope = true ; this . astLengthPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr -- ] ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) == 0 ) { updates = null ; } else { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , updates = new Statement [ length ] , 0 , length ) ; } if ( this . expressionLengthStack [ this . expressionLengthPtr -- ] != 0 ) cond = this . expressionStack [ this . expressionPtr -- ] ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) == 0 ) { inits = null ; scope = false ; } else { if ( length == - 1 ) { scope = false ; length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ; this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , inits = new Statement [ length ] , 0 , length ) ; } else { this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + 1 , inits = new Statement [ length ] , 0 , length ) ; } } pushOnAstStack ( new ForStatement ( inits , cond , updates , statement , scope , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } protected void consumeStatementIfNoElse ( ) { this . expressionLengthPtr -- ; Statement thenStatement = ( Statement ) this . astStack [ this . astPtr ] ; this . astStack [ this . astPtr ] = new IfStatement ( this . expressionStack [ this . expressionPtr -- ] , thenStatement , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStatementIfWithElse ( ) { this . expressionLengthPtr -- ; this . astLengthPtr -- ; this . astStack [ -- this . astPtr ] = new IfStatement ( this . expressionStack [ this . expressionPtr -- ] , ( Statement ) this . astStack [ this . astPtr ] , ( Statement ) this . astStack [ this . astPtr + 1 ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStatementLabel ( ) { Statement statement = ( Statement ) this . astStack [ this . astPtr ] ; this . astStack [ this . astPtr ] = new LabeledStatement ( this . identifierStack [ this . identifierPtr ] , statement , this . identifierPositionStack [ this . identifierPtr -- ] , this . endStatementPosition ) ; this . identifierLengthPtr -- ; } protected void consumeStatementReturn ( ) { if ( this . expressionLengthStack [ this . expressionLengthPtr -- ] != 0 ) { pushOnAstStack ( new ReturnStatement ( this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } else { pushOnAstStack ( new ReturnStatement ( null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } } protected void consumeStatementSwitch ( ) { int length ; SwitchStatement switchStatement = new SwitchStatement ( ) ; this . expressionLengthPtr -- ; switchStatement . expression = this . expressionStack [ this . expressionPtr -- ] ; if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { this . astPtr -= length ; System . arraycopy ( this . astStack , this . astPtr + 1 , switchStatement . statements = new Statement [ length ] , 0 , length ) ; } switchStatement . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; pushOnAstStack ( switchStatement ) ; switchStatement . blockStart = this . intStack [ this . intPtr -- ] ; switchStatement . sourceStart = this . intStack [ this . intPtr -- ] ; switchStatement . sourceEnd = this . endStatementPosition ; if ( length == 0 && ! containsComment ( switchStatement . blockStart , switchStatement . sourceEnd ) ) { switchStatement . bits |= ASTNode . UndocumentedEmptyBlock ; } } protected void consumeStatementSynchronized ( ) { if ( this . astLengthStack [ this . astLengthPtr ] == 0 ) { this . astLengthStack [ this . astLengthPtr ] = 1 ; this . expressionLengthPtr -- ; this . astStack [ ++ this . astPtr ] = new SynchronizedStatement ( this . expressionStack [ this . expressionPtr -- ] , null , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } else { this . expressionLengthPtr -- ; this . astStack [ this . astPtr ] = new SynchronizedStatement ( this . expressionStack [ this . expressionPtr -- ] , ( Block ) this . astStack [ this . astPtr ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } resetModifiers ( ) ; } protected void consumeStatementThrow ( ) { this . expressionLengthPtr -- ; pushOnAstStack ( new ThrowStatement ( this . expressionStack [ this . expressionPtr -- ] , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ) ; } protected void consumeStatementTry ( boolean withFinally , boolean hasResources ) { int length ; TryStatement tryStmt = new TryStatement ( ) ; if ( withFinally ) { this . astLengthPtr -- ; tryStmt . finallyBlock = ( Block ) this . astStack [ this . astPtr -- ] ; } if ( ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { if ( length == 1 ) { tryStmt . catchBlocks = new Block [ ] { ( Block ) this . astStack [ this . astPtr -- ] } ; tryStmt . catchArguments = new Argument [ ] { ( Argument ) this . astStack [ this . astPtr -- ] } ; } else { Block [ ] bks = ( tryStmt . catchBlocks = new Block [ length ] ) ; Argument [ ] args = ( tryStmt . catchArguments = new Argument [ length ] ) ; while ( length -- > 0 ) { bks [ length ] = ( Block ) this . astStack [ this . astPtr -- ] ; args [ length ] = ( Argument ) this . astStack [ this . astPtr -- ] ; } } } this . astLengthPtr -- ; tryStmt . tryBlock = ( Block ) this . astStack [ this . astPtr -- ] ; if ( hasResources ) { length = this . astLengthStack [ this . astLengthPtr -- ] ; LocalDeclaration [ ] resources = new LocalDeclaration [ length ] ; System . arraycopy ( this . astStack , ( this . astPtr -= length ) + 1 , resources , 0 , length ) ; tryStmt . resources = resources ; if ( this . options . sourceLevel < ClassFileConstants . JDK1_7 ) { problemReporter ( ) . autoManagedResourcesNotBelow17 ( resources ) ; } } tryStmt . sourceEnd = this . endStatementPosition ; tryStmt . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnAstStack ( tryStmt ) ; } protected void consumeStatementWhile ( ) { this . expressionLengthPtr -- ; Statement statement = ( Statement ) this . astStack [ this . astPtr ] ; this . astStack [ this . astPtr ] = new WhileStatement ( this . expressionStack [ this . expressionPtr -- ] , statement , this . intStack [ this . intPtr -- ] , this . endStatementPosition ) ; } protected void consumeStaticImportOnDemandDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , true , ClassFileConstants . AccStatic ) ) ; impt . trailingStarPosition = this . intStack [ this . intPtr -- ] ; this . modifiers = ClassFileConstants . AccDefault ; this . modifiersSourceStart = - 1 ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - 1 ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { impt . modifiers = ClassFileConstants . AccDefault ; problemReporter ( ) . invalidUsageOfStaticImports ( impt ) ; } if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . currentElement = this . currentElement . add ( impt , 0 ) ; this . lastIgnoredToken = - 1 ; this . restartRecovery = true ; } } protected void consumeStaticInitializer ( ) { Block block = ( Block ) this . astStack [ this . astPtr ] ; if ( this . diet ) block . bits &= ~ ASTNode . UndocumentedEmptyBlock ; Initializer initializer = new Initializer ( block , ClassFileConstants . AccStatic ) ; this . astStack [ this . astPtr ] = initializer ; initializer . sourceEnd = this . endStatementPosition ; initializer . declarationSourceEnd = flushCommentsDefinedPriorTo ( this . endStatementPosition ) ; this . nestedMethod [ this . nestedType ] -- ; initializer . declarationSourceStart = this . intStack [ this . intPtr -- ] ; initializer . bodyStart = this . intStack [ this . intPtr -- ] ; initializer . bodyEnd = this . endPosition ; initializer . javadoc = this . javadoc ; this . javadoc = null ; if ( this . currentElement != null ) { this . lastCheckPoint = initializer . declarationSourceEnd ; this . currentElement = this . currentElement . add ( initializer , 0 ) ; this . lastIgnoredToken = - 1 ; } } protected void consumeStaticOnly ( ) { int savedModifiersSourceStart = this . modifiersSourceStart ; checkComment ( ) ; if ( this . modifiersSourceStart >= savedModifiersSourceStart ) { this . modifiersSourceStart = savedModifiersSourceStart ; } pushOnIntStack ( this . scanner . currentPosition ) ; pushOnIntStack ( this . modifiersSourceStart >= 0 ? this . modifiersSourceStart : this . scanner . startPosition ) ; jumpOverMethodBody ( ) ; this . nestedMethod [ this . nestedType ] ++ ; resetModifiers ( ) ; this . expressionLengthPtr -- ; if ( this . currentElement != null ) { this . recoveredStaticInitializerStart = this . intStack [ this . intPtr ] ; } } protected void consumeSwitchBlock ( ) { concatNodeLists ( ) ; } protected void consumeSwitchBlockStatement ( ) { concatNodeLists ( ) ; } protected void consumeSwitchBlockStatements ( ) { concatNodeLists ( ) ; } protected void consumeSwitchLabels ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeToken ( int type ) { switch ( type ) { case TokenNameIdentifier : pushIdentifier ( ) ; if ( this . scanner . useAssertAsAnIndentifier && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { long positions = this . identifierPositionStack [ this . identifierPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . useAssertAsAnIdentifier ( ( int ) ( positions >>> 32 ) , ( int ) positions ) ; } if ( this . scanner . useEnumAsAnIndentifier && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { long positions = this . identifierPositionStack [ this . identifierPtr ] ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . useEnumAsAnIdentifier ( ( int ) ( positions >>> 32 ) , ( int ) positions ) ; } break ; case TokenNameinterface : pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameabstract : checkAndSetModifiers ( ClassFileConstants . AccAbstract ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamestrictfp : checkAndSetModifiers ( ClassFileConstants . AccStrictfp ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamefinal : checkAndSetModifiers ( ClassFileConstants . AccFinal ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamenative : checkAndSetModifiers ( ClassFileConstants . AccNative ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNameprivate : checkAndSetModifiers ( ClassFileConstants . AccPrivate ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNameprotected : checkAndSetModifiers ( ClassFileConstants . AccProtected ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamepublic : checkAndSetModifiers ( ClassFileConstants . AccPublic ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNametransient : checkAndSetModifiers ( ClassFileConstants . AccTransient ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamevolatile : checkAndSetModifiers ( ClassFileConstants . AccVolatile ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamestatic : checkAndSetModifiers ( ClassFileConstants . AccStatic ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamesynchronized : this . synchronizedBlockSourceStart = this . scanner . startPosition ; checkAndSetModifiers ( ClassFileConstants . AccSynchronized ) ; pushOnExpressionStackLengthStack ( 0 ) ; break ; case TokenNamevoid : pushIdentifier ( - T_void ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameboolean : pushIdentifier ( - T_boolean ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamebyte : pushIdentifier ( - T_byte ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamechar : pushIdentifier ( - T_char ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamedouble : pushIdentifier ( - T_double ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamefloat : pushIdentifier ( - T_float ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameint : pushIdentifier ( - T_int ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamelong : pushIdentifier ( - T_long ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameshort : pushIdentifier ( - T_short ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameIntegerLiteral : pushOnExpressionStack ( IntLiteral . buildIntLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNameLongLiteral : pushOnExpressionStack ( LongLiteral . buildLongLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNameFloatingPointLiteral : pushOnExpressionStack ( new FloatLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNameDoubleLiteral : pushOnExpressionStack ( new DoubleLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNameCharacterLiteral : pushOnExpressionStack ( new CharLiteral ( this . scanner . getCurrentTokenSource ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNameStringLiteral : StringLiteral stringLiteral ; if ( this . recordStringLiterals && this . checkExternalizeStrings && this . lastPosistion < this . scanner . currentPosition && ! this . statementRecoveryActivated ) { stringLiteral = createStringLiteral ( this . scanner . getCurrentTokenSourceString ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 , Util . getLineNumber ( this . scanner . startPosition , this . scanner . lineEnds , 0 , this . scanner . linePtr ) ) ; this . compilationUnit . recordStringLiteral ( stringLiteral , this . currentElement != null ) ; } else { stringLiteral = createStringLiteral ( this . scanner . getCurrentTokenSourceString ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 , 0 ) ; } pushOnExpressionStack ( stringLiteral ) ; break ; case TokenNamefalse : pushOnExpressionStack ( new FalseLiteral ( this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNametrue : pushOnExpressionStack ( new TrueLiteral ( this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNamenull : pushOnExpressionStack ( new NullLiteral ( this . scanner . startPosition , this . scanner . currentPosition - 1 ) ) ; break ; case TokenNamesuper : case TokenNamethis : this . endPosition = this . scanner . currentPosition - 1 ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameassert : case TokenNameimport : case TokenNamepackage : case TokenNamethrow : case TokenNamedo : case TokenNameif : case TokenNamefor : case TokenNameswitch : case TokenNametry : case TokenNamewhile : case TokenNamebreak : case TokenNamecontinue : case TokenNamereturn : case TokenNamecase : pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamenew : resetModifiers ( ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameclass : pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameenum : pushOnIntStack ( this . scanner . currentPosition - 1 ) ; pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNamedefault : pushOnIntStack ( this . scanner . startPosition ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; break ; case TokenNameRBRACKET : this . endPosition = this . scanner . startPosition ; this . endStatementPosition = this . scanner . currentPosition - 1 ; break ; case TokenNameLBRACE : this . endStatementPosition = this . scanner . currentPosition - 1 ; case TokenNamePLUS : case TokenNameMINUS : case TokenNameNOT : case TokenNameTWIDDLE : this . endPosition = this . scanner . startPosition ; break ; case TokenNamePLUS_PLUS : case TokenNameMINUS_MINUS : this . endPosition = this . scanner . startPosition ; this . endStatementPosition = this . scanner . currentPosition - 1 ; break ; case TokenNameRBRACE : case TokenNameSEMICOLON : this . endStatementPosition = this . scanner . currentPosition - 1 ; this . endPosition = this . scanner . startPosition - 1 ; break ; case TokenNameRPAREN : this . rParenPos = this . scanner . currentPosition - 1 ; break ; case TokenNameLPAREN : this . lParenPos = this . scanner . startPosition ; break ; case TokenNameAT : pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameQUESTION : pushOnIntStack ( this . scanner . startPosition ) ; pushOnIntStack ( this . scanner . currentPosition - 1 ) ; break ; case TokenNameLESS : pushOnIntStack ( this . scanner . startPosition ) ; break ; case TokenNameELLIPSIS : pushOnIntStack ( this . scanner . currentPosition - 1 ) ; break ; case TokenNameEQUAL : if ( this . currentElement != null && this . currentElement instanceof RecoveredAnnotation ) { RecoveredAnnotation recoveredAnnotation = ( RecoveredAnnotation ) this . currentElement ; if ( recoveredAnnotation . memberValuPairEqualEnd == - 1 ) { recoveredAnnotation . memberValuPairEqualEnd = this . scanner . currentPosition - 1 ; } } break ; case TokenNameMULTIPLY : pushOnIntStack ( this . scanner . currentPosition - 1 ) ; break ; } } protected void consumeTypeArgument ( ) { pushOnGenericsStack ( getTypeReference ( this . intStack [ this . intPtr -- ] ) ) ; } protected void consumeTypeArgumentList ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentList1 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentList2 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentList3 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeArgumentReferenceType1 ( ) { concatGenericsLists ( ) ; pushOnGenericsStack ( getTypeReference ( 0 ) ) ; this . intPtr -- ; } protected void consumeTypeArgumentReferenceType2 ( ) { concatGenericsLists ( ) ; pushOnGenericsStack ( getTypeReference ( 0 ) ) ; this . intPtr -- ; } protected void consumeTypeArguments ( ) { concatGenericsLists ( ) ; this . intPtr -- ; if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; problemReporter ( ) . invalidUsageOfTypeArguments ( ( TypeReference ) this . genericsStack [ this . genericsPtr - length + 1 ] , ( TypeReference ) this . genericsStack [ this . genericsPtr ] ) ; } } protected void consumeTypeDeclarations ( ) { concatNodeLists ( ) ; } protected void consumeTypeHeaderNameWithTypeParameters ( ) { TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; int length = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; this . genericsPtr -= length ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , typeDecl . typeParameters = new TypeParameter [ length ] , 0 , length ) ; typeDecl . bodyStart = typeDecl . typeParameters [ length - 1 ] . declarationSourceEnd + 1 ; this . listTypeParameterLength = 0 ; if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType ) { RecoveredType recoveredType = ( RecoveredType ) this . currentElement ; recoveredType . pendingTypeParameters = null ; this . lastCheckPoint = typeDecl . bodyStart ; } else { this . lastCheckPoint = typeDecl . bodyStart ; this . currentElement = this . currentElement . add ( typeDecl , 0 ) ; this . lastIgnoredToken = - 1 ; } } } protected void consumeTypeImportOnDemandDeclarationName ( ) { ImportReference impt ; int length ; char [ ] [ ] tokens = new char [ length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; pushOnAstStack ( impt = new ImportReference ( tokens , positions , true , ClassFileConstants . AccDefault ) ) ; impt . trailingStarPosition = this . intStack [ this . intPtr -- ] ; if ( this . currentToken == TokenNameSEMICOLON ) { impt . declarationSourceEnd = this . scanner . currentPosition - 1 ; } else { impt . declarationSourceEnd = impt . sourceEnd ; } impt . declarationEnd = impt . declarationSourceEnd ; impt . declarationSourceStart = this . intStack [ this . intPtr -- ] ; if ( this . currentElement != null ) { this . lastCheckPoint = impt . declarationSourceEnd + 1 ; this . currentElement = this . currentElement . add ( impt , 0 ) ; this . lastIgnoredToken = - 1 ; this . restartRecovery = true ; } } protected void consumeTypeParameter1 ( ) { } protected void consumeTypeParameter1WithExtends ( ) { TypeReference superType = ( TypeReference ) this . genericsStack [ this . genericsPtr -- ] ; this . genericsLengthPtr -- ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . declarationSourceEnd = superType . sourceEnd ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; this . genericsStack [ this . genericsPtr ] = typeParameter ; } protected void consumeTypeParameter1WithExtendsAndBounds ( ) { int additionalBoundsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] bounds = new TypeReference [ additionalBoundsLength ] ; this . genericsPtr -= additionalBoundsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , bounds , 0 , additionalBoundsLength ) ; TypeReference superType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . declarationSourceEnd = bounds [ additionalBoundsLength - 1 ] . sourceEnd ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; typeParameter . bounds = bounds ; for ( int i = 0 , max = bounds . length ; i < max ; i ++ ) { bounds [ i ] . bits |= ASTNode . IsSuperType ; } } protected void consumeTypeParameterHeader ( ) { TypeParameter typeParameter = new TypeParameter ( ) ; long pos = this . identifierPositionStack [ this . identifierPtr ] ; final int end = ( int ) pos ; typeParameter . declarationSourceEnd = end ; typeParameter . sourceEnd = end ; final int start = ( int ) ( pos >>> 32 ) ; typeParameter . declarationSourceStart = start ; typeParameter . sourceStart = start ; typeParameter . name = this . identifierStack [ this . identifierPtr -- ] ; this . identifierLengthPtr -- ; pushOnGenericsStack ( typeParameter ) ; this . listTypeParameterLength ++ ; } protected void consumeTypeParameterList ( ) { concatGenericsLists ( ) ; } protected void consumeTypeParameterList1 ( ) { concatGenericsLists ( ) ; } protected void consumeTypeParameters ( ) { int startPos = this . intStack [ this . intPtr -- ] ; if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType ) { RecoveredType recoveredType = ( RecoveredType ) this . currentElement ; int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; TypeParameter [ ] typeParameters = new TypeParameter [ length ] ; System . arraycopy ( this . genericsStack , this . genericsPtr - length + 1 , typeParameters , 0 , length ) ; recoveredType . add ( typeParameters , startPos ) ; } } if ( ! this . statementRecoveryActivated && this . options . sourceLevel < ClassFileConstants . JDK1_5 && this . lastErrorEndPositionBeforeRecovery < this . scanner . currentPosition ) { int length = this . genericsLengthStack [ this . genericsLengthPtr ] ; problemReporter ( ) . invalidUsageOfTypeParameters ( ( TypeParameter ) this . genericsStack [ this . genericsPtr - length + 1 ] , ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ) ; } } protected void consumeTypeParameterWithExtends ( ) { TypeReference superType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . declarationSourceEnd = superType . sourceEnd ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; } protected void consumeTypeParameterWithExtendsAndBounds ( ) { int additionalBoundsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] bounds = new TypeReference [ additionalBoundsLength ] ; this . genericsPtr -= additionalBoundsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , bounds , 0 , additionalBoundsLength ) ; TypeReference superType = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; TypeParameter typeParameter = ( TypeParameter ) this . genericsStack [ this . genericsPtr ] ; typeParameter . type = superType ; superType . bits |= ASTNode . IsSuperType ; typeParameter . bounds = bounds ; typeParameter . declarationSourceEnd = bounds [ additionalBoundsLength - 1 ] . sourceEnd ; for ( int i = 0 , max = bounds . length ; i < max ; i ++ ) { bounds [ i ] . bits |= ASTNode . IsSuperType ; } } protected void consumeUnaryExpression ( int op ) { Expression r , exp = this . expressionStack [ this . expressionPtr ] ; if ( op == MINUS ) { if ( exp instanceof IntLiteral ) { IntLiteral intLiteral = ( IntLiteral ) exp ; IntLiteral convertToMinValue = intLiteral . convertToMinValue ( ) ; if ( convertToMinValue == intLiteral ) { r = new UnaryExpression ( exp , op ) ; } else { r = convertToMinValue ; } } else if ( exp instanceof LongLiteral ) { LongLiteral longLiteral = ( LongLiteral ) exp ; LongLiteral convertToMinValue = longLiteral . convertToMinValue ( ) ; if ( convertToMinValue == longLiteral ) { r = new UnaryExpression ( exp , op ) ; } else { r = convertToMinValue ; } } else { r = new UnaryExpression ( exp , op ) ; } } else { r = new UnaryExpression ( exp , op ) ; } r . sourceStart = this . intStack [ this . intPtr -- ] ; r . sourceEnd = exp . sourceEnd ; this . expressionStack [ this . expressionPtr ] = r ; } protected void consumeUnaryExpression ( int op , boolean post ) { Expression leftHandSide = this . expressionStack [ this . expressionPtr ] ; if ( leftHandSide instanceof Reference ) { if ( post ) { this . expressionStack [ this . expressionPtr ] = new PostfixExpression ( leftHandSide , IntLiteral . One , op , this . endStatementPosition ) ; } else { this . expressionStack [ this . expressionPtr ] = new PrefixExpression ( leftHandSide , IntLiteral . One , op , this . intStack [ this . intPtr -- ] ) ; } } else { if ( ! post ) { this . intPtr -- ; } if ( ! this . statementRecoveryActivated ) problemReporter ( ) . invalidUnaryExpression ( leftHandSide ) ; } } protected void consumeVariableDeclarators ( ) { optimizedConcatNodeLists ( ) ; } protected void consumeVariableInitializers ( ) { concatExpressionLists ( ) ; } protected void consumeWildcard ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard1 ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard1WithBounds ( ) { } protected void consumeWildcard2 ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard2WithBounds ( ) { } protected void consumeWildcard3 ( ) { final Wildcard wildcard = new Wildcard ( Wildcard . UNBOUND ) ; wildcard . sourceEnd = this . intStack [ this . intPtr -- ] ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcard3WithBounds ( ) { } protected void consumeWildcardBounds1Extends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds1Super ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds2Extends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds2Super ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds3Extends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBounds3Super ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = ( TypeReference ) this . genericsStack [ this . genericsPtr ] ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; this . genericsStack [ this . genericsPtr ] = wildcard ; } protected void consumeWildcardBoundsExtends ( ) { Wildcard wildcard = new Wildcard ( Wildcard . EXTENDS ) ; wildcard . bound = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcardBoundsSuper ( ) { Wildcard wildcard = new Wildcard ( Wildcard . SUPER ) ; wildcard . bound = getTypeReference ( this . intStack [ this . intPtr -- ] ) ; this . intPtr -- ; wildcard . sourceEnd = wildcard . bound . sourceEnd ; this . intPtr -- ; wildcard . sourceStart = this . intStack [ this . intPtr -- ] ; pushOnGenericsStack ( wildcard ) ; } protected void consumeWildcardWithBounds ( ) { } public boolean containsComment ( int sourceStart , int sourceEnd ) { int iComment = this . scanner . commentPtr ; for ( ; iComment >= 0 ; iComment -- ) { int commentStart = this . scanner . commentStarts [ iComment ] ; if ( commentStart < 0 ) commentStart = - commentStart ; if ( commentStart < sourceStart ) continue ; if ( commentStart > sourceEnd ) continue ; return true ; } return false ; } public MethodDeclaration convertToMethodDeclaration ( ConstructorDeclaration c , CompilationResult compilationResult ) { MethodDeclaration m = new MethodDeclaration ( compilationResult ) ; m . typeParameters = c . typeParameters ; m . sourceStart = c . sourceStart ; m . sourceEnd = c . sourceEnd ; m . bodyStart = c . bodyStart ; m . bodyEnd = c . bodyEnd ; m . declarationSourceEnd = c . declarationSourceEnd ; m . declarationSourceStart = c . declarationSourceStart ; m . selector = c . selector ; m . statements = c . statements ; m . modifiers = c . modifiers ; m . annotations = c . annotations ; m . arguments = c . arguments ; m . thrownExceptions = c . thrownExceptions ; m . explicitDeclarations = c . explicitDeclarations ; m . returnType = null ; m . javadoc = c . javadoc ; return m ; } protected TypeReference copyDims ( TypeReference typeRef , int dim ) { return typeRef . copyDims ( dim ) ; } protected FieldDeclaration createFieldDeclaration ( char [ ] fieldDeclarationName , int sourceStart , int sourceEnd ) { return new FieldDeclaration ( fieldDeclarationName , sourceStart , sourceEnd ) ; } protected JavadocParser createJavadocParser ( ) { return new JavadocParser ( this ) ; } protected LocalDeclaration createLocalDeclaration ( char [ ] localDeclarationName , int sourceStart , int sourceEnd ) { return new LocalDeclaration ( localDeclarationName , sourceStart , sourceEnd ) ; } protected StringLiteral createStringLiteral ( char [ ] token , int start , int end , int lineNumber ) { return new StringLiteral ( token , start , end , lineNumber ) ; } protected RecoveredType currentRecoveryType ( ) { if ( this . currentElement != null ) { if ( this . currentElement instanceof RecoveredType ) { return ( RecoveredType ) this . currentElement ; } else { return this . currentElement . enclosingType ( ) ; } } return null ; } public CompilationUnitDeclaration dietParse ( ICompilationUnit sourceUnit , CompilationResult compilationResult ) { CompilationUnitDeclaration parsedUnit ; boolean old = this . diet ; try { this . diet = true ; parsedUnit = parse ( sourceUnit , compilationResult ) ; } finally { this . diet = old ; } return parsedUnit ; } protected void dispatchDeclarationInto ( int length ) { if ( length == 0 ) return ; int [ ] flag = new int [ length + 1 ] ; int size1 = 0 , size2 = 0 , size3 = 0 ; boolean hasAbstractMethods = false ; for ( int i = length - 1 ; i >= 0 ; i -- ) { ASTNode astNode = this . astStack [ this . astPtr -- ] ; if ( astNode instanceof AbstractMethodDeclaration ) { flag [ i ] = 2 ; size2 ++ ; if ( ( ( AbstractMethodDeclaration ) astNode ) . isAbstract ( ) ) { hasAbstractMethods = true ; } } else if ( astNode instanceof TypeDeclaration ) { flag [ i ] = 3 ; size3 ++ ; } else { flag [ i ] = 1 ; size1 ++ ; } } TypeDeclaration typeDecl = ( TypeDeclaration ) this . astStack [ this . astPtr ] ; if ( size1 != 0 ) { typeDecl . fields = new FieldDeclaration [ size1 ] ; } if ( size2 != 0 ) { typeDecl . methods = new AbstractMethodDeclaration [ size2 ] ; if ( hasAbstractMethods ) typeDecl . bits |= ASTNode . HasAbstractMethods ; } if ( size3 != 0 ) { typeDecl . memberTypes = new TypeDeclaration [ size3 ] ; } size1 = size2 = size3 = 0 ; int flagI = flag [ 0 ] , start = 0 ; int length2 ; for ( int end = 0 ; end <= length ; end ++ ) { if ( flagI != flag [ end ] ) { switch ( flagI ) { case 1 : size1 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + 1 , typeDecl . fields , size1 - length2 , length2 ) ; break ; case 2 : size2 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + 1 , typeDecl . methods , size2 - length2 , length2 ) ; break ; case 3 : size3 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + 1 , typeDecl . memberTypes , size3 - length2 , length2 ) ; break ; } flagI = flag [ start = end ] ; } } if ( typeDecl . memberTypes != null ) { for ( int i = typeDecl . memberTypes . length - 1 ; i >= 0 ; i -- ) { typeDecl . memberTypes [ i ] . enclosingType = typeDecl ; } } } protected void dispatchDeclarationIntoEnumDeclaration ( int length ) { if ( length == 0 ) return ; int [ ] flag = new int [ length + 1 ] ; int size1 = 0 , size2 = 0 , size3 = 0 ; TypeDeclaration enumDeclaration = ( TypeDeclaration ) this . astStack [ this . astPtr - length ] ; boolean hasAbstractMethods = false ; int enumConstantsCounter = 0 ; for ( int i = length - 1 ; i >= 0 ; i -- ) { ASTNode astNode = this . astStack [ this . astPtr -- ] ; if ( astNode instanceof AbstractMethodDeclaration ) { flag [ i ] = 2 ; size2 ++ ; if ( ( ( AbstractMethodDeclaration ) astNode ) . isAbstract ( ) ) { hasAbstractMethods = true ; } } else if ( astNode instanceof TypeDeclaration ) { flag [ i ] = 3 ; size3 ++ ; } else if ( astNode instanceof FieldDeclaration ) { flag [ i ] = 1 ; size1 ++ ; if ( ( ( FieldDeclaration ) astNode ) . getKind ( ) == AbstractVariableDeclaration . ENUM_CONSTANT ) { enumConstantsCounter ++ ; } } } if ( size1 != 0 ) { enumDeclaration . fields = new FieldDeclaration [ size1 ] ; } if ( size2 != 0 ) { enumDeclaration . methods = new AbstractMethodDeclaration [ size2 ] ; if ( hasAbstractMethods ) enumDeclaration . bits |= ASTNode . HasAbstractMethods ; } if ( size3 != 0 ) { enumDeclaration . memberTypes = new TypeDeclaration [ size3 ] ; } size1 = size2 = size3 = 0 ; int flagI = flag [ 0 ] , start = 0 ; int length2 ; for ( int end = 0 ; end <= length ; end ++ ) { if ( flagI != flag [ end ] ) { switch ( flagI ) { case 1 : size1 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + 1 , enumDeclaration . fields , size1 - length2 , length2 ) ; break ; case 2 : size2 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + 1 , enumDeclaration . methods , size2 - length2 , length2 ) ; break ; case 3 : size3 += ( length2 = end - start ) ; System . arraycopy ( this . astStack , this . astPtr + start + 1 , enumDeclaration . memberTypes , size3 - length2 , length2 ) ; break ; } flagI = flag [ start = end ] ; } } if ( enumDeclaration . memberTypes != null ) { for ( int i = enumDeclaration . memberTypes . length - 1 ; i >= 0 ; i -- ) { enumDeclaration . memberTypes [ i ] . enclosingType = enumDeclaration ; } } enumDeclaration . enumConstantsCounter = enumConstantsCounter ; } protected CompilationUnitDeclaration endParse ( int act ) { this . lastAct = act ; if ( this . statementRecoveryActivated ) { RecoveredElement recoveredElement = buildInitialRecoveryState ( ) ; if ( recoveredElement != null ) { recoveredElement . topElement ( ) . updateParseTree ( ) ; } if ( this . hasError ) resetStacks ( ) ; } else if ( this . currentElement != null ) { if ( VERBOSE_RECOVERY ) { System . out . print ( Messages . parser_syntaxRecovery ) ; System . out . println ( "" ) ; System . out . println ( this . compilationUnit ) ; System . out . println ( "" ) ; } this . currentElement . topElement ( ) . updateParseTree ( ) ; } else { if ( this . diet & VERBOSE_RECOVERY ) { System . out . print ( Messages . parser_regularParse ) ; System . out . println ( "" ) ; System . out . println ( this . compilationUnit ) ; System . out . println ( "" ) ; } } persistLineSeparatorPositions ( ) ; for ( int i = 0 ; i < this . scanner . foundTaskCount ; i ++ ) { if ( ! this . statementRecoveryActivated ) problemReporter ( ) . task ( new String ( this . scanner . foundTaskTags [ i ] ) , new String ( this . scanner . foundTaskMessages [ i ] ) , this . scanner . foundTaskPriorities [ i ] == null ? null : new String ( this . scanner . foundTaskPriorities [ i ] ) , this . scanner . foundTaskPositions [ i ] [ 0 ] , this . scanner . foundTaskPositions [ i ] [ 1 ] ) ; } return this . compilationUnit ; } public int flushCommentsDefinedPriorTo ( int position ) { int lastCommentIndex = this . scanner . commentPtr ; if ( lastCommentIndex < 0 ) return position ; int index = lastCommentIndex ; int validCount = 0 ; while ( index >= 0 ) { int commentEnd = this . scanner . commentStops [ index ] ; if ( commentEnd < 0 ) commentEnd = - commentEnd ; if ( commentEnd <= position ) { break ; } index -- ; validCount ++ ; } if ( validCount > 0 ) { int immediateCommentEnd = - this . scanner . commentStops [ index + 1 ] ; if ( immediateCommentEnd > 0 ) { immediateCommentEnd -- ; if ( Util . getLineNumber ( position , this . scanner . lineEnds , 0 , this . scanner . linePtr ) == Util . getLineNumber ( immediateCommentEnd , this . scanner . lineEnds , 0 , this . scanner . linePtr ) ) { position = immediateCommentEnd ; validCount -- ; index ++ ; } } } if ( index < 0 ) return position ; switch ( validCount ) { case 0 : break ; case 2 : this . scanner . commentStarts [ 0 ] = this . scanner . commentStarts [ index + 1 ] ; this . scanner . commentStops [ 0 ] = this . scanner . commentStops [ index + 1 ] ; this . scanner . commentTagStarts [ 0 ] = this . scanner . commentTagStarts [ index + 1 ] ; this . scanner . commentStarts [ 1 ] = this . scanner . commentStarts [ index + 2 ] ; this . scanner . commentStops [ 1 ] = this . scanner . commentStops [ index + 2 ] ; this . scanner . commentTagStarts [ 1 ] = this . scanner . commentTagStarts [ index + 2 ] ; break ; case 1 : this . scanner . commentStarts [ 0 ] = this . scanner . commentStarts [ index + 1 ] ; this . scanner . commentStops [ 0 ] = this . scanner . commentStops [ index + 1 ] ; this . scanner . commentTagStarts [ 0 ] = this . scanner . commentTagStarts [ index + 1 ] ; break ; default : System . arraycopy ( this . scanner . commentStarts , index + 1 , this . scanner . commentStarts , 0 , validCount ) ; System . arraycopy ( this . scanner . commentStops , index + 1 , this . scanner . commentStops , 0 , validCount ) ; System . arraycopy ( this . scanner . commentTagStarts , index + 1 , this . scanner . commentTagStarts , 0 , validCount ) ; } this . scanner . commentPtr = validCount - 1 ; return position ; } protected TypeReference getAnnotationType ( ) { int length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; if ( length == 1 ) { return new SingleTypeReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; } else { char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; return new QualifiedTypeReference ( tokens , positions ) ; } } public int getFirstToken ( ) { return this . firstToken ; } public int [ ] getJavaDocPositions ( ) { int javadocCount = 0 ; int max = this . scanner . commentPtr ; for ( int i = 0 ; i <= max ; i ++ ) { if ( this . scanner . commentStarts [ i ] >= 0 && this . scanner . commentStops [ i ] > 0 ) { javadocCount ++ ; } } if ( javadocCount == 0 ) return null ; int [ ] positions = new int [ 2 * javadocCount ] ; int index = 0 ; for ( int i = 0 ; i <= max ; i ++ ) { int commentStart = this . scanner . commentStarts [ i ] ; if ( commentStart >= 0 ) { int commentStop = this . scanner . commentStops [ i ] ; if ( commentStop > 0 ) { positions [ index ++ ] = commentStart ; positions [ index ++ ] = commentStop - 1 ; } } } return positions ; } public void getMethodBodies ( CompilationUnitDeclaration unit ) { if ( unit == null ) return ; if ( unit . ignoreMethodBodies ) { unit . ignoreFurtherInvestigation = true ; return ; } if ( ( unit . bits & ASTNode . HasAllMethodBodies ) != 0 ) return ; int [ ] oldLineEnds = this . scanner . lineEnds ; int oldLinePtr = this . scanner . linePtr ; CompilationResult compilationResult = unit . compilationResult ; char [ ] contents = this . readManager != null ? this . readManager . getContents ( compilationResult . compilationUnit ) : compilationResult . compilationUnit . getContents ( ) ; this . scanner . setSource ( contents , compilationResult ) ; if ( this . javadocParser != null && this . javadocParser . checkDocComment ) { this . javadocParser . scanner . setSource ( contents ) ; } if ( unit . types != null ) { for ( int i = 0 , length = unit . types . length ; i < length ; i ++ ) unit . types [ i ] . parseMethods ( this , unit ) ; } unit . bits |= ASTNode . HasAllMethodBodies ; this . scanner . lineEnds = oldLineEnds ; this . scanner . linePtr = oldLinePtr ; } protected char getNextCharacter ( char [ ] comment , int [ ] index ) { char nextCharacter = comment [ index [ 0 ] ++ ] ; switch ( nextCharacter ) { case '\\' : int c1 , c2 , c3 , c4 ; index [ 0 ] ++ ; while ( comment [ index [ 0 ] ] == 'u' ) index [ 0 ] ++ ; if ( ! ( ( ( c1 = ScannerHelper . getHexadecimalValue ( comment [ index [ 0 ] ++ ] ) ) > 15 || c1 < 0 ) || ( ( c2 = ScannerHelper . getHexadecimalValue ( comment [ index [ 0 ] ++ ] ) ) > 15 || c2 < 0 ) || ( ( c3 = ScannerHelper . getHexadecimalValue ( comment [ index [ 0 ] ++ ] ) ) > 15 || c3 < 0 ) || ( ( c4 = ScannerHelper . getHexadecimalValue ( comment [ index [ 0 ] ++ ] ) ) > 15 || c4 < 0 ) ) ) { nextCharacter = ( char ) ( ( ( c1 * 16 + c2 ) * 16 + c3 ) * 16 + c4 ) ; } break ; } return nextCharacter ; } protected Expression getTypeReference ( Expression exp ) { exp . bits &= ~ ASTNode . RestrictiveFlagMASK ; exp . bits |= Binding . TYPE ; return exp ; } protected TypeReference getTypeReference ( int dim ) { TypeReference ref ; int length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; if ( length < 0 ) { ref = TypeReference . baseTypeReference ( - length , dim ) ; ref . sourceStart = this . intStack [ this . intPtr -- ] ; if ( dim == 0 ) { ref . sourceEnd = this . intStack [ this . intPtr -- ] ; } else { this . intPtr -- ; ref . sourceEnd = this . endPosition ; } } else { int numberOfIdentifiers = this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr -- ] ; if ( length != numberOfIdentifiers || this . genericsLengthStack [ this . genericsLengthPtr ] != 0 ) { ref = getTypeReferenceForGenericType ( dim , length , numberOfIdentifiers ) ; } else if ( length == 1 ) { this . genericsLengthPtr -- ; if ( dim == 0 ) { ref = new SingleTypeReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; } else { ref = new ArrayTypeReference ( this . identifierStack [ this . identifierPtr ] , dim , this . identifierPositionStack [ this . identifierPtr -- ] ) ; ref . sourceEnd = this . endPosition ; } } else { this . genericsLengthPtr -- ; char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; if ( dim == 0 ) { ref = new QualifiedTypeReference ( tokens , positions ) ; } else { ref = new ArrayQualifiedTypeReference ( tokens , dim , positions ) ; ref . sourceEnd = this . endPosition ; } } } return ref ; } protected TypeReference getTypeReferenceForGenericType ( int dim , int identifierLength , int numberOfIdentifiers ) { if ( identifierLength == 1 && numberOfIdentifiers == 1 ) { int currentTypeArgumentsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; TypeReference [ ] typeArguments = null ; if ( currentTypeArgumentsLength < 0 ) { typeArguments = TypeReference . NO_TYPE_ARGUMENTS ; } else { typeArguments = new TypeReference [ currentTypeArgumentsLength ] ; this . genericsPtr -= currentTypeArgumentsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , typeArguments , 0 , currentTypeArgumentsLength ) ; } ParameterizedSingleTypeReference parameterizedSingleTypeReference = new ParameterizedSingleTypeReference ( this . identifierStack [ this . identifierPtr ] , typeArguments , dim , this . identifierPositionStack [ this . identifierPtr -- ] ) ; if ( dim != 0 ) { parameterizedSingleTypeReference . sourceEnd = this . endStatementPosition ; } return parameterizedSingleTypeReference ; } else { TypeReference [ ] [ ] typeArguments = new TypeReference [ numberOfIdentifiers ] [ ] ; char [ ] [ ] tokens = new char [ numberOfIdentifiers ] [ ] ; long [ ] positions = new long [ numberOfIdentifiers ] ; int index = numberOfIdentifiers ; int currentIdentifiersLength = identifierLength ; while ( index > 0 ) { int currentTypeArgumentsLength = this . genericsLengthStack [ this . genericsLengthPtr -- ] ; if ( currentTypeArgumentsLength > 0 ) { this . genericsPtr -= currentTypeArgumentsLength ; System . arraycopy ( this . genericsStack , this . genericsPtr + 1 , typeArguments [ index - 1 ] = new TypeReference [ currentTypeArgumentsLength ] , 0 , currentTypeArgumentsLength ) ; } else if ( currentTypeArgumentsLength < 0 ) { typeArguments [ index - 1 ] = TypeReference . NO_TYPE_ARGUMENTS ; } switch ( currentIdentifiersLength ) { case 1 : tokens [ index - 1 ] = this . identifierStack [ this . identifierPtr ] ; positions [ index - 1 ] = this . identifierPositionStack [ this . identifierPtr -- ] ; break ; default : this . identifierPtr -= currentIdentifiersLength ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , index - currentIdentifiersLength , currentIdentifiersLength ) ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , index - currentIdentifiersLength , currentIdentifiersLength ) ; } index -= currentIdentifiersLength ; if ( index > 0 ) { currentIdentifiersLength = this . identifierLengthStack [ this . identifierLengthPtr -- ] ; } } ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference = new ParameterizedQualifiedTypeReference ( tokens , typeArguments , dim , positions ) ; if ( dim != 0 ) { parameterizedQualifiedTypeReference . sourceEnd = this . endStatementPosition ; } return parameterizedQualifiedTypeReference ; } } protected NameReference getUnspecifiedReference ( ) { int length ; NameReference ref ; if ( ( length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ) == 1 ) ref = new SingleNameReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; else { char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; ref = new QualifiedNameReference ( tokens , positions , ( int ) ( this . identifierPositionStack [ this . identifierPtr + 1 ] >> 32 ) , ( int ) this . identifierPositionStack [ this . identifierPtr + length ] ) ; } return ref ; } protected NameReference getUnspecifiedReferenceOptimized ( ) { int length ; NameReference ref ; if ( ( length = this . identifierLengthStack [ this . identifierLengthPtr -- ] ) == 1 ) { ref = new SingleNameReference ( this . identifierStack [ this . identifierPtr ] , this . identifierPositionStack [ this . identifierPtr -- ] ) ; ref . bits &= ~ ASTNode . RestrictiveFlagMASK ; ref . bits |= Binding . LOCAL | Binding . FIELD ; return ref ; } char [ ] [ ] tokens = new char [ length ] [ ] ; this . identifierPtr -= length ; System . arraycopy ( this . identifierStack , this . identifierPtr + 1 , tokens , 0 , length ) ; long [ ] positions = new long [ length ] ; System . arraycopy ( this . identifierPositionStack , this . identifierPtr + 1 , positions , 0 , length ) ; ref = new QualifiedNameReference ( tokens , positions , ( int ) ( this . identifierPositionStack [ this . identifierPtr + 1 ] >> 32 ) , ( int ) this . identifierPositionStack [ this . identifierPtr + length ] ) ; ref . bits &= ~ ASTNode . RestrictiveFlagMASK ; ref . bits |= Binding . LOCAL | Binding . FIELD ; return ref ; } public void goForBlockStatementsopt ( ) { this . firstToken = TokenNameTWIDDLE ; this . scanner . recordLineSeparator = false ; } public void goForBlockStatementsOrCatchHeader ( ) { this . firstToken = TokenNameMULTIPLY ; this . scanner . recordLineSeparator = false ; } public void goForClassBodyDeclarations ( ) { this . firstToken = TokenNameAND ; this . scanner . recordLineSeparator = true ; } public void goForCompilationUnit ( ) { this . firstToken = TokenNamePLUS_PLUS ; this . scanner . foundTaskCount = 0 ; this . scanner . recordLineSeparator = true ; } public void goForExpression ( ) { this . firstToken = TokenNameREMAINDER ; this . scanner . recordLineSeparator = true ; } public void goForFieldDeclaration ( ) { this . firstToken = TokenNameAND_AND ; this . scanner . recordLineSeparator = true ; } public void goForGenericMethodDeclaration ( ) { this . firstToken = TokenNameDIVIDE ; this . scanner . recordLineSeparator = true ; } public void goForHeaders ( ) { RecoveredType currentType = currentRecoveryType ( ) ; if ( currentType != null && currentType . insideEnumConstantPart ) { this . firstToken = TokenNameNOT ; } else { this . firstToken = TokenNameUNSIGNED_RIGHT_SHIFT ; } this . scanner . recordLineSeparator = true ; } public void goForImportDeclaration ( ) { this . firstToken = TokenNameOR_OR ; this . scanner . recordLineSeparator = true ; } public void goForInitializer ( ) { this . firstToken = TokenNameRIGHT_SHIFT ; this . scanner . recordLineSeparator = false ; } public void goForMemberValue ( ) { this . firstToken = TokenNameOR_OR ; this . scanner . recordLineSeparator = true ; } public void goForMethodBody ( ) { this . firstToken = TokenNameMINUS_MINUS ; this . scanner . recordLineSeparator = false ; } public void goForPackageDeclaration ( ) { this . firstToken = TokenNameQUESTION ; this . scanner . recordLineSeparator = true ; } public void goForTypeDeclaration ( ) { this . firstToken = TokenNamePLUS ; this . scanner . recordLineSeparator = true ; } public boolean hasLeadingTagComment ( char [ ] commentPrefixTag , int rangeEnd ) { int iComment = this . scanner . commentPtr ; if ( iComment < 0 ) return false ; int iStatement = this . astLengthPtr ; if ( iStatement < 0 || this . astLengthStack [ iStatement ] <= 1 ) return false ; ASTNode lastNode = this . astStack [ this . astPtr ] ; int rangeStart = lastNode . sourceEnd ; previousComment : for ( ; iComment >= 0 ; iComment -- ) { int commentStart = this . scanner . commentStarts [ iComment ] ; if ( commentStart < 0 ) commentStart = - commentStart ; if ( commentStart < rangeStart ) return false ; if ( commentStart > rangeEnd ) continue previousComment ; char [ ] source = this . scanner . source ; int charPos = commentStart + 2 ; for ( ; charPos < rangeEnd ; charPos ++ ) { char c = source [ charPos ] ; if ( c >= ScannerHelper . MAX_OBVIOUS || ( ScannerHelper . OBVIOUS_IDENT_CHAR_NATURES [ c ] & ScannerHelper . C_JLS_SPACE ) == 0 ) { break ; } } for ( int iTag = 0 , length = commentPrefixTag . length ; iTag < length ; iTag ++ , charPos ++ ) { if ( charPos >= rangeEnd || source [ charPos ] != commentPrefixTag [ iTag ] ) { if ( iTag == 0 ) { return false ; } else { continue previousComment ; } } } return true ; } return false ; } protected void ignoreExpressionAssignment ( ) { this . intPtr -- ; ArrayInitializer arrayInitializer = ( ArrayInitializer ) this . expressionStack [ this . expressionPtr -- ] ; this . expressionLengthPtr -- ; if ( ! this . statementRecoveryActivated ) problemReporter ( ) . arrayConstantsOnlyInArrayInitializers ( arrayInitializer . sourceStart , arrayInitializer . sourceEnd ) ; } public void initialize ( ) { this . initialize ( false ) ; } public void initialize ( boolean initializeNLS ) { this . astPtr = - 1 ; this . astLengthPtr = - 1 ; this . expressionPtr = - 1 ; this . expressionLengthPtr = - 1 ; this . identifierPtr = - 1 ; this . identifierLengthPtr = - 1 ; this . intPtr = - 1 ; this . nestedMethod [ this . nestedType = 0 ] = 0 ; this . variablesCounter [ this . nestedType ] = 0 ; this . dimensions = 0 ; this . realBlockPtr = - 1 ; this . compilationUnit = null ; this . referenceContext = null ; this . endStatementPosition = 0 ; int astLength = this . astStack . length ; if ( this . noAstNodes . length < astLength ) { this . noAstNodes = new ASTNode [ astLength ] ; } System . arraycopy ( this . noAstNodes , 0 , this . astStack , 0 , astLength ) ; int expressionLength = this . expressionStack . length ; if ( this . noExpressions . length < expressionLength ) { this . noExpressions = new Expression [ expressionLength ] ; } System . arraycopy ( this . noExpressions , 0 , this . expressionStack , 0 , expressionLength ) ; this . scanner . commentPtr = - 1 ; this . scanner . foundTaskCount = 0 ; this . scanner . eofPosition = Integer . MAX_VALUE ; this . recordStringLiterals = true ; final boolean checkNLS = this . options . getSeverity ( CompilerOptions . NonExternalizedString ) != ProblemSeverities . Ignore ; this . checkExternalizeStrings = checkNLS ; this . scanner . checkNonExternalizedStringLiterals = initializeNLS && checkNLS ; this . scanner . lastPosition = - 1 ; resetModifiers ( ) ; this . lastCheckPoint = - 1 ; this . currentElement = null ; this . restartRecovery = false ; this . hasReportedError = false ; this . recoveredStaticInitializerStart = 0 ; this . lastIgnoredToken = - 1 ; this . lastErrorEndPosition = - 1 ; this . lastErrorEndPositionBeforeRecovery = - 1 ; this . lastJavadocEnd = - 1 ; this . listLength = 0 ; this . listTypeParameterLength = 0 ; this . lastPosistion = - 1 ; this . rBraceStart = 0 ; this . rBraceEnd = 0 ; this . rBraceSuccessorStart = 0 ; this . genericsIdentifiersLengthPtr = - 1 ; this . genericsLengthPtr = - 1 ; this . genericsPtr = - 1 ; } public void initializeScanner ( ) { this . scanner = new Scanner ( false , false , false , this . options . sourceLevel , this . options . complianceLevel , this . options . taskTags , this . options . taskPriorities , this . options . isTaskCaseSensitive ) ; this . options . taskPriorities = scanner . taskPriorities ; } public void jumpOverMethodBody ( ) { if ( this . diet && ( this . dietInt == 0 ) ) this . scanner . diet = true ; } private void jumpOverType ( ) { if ( this . recoveredTypes != null && this . nextTypeStart > - 1 && this . nextTypeStart < this . scanner . currentPosition ) { if ( DEBUG_AUTOMATON ) { System . out . println ( "" ) ; } TypeDeclaration typeDeclaration = this . recoveredTypes [ this . recoveredTypePtr ] ; boolean isAnonymous = typeDeclaration . allocation != null ; this . scanner . startPosition = typeDeclaration . declarationSourceEnd + 1 ; this . scanner . currentPosition = typeDeclaration . declarationSourceEnd + 1 ; this . scanner . diet = false ; if ( ! isAnonymous ) { ( ( RecoveryScanner ) this . scanner ) . setPendingTokens ( new int [ ] { TokenNameSEMICOLON , TokenNamebreak } ) ; } else { ( ( RecoveryScanner ) this . scanner ) . setPendingTokens ( new int [ ] { TokenNameIdentifier , TokenNameEQUAL , TokenNameIdentifier } ) ; } this . pendingRecoveredType = typeDeclaration ; try { this . currentToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { } if ( ++ this . recoveredTypePtr < this . recoveredTypes . length ) { TypeDeclaration nextTypeDeclaration = this . recoveredTypes [ this . recoveredTypePtr ] ; this . nextTypeStart = nextTypeDeclaration . allocation == null ? nextTypeDeclaration . declarationSourceStart : nextTypeDeclaration . allocation . sourceStart ; } else { this . nextTypeStart = Integer . MAX_VALUE ; } } } protected void markEnclosingMemberWithLocalType ( ) { if ( this . currentElement != null ) return ; for ( int i = this . astPtr ; i >= 0 ; i -- ) { ASTNode node = this . astStack [ i ] ; if ( node instanceof AbstractMethodDeclaration || node instanceof FieldDeclaration || ( node instanceof TypeDeclaration && ( ( TypeDeclaration ) node ) . declarationSourceEnd == 0 ) ) { node . bits |= ASTNode . HasLocalType ; return ; } } if ( this . referenceContext instanceof AbstractMethodDeclaration || this . referenceContext instanceof TypeDeclaration ) { ( ( ASTNode ) this . referenceContext ) . bits |= ASTNode . HasLocalType ; } } protected boolean moveRecoveryCheckpoint ( ) { int pos = this . lastCheckPoint ; this . scanner . startPosition = pos ; this . scanner . currentPosition = pos ; this . scanner . diet = false ; if ( this . restartRecovery ) { this . lastIgnoredToken = - 1 ; this . scanner . insideRecovery = true ; return true ; } this . lastIgnoredToken = this . nextIgnoredToken ; this . nextIgnoredToken = - 1 ; do { try { this . nextIgnoredToken = this . scanner . getNextToken ( ) ; if ( this . scanner . currentPosition == this . scanner . startPosition ) { this . scanner . currentPosition ++ ; this . nextIgnoredToken = - 1 ; } } catch ( InvalidInputException e ) { pos = this . scanner . currentPosition ; } } while ( this . nextIgnoredToken < 0 ) ; if ( this . nextIgnoredToken == TokenNameEOF ) { if ( this . currentToken == TokenNameEOF ) { return false ; } } this . lastCheckPoint = this . scanner . currentPosition ; this . scanner . startPosition = pos ; this . scanner . currentPosition = pos ; this . scanner . commentPtr = - 1 ; this . scanner . foundTaskCount = 0 ; return true ; } protected MessageSend newMessageSend ( ) { MessageSend m = new MessageSend ( ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , m . arguments = new Expression [ length ] , 0 , length ) ; } return m ; } protected MessageSend newMessageSendWithTypeArguments ( ) { MessageSend m = new MessageSend ( ) ; int length ; if ( ( length = this . expressionLengthStack [ this . expressionLengthPtr -- ] ) != 0 ) { this . expressionPtr -= length ; System . arraycopy ( this . expressionStack , this . expressionPtr + 1 , m . arguments = new Expression [ length ] , 0 , length ) ; } return m ; } protected void optimizedConcatNodeLists ( ) { this . astLengthStack [ -- this . astLengthPtr ] ++ ; } protected void parse ( ) { if ( DEBUG ) System . out . println ( "" ) ; if ( DEBUG_AUTOMATON ) { System . out . println ( "" ) ; } boolean isDietParse = this . diet ; int oldFirstToken = getFirstToken ( ) ; this . hasError = false ; this . hasReportedError = false ; int act = START_STATE ; this . stateStackTop = - 1 ; this . currentToken = getFirstToken ( ) ; ProcessTerminals : for ( ; ; ) { int stackLength = this . stack . length ; if ( ++ this . stateStackTop >= stackLength ) { System . arraycopy ( this . stack , 0 , this . stack = new int [ stackLength + StackIncrement ] , 0 , stackLength ) ; } this . stack [ this . stateStackTop ] = act ; act = tAction ( act , this . currentToken ) ; if ( act == ERROR_ACTION || ( this . restartRecovery && ! this . shouldDeferRecovery ) ) { this . shouldDeferRecovery = false ; if ( DEBUG_AUTOMATON ) { if ( this . restartRecovery ) { System . out . println ( "" ) ; } else { System . out . println ( "" ) ; } } int errorPos = this . scanner . currentPosition - 1 ; if ( ! this . hasReportedError ) { this . hasError = true ; } int previousToken = this . currentToken ; if ( resumeOnSyntaxError ( ) ) { if ( act == ERROR_ACTION && previousToken != 0 ) this . lastErrorEndPosition = errorPos ; act = START_STATE ; this . stateStackTop = - 1 ; this . currentToken = getFirstToken ( ) ; continue ProcessTerminals ; } act = ERROR_ACTION ; break ProcessTerminals ; } if ( act <= NUM_RULES ) { this . stateStackTop -- ; if ( DEBUG_AUTOMATON ) { System . out . print ( "" ) ; } } else if ( act > ERROR_ACTION ) { consumeToken ( this . currentToken ) ; if ( this . currentElement != null ) { boolean oldValue = this . recordStringLiterals ; this . recordStringLiterals = false ; recoveryTokenCheck ( ) ; this . recordStringLiterals = oldValue ; } try { this . currentToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { if ( ! this . hasReportedError ) { problemReporter ( ) . scannerError ( this , e . getMessage ( ) ) ; this . hasReportedError = true ; } this . lastCheckPoint = this . scanner . currentPosition ; this . currentToken = 0 ; this . restartRecovery = true ; } if ( this . statementRecoveryActivated ) { jumpOverType ( ) ; } act -= ERROR_ACTION ; if ( DEBUG_AUTOMATON ) { System . out . print ( "" + name [ terminal_index [ this . currentToken ] ] + ") " ) ; } } else { if ( act < ACCEPT_ACTION ) { consumeToken ( this . currentToken ) ; if ( this . currentElement != null ) { boolean oldValue = this . recordStringLiterals ; this . recordStringLiterals = false ; recoveryTokenCheck ( ) ; this . recordStringLiterals = oldValue ; } try { this . currentToken = this . scanner . getNextToken ( ) ; } catch ( InvalidInputException e ) { if ( ! this . hasReportedError ) { problemReporter ( ) . scannerError ( this , e . getMessage ( ) ) ; this . hasReportedError = true ; } this . lastCheckPoint = this . scanner . currentPosition ; this . currentToken = 0 ; this . restartRecovery = true ; } if ( this . statementRecoveryActivated ) { jumpOverType ( ) ; } if ( DEBUG_AUTOMATON ) { System . out . println ( "" + name [ terminal_index [ this . currentToken ] ] + ")" ) ; } continue ProcessTerminals ; } break ProcessTerminals ; } do { if ( DEBUG_AUTOMATON ) { System . out . println ( name [ non_terminal_index [ lhs [ act ] ] ] ) ; } consumeRule ( act ) ; this . stateStackTop -= ( rhs [ act ] - 1 ) ; act = ntAction ( this . stack [ this . stateStackTop ] , lhs [ act ] ) ; if ( DEBUG_AUTOMATON ) { if ( act <= NUM_RULES ) { System . out . print ( "" ) ; } } } while ( act <= NUM_RULES ) ; if ( DEBUG_AUTOMATON ) { System . out . println ( "" ) ; } } if ( DEBUG_AUTOMATON ) { System . out . println ( "" ) ; } endParse ( act ) ; final NLSTag [ ] tags = this . scanner . getNLSTags ( ) ; if ( tags != null ) { this . compilationUnit . nlsTags = tags ; } this . scanner . checkNonExternalizedStringLiterals = false ; if ( this . reportSyntaxErrorIsRequired && this . hasError && ! this . statementRecoveryActivated ) { if ( ! this . options . performStatementsRecovery ) { reportSyntaxErrors ( isDietParse , oldFirstToken ) ; } else { RecoveryScannerData data = this . referenceContext . compilationResult ( ) . recoveryScannerData ; if ( this . recoveryScanner == null ) { this . recoveryScanner = new RecoveryScanner ( this . scanner , data ) ; } else { this . recoveryScanner . setData ( data ) ; } this . recoveryScanner . setSource ( this . scanner . source ) ; this . recoveryScanner . lineEnds = this . scanner . lineEnds ; this . recoveryScanner . linePtr = this . scanner . linePtr ; reportSyntaxErrors ( isDietParse , oldFirstToken ) ; if ( data == null ) { this . referenceContext . compilationResult ( ) . recoveryScannerData = this . recoveryScanner . getData ( ) ; } if ( this . methodRecoveryActivated && this . options . performStatementsRecovery ) { this . methodRecoveryActivated = false ; recoverStatements ( ) ; this . methodRecoveryActivated = true ; this . lastAct = ERROR_ACTION ; } } } if ( DEBUG ) System . out . println ( "" ) ; } public void parse ( ConstructorDeclaration cd , CompilationUnitDeclaration unit , boolean recordLineSeparator ) { boolean oldMethodRecoveryActivated = this . methodRecoveryActivated ; if ( this . options . performMethodsFullRecovery ) { this . methodRecoveryActivated = true ; this . ignoreNextOpeningBrace = true ; } initialize ( ) ; goForBlockStatementsopt ( ) ; if ( recordLineSeparator ) { this . scanner . recordLineSeparator = true ; } this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( 0 ) ; this . referenceContext = cd ; this . compilationUnit = unit ; this . scanner . resetTo ( cd . bodyStart , cd . bodyEnd ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; if ( this . options . performStatementsRecovery ) { this . methodRecoveryActivated = oldMethodRecoveryActivated ; } } checkNonNLSAfterBodyEnd ( cd . declarationSourceEnd ) ; if ( this . lastAct == ERROR_ACTION ) { cd . bits |= ASTNode . HasSyntaxErrors ; initialize ( ) ; return ; } cd . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; int length ; if ( this . astLengthPtr > - 1 && ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { this . astPtr -= length ; if ( ! this . options . ignoreMethodBodies ) { if ( this . astStack [ this . astPtr + 1 ] instanceof ExplicitConstructorCall ) { System . arraycopy ( this . astStack , this . astPtr + 2 , cd . statements = new Statement [ length - 1 ] , 0 , length - 1 ) ; cd . constructorCall = ( ExplicitConstructorCall ) this . astStack [ this . astPtr + 1 ] ; } else { System . arraycopy ( this . astStack , this . astPtr + 1 , cd . statements = new Statement [ length ] , 0 , length ) ; cd . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } } } else { if ( ! this . options . ignoreMethodBodies ) { cd . constructorCall = SuperReference . implicitSuperConstructorCall ( ) ; } if ( ! containsComment ( cd . bodyStart , cd . bodyEnd ) ) { cd . bits |= ASTNode . UndocumentedEmptyBlock ; } } ExplicitConstructorCall explicitConstructorCall = cd . constructorCall ; if ( explicitConstructorCall != null && explicitConstructorCall . sourceEnd == 0 ) { explicitConstructorCall . sourceEnd = cd . sourceEnd ; explicitConstructorCall . sourceStart = cd . sourceStart ; } } public void parse ( FieldDeclaration field , TypeDeclaration type , CompilationUnitDeclaration unit , char [ ] initializationSource ) { initialize ( ) ; goForExpression ( ) ; this . nestedMethod [ this . nestedType ] ++ ; this . referenceContext = type ; this . compilationUnit = unit ; this . scanner . setSource ( initializationSource ) ; this . scanner . resetTo ( 0 , initializationSource . length - 1 ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; } if ( this . lastAct == ERROR_ACTION ) { field . bits |= ASTNode . HasSyntaxErrors ; return ; } field . initialization = this . expressionStack [ this . expressionPtr ] ; if ( ( type . bits & ASTNode . HasLocalType ) != 0 ) { field . bits |= ASTNode . HasLocalType ; } } public CompilationUnitDeclaration parse ( ICompilationUnit sourceUnit , CompilationResult compilationResult ) { return parse ( sourceUnit , compilationResult , - 1 , - 1 ) ; } public CompilationUnitDeclaration parse ( ICompilationUnit sourceUnit , CompilationResult compilationResult , int start , int end ) { CompilationUnitDeclaration unit ; try { initialize ( true ) ; goForCompilationUnit ( ) ; this . referenceContext = this . compilationUnit = new CompilationUnitDeclaration ( this . problemReporter , compilationResult , 0 ) ; char [ ] contents ; try { contents = this . readManager != null ? this . readManager . getContents ( sourceUnit ) : sourceUnit . getContents ( ) ; } catch ( AbortCompilationUnit abortException ) { problemReporter ( ) . cannotReadSource ( this . compilationUnit , abortException , this . options . verbose ) ; contents = CharOperation . NO_CHAR ; } this . scanner . setSource ( contents ) ; this . compilationUnit . sourceEnd = this . scanner . source . length - 1 ; if ( end != - 1 ) this . scanner . resetTo ( start , end ) ; if ( this . javadocParser != null && this . javadocParser . checkDocComment ) { this . javadocParser . scanner . setSource ( contents ) ; if ( end != - 1 ) { this . javadocParser . scanner . resetTo ( start , end ) ; } } parse ( ) ; } finally { unit = this . compilationUnit ; this . compilationUnit = null ; if ( ! this . diet ) unit . bits |= ASTNode . HasAllMethodBodies ; } return unit ; } public void parse ( Initializer initializer , TypeDeclaration type , CompilationUnitDeclaration unit ) { boolean oldMethodRecoveryActivated = this . methodRecoveryActivated ; if ( this . options . performMethodsFullRecovery ) { this . methodRecoveryActivated = true ; } initialize ( ) ; goForBlockStatementsopt ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( 0 ) ; this . referenceContext = type ; this . compilationUnit = unit ; this . scanner . resetTo ( initializer . bodyStart , initializer . bodyEnd ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; if ( this . options . performStatementsRecovery ) { this . methodRecoveryActivated = oldMethodRecoveryActivated ; } } checkNonNLSAfterBodyEnd ( initializer . declarationSourceEnd ) ; if ( this . lastAct == ERROR_ACTION ) { initializer . bits |= ASTNode . HasSyntaxErrors ; return ; } initializer . block . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; int length ; if ( this . astLengthPtr > - 1 && ( length = this . astLengthStack [ this . astLengthPtr -- ] ) > 0 ) { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + 1 , initializer . block . statements = new Statement [ length ] , 0 , length ) ; } else { if ( ! containsComment ( initializer . block . sourceStart , initializer . block . sourceEnd ) ) { initializer . block . bits |= ASTNode . UndocumentedEmptyBlock ; } } if ( ( type . bits & ASTNode . HasLocalType ) != 0 ) { initializer . bits |= ASTNode . HasLocalType ; } } public void parse ( MethodDeclaration md , CompilationUnitDeclaration unit ) { if ( md . isAbstract ( ) ) return ; if ( md . isNative ( ) ) return ; if ( ( md . modifiers & ExtraCompilerModifiers . AccSemicolonBody ) != 0 ) return ; boolean oldMethodRecoveryActivated = this . methodRecoveryActivated ; if ( this . options . performMethodsFullRecovery ) { this . ignoreNextOpeningBrace = true ; this . methodRecoveryActivated = true ; this . rParenPos = md . sourceEnd ; } initialize ( ) ; goForBlockStatementsopt ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( 0 ) ; this . referenceContext = md ; this . compilationUnit = unit ; this . scanner . resetTo ( md . bodyStart , md . bodyEnd ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; if ( this . options . performStatementsRecovery ) { this . methodRecoveryActivated = oldMethodRecoveryActivated ; } } checkNonNLSAfterBodyEnd ( md . declarationSourceEnd ) ; if ( this . lastAct == ERROR_ACTION ) { md . bits |= ASTNode . HasSyntaxErrors ; return ; } md . explicitDeclarations = this . realBlockStack [ this . realBlockPtr -- ] ; int length ; if ( this . astLengthPtr > - 1 && ( length = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { if ( this . options . ignoreMethodBodies ) { this . astPtr -= length ; } else { System . arraycopy ( this . astStack , ( this . astPtr -= length ) + 1 , md . statements = new Statement [ length ] , 0 , length ) ; } } else { if ( ! containsComment ( md . bodyStart , md . bodyEnd ) ) { md . bits |= ASTNode . UndocumentedEmptyBlock ; } } } public ASTNode [ ] parseClassBodyDeclarations ( char [ ] source , int offset , int length , CompilationUnitDeclaration unit ) { boolean oldDiet = this . diet ; initialize ( ) ; goForClassBodyDeclarations ( ) ; this . scanner . setSource ( source ) ; this . scanner . resetTo ( offset , offset + length - 1 ) ; if ( this . javadocParser != null && this . javadocParser . checkDocComment ) { this . javadocParser . scanner . setSource ( source ) ; this . javadocParser . scanner . resetTo ( offset , offset + length - 1 ) ; } this . nestedType = 1 ; TypeDeclaration referenceContextTypeDeclaration = new TypeDeclaration ( unit . compilationResult ) ; referenceContextTypeDeclaration . name = Util . EMPTY_STRING . toCharArray ( ) ; referenceContextTypeDeclaration . fields = new FieldDeclaration [ 0 ] ; this . compilationUnit = unit ; unit . types = new TypeDeclaration [ 1 ] ; unit . types [ 0 ] = referenceContextTypeDeclaration ; this . referenceContext = unit ; try { this . diet = true ; parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . diet = oldDiet ; } ASTNode [ ] result = null ; if ( this . lastAct == ERROR_ACTION ) { if ( ! this . options . performMethodsFullRecovery && ! this . options . performStatementsRecovery ) { return null ; } final List bodyDeclarations = new ArrayList ( ) ; ASTVisitor visitor = new ASTVisitor ( ) { public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { if ( ! methodDeclaration . isDefaultConstructor ( ) ) { bodyDeclarations . add ( methodDeclaration ) ; } return false ; } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { bodyDeclarations . add ( fieldDeclaration ) ; return false ; } public boolean visit ( TypeDeclaration memberTypeDeclaration , ClassScope scope ) { bodyDeclarations . add ( memberTypeDeclaration ) ; return false ; } } ; unit . ignoreFurtherInvestigation = false ; unit . traverse ( visitor , unit . scope ) ; unit . ignoreFurtherInvestigation = true ; result = ( ASTNode [ ] ) bodyDeclarations . toArray ( new ASTNode [ bodyDeclarations . size ( ) ] ) ; } else { int astLength ; if ( this . astLengthPtr > - 1 && ( astLength = this . astLengthStack [ this . astLengthPtr -- ] ) != 0 ) { result = new ASTNode [ astLength ] ; this . astPtr -= astLength ; System . arraycopy ( this . astStack , this . astPtr + 1 , result , 0 , astLength ) ; } else { result = new ASTNode [ 0 ] ; } } boolean containsInitializers = false ; TypeDeclaration typeDeclaration = null ; for ( int i = 0 , max = result . length ; i < max ; i ++ ) { ASTNode node = result [ i ] ; if ( node instanceof TypeDeclaration ) { ( ( TypeDeclaration ) node ) . parseMethods ( this , unit ) ; } else if ( node instanceof AbstractMethodDeclaration ) { ( ( AbstractMethodDeclaration ) node ) . parseStatements ( this , unit ) ; } else if ( node instanceof FieldDeclaration ) { FieldDeclaration fieldDeclaration = ( FieldDeclaration ) node ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . INITIALIZER : containsInitializers = true ; if ( typeDeclaration == null ) { typeDeclaration = referenceContextTypeDeclaration ; } if ( typeDeclaration . fields == null ) { typeDeclaration . fields = new FieldDeclaration [ 1 ] ; typeDeclaration . fields [ 0 ] = fieldDeclaration ; } else { int length2 = typeDeclaration . fields . length ; FieldDeclaration [ ] temp = new FieldDeclaration [ length2 + 1 ] ; System . arraycopy ( typeDeclaration . fields , 0 , temp , 0 , length2 ) ; temp [ length2 ] = fieldDeclaration ; typeDeclaration . fields = temp ; } break ; } } if ( ( ( node . bits & ASTNode . HasSyntaxErrors ) != 0 ) && ( ! this . options . performMethodsFullRecovery && ! this . options . performStatementsRecovery ) ) { return null ; } } if ( containsInitializers ) { FieldDeclaration [ ] fieldDeclarations = typeDeclaration . fields ; for ( int i = 0 , max = fieldDeclarations . length ; i < max ; i ++ ) { Initializer initializer = ( Initializer ) fieldDeclarations [ i ] ; initializer . parseStatements ( this , typeDeclaration , unit ) ; if ( ( ( initializer . bits & ASTNode . HasSyntaxErrors ) != 0 ) && ( ! this . options . performMethodsFullRecovery && ! this . options . performStatementsRecovery ) ) { return null ; } } } return result ; } public Expression parseExpression ( char [ ] source , int offset , int length , CompilationUnitDeclaration unit ) { initialize ( ) ; goForExpression ( ) ; this . nestedMethod [ this . nestedType ] ++ ; this . referenceContext = unit ; this . compilationUnit = unit ; this . scanner . setSource ( source ) ; this . scanner . resetTo ( offset , offset + length - 1 ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; } if ( this . lastAct == ERROR_ACTION ) { return null ; } return this . expressionStack [ this . expressionPtr ] ; } public Expression parseMemberValue ( char [ ] source , int offset , int length , CompilationUnitDeclaration unit ) { initialize ( ) ; goForMemberValue ( ) ; this . nestedMethod [ this . nestedType ] ++ ; this . referenceContext = unit ; this . compilationUnit = unit ; this . scanner . setSource ( source ) ; this . scanner . resetTo ( offset , offset + length - 1 ) ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; } if ( this . lastAct == ERROR_ACTION ) { return null ; } return this . expressionStack [ this . expressionPtr ] ; } public void parseStatements ( ReferenceContext rc , int start , int end , TypeDeclaration [ ] types , CompilationUnitDeclaration unit ) { boolean oldStatementRecoveryEnabled = this . statementRecoveryActivated ; this . statementRecoveryActivated = true ; initialize ( ) ; goForBlockStatementsopt ( ) ; this . nestedMethod [ this . nestedType ] ++ ; pushOnRealBlockStack ( 0 ) ; pushOnAstLengthStack ( 0 ) ; this . referenceContext = rc ; this . compilationUnit = unit ; this . pendingRecoveredType = null ; if ( types != null && types . length > 0 ) { this . recoveredTypes = types ; this . recoveredTypePtr = 0 ; this . nextTypeStart = this . recoveredTypes [ 0 ] . allocation == null ? this . recoveredTypes [ 0 ] . declarationSourceStart : this . recoveredTypes [ 0 ] . allocation . sourceStart ; } else { this . recoveredTypes = null ; this . recoveredTypePtr = - 1 ; this . nextTypeStart = - 1 ; } this . scanner . resetTo ( start , end ) ; this . lastCheckPoint = this . scanner . initialPosition ; this . stateStackTop = - 1 ; try { parse ( ) ; } catch ( AbortCompilation ex ) { this . lastAct = ERROR_ACTION ; } finally { this . nestedMethod [ this . nestedType ] -- ; this . recoveredTypes = null ; this . statementRecoveryActivated = oldStatementRecoveryEnabled ; } checkNonNLSAfterBodyEnd ( end ) ; } public void persistLineSeparatorPositions ( ) { if ( this . scanner . recordLineSeparator ) { this . compilationUnit . compilationResult . lineSeparatorPositions = this . scanner . getLineEnds ( ) ; } } protected void prepareForBlockStatements ( ) { this . nestedMethod [ this . nestedType = 0 ] = 1 ; this . variablesCounter [ this . nestedType ] = 0 ; this . realBlockStack [ this . realBlockPtr = 1 ] = 0 ; } public ProblemReporter problemReporter ( ) { if ( this . scanner . recordLineSeparator ) { this . compilationUnit . compilationResult . lineSeparatorPositions = this . scanner . getLineEnds ( ) ; } this . problemReporter . referenceContext = this . referenceContext ; return this . problemReporter ; } protected void pushIdentifier ( ) { int stackLength = this . identifierStack . length ; if ( ++ this . identifierPtr >= stackLength ) { System . arraycopy ( this . identifierStack , 0 , this . identifierStack = new char [ stackLength + 20 ] [ ] , 0 , stackLength ) ; System . arraycopy ( this . identifierPositionStack , 0 , this . identifierPositionStack = new long [ stackLength + 20 ] , 0 , stackLength ) ; } this . identifierStack [ this . identifierPtr ] = this . scanner . getCurrentIdentifierSource ( ) ; this . identifierPositionStack [ this . identifierPtr ] = ( ( ( long ) this . scanner . startPosition ) << 32 ) + ( this . scanner . currentPosition - 1 ) ; stackLength = this . identifierLengthStack . length ; if ( ++ this . identifierLengthPtr >= stackLength ) { System . arraycopy ( this . identifierLengthStack , 0 , this . identifierLengthStack = new int [ stackLength + 10 ] , 0 , stackLength ) ; } this . identifierLengthStack [ this . identifierLengthPtr ] = 1 ; } protected void pushIdentifier ( int flag ) { int stackLength = this . identifierLengthStack . length ; if ( ++ this . identifierLengthPtr >= stackLength ) { System . arraycopy ( this . identifierLengthStack , 0 , this . identifierLengthStack = new int [ stackLength + 10 ] , 0 , stackLength ) ; } this . identifierLengthStack [ this . identifierLengthPtr ] = flag ; } protected void pushOnAstLengthStack ( int pos ) { int stackLength = this . astLengthStack . length ; if ( ++ this . astLengthPtr >= stackLength ) { System . arraycopy ( this . astLengthStack , 0 , this . astLengthStack = new int [ stackLength + StackIncrement ] , 0 , stackLength ) ; } this . astLengthStack [ this . astLengthPtr ] = pos ; } protected void pushOnAstStack ( ASTNode node ) { int stackLength = this . astStack . length ; if ( ++ this . astPtr >= stackLength ) { System . arraycopy ( this . astStack , 0 , this . astStack = new ASTNode [ stackLength + AstStackIncrement ] , 0 , stackLength ) ; this . astPtr = stackLength ; } this . astStack [ this . astPtr ] = node ; stackLength = this . astLengthStack . length ; if ( ++ this . astLengthPtr >= stackLength ) { System . arraycopy ( this . astLengthStack , 0 , this . astLengthStack = new int [ stackLength + AstStackIncrement ] , 0 , stackLength ) ; } this . astLengthStack [ this . astLengthPtr ] = 1 ; } protected void pushOnExpressionStack ( Expression expr ) { int stackLength = this . expressionStack . length ; if ( ++ this . expressionPtr >= stackLength ) { System . arraycopy ( this . expressionStack , 0 , this . expressionStack = new Expression [ stackLength + ExpressionStackIncrement ] , 0 , stackLength ) ; } this . expressionStack [ this . expressionPtr ] = expr ; stackLength = this . expressionLengthStack . length ; if ( ++ this . expressionLengthPtr >= stackLength ) { System . arraycopy ( this . expressionLengthStack , 0 , this . expressionLengthStack = new int [ stackLength + ExpressionStackIncrement ] , 0 , stackLength ) ; } this . expressionLengthStack [ this . expressionLengthPtr ] = 1 ; } protected void pushOnExpressionStackLengthStack ( int pos ) { int stackLength = this . expressionLengthStack . length ; if ( ++ this . expressionLengthPtr >= stackLength ) { System . arraycopy ( this . expressionLengthStack , 0 , this . expressionLengthStack = new int [ stackLength + StackIncrement ] , 0 , stackLength ) ; } this . expressionLengthStack [ this . expressionLengthPtr ] = pos ; } protected void pushOnGenericsIdentifiersLengthStack ( int pos ) { int stackLength = this . genericsIdentifiersLengthStack . length ; if ( ++ this . genericsIdentifiersLengthPtr >= stackLength ) { System . arraycopy ( this . genericsIdentifiersLengthStack , 0 , this . genericsIdentifiersLengthStack = new int [ stackLength + GenericsStackIncrement ] , 0 , stackLength ) ; } this . genericsIdentifiersLengthStack [ this . genericsIdentifiersLengthPtr ] = pos ; } protected void pushOnGenericsLengthStack ( int pos ) { int stackLength = this . genericsLengthStack . length ; if ( ++ this . genericsLengthPtr >= stackLength ) { System . arraycopy ( this . genericsLengthStack , 0 , this . genericsLengthStack = new int [ stackLength + GenericsStackIncrement ] , 0 , stackLength ) ; } this . genericsLengthStack [ this . genericsLengthPtr ] = pos ; } protected void pushOnGenericsStack ( ASTNode node ) { int stackLength = this . genericsStack . length ; if ( ++ this . genericsPtr >= stackLength ) { System . arraycopy ( this . genericsStack , 0 , this . genericsStack = new ASTNode [ stackLength + GenericsStackIncrement ] , 0 , stackLength ) ; } this . genericsStack [ this . genericsPtr ] = node ; stackLength = this . genericsLengthStack . length ; if ( ++ this . genericsLengthPtr >= stackLength ) { System . arraycopy ( this . genericsLengthStack , 0 , this . genericsLengthStack = new int [ stackLength + GenericsStackIncrement ] , 0 , stackLength ) ; } this . genericsLengthStack [ this . genericsLengthPtr ] = 1 ; } protected void pushOnIntStack ( int pos ) { int stackLength = this . intStack . length ; if ( ++ this . intPtr >= stackLength ) { System . arraycopy ( this . intStack , 0 , this . intStack = new int [ stackLength + StackIncrement ] , 0 , stackLength ) ; } this . intStack [ this . intPtr ] = pos ; } protected void pushOnRealBlockStack ( int i ) { int stackLength = this . realBlockStack . length ; if ( ++ this . realBlockPtr >= stackLength ) { System . arraycopy ( this . realBlockStack , 0 , this . realBlockStack = new int [ stackLength + StackIncrement ] , 0 , stackLength ) ; } this . realBlockStack [ this . realBlockPtr ] = i ; } protected void recoverStatements ( ) { class MethodVisitor extends ASTVisitor { public ASTVisitor typeVisitor ; TypeDeclaration enclosingType ; TypeDeclaration [ ] types = new TypeDeclaration [ 0 ] ; int typePtr = - 1 ; public void endVisit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { endVisitMethod ( constructorDeclaration , scope ) ; } public void endVisit ( Initializer initializer , MethodScope scope ) { if ( initializer . block == null ) return ; TypeDeclaration [ ] foundTypes = null ; int length = 0 ; if ( this . typePtr > - 1 ) { length = this . typePtr + 1 ; foundTypes = new TypeDeclaration [ length ] ; System . arraycopy ( this . types , 0 , foundTypes , 0 , length ) ; } ReferenceContext oldContext = Parser . this . referenceContext ; Parser . this . recoveryScanner . resetTo ( initializer . bodyStart , initializer . bodyEnd ) ; Scanner oldScanner = Parser . this . scanner ; Parser . this . scanner = Parser . this . recoveryScanner ; parseStatements ( this . enclosingType , initializer . bodyStart , initializer . bodyEnd , foundTypes , Parser . this . compilationUnit ) ; Parser . this . scanner = oldScanner ; Parser . this . referenceContext = oldContext ; for ( int i = 0 ; i < length ; i ++ ) { foundTypes [ i ] . traverse ( this . typeVisitor , scope ) ; } } public void endVisit ( MethodDeclaration methodDeclaration , ClassScope scope ) { endVisitMethod ( methodDeclaration , scope ) ; } private void endVisitMethod ( AbstractMethodDeclaration methodDeclaration , ClassScope scope ) { TypeDeclaration [ ] foundTypes = null ; int length = 0 ; if ( this . typePtr > - 1 ) { length = this . typePtr + 1 ; foundTypes = new TypeDeclaration [ length ] ; System . arraycopy ( this . types , 0 , foundTypes , 0 , length ) ; } ReferenceContext oldContext = Parser . this . referenceContext ; Parser . this . recoveryScanner . resetTo ( methodDeclaration . bodyStart , methodDeclaration . bodyEnd ) ; Scanner oldScanner = Parser . this . scanner ; Parser . this . scanner = Parser . this . recoveryScanner ; parseStatements ( methodDeclaration , methodDeclaration . bodyStart , methodDeclaration . bodyEnd , foundTypes , Parser . this . compilationUnit ) ; Parser . this . scanner = oldScanner ; Parser . this . referenceContext = oldContext ; for ( int i = 0 ; i < length ; i ++ ) { foundTypes [ i ] . traverse ( this . typeVisitor , scope ) ; } } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { this . typePtr = - 1 ; return true ; } public boolean visit ( Initializer initializer , MethodScope scope ) { this . typePtr = - 1 ; if ( initializer . block == null ) return false ; return true ; } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { this . typePtr = - 1 ; return true ; } private boolean visit ( TypeDeclaration typeDeclaration ) { if ( this . types . length <= ++ this . typePtr ) { int length = this . typePtr ; System . arraycopy ( this . types , 0 , this . types = new TypeDeclaration [ length * 2 + 1 ] , 0 , length ) ; } this . types [ this . typePtr ] = typeDeclaration ; return false ; } public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { return this . visit ( typeDeclaration ) ; } public boolean visit ( TypeDeclaration typeDeclaration , ClassScope scope ) { return this . visit ( typeDeclaration ) ; } } class TypeVisitor extends ASTVisitor { public MethodVisitor methodVisitor ; TypeDeclaration [ ] types = new TypeDeclaration [ 0 ] ; int typePtr = - 1 ; public void endVisit ( TypeDeclaration typeDeclaration , BlockScope scope ) { endVisitType ( ) ; } public void endVisit ( TypeDeclaration typeDeclaration , ClassScope scope ) { endVisitType ( ) ; } private void endVisitType ( ) { this . typePtr -- ; } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { if ( constructorDeclaration . isDefaultConstructor ( ) ) return false ; constructorDeclaration . traverse ( this . methodVisitor , scope ) ; return false ; } public boolean visit ( Initializer initializer , MethodScope scope ) { if ( initializer . block == null ) return false ; this . methodVisitor . enclosingType = this . types [ this . typePtr ] ; initializer . traverse ( this . methodVisitor , scope ) ; return false ; } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { methodDeclaration . traverse ( this . methodVisitor , scope ) ; return false ; } private boolean visit ( TypeDeclaration typeDeclaration ) { if ( this . types . length <= ++ this . typePtr ) { int length = this . typePtr ; System . arraycopy ( this . types , 0 , this . types = new TypeDeclaration [ length * 2 + 1 ] , 0 , length ) ; } this . types [ this . typePtr ] = typeDeclaration ; return true ; } public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { return this . visit ( typeDeclaration ) ; } public boolean visit ( TypeDeclaration typeDeclaration , ClassScope scope ) { return this . visit ( typeDeclaration ) ; } } MethodVisitor methodVisitor = new MethodVisitor ( ) ; TypeVisitor typeVisitor = new TypeVisitor ( ) ; methodVisitor . typeVisitor = typeVisitor ; typeVisitor . methodVisitor = methodVisitor ; if ( this . referenceContext instanceof AbstractMethodDeclaration ) { ( ( AbstractMethodDeclaration ) this . referenceContext ) . traverse ( methodVisitor , ( ClassScope ) null ) ; } else if ( this . referenceContext instanceof TypeDeclaration ) { TypeDeclaration typeContext = ( TypeDeclaration ) this . referenceContext ; int length = typeContext . fields . length ; for ( int i = 0 ; i < length ; i ++ ) { final FieldDeclaration fieldDeclaration = typeContext . fields [ i ] ; switch ( fieldDeclaration . getKind ( ) ) { case AbstractVariableDeclaration . INITIALIZER : Initializer initializer = ( Initializer ) fieldDeclaration ; if ( initializer . block == null ) break ; methodVisitor . enclosingType = typeContext ; initializer . traverse ( methodVisitor , ( MethodScope ) null ) ; break ; } } } } public void recoveryExitFromVariable ( ) { if ( this . currentElement != null && this . currentElement . parent != null ) { if ( this . currentElement instanceof RecoveredLocalVariable ) { int end = ( ( RecoveredLocalVariable ) this . currentElement ) . localDeclaration . sourceEnd ; this . currentElement . updateSourceEndIfNecessary ( end ) ; this . currentElement = this . currentElement . parent ; } else if ( this . currentElement instanceof RecoveredField && ! ( this . currentElement instanceof RecoveredInitializer ) ) { if ( this . currentElement . bracketBalance <= 0 ) { int end = ( ( RecoveredField ) this . currentElement ) . fieldDeclaration . sourceEnd ; this . currentElement . updateSourceEndIfNecessary ( end ) ; this . currentElement = this . currentElement . parent ; } } } } public void recoveryTokenCheck ( ) { switch ( this . currentToken ) { case TokenNameStringLiteral : if ( this . recordStringLiterals && this . checkExternalizeStrings && this . lastPosistion < this . scanner . currentPosition && ! this . statementRecoveryActivated ) { StringLiteral stringLiteral = createStringLiteral ( this . scanner . getCurrentTokenSourceString ( ) , this . scanner . startPosition , this . scanner . currentPosition - 1 , Util . getLineNumber ( this . scanner . startPosition , this . scanner . lineEnds , 0 , this . scanner . linePtr ) ) ; this . compilationUnit . recordStringLiteral ( stringLiteral , this . currentElement != null ) ; } break ; case TokenNameLBRACE : RecoveredElement newElement = null ; if ( ! this . ignoreNextOpeningBrace ) { newElement = this . currentElement . updateOnOpeningBrace ( this . scanner . startPosition - 1 , this . scanner . currentPosition - 1 ) ; } this . lastCheckPoint = this . scanner . currentPosition ; if ( newElement != null ) { this . restartRecovery = true ; this . currentElement = newElement ; } break ; case TokenNameRBRACE : this . rBraceStart = this . scanner . startPosition - 1 ; this . rBraceEnd = this . scanner . currentPosition - 1 ; this . endPosition = flushCommentsDefinedPriorTo ( this . rBraceEnd ) ; newElement = this . currentElement . updateOnClosingBrace ( this . scanner . startPosition , this . rBraceEnd ) ; this . lastCheckPoint = this . scanner . currentPosition ; if ( newElement != this . currentElement ) { this . currentElement = newElement ; } break ; case TokenNameSEMICOLON : this . endStatementPosition = this . scanner . currentPosition - 1 ; this . endPosition = this . scanner . startPosition - 1 ; RecoveredType currentType = currentRecoveryType ( ) ; if ( currentType != null ) { currentType . insideEnumConstantPart = false ; } default : { if ( this . rBraceEnd > this . rBraceSuccessorStart && this . scanner . currentPosition != this . scanner . startPosition ) { this . rBraceSuccessorStart = this . scanner . startPosition ; } break ; } } this . ignoreNextOpeningBrace = false ; } protected void reportSyntaxErrors ( boolean isDietParse , int oldFirstToken ) { if ( this . referenceContext instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( MethodDeclaration ) this . referenceContext ; if ( ( methodDeclaration . bits & ASTNode . ErrorInSignature ) != 0 ) { return ; } } this . compilationUnit . compilationResult . lineSeparatorPositions = this . scanner . getLineEnds ( ) ; this . scanner . recordLineSeparator = false ; int start = this . scanner . initialPosition ; int end = this . scanner . eofPosition == Integer . MAX_VALUE ? this . scanner . eofPosition : this . scanner . eofPosition - 1 ; if ( isDietParse ) { TypeDeclaration [ ] types = this . compilationUnit . types ; int [ ] [ ] intervalToSkip = org . eclipse . jdt . internal . compiler . parser . diagnose . RangeUtil . computeDietRange ( types ) ; DiagnoseParser diagnoseParser = new DiagnoseParser ( this , oldFirstToken , start , end , intervalToSkip [ 0 ] , intervalToSkip [ 1 ] , intervalToSkip [ 2 ] , this . options ) ; diagnoseParser . diagnoseParse ( false ) ; reportSyntaxErrorsForSkippedMethod ( types ) ; this . scanner . resetTo ( start , end ) ; } else { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , oldFirstToken , start , end , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } } private void reportSyntaxErrorsForSkippedMethod ( TypeDeclaration [ ] types ) { if ( types != null ) { for ( int i = 0 ; i < types . length ; i ++ ) { TypeDeclaration [ ] memberTypes = types [ i ] . memberTypes ; if ( memberTypes != null ) { reportSyntaxErrorsForSkippedMethod ( memberTypes ) ; } AbstractMethodDeclaration [ ] methods = types [ i ] . methods ; if ( methods != null ) { for ( int j = 0 ; j < methods . length ; j ++ ) { AbstractMethodDeclaration method = methods [ j ] ; if ( ( method . bits & ASTNode . ErrorInSignature ) != 0 ) { if ( method . isAnnotationMethod ( ) ) { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , TokenNameQUESTION , method . declarationSourceStart , method . declarationSourceEnd , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } else { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , TokenNameDIVIDE , method . declarationSourceStart , method . declarationSourceEnd , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } } } } FieldDeclaration [ ] fields = types [ i ] . fields ; if ( fields != null ) { int length = fields . length ; for ( int j = 0 ; j < length ; j ++ ) { if ( fields [ j ] instanceof Initializer ) { Initializer initializer = ( Initializer ) fields [ j ] ; if ( ( initializer . bits & ASTNode . ErrorInSignature ) != 0 ) { DiagnoseParser diagnoseParser = new DiagnoseParser ( this , TokenNameRIGHT_SHIFT , initializer . declarationSourceStart , initializer . declarationSourceEnd , this . options ) ; diagnoseParser . diagnoseParse ( this . options . performStatementsRecovery ) ; } } } } } } } protected void resetModifiers ( ) { this . modifiers = ClassFileConstants . AccDefault ; this . modifiersSourceStart = - 1 ; this . scanner . commentPtr = - 1 ; } protected void resetStacks ( ) { this . astPtr = - 1 ; this . astLengthPtr = - 1 ; this . expressionPtr = - 1 ; this . expressionLengthPtr = - 1 ; this . identifierPtr = - 1 ; this . identifierLengthPtr = - 1 ; this . intPtr = - 1 ; this . nestedMethod [ this . nestedType = 0 ] = 0 ; this . variablesCounter [ this . nestedType ] = 0 ; this . dimensions = 0 ; this . realBlockStack [ this . realBlockPtr = 0 ] = 0 ; this . recoveredStaticInitializerStart = 0 ; this . listLength = 0 ; this . listTypeParameterLength = 0 ; this . genericsIdentifiersLengthPtr = - 1 ; this . genericsLengthPtr = - 1 ; this . genericsPtr = - 1 ; } protected boolean resumeAfterRecovery ( ) { if ( ! this . methodRecoveryActivated && ! this . statementRecoveryActivated ) { resetStacks ( ) ; resetModifiers ( ) ; if ( ! moveRecoveryCheckpoint ( ) ) { return false ; } if ( this . referenceContext instanceof CompilationUnitDeclaration ) { goForHeaders ( ) ; this . diet = true ; return true ; } return false ; } else if ( ! this . statementRecoveryActivated ) { resetStacks ( ) ; resetModifiers ( ) ; if ( ! moveRecoveryCheckpoint ( ) ) { return false ; } goForHeaders ( ) ; return true ; } else { return false ; } } protected boolean resumeOnSyntaxError ( ) { if ( this . currentElement == null ) { this . javadoc = null ; if ( this . statementRecoveryActivated ) return false ; this . currentElement = buildInitialRecoveryState ( ) ; } if ( this . currentElement == null ) return false ; if ( this . restartRecovery ) { this . restartRecovery = false ; } updateRecoveryState ( ) ; if ( getFirstToken ( ) == TokenNameAND ) { if ( this . referenceContext instanceof CompilationUnitDeclaration ) { TypeDeclaration typeDeclaration = new TypeDeclaration ( this . referenceContext . compilationResult ( ) ) ; typeDeclaration . name = Util . EMPTY_STRING . toCharArray ( ) ; this . currentElement = this . currentElement . add ( typeDeclaration , 0 ) ; } } if ( this . lastPosistion < this . scanner . currentPosition ) { this . lastPosistion = this . scanner . currentPosition ; this . scanner . lastPosition = this . scanner . currentPosition ; } return resumeAfterRecovery ( ) ; } public void setMethodsFullRecovery ( boolean enabled ) { this . options . performMethodsFullRecovery = enabled ; } public void setStatementsRecovery ( boolean enabled ) { if ( enabled ) this . options . performMethodsFullRecovery = true ; this . options . performStatementsRecovery = enabled ; } public String toString ( ) { String s = "" + String . valueOf ( this . lastCheckPoint ) + "n" ; s = s + "" + ( this . identifierPtr + 1 ) + "][] = {" ; for ( int i = 0 ; i <= this . identifierPtr ; i ++ ) { s = s + "\"" + String . valueOf ( this . identifierStack [ i ] ) + "\"," ; } s = s + "}n" ; s = s + "" + ( this . identifierLengthPtr + 1 ) + "] = {" ; for ( int i = 0 ; i <= this . identifierLengthPtr ; i ++ ) { s = s + this . identifierLengthStack [ i ] + "," ; } s = s + "}n" ; s = s + "" + ( this . astLengthPtr + 1 ) + "] = {" ; for ( int i = 0 ; i <= this . astLengthPtr ; i ++ ) { s = s + this . astLengthStack [ i ] + "," ; } s = s + "}n" ; s = s + "" + String . valueOf ( this . astPtr ) + "n" ; s = s + "" + ( this . intPtr + 1 ) + "] = {" ; for ( int i = 0 ; i <= this . intPtr ; i ++ ) { s = s + this . intStack [ i ] + "," ; } s = s + "}n" ; s = s + "" + ( this . expressionLengthPtr + 1 ) + "] = {" ; for ( int i = 0 ; i <= this . expressionLengthPtr ; i ++ ) { s = s + this . expressionLengthStack [ i ] + "," ; } s = s + "}n" ; s = s + "" + String . valueOf ( this . expressionPtr ) + "n" ; s = s + "" + ( this . genericsIdentifiersLengthPtr + 1 ) + "] = {" ; for ( int i = 0 ; i <= this . genericsIdentifiersLengthPtr ; i ++ ) { s = s + this . genericsIdentifiersLengthStack [ i ] + "," ; } s = s + "}n" ; s = s + "" + ( this . genericsLengthPtr + 1 ) + "] = {" ; for ( int i = 0 ; i <= this . genericsLengthPtr ; i ++ ) { s = s + this . genericsLengthStack [ i ] + "," ; } s = s + "}n" ; s = s + "" + String . valueOf ( this . genericsPtr ) + "n" ; s = s + "" + this . scanner . toString ( ) ; return s ; } protected void updateRecoveryState ( ) { this . currentElement . updateFromParserState ( ) ; recoveryTokenCheck ( ) ; } protected void updateSourceDeclarationParts ( int variableDeclaratorsCounter ) { FieldDeclaration field ; int endTypeDeclarationPosition = - 1 + this . astStack [ this . astPtr - variableDeclaratorsCounter + 1 ] . sourceStart ; for ( int i = 0 ; i < variableDeclaratorsCounter - 1 ; i ++ ) { field = ( FieldDeclaration ) this . astStack [ this . astPtr - i - 1 ] ; field . endPart1Position = endTypeDeclarationPosition ; field . endPart2Position = - 1 + this . astStack [ this . astPtr - i ] . sourceStart ; } ( field = ( FieldDeclaration ) this . astStack [ this . astPtr ] ) . endPart1Position = endTypeDeclarationPosition ; field . endPart2Position = field . declarationSourceEnd ; } protected void updateSourcePosition ( Expression exp ) { exp . sourceEnd = this . intStack [ this . intPtr -- ] ; exp . sourceStart = this . intStack [ this . intPtr -- ] ; } public void reset ( ) { } } </s>