@Override protected JavadocParser createJavadocParser() { return new CompletionJavadocParser(this); }
protected void updateDocComment() { super.updateDocComment(); if (this.completionNode instanceof Expression) { getCompletionParser().assistNodeParent = this.docComment; getCompletionParser().assistNode = (ASTNode) this.completionNode; getCompletionJavadoc().completionNode = (Expression) this.completionNode; } }
public CompletionJavadocParser(CompletionParser sourceParser) { super(sourceParser); this.scanner = new CompletionScanner(ClassFileConstants.JDK1_3); this.kind = COMPLETION_PARSER | TEXT_PARSE; initLevelTags(); }
typeRef = parseQualifiedName(false); if (this.abort) return null; // May be aborted by specialized parser } catch (InvalidInputException e) { if (firstArg && getCurrentTokenType() == TerminalTokens.TokenNameRPAREN) { this.lineStarted = true; return createMethodReference(receiver, null); Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); Object argument = createArgumentReference(this.scanner.getCurrentIdentifierSource(), 0, false, typeRef, null, (((long)argumentStart)<<32)+this.tokenPreviousPosition-1); return syntaxRecoverArgumentType(receiver, arguments, argument); CompletionOnJavadocSingleTypeReference singleTypeReference = (CompletionOnJavadocSingleTypeReference) this.completionNode; if (singleTypeReference.token == null || singleTypeReference.token.length == 0) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); CompletionOnJavadocQualifiedTypeReference qualifiedTypeReference = (CompletionOnJavadocQualifiedTypeReference) this.completionNode; if (qualifiedTypeReference.tokens == null || qualifiedTypeReference.tokens.length < qualifiedTypeReference.sourcePositions.length) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); if (readToken() == TerminalTokens.TokenNameLBRACKET) { while (readToken() == TerminalTokens.TokenNameLBRACKET) { consumeToken(); if (readToken() != TerminalTokens.TokenNameRBRACKET) {
int token = readTokenSafely(); switch (token) { case TerminalTokens.TokenNameStringLiteral : consumeToken(); break; case TerminalTokens.TokenNameERROR : consumeToken(); if (this.scanner.currentCharacter == '#') { // @see ...#member Object member = null; try { this.scanner.tokenizeWhiteSpace = false; member = parseMember(typeRef); } catch (InvalidInputException e) { consumeToken(); try { this.scanner.tokenizeWhiteSpace = false; typeRef = parseQualifiedName(true); if (this.completionNode == null) { consumeToken(); this.scanner.resetTo(this.tokenPreviousPosition, end); this.index = this.tokenPreviousPosition; consumeToken(); consumeToken(); try { this.scanner.tokenizeWhiteSpace = false;
protected Object syntaxRecoverQualifiedName(int primitiveToken) throws InvalidInputException { if (this.cursorLocation == ((int)this.identifierPositionStack[this.identifierPtr])) { // special case of completion just before the dot. return createTypeReference(primitiveToken); } int idLength = this.identifierLengthStack[this.identifierLengthPtr]; char[][] tokens = new char[idLength][]; int startPtr = this.identifierPtr-idLength+1; System.arraycopy(this.identifierStack, startPtr, tokens, 0, idLength); long[] positions = new long[idLength+1]; System.arraycopy(this.identifierPositionStack, startPtr, positions, 0, idLength); positions[idLength] = (((long)this.tokenPreviousPosition)<<32) + this.tokenPreviousPosition; this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, CharOperation.NO_CHAR, positions, this.tagSourceStart, this.tagSourceEnd); if (CompletionEngine.DEBUG) { System.out.println(" completion partial qualified type="+this.completionNode); //$NON-NLS-1$ } return this.completionNode; }
@Override protected Object createFieldReference(Object receiver) throws InvalidInputException { int refStart = (int) (this.identifierPositionStack[0] >>> 32); int refEnd = (int) this.identifierPositionStack[0]; boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers || ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token || (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor if (inCompletion) { JavadocFieldReference fieldRef = (JavadocFieldReference) super.createFieldReference(receiver); char[] name = this.sourceParser.compilationUnit.getMainTypeName(); TypeDeclaration typeDecl = getParsedTypeDeclaration(); if (typeDecl != null) { name = typeDecl.name; } this.completionNode = new CompletionOnJavadocFieldReference(fieldRef, this.memberStart, name); if (CompletionEngine.DEBUG) { System.out.println(" completion field="+this.completionNode); //$NON-NLS-1$ } return this.completionNode; } return super.createFieldReference(receiver); }
typeRef = parseQualifiedName(false); if (this.abort) return null; // May be aborted by specialized parser } catch (InvalidInputException e) { if (firstArg && getCurrentTokenType() == TerminalTokens.TokenNameRPAREN) { this.lineStarted = true; return createMethodReference(receiver, null); Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); Object argument = createArgumentReference(this.scanner.getCurrentIdentifierSource(), 0, false, typeRef, null, (((long)argumentStart)<<32)+this.tokenPreviousPosition-1); return syntaxRecoverArgumentType(receiver, arguments, argument); CompletionOnJavadocSingleTypeReference singleTypeReference = (CompletionOnJavadocSingleTypeReference) this.completionNode; if (singleTypeReference.token == null || singleTypeReference.token.length == 0) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); CompletionOnJavadocQualifiedTypeReference qualifiedTypeReference = (CompletionOnJavadocQualifiedTypeReference) this.completionNode; if (qualifiedTypeReference.tokens == null || qualifiedTypeReference.tokens.length < qualifiedTypeReference.sourcePositions.length) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); if (readToken() == TerminalTokens.TokenNameLBRACKET) { while (readToken() == TerminalTokens.TokenNameLBRACKET) { consumeToken(); if (readToken() != TerminalTokens.TokenNameRBRACKET) {
int token = readTokenSafely(); switch (token) { case TerminalTokens.TokenNameStringLiteral : consumeToken(); break; case TerminalTokens.TokenNameERROR : consumeToken(); if (this.scanner.currentCharacter == '#') { // @see ...#member Object member = null; try { this.scanner.tokenizeWhiteSpace = false; member = parseMember(typeRef); } catch (InvalidInputException e) { consumeToken(); try { this.scanner.tokenizeWhiteSpace = false; typeRef = parseQualifiedName(true); if (this.completionNode == null) { consumeToken(); this.scanner.resetTo(this.tokenPreviousPosition, end); this.index = this.tokenPreviousPosition; consumeToken(); consumeToken(); try { this.scanner.tokenizeWhiteSpace = false;
protected Object syntaxRecoverQualifiedName(int primitiveToken) throws InvalidInputException { if (this.cursorLocation == ((int)this.identifierPositionStack[this.identifierPtr])) { // special case of completion just before the dot. return createTypeReference(primitiveToken); } int idLength = this.identifierLengthStack[this.identifierLengthPtr]; char[][] tokens = new char[idLength][]; int startPtr = this.identifierPtr-idLength+1; System.arraycopy(this.identifierStack, startPtr, tokens, 0, idLength); long[] positions = new long[idLength+1]; System.arraycopy(this.identifierPositionStack, startPtr, positions, 0, idLength); positions[idLength] = (((long)this.tokenPreviousPosition)<<32) + this.tokenPreviousPosition; this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, CharOperation.NO_CHAR, positions, this.tagSourceStart, this.tagSourceEnd); if (CompletionEngine.DEBUG) { System.out.println(" completion partial qualified type="+this.completionNode); //$NON-NLS-1$ } return this.completionNode; }
protected Object createFieldReference(Object receiver) throws InvalidInputException { int refStart = (int) (this.identifierPositionStack[0] >>> 32); int refEnd = (int) this.identifierPositionStack[0]; boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers || ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token || (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor if (inCompletion) { JavadocFieldReference fieldRef = (JavadocFieldReference) super.createFieldReference(receiver); char[] name = this.sourceParser.compilationUnit.getMainTypeName(); TypeDeclaration typeDecl = getParsedTypeDeclaration(); if (typeDecl != null) { name = typeDecl.name; } this.completionNode = new CompletionOnJavadocFieldReference(fieldRef, this.memberStart, name); if (CompletionEngine.DEBUG) { System.out.println(" completion field="+this.completionNode); //$NON-NLS-1$ } return this.completionNode; } return super.createFieldReference(receiver); }
typeRef = parseQualifiedName(false); if (this.abort) return null; // May be aborted by specialized parser } catch (InvalidInputException e) { if (firstArg && getCurrentTokenType() == TerminalTokens.TokenNameRPAREN) { this.lineStarted = true; return createMethodReference(receiver, null); Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); Object argument = createArgumentReference(this.scanner.getCurrentIdentifierSource(), 0, false, typeRef, null, (((long)argumentStart)<<32)+this.tokenPreviousPosition-1); return syntaxRecoverArgumentType(receiver, arguments, argument); CompletionOnJavadocSingleTypeReference singleTypeReference = (CompletionOnJavadocSingleTypeReference) this.completionNode; if (singleTypeReference.token == null || singleTypeReference.token.length == 0) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); CompletionOnJavadocQualifiedTypeReference qualifiedTypeReference = (CompletionOnJavadocQualifiedTypeReference) this.completionNode; if (qualifiedTypeReference.tokens == null || qualifiedTypeReference.tokens.length < qualifiedTypeReference.sourcePositions.length) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); if (readToken() == TerminalTokens.TokenNameLBRACKET) { while (readToken() == TerminalTokens.TokenNameLBRACKET) { consumeToken(); if (readToken() != TerminalTokens.TokenNameRBRACKET) {
int token = readTokenSafely(); switch (token) { case TerminalTokens.TokenNameStringLiteral : consumeToken(); break; case TerminalTokens.TokenNameERROR : consumeToken(); if (this.scanner.currentCharacter == '#') { // @see ...#member Object member = null; try { this.scanner.tokenizeWhiteSpace = false; member = parseMember(typeRef); } catch (InvalidInputException e) { consumeToken(); try { this.scanner.tokenizeWhiteSpace = false; typeRef = parseQualifiedName(true); if (this.completionNode == null) { consumeToken(); this.scanner.resetTo(this.tokenPreviousPosition, end); this.index = this.tokenPreviousPosition; consumeToken(); consumeToken(); try { this.scanner.tokenizeWhiteSpace = false;
@Override protected void updateDocComment() { super.updateDocComment(); if (this.completionNode instanceof Expression) { getCompletionParser().assistNodeParent = this.docComment; getCompletionParser().assistNode = (ASTNode) this.completionNode; getCompletionJavadoc().completionNode = (Expression) this.completionNode; } }
public CompletionJavadocParser(CompletionParser sourceParser) { super(sourceParser); this.scanner = new CompletionScanner(ClassFileConstants.JDK1_3); this.kind = COMPLETION_PARSER | TEXT_PARSE; initLevelTags(); }
protected JavadocParser createJavadocParser() { return new CompletionJavadocParser(this); }
protected Object syntaxRecoverQualifiedName(int primitiveToken) throws InvalidInputException { if (this.cursorLocation == ((int)this.identifierPositionStack[this.identifierPtr])) { // special case of completion just before the dot. return createTypeReference(primitiveToken); } int idLength = this.identifierLengthStack[this.identifierLengthPtr]; char[][] tokens = new char[idLength][]; int startPtr = this.identifierPtr-idLength+1; System.arraycopy(this.identifierStack, startPtr, tokens, 0, idLength); long[] positions = new long[idLength+1]; System.arraycopy(this.identifierPositionStack, startPtr, positions, 0, idLength); positions[idLength] = (((long)this.tokenPreviousPosition)<<32) + this.tokenPreviousPosition; this.completionNode = new CompletionOnJavadocQualifiedTypeReference(tokens, CharOperation.NO_CHAR, positions, this.tagSourceStart, this.tagSourceEnd); if (CompletionEngine.DEBUG) { System.out.println(" completion partial qualified type="+this.completionNode); //$NON-NLS-1$ } return this.completionNode; }
protected Object createFieldReference(Object receiver) throws InvalidInputException { int refStart = (int) (this.identifierPositionStack[0] >>> 32); int refEnd = (int) this.identifierPositionStack[0]; boolean inCompletion = (refStart <= (this.cursorLocation+1) && this.cursorLocation <= refEnd) // completion cursor is between first and last stacked identifiers || ((refStart == (refEnd+1) && refEnd == this.cursorLocation)) // or it's a completion on empty token || (this.memberStart == this.cursorLocation); // or it's a completion just after the member separator with an identifier after the cursor if (inCompletion) { JavadocFieldReference fieldRef = (JavadocFieldReference) super.createFieldReference(receiver); char[] name = this.sourceParser.compilationUnit.getMainTypeName(); TypeDeclaration typeDecl = getParsedTypeDeclaration(); if (typeDecl != null) { name = typeDecl.name; } this.completionNode = new CompletionOnJavadocFieldReference(fieldRef, this.memberStart, name); if (CompletionEngine.DEBUG) { System.out.println(" completion field="+this.completionNode); //$NON-NLS-1$ } return this.completionNode; } return super.createFieldReference(receiver); }
typeRef = parseQualifiedName(false); if (this.abort) return null; // May be aborted by specialized parser } catch (InvalidInputException e) { if (firstArg && getCurrentTokenType() == TerminalTokens.TokenNameRPAREN) { this.lineStarted = true; return createMethodReference(receiver, null); Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); Object argument = createArgumentReference(this.scanner.getCurrentIdentifierSource(), 0, false, typeRef, null, (((long)argumentStart)<<32)+this.tokenPreviousPosition-1); return syntaxRecoverArgumentType(receiver, arguments, argument); CompletionOnJavadocSingleTypeReference singleTypeReference = (CompletionOnJavadocSingleTypeReference) this.completionNode; if (singleTypeReference.token == null || singleTypeReference.token.length == 0) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); CompletionOnJavadocQualifiedTypeReference qualifiedTypeReference = (CompletionOnJavadocQualifiedTypeReference) this.completionNode; if (qualifiedTypeReference.tokens == null || qualifiedTypeReference.tokens.length < qualifiedTypeReference.sourcePositions.length) { Object methodRef = createMethodReference(receiver, arguments); return syntaxRecoverEmptyArgumentType(methodRef); if (readToken() == TerminalTokens.TokenNameLBRACKET) { while (readToken() == TerminalTokens.TokenNameLBRACKET) { consumeToken(); if (readToken() != TerminalTokens.TokenNameRBRACKET) {
int token = readTokenSafely(); switch (token) { case TerminalTokens.TokenNameStringLiteral : consumeToken(); break; case TerminalTokens.TokenNameERROR : consumeToken(); if (this.scanner.currentCharacter == '#') { // @see ...#member Object member = null; try { this.scanner.tokenizeWhiteSpace = false; member = parseMember(typeRef); } catch (InvalidInputException e) { consumeToken(); try { this.scanner.tokenizeWhiteSpace = false; typeRef = parseQualifiedName(true); if (this.completionNode == null) { consumeToken(); this.scanner.resetTo(this.tokenPreviousPosition, end); this.index = this.tokenPreviousPosition; consumeToken(); consumeToken(); try { this.scanner.tokenizeWhiteSpace = false;