private VanguardParser getVanguardParser() { if (this.vanguardParser == null) { this.vanguardScanner = new VanguardScanner(this.sourceLevel, this.complianceLevel); this.vanguardParser = new VanguardParser(this.vanguardScanner); this.vanguardScanner.setActiveParser(this.vanguardParser); } this.vanguardScanner.setSource(this.source); this.vanguardScanner.resetTo(this.startPosition, this.eofPosition - 1); return this.vanguardParser; }
protected void updateRecoveryState() { /* expose parser state to recovery state */ this.currentElement.updateFromParserState(); /* check and update recovered state based on current token, this action is also performed when shifting token after recovery got activated once. */ recoveryTokenCheck(); } protected void updateSourceDeclarationParts(int variableDeclaratorsCounter) {
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement updateOnOpeningBrace(int braceStart, int braceEnd){ if (this.localDeclaration.declarationSourceEnd == 0 && (this.localDeclaration.type instanceof ArrayTypeReference || this.localDeclaration.type instanceof ArrayQualifiedTypeReference) && !this.alreadyCompletedLocalInitialization){ this.bracketBalance++; return null; // no update is necessary (array initializer) } // might be an array initializer this.updateSourceEndIfNecessary(braceStart - 1, braceEnd - 1); return this.parent.updateOnOpeningBrace(braceStart, braceEnd); } public void updateParseTree(){
@Override protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { super.consumeEnhancedForStatementHeaderInit(hasModifiers); if (this.currentElement != null) { LocalDeclaration localDecl = ((ForeachStatement)this.astStack[this.astPtr]).elementVariable; this.lastCheckPoint = localDecl.sourceEnd + 1; this.currentElement = this.currentElement.add(localDecl, 0); } } @Override
protected boolean parseReference() throws InvalidInputException { boolean valid = super.parseReference(); if (!valid) { this.scanner.resetTo(this.tagSourceEnd+1, this.javadocEnd); this.index = this.tagSourceEnd+1; this.tagValue = TAG_OTHERS_VALUE; // tag is invalid, do not keep the parsed tag value } return valid; }
public RecoveredElement updateOnClosingBrace(int braceStart, int braceEnd){ if ((--this.bracketBalance <= 0) && (this.parent != null)){ this.updateSourceEndIfNecessary(braceStart, braceEnd); return this.parent.updateOnClosingBrace(braceStart, braceEnd); } return this; } }
protected int readToken() throws InvalidInputException { int token = super.readToken(); if (token == TerminalTokens.TokenNameIdentifier && this.scanner.currentPosition == this.scanner.startPosition) { // Scanner is looping on empty token => read it... this.scanner.getCurrentIdentifierSource(); } return token; }
unit = unitsToProcess[i]; this.reportProgress(Messages.bind(Messages.compilation_processing, new String(unit.getFileName()))); this.parser.getMethodBodies(unit);
private VanguardParser getVanguardParser() { if (this.vanguardParser == null) { this.vanguardScanner = new VanguardScanner(this.sourceLevel, this.complianceLevel); this.vanguardParser = new VanguardParser(this.vanguardScanner); this.vanguardScanner.setActiveParser(this.vanguardParser); } this.vanguardScanner.setSource(this.source); this.vanguardScanner.resetTo(this.startPosition, this.eofPosition - 1, isInModuleDeclaration(), this.scanContext); return this.vanguardParser; }
protected void updateRecoveryState() { /* expose parser state to recovery state */ this.currentElement.updateFromParserState(); /* check and update recovered state based on current token, this action is also performed when shifting token after recovery got activated once. */ recoveryTokenCheck(); } protected void updateSourceDeclarationParts(int variableDeclaratorsCounter) {
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*
public RecoveredElement updateOnOpeningBrace(int braceStart, int braceEnd){ if (this.localDeclaration.declarationSourceEnd == 0 && (this.localDeclaration.type instanceof ArrayTypeReference || this.localDeclaration.type instanceof ArrayQualifiedTypeReference) && !this.alreadyCompletedLocalInitialization){ this.bracketBalance++; return null; // no update is necessary (array initializer) } // might be an array initializer this.updateSourceEndIfNecessary(braceStart - 1, braceEnd - 1); return this.parent.updateOnOpeningBrace(braceStart, braceEnd); } public void updateParseTree(){
protected void consumeEnhancedForStatementHeaderInit(boolean hasModifiers) { super.consumeEnhancedForStatementHeaderInit(hasModifiers); if (this.currentElement != null) { LocalDeclaration localDecl = ((ForeachStatement)this.astStack[this.astPtr]).elementVariable; this.lastCheckPoint = localDecl.sourceEnd + 1; this.currentElement = this.currentElement.add(localDecl, 0); } } protected void consumeEnterAnonymousClassBody(boolean qualified) {
public RecoveredElement updateOnClosingBrace(int braceStart, int braceEnd){ if ((--this.bracketBalance <= 0) && (this.parent != null)){ this.updateSourceEndIfNecessary(braceStart, braceEnd); return this.parent.updateOnClosingBrace(braceStart, braceEnd); } return this; } }
private VanguardParser getVanguardParser() { if (this.vanguardParser == null) { this.vanguardScanner = new VanguardScanner(this.sourceLevel, this.complianceLevel); this.vanguardParser = new VanguardParser(this.vanguardScanner); this.vanguardScanner.setActiveParser(this.vanguardParser); } this.vanguardScanner.setSource(this.source); this.vanguardScanner.resetTo(this.startPosition, this.eofPosition - 1, isInModuleDeclaration(), this.scanContext); return this.vanguardParser; }
protected void updateRecoveryState() { /* expose parser state to recovery state */ this.currentElement.updateFromParserState(); /* check and update recovered state based on current token, this action is also performed when shifting token after recovery got activated once. */ recoveryTokenCheck(); } protected void updateSourceDeclarationParts(int variableDeclaratorsCounter) {
public RecoveredElement add(AbstractMethodDeclaration methodDeclaration, int bracketBalanceValue) { if (this.parent != null && this.parent instanceof RecoveredMethod) { RecoveredMethod enclosingRecoveredMethod = (RecoveredMethod) this.parent; if (enclosingRecoveredMethod.methodBody == this && enclosingRecoveredMethod.parent == null) { resetPendingModifiers(); // the element cannot be added because we are in the body of a top level method return this; // ignore this element } } return super.add(methodDeclaration, bracketBalanceValue); } /*