/** * Sets the scanner offset to the given offset. * @param offset The offset to set */ public void setOffset(int offset) { this.scanner.resetTo(offset, this.endPosition); }
/** * Sets the scanner offset to the given offset. * @param offset The offset to set */ public void setOffset(int offset) { this.scanner.resetTo(offset, this.endPosition); }
/** * Sets the scanner offset to the given offset. * @param offset The offset to set */ public void setOffset(int offset) { this.scanner.resetTo(offset, this.endPosition); }
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; }
void redoAlignment(AlignmentException e){ if (e.relativeDepth > 0) { // if exception targets a distinct context e.relativeDepth--; // record fact that current context got traversed this.currentAlignment = this.currentAlignment.enclosing; // pop currentLocation throw e; // rethrow } // reset scribe/scanner to restart at this given location resetAt(this.currentAlignment.location); this.scanner.resetTo(this.currentAlignment.location.inputOffset, this.scanner.eofPosition - 1); // clean alignment chunkKind so it will think it is a new chunk again this.currentAlignment.chunkKind = 0; }
/** * Reposition the scanner on some portion of the original source. The given endPosition is the last valid position. * Beyond this position, the scanner will answer EOF tokens (<code>ITerminalSymbols.TokenNameEOF</code>). * * @param begin the given start position * @param end the given end position */ public void resetTo(int begin, int end) { resetTo(begin, end, isInModuleDeclaration()); } public void resetTo(int begin, int end, boolean isModuleInfo) {
/** * Reposition the scanner on some portion of the original source. The given endPosition is the last valid position. * Beyond this position, the scanner will answer EOF tokens (<code>ITerminalSymbols.TokenNameEOF</code>). * * @param begin the given start position * @param end the given end position */ public void resetTo(int begin, int end) { resetTo(begin, end, isInModuleDeclaration()); } public void resetTo(int begin, int end, boolean isModuleInfo) {
protected void setAnnotations(ModuleDeclaration moduleDecl, org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration moduleDeclaration) { this.scanner.resetTo(moduleDeclaration.declarationSourceStart, moduleDeclaration.sourceStart); List<IExtendedModifier> modifiers = new ArrayList<>(); this.setModifiers(modifiers, moduleDeclaration.annotations, moduleDeclaration.sourceStart); for (IExtendedModifier ie : modifiers) { if (!ie.isAnnotation()) { continue; // not setting to malformed. } moduleDecl.annotations().add(ie); } } /**
protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } return false; }
protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } return false; }
@Override protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } return false; }
protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } return false; }
protected void setAnnotations(ModuleDeclaration moduleDecl, org.eclipse.jdt.internal.compiler.ast.ModuleDeclaration moduleDeclaration) { this.scanner.resetTo(moduleDeclaration.declarationSourceStart, moduleDeclaration.sourceStart); List<IExtendedModifier> modifiers = new ArrayList<>(); this.setModifiers(modifiers, moduleDeclaration.annotations, moduleDeclaration.sourceStart); for (IExtendedModifier ie : modifiers) { if (!ie.isAnnotation()) { continue; // not setting to malformed. } moduleDecl.annotations().add(ie); } } /**
protected boolean parseIdentifierTag(boolean report) { if (super.parseIdentifierTag(report)) { createTag(); this.index = this.tagSourceEnd+1; this.scanner.resetTo(this.index, this.javadocEnd); return true; } return false; }
private boolean isNextTokenPunctuation() { this.localScanner.resetTo(this.scribe.scanner.currentPosition, this.scribe.scannerEndPosition - 1); try { int token = this.localScanner.getNextToken(); return !(Scanner.isLiteral(token) || Scanner.isKeyword(token) || Scanner.isIdentifier(token)); } catch(InvalidInputException e) { // ignore } return false; }
private static enum LocalTypeKind { LOCAL, METHOD_REFERENCE, LAMBDA, }
private static enum LocalTypeKind { LOCAL, METHOD_REFERENCE, LAMBDA, }
private static enum LocalTypeKind { LOCAL, METHOD_REFERENCE, LAMBDA, }
private static enum LocalTypeKind { LOCAL, METHOD_REFERENCE, LAMBDA, }
private static enum LocalTypeKind { LOCAL, METHOD_REFERENCE, LAMBDA, }