org.eclipse.jdt.internal.codeassist.complete
Class CompletionParser
java.lang.Object
org.eclipse.jdt.internal.compiler.parser.Parser
org.eclipse.jdt.internal.codeassist.impl.AssistParser
org.eclipse.jdt.internal.codeassist.complete.CompletionParser
- All Implemented Interfaces:
- OperatorIds, TypeIds, ParserBasicInformation, TerminalTokens
public class CompletionParser
- extends AssistParser
Fields inherited from class org.eclipse.jdt.internal.compiler.parser.Parser |
asb, asr, base_action, BracketKinds, check_table, compilationUnit, CurlyBracket, currentToken, firstToken, in_symb, javadoc, javadocParser, lastAct, lhs, methodRecoveryActivated, name, nasb, nasr, non_terminal_index, readableName, readManager, recovery_templates, recovery_templates_index, recoveryScanner, referenceContext, reportOnlyOneSyntaxError, reportSyntaxErrorIsRequired, reverse_index, rhs, RoundBracket, rules_compliance, scanner, scope_la, scope_lhs, scope_prefix, scope_rhs, scope_state, scope_state_set, scope_suffix, SquareBracket, statements_recovery_filter, term_action, term_check, terminal_index, VERBOSE_RECOVERY |
Fields inherited from interface org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation |
ACCEPT_ACTION, EOFT_SYMBOL, EOLT_SYMBOL, ERROR_ACTION, ERROR_SYMBOL, LA_STATE_OFFSET, MAX_LA, MAX_NAME_LENGTH, NT_OFFSET, NUM_NON_TERMINALS, NUM_RULES, NUM_STATES, NUM_SYMBOLS, NUM_TERMINALS, SCOPE_SIZE, SCOPE_UBOUND, START_STATE |
Fields inherited from interface org.eclipse.jdt.internal.compiler.parser.TerminalTokens |
TokenNameabstract, TokenNamealso, TokenNameAND, TokenNameAND_AND, TokenNameAND_EQUAL, TokenNameassert, TokenNameAssignableOrSynonym, TokenNameAssignableRedundantlyOrSynonym, TokenNameassume, TokenNameassume_redundantly, TokenNameAT, TokenNameaxiom, TokenNameBehaviorOrSynonym, TokenNameboolean, TokenNamebreak, TokenNamebyte, TokenNamecase, TokenNamecatch, TokenNamechar, TokenNameCharacterLiteral, TokenNameclass, TokenNamecode_bigint_math, TokenNamecode_java_math, TokenNamecode_safe_math, TokenNameCOLON, TokenNameCOMMA, TokenNameCOMMENT_BLOCK, TokenNameCOMMENT_JAVADOC, TokenNameCOMMENT_LINE, TokenNameconst, TokenNameconstraint, TokenNameconstraint_redundantly, TokenNamecontinue, TokenNamedecreases, TokenNamedecreases_redundantly, TokenNamedefault, TokenNamediverges, TokenNamediverges_redundantly, TokenNameDIVIDE, TokenNameDIVIDE_EQUAL, TokenNamedo, TokenNameDOT, TokenNameDOTDOT, TokenNamedouble, TokenNameDoubleLiteral, TokenNameELLIPSIS, TokenNameelse, TokenNameEnsuresOrSynonym, TokenNameEnsuresRedundantlyOrSynonym, TokenNameenum, TokenNameEOF, TokenNameEQUAL, TokenNameEQUAL_EQUAL, TokenNameEQUIV, TokenNameERROR, TokenNameextends, TokenNamefalse, TokenNamefinal, TokenNamefinally, TokenNamefloat, TokenNameFloatingPointLiteral, TokenNamefor, TokenNameforall, TokenNameghost, TokenNamegoto, TokenNameGREATER, TokenNameGREATER_EQUAL, TokenNamehelper, TokenNameIdentifier, TokenNameif, TokenNameimplements, TokenNameIMPLIES, TokenNameimplies_that, TokenNameimport, TokenNamein, TokenNamein_redundantly, TokenNameInformalDescription, TokenNameinitially, TokenNameinstance, TokenNameinstanceof, TokenNameint, TokenNameIntegerLiteral, TokenNameinterface, TokenNameinvariant, TokenNameinvariant_redundantly, TokenNamejml_assert, TokenNamejml_assert_redundantly, TokenNameLBRACE, TokenNameLBRACE_OR, TokenNameLBRACKET, TokenNameLEFT_SHIFT, TokenNameLEFT_SHIFT_EQUAL, TokenNameLESS, TokenNameLESS_EQUAL, TokenNamelong, TokenNameLongLiteral, TokenNameloop_invariant, TokenNameloop_invariant_redundantly, TokenNameLPAREN, TokenNamemaps, TokenNamemaps_redundantly, TokenNameMINUS, TokenNameMINUS_EQUAL, TokenNameMINUS_MINUS, TokenNamemodel, TokenNamemono_non_null, TokenNameMULTIPLY, TokenNameMULTIPLY_EQUAL, TokenNamenative, TokenNamenew, TokenNamenon_null, TokenNamenon_null_by_default, TokenNameNOT, TokenNameNOT_EQUAL, TokenNameNOT_EQUIV, TokenNamenowarn, TokenNamenull, TokenNamenullable, TokenNamenullable_by_default, TokenNameold, TokenNameOR, TokenNameOR_EQUAL, TokenNameOR_OR, TokenNameOR_RBRACE, TokenNamepackage, TokenNamepeer, TokenNamePLUS, TokenNamePLUS_EQUAL, TokenNamePLUS_PLUS, TokenNameprivate, TokenNameprotected, TokenNamepublic, TokenNamepure, TokenNameQUESTION, TokenNameRBRACE, TokenNameRBRACKET, TokenNamereadonly, TokenNameREMAINDER, TokenNameREMAINDER_EQUAL, TokenNamerep, TokenNamerepresents, TokenNameREPRESENTS, TokenNamerepresents_redundantly, TokenNameRequiresOrSynonym, TokenNameRequiresRedundantlyOrSynonym, TokenNamereturn, TokenNameREV_IMPLIES, TokenNameRIGHT_SHIFT, TokenNameRIGHT_SHIFT_EQUAL, TokenNameRPAREN, TokenNameSEMICOLON, TokenNameset, TokenNameshort, TokenNamesignals_only, TokenNamesignals_only_redundantly, TokenNameSignalsOrSynonym, TokenNameSignalsRedundantlyOrSynonym, TokenNameslash_elemtype, TokenNameslash_everything, TokenNameslash_exists, TokenNameslash_forall, TokenNameslash_fresh, TokenNameslash_into, TokenNameslash_max, TokenNameslash_min, TokenNameslash_nonnullelements, TokenNameslash_not_assigned, TokenNameslash_not_modified, TokenNameslash_not_specified, TokenNameslash_nothing, TokenNameslash_num_of, TokenNameslash_old, TokenNameslash_peer, TokenNameslash_pre, TokenNameslash_product, TokenNameslash_readonly, TokenNameslash_rep, TokenNameslash_result, TokenNameslash_same, TokenNameslash_sum, TokenNameslash_type, TokenNameslash_typeof, TokenNamespec_bigint_math, TokenNamespec_java_math, TokenNamespec_protected, TokenNamespec_public, TokenNamespec_safe_math, TokenNamestatic, TokenNamestrictfp, TokenNameStringLiteral, TokenNameSUBTYPE, TokenNamesuper, TokenNameswitch, TokenNamesynchronized, TokenNamethis, TokenNamethrow, TokenNamethrows, TokenNametransient, TokenNametrue, TokenNametry, TokenNameTWIDDLE, TokenNameuninitialized, TokenNameUNSIGNED_RIGHT_SHIFT, TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL, TokenNamevoid, TokenNamevolatile, TokenNamewhile, TokenNameWHITESPACE, TokenNameXOR, TokenNameXOR_EQUAL |
Fields inherited from interface org.eclipse.jdt.internal.compiler.ast.OperatorIds |
AND, AND_AND, DIVIDE, EQUAL, EQUAL_EQUAL, GREATER, GREATER_EQUAL, INSTANCEOF, JML_ELEMTYPE, JML_EQUIV, JML_IMPLIES, JML_NONNULLELEMENTS, JML_NOT_ASSIGNED, JML_NOT_EQUIV, JML_NOT_MODIFIED, JML_OLD, JML_PRE, JML_REPRESENTS, JML_REV_IMPLIES, JML_TYPE, JML_TYPEOF, JmlOtherOpIdStart, LEFT_SHIFT, LESS, LESS_EQUAL, MINUS, MINUS_MINUS, MULTIPLY, NOT, NOT_EQUAL, NumberOfExtraTablesForJML, NumberOfTables, OR, OR_OR, PLUS, PLUS_PLUS, QUESTIONCOLON, REMAINDER, RIGHT_SHIFT, TWIDDLE, UNSIGNED_RIGHT_SHIFT, XOR |
Fields inherited from interface org.eclipse.jdt.internal.compiler.lookup.TypeIds |
Boolean2Boolean, Boolean2Int, Boolean2String, BOXING, Byte2Byte, Byte2Char, Byte2Double, Byte2Float, Byte2Int, Byte2Long, Byte2Short, Byte2String, Char2Byte, Char2Char, Char2Double, Char2Float, Char2Int, Char2Long, Char2Short, Char2String, COMPILE_TYPE_MASK, Double2Byte, Double2Char, Double2Double, Double2Float, Double2Int, Double2Long, Double2Short, Double2String, Float2Byte, Float2Char, Float2Double, Float2Float, Float2Int, Float2Long, Float2Short, Float2String, IMPLICIT_CONVERSION_MASK, Int2Byte, Int2Char, Int2Double, Int2Float, Int2Int, Int2Long, Int2Short, Int2String, Long2Byte, Long2Char, Long2Double, Long2Float, Long2Int, Long2Long, Long2Short, Long2String, NoId, Null2String, Object2Object, Object2String, Short2Byte, Short2Char, Short2Double, Short2Float, Short2Int, Short2Long, Short2Short, Short2String, String2String, T_boolean, T_byte, T_char, T_double, T_float, T_int, T_JavaIoException, T_JavaIoExternalizable, T_JavaIoObjectStreamException, T_JavaIoPrintStream, T_JavaIoSerializable, T_JavaLangAnnotationAnnotation, T_JavaLangAnnotationDocumented, T_JavaLangAnnotationElementType, T_JavaLangAnnotationInherited, T_JavaLangAnnotationRetention, T_JavaLangAnnotationRetentionPolicy, T_JavaLangAnnotationTarget, T_JavaLangAssertionError, T_JavaLangBoolean, T_JavaLangByte, T_JavaLangCharacter, T_JavaLangClass, T_JavaLangClassNotFoundException, T_JavaLangCloneable, T_JavaLangDeprecated, T_JavaLangDouble, T_JavaLangEnum, T_JavaLangError, T_JavaLangException, T_JavaLangFloat, T_JavaLangIllegalArgumentException, T_JavaLangInteger, T_JavaLangIterable, T_JavaLangLong, T_JavaLangNoClassDefError, T_JavaLangObject, T_JavaLangOverride, T_JavaLangReflectConstructor, T_JavaLangReflectField, T_JavaLangReflectMethod, T_JavaLangRuntimeException, T_JavaLangShort, T_JavaLangString, T_JavaLangStringBuffer, T_JavaLangStringBuilder, T_JavaLangSuppressWarnings, T_JavaLangSystem, T_JavaLangThrowable, T_JavaLangVoid, T_JavaUtilIterator, T_long, T_null, T_short, T_undefined, T_void, UNBOXING |
Method Summary |
char[] |
assistIdentifier()
|
int |
bodyEnd(AbstractMethodDeclaration method)
|
int |
bodyEnd(Initializer initializer)
|
void |
completionIdentifierCheck()
|
MethodDeclaration |
convertToMethodDeclaration(ConstructorDeclaration c,
CompilationResult compilationResult)
|
ImportReference |
createAssistImportReference(char[][] tokens,
long[] positions,
int mod)
|
ImportReference |
createAssistPackageReference(char[][] tokens,
long[] positions)
|
TypeReference |
createParameterizedQualifiedAssistTypeReference(char[][] previousIdentifiers,
TypeReference[][] typeArguments,
char[] assistName,
TypeReference[] assistTypeArguments,
long[] positions)
|
TypeReference |
createParameterizedSingleAssistTypeReference(TypeReference[] typeArguments,
char[] assistName,
long position)
|
NameReference |
createQualifiedAssistNameReference(char[][] previousIdentifiers,
char[] assistName,
long[] positions)
|
TypeReference |
createQualifiedAssistTypeReference(char[][] previousIdentifiers,
char[] assistName,
long[] positions)
|
NameReference |
createSingleAssistNameReference(char[] assistName,
long position)
|
TypeReference |
createSingleAssistTypeReference(char[] assistName,
long position)
|
CompilationUnitDeclaration |
dietParse(ICompilationUnit sourceUnit,
CompilationResult compilationResult,
int cursorLoc)
|
void |
flushAssistState()
|
void |
initialize()
|
void |
initialize(boolean initializeNLS)
|
void |
initializeScanner()
|
CompilationUnitDeclaration |
parse(ICompilationUnit sourceUnit,
CompilationResult compilationResult,
int cursorLoc)
|
void |
parseBlockStatements(ConstructorDeclaration cd,
CompilationUnitDeclaration unit)
Parse the block statements inside the given constructor declaration and try to complete at the
cursor location. |
MethodDeclaration |
parseSomeStatements(int start,
int end,
int fakeBlocksCount,
CompilationUnitDeclaration unit)
|
void |
recoveryExitFromVariable()
|
void |
recoveryTokenCheck()
|
void |
reset()
|
void |
resetAfterCompletion()
|
void |
setAssistIdentifier(char[] assistIdent)
|
void |
startRecordingIdentifiers(int from,
int to)
|
void |
stopRecordingIdentifiers()
|
java.lang.String |
toString()
|
Methods inherited from class org.eclipse.jdt.internal.compiler.parser.Parser |
arrayInitializer, asi, base_check, buildFilesFromLPG, checkComment, containsComment, dietParse, flushCommentsDefinedPriorTo, getFirstToken, getJavaDocPositions, getMethodBodies, goForClassBodyDeclarations, goForExpression, goForFieldDeclaration, goForGenericMethodDeclaration, goForImportDeclaration, goForInitializer, goForMemberValue, goForMethodBody, goForPackageDeclaration, goForTypeDeclaration, in_symbol, initTables, jumpOverMethodBody, nasi, ntAction, parse, parse, parse, parse, parse, parse, parseClassBodyDeclarations, parseExpression, parseMemberValue, parseStatements, persistLineSeparatorPositions, problemReporter, setMethodsFullRecovery, setStatementsRecovery, tAction |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FAKE_TYPE_NAME
public static final char[] FAKE_TYPE_NAME
FAKE_METHOD_NAME
public static final char[] FAKE_METHOD_NAME
FAKE_ARGUMENT_NAME
public static final char[] FAKE_ARGUMENT_NAME
VALUE
public static final char[] VALUE
cursorLocation
public int cursorLocation
assistNodeParent
public ASTNode assistNodeParent
enclosingNode
public ASTNode enclosingNode
record
public boolean record
skipRecord
public boolean skipRecord
recordFrom
public int recordFrom
recordTo
public int recordTo
potentialVariableNamesPtr
public int potentialVariableNamesPtr
potentialVariableNames
public char[][] potentialVariableNames
potentialVariableNameStarts
public int[] potentialVariableNameStarts
potentialVariableNameEnds
public int[] potentialVariableNameEnds
sourceEnds
public HashtableOfObjectToInt sourceEnds
CompletionParser
public CompletionParser(ProblemReporter problemReporter,
boolean storeExtraSourceEnds)
startRecordingIdentifiers
public void startRecordingIdentifiers(int from,
int to)
stopRecordingIdentifiers
public void stopRecordingIdentifiers()
assistIdentifier
public char[] assistIdentifier()
- Specified by:
assistIdentifier
in class AssistParser
bodyEnd
public int bodyEnd(AbstractMethodDeclaration method)
- Overrides:
bodyEnd
in class AssistParser
bodyEnd
public int bodyEnd(Initializer initializer)
- Overrides:
bodyEnd
in class AssistParser
completionIdentifierCheck
public void completionIdentifierCheck()
convertToMethodDeclaration
public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c,
CompilationResult compilationResult)
- Overrides:
convertToMethodDeclaration
in class Parser
createAssistImportReference
public ImportReference createAssistImportReference(char[][] tokens,
long[] positions,
int mod)
- Specified by:
createAssistImportReference
in class AssistParser
createAssistPackageReference
public ImportReference createAssistPackageReference(char[][] tokens,
long[] positions)
- Specified by:
createAssistPackageReference
in class AssistParser
createQualifiedAssistNameReference
public NameReference createQualifiedAssistNameReference(char[][] previousIdentifiers,
char[] assistName,
long[] positions)
- Specified by:
createQualifiedAssistNameReference
in class AssistParser
createQualifiedAssistTypeReference
public TypeReference createQualifiedAssistTypeReference(char[][] previousIdentifiers,
char[] assistName,
long[] positions)
- Specified by:
createQualifiedAssistTypeReference
in class AssistParser
createParameterizedQualifiedAssistTypeReference
public TypeReference createParameterizedQualifiedAssistTypeReference(char[][] previousIdentifiers,
TypeReference[][] typeArguments,
char[] assistName,
TypeReference[] assistTypeArguments,
long[] positions)
- Specified by:
createParameterizedQualifiedAssistTypeReference
in class AssistParser
createSingleAssistNameReference
public NameReference createSingleAssistNameReference(char[] assistName,
long position)
- Specified by:
createSingleAssistNameReference
in class AssistParser
createSingleAssistTypeReference
public TypeReference createSingleAssistTypeReference(char[] assistName,
long position)
- Specified by:
createSingleAssistTypeReference
in class AssistParser
createParameterizedSingleAssistTypeReference
public TypeReference createParameterizedSingleAssistTypeReference(TypeReference[] typeArguments,
char[] assistName,
long position)
- Specified by:
createParameterizedSingleAssistTypeReference
in class AssistParser
dietParse
public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit,
CompilationResult compilationResult,
int cursorLoc)
flushAssistState
public void flushAssistState()
- Overrides:
flushAssistState
in class AssistParser
initialize
public void initialize()
- Overrides:
initialize
in class AssistParser
initialize
public void initialize(boolean initializeNLS)
- Overrides:
initialize
in class AssistParser
initializeScanner
public void initializeScanner()
- Specified by:
initializeScanner
in class AssistParser
parse
public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit,
CompilationResult compilationResult,
int cursorLoc)
parseBlockStatements
public void parseBlockStatements(ConstructorDeclaration cd,
CompilationUnitDeclaration unit)
- Description copied from class:
AssistParser
- Parse the block statements inside the given constructor declaration and try to complete at the
cursor location.
- Overrides:
parseBlockStatements
in class AssistParser
parseSomeStatements
public MethodDeclaration parseSomeStatements(int start,
int end,
int fakeBlocksCount,
CompilationUnitDeclaration unit)
recoveryExitFromVariable
public void recoveryExitFromVariable()
- Overrides:
recoveryExitFromVariable
in class AssistParser
recoveryTokenCheck
public void recoveryTokenCheck()
- Overrides:
recoveryTokenCheck
in class AssistParser
reset
public void reset()
- Overrides:
reset
in class AssistParser
resetAfterCompletion
public void resetAfterCompletion()
setAssistIdentifier
public void setAssistIdentifier(char[] assistIdent)
- Specified by:
setAssistIdentifier
in class AssistParser
toString
public java.lang.String toString()
- Overrides:
toString
in class Parser