java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner
Alle implementierten Schnittstellen:
TerminalTokens
Bekannte direkte Unterklassen:
CompletionScanner, JavadocScanner, RecoveryScanner, SelectionScanner

public class Scanner extends Object implements TerminalTokens
IMPORTANT NOTE: Internal Scanner implementation. It is mirrored in org.eclipse.jdt.core.compiler public package where it is API. The mirror implementation is using the backward compatible ITerminalSymbols constant definitions (stable with 2.0), whereas the internal implementation uses TerminalTokens which constant values reflect the latest parser generation state.
  • Felddetails

    • sourceLevel

      public long sourceLevel
    • complianceLevel

      public long complianceLevel
    • useAssertAsAnIndentifier

      public boolean useAssertAsAnIndentifier
    • containsAssertKeyword

      public boolean containsAssertKeyword
    • previewEnabled

      public boolean previewEnabled
    • useEnumAsAnIndentifier

      public boolean useEnumAsAnIndentifier
    • recordLineSeparator

      public boolean recordLineSeparator
    • currentCharacter

      public char currentCharacter
    • startPosition

      public int startPosition
    • currentPosition

      public int currentPosition
    • initialPosition

      public int initialPosition
    • eofPosition

      public int eofPosition
    • skipComments

      public boolean skipComments
    • tokenizeComments

      public boolean tokenizeComments
    • tokenizeWhiteSpace

      public boolean tokenizeWhiteSpace
    • source

      public char[] source
    • withoutUnicodeBuffer

      public char[] withoutUnicodeBuffer
    • withoutUnicodePtr

      public int withoutUnicodePtr
    • unicodeAsBackSlash

      public boolean unicodeAsBackSlash
    • scanningFloatLiteral

      public boolean scanningFloatLiteral
    • COMMENT_ARRAYS_SIZE

      public static int COMMENT_ARRAYS_SIZE
    • commentStops

      public int[] commentStops
    • commentStarts

      public int[] commentStarts
    • commentTagStarts

      public int[] commentTagStarts
    • commentPtr

      public int commentPtr
    • lastCommentLinePosition

      public int lastCommentLinePosition
    • foundTaskTags

      public char[][] foundTaskTags
    • foundTaskMessages

      public char[][] foundTaskMessages
    • foundTaskPriorities

      public char[][] foundTaskPriorities
    • foundTaskPositions

      public int[][] foundTaskPositions
    • foundTaskCount

      public int foundTaskCount
    • taskTags

      public char[][] taskTags
    • taskPriorities

      public char[][] taskPriorities
    • isTaskCaseSensitive

      public boolean isTaskCaseSensitive
    • diet

      public boolean diet
    • lineEnds

      public int[] lineEnds
    • linePtr

      public int linePtr
    • wasAcr

      public boolean wasAcr
    • fakeInModule

      public boolean fakeInModule
    • caseStartPosition

      public int caseStartPosition
    • scanContext

      protected org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner.ScanContext scanContext
    • insideModuleInfo

      protected boolean insideModuleInfo
    • END_OF_SOURCE

      public static final String END_OF_SOURCE
      Siehe auch:
    • INVALID_HEXA

      public static final String INVALID_HEXA
      Siehe auch:
    • INVALID_OCTAL

      public static final String INVALID_OCTAL
      Siehe auch:
    • INVALID_CHARACTER_CONSTANT

      public static final String INVALID_CHARACTER_CONSTANT
      Siehe auch:
    • INVALID_ESCAPE

      public static final String INVALID_ESCAPE
      Siehe auch:
    • INVALID_INPUT

      public static final String INVALID_INPUT
      Siehe auch:
    • INVALID_TEXTBLOCK

      public static final String INVALID_TEXTBLOCK
      Siehe auch:
    • INVALID_UNICODE_ESCAPE

      public static final String INVALID_UNICODE_ESCAPE
      Siehe auch:
    • INVALID_FLOAT

      public static final String INVALID_FLOAT
      Siehe auch:
    • INVALID_LOW_SURROGATE

      public static final String INVALID_LOW_SURROGATE
      Siehe auch:
    • INVALID_HIGH_SURROGATE

      public static final String INVALID_HIGH_SURROGATE
      Siehe auch:
    • NULL_SOURCE_STRING

      public static final String NULL_SOURCE_STRING
      Siehe auch:
    • UNTERMINATED_STRING

      public static final String UNTERMINATED_STRING
      Siehe auch:
    • UNTERMINATED_TEXT_BLOCK

      public static final String UNTERMINATED_TEXT_BLOCK
      Siehe auch:
    • UNTERMINATED_COMMENT

      public static final String UNTERMINATED_COMMENT
      Siehe auch:
    • INVALID_CHAR_IN_STRING

      public static final String INVALID_CHAR_IN_STRING
      Siehe auch:
    • INVALID_DIGIT

      public static final String INVALID_DIGIT
      Siehe auch:
    • INVALID_BINARY

      public static final String INVALID_BINARY
      Siehe auch:
    • BINARY_LITERAL_NOT_BELOW_17

      public static final String BINARY_LITERAL_NOT_BELOW_17
      Siehe auch:
    • ILLEGAL_HEXA_LITERAL

      public static final String ILLEGAL_HEXA_LITERAL
      Siehe auch:
    • INVALID_UNDERSCORE

      public static final String INVALID_UNDERSCORE
      Siehe auch:
    • UNDERSCORES_IN_LITERALS_NOT_BELOW_17

      public static final String UNDERSCORES_IN_LITERALS_NOT_BELOW_17
      Siehe auch:
    • TAG_PREFIX

      public static final char[] TAG_PREFIX
    • TAG_PREFIX_LENGTH

      public static final int TAG_PREFIX_LENGTH
    • TAG_POSTFIX

      public static final char TAG_POSTFIX
      Siehe auch:
    • TAG_POSTFIX_LENGTH

      public static final int TAG_POSTFIX_LENGTH
      Siehe auch:
    • IDENTITY_COMPARISON_TAG

      public static final char[] IDENTITY_COMPARISON_TAG
    • validIdentityComparisonLines

      public boolean[] validIdentityComparisonLines
    • checkUninternedIdentityComparison

      public boolean checkUninternedIdentityComparison
    • nlsTagsPtr

      protected int nlsTagsPtr
    • checkNonExternalizedStringLiterals

      public boolean checkNonExternalizedStringLiterals
    • lastPosition

      protected int lastPosition
    • returnOnlyGreater

      public boolean returnOnlyGreater
    • insideRecovery

      public boolean insideRecovery
    • nextToken

      protected int nextToken
    • multiCaseLabelComma

      protected boolean multiCaseLabelComma
    • RoundBracket

      public static final int RoundBracket
      Siehe auch:
    • SquareBracket

      public static final int SquareBracket
      Siehe auch:
    • CurlyBracket

      public static final int CurlyBracket
      Siehe auch:
    • BracketKinds

      public static final int BracketKinds
      Siehe auch:
    • LOW_SURROGATE_MIN_VALUE

      public static final int LOW_SURROGATE_MIN_VALUE
      Siehe auch:
    • HIGH_SURROGATE_MIN_VALUE

      public static final int HIGH_SURROGATE_MIN_VALUE
      Siehe auch:
    • HIGH_SURROGATE_MAX_VALUE

      public static final int HIGH_SURROGATE_MAX_VALUE
      Siehe auch:
    • LOW_SURROGATE_MAX_VALUE

      public static final int LOW_SURROGATE_MAX_VALUE
      Siehe auch:
    • rawStart

      protected int rawStart
  • Konstruktordetails

    • Scanner

      public Scanner()
    • Scanner

      public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals, long sourceLevel, long complianceLevel, char[][] taskTags, char[][] taskPriorities, boolean isTaskCaseSensitive, boolean isPreviewEnabled)
    • Scanner

      public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals, long sourceLevel, char[][] taskTags, char[][] taskPriorities, boolean isTaskCaseSensitive, boolean isPreviewEnabled)
    • Scanner

      public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace, boolean checkNonExternalizedStringLiterals, long sourceLevel, char[][] taskTags, char[][] taskPriorities, boolean isTaskCaseSensitive)
  • Methodendetails

    • atEnd

      public final boolean atEnd()
    • checkTaskTag

      public void checkTaskTag(int commentStart, int commentEnd) throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getCurrentIdentifierSource

      public char[] getCurrentIdentifierSource()
    • getCurrentTokenEndPosition

      public int getCurrentTokenEndPosition()
    • getCurrentTokenSource

      public char[] getCurrentTokenSource()
    • getCurrentTokenString

      public final String getCurrentTokenString()
    • getCurrentTokenSourceString

      public char[] getCurrentTokenSourceString()
    • scanForTextBlockBeginning

      protected final boolean scanForTextBlockBeginning()
    • scanForTextBlockClose

      protected final boolean scanForTextBlockClose() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getCurrentTextBlock

      public char[] getCurrentTextBlock()
    • getCurrentStringLiteral

      public final String getCurrentStringLiteral()
    • getRawTokenSource

      public final char[] getRawTokenSource()
    • getRawTokenSourceEnd

      public final char[] getRawTokenSourceEnd()
    • getCurrentTokenStartPosition

      public int getCurrentTokenStartPosition()
    • getLineEnd

      public final int getLineEnd(int lineNumber)
    • getLineEnds

      public final int[] getLineEnds()
    • getLineStart

      public final int getLineStart(int lineNumber)
      Search the source position corresponding to the beginning of a given line number Line numbers are 1-based, and relative to the scanner initialPosition. Character positions are 0-based. e.g. getLineStart(1) --> 0 indicates that the first line starts at character 0. In case the given line number is inconsistent, answers -1.
      Parameter:
      lineNumber - int
      Gibt zurück:
      int
    • getNextChar

      public final int getNextChar()
    • getNextCharWithBoundChecks

      public final int getNextCharWithBoundChecks()
    • getNextChar

      public final boolean getNextChar(char testedChar)
    • getNextChar

      public final int getNextChar(char testedChar1, char testedChar2)
    • getNextCharAsDigit

      public final boolean getNextCharAsDigit() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getNextCharAsDigit

      public final boolean getNextCharAsDigit(int radix)
    • getNextCharAsJavaIdentifierPartWithBoundCheck

      public boolean getNextCharAsJavaIdentifierPartWithBoundCheck()
    • getNextCharAsJavaIdentifierPart

      public boolean getNextCharAsJavaIdentifierPart()
    • scanIdentifier

      public int scanIdentifier() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • ungetToken

      public void ungetToken(int unambiguousToken)
    • updateCase

      protected void updateCase(int token)
    • getNextToken

      public int getNextToken() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getNextToken0

      protected int getNextToken0() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • processSingleQuotes

      protected int processSingleQuotes(boolean checkIfUnicode) throws InvalidInputException
      Löst aus:
      InvalidInputException
    • scanForStringLiteral

      protected int scanForStringLiteral() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • scanForTextBlock

      protected int scanForTextBlock() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getNextUnicodeChar

      public void getNextUnicodeChar() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getNLSTags

      public NLSTag[] getNLSTags()
    • getIdentityComparisonLines

      public boolean[] getIdentityComparisonLines()
    • getSource

      public char[] getSource()
    • isFirstTag

      protected boolean isFirstTag()
    • jumpOverMethodBody

      public final void jumpOverMethodBody()
    • jumpOverUnicodeWhiteSpace

      public final boolean jumpOverUnicodeWhiteSpace() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • isInModuleDeclaration

      public boolean isInModuleDeclaration()
    • areRestrictedModuleKeywordsActive

      protected boolean areRestrictedModuleKeywordsActive()
    • pushLineSeparator

      public final void pushLineSeparator()
    • pushUnicodeLineSeparator

      public final void pushUnicodeLineSeparator()
    • recordComment

      public void recordComment(int token)
    • resetTo

      public void resetTo(int begin, int end)
      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 (ITerminalSymbols.TokenNameEOF).
      Parameter:
      begin - the given start position
      end - the given end position
    • resetTo

      public void resetTo(int begin, int end, boolean isModuleInfo)
    • resetTo

      public void resetTo(int begin, int end, boolean isModuleInfo, org.aspectj.org.eclipse.jdt.internal.compiler.parser.Scanner.ScanContext context)
      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 (ITerminalSymbols.TokenNameEOF).
      Parameter:
      begin - the given start position
      end - the given end position
      isModuleInfo - if true apply rules for restricted keywords even without a connection to a properly configured parser
      context - The scan context to use for restricted keyword support, use null to compute
    • scanEscapeCharacter

      protected final void scanEscapeCharacter() throws InvalidInputException
      Löst aus:
      InvalidInputException
    • scanIdentifierOrKeywordWithBoundCheck

      public int scanIdentifierOrKeywordWithBoundCheck()
    • scanIdentifierOrKeyword

      public int scanIdentifierOrKeyword()
    • scanIdentifierOrKeywordAj

      public int scanIdentifierOrKeywordAj(int kind)
    • scanNumber

      public int scanNumber(boolean dotPrefix) throws InvalidInputException
      Löst aus:
      InvalidInputException
    • getLineNumber

      public final int getLineNumber(int position)
      Search the line number corresponding to a specific position
      Parameter:
      position - int
      Gibt zurück:
      int
    • setSource

      public final void setSource(char[] sourceString)
    • setSource

      public final void setSource(char[] contents, CompilationResult compilationResult)
    • setSource

      public final void setSource(CompilationResult compilationResult)
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • toStringAction

      public String toStringAction(int act)
    • unicodeInitializeBuffer

      public void unicodeInitializeBuffer(int length)
    • unicodeStore

      public void unicodeStore()
    • unicodeStore

      public void unicodeStore(char character)
    • isIdentifier

      public static boolean isIdentifier(int token)
    • isLiteral

      public static boolean isLiteral(int token)
    • isKeyword

      public static boolean isKeyword(int token)
    • mayBeAtCasePattern

      protected final boolean mayBeAtCasePattern(int token)
    • maybeAtLambdaOrCast

      protected final boolean maybeAtLambdaOrCast()
    • maybeAtEnhForRecordPattern

      protected final boolean maybeAtEnhForRecordPattern()
    • maybeAtReferenceExpression

      protected final boolean maybeAtReferenceExpression()
    • atTypeAnnotation

      protected final boolean atTypeAnnotation()
    • setActiveParser

      public void setActiveParser(ConflictedParser parser)
    • isRestrictedKeyword

      public static boolean isRestrictedKeyword(int token)
    • disambiguateArrowWithCaseExpr

      protected int disambiguateArrowWithCaseExpr(Scanner scanner, int retToken)
    • mayBeAtCaseLabelExpr

      protected boolean mayBeAtCaseLabelExpr()
    • isAtAssistIdentifier

      protected boolean isAtAssistIdentifier()
    • fastForward

      public int fastForward(Statement unused)
    • getNextNotFakedToken

      protected int getNextNotFakedToken() throws InvalidInputException
      Overridable hook, to allow CompletionScanner to hide a faked identifier token.
      Löst aus:
      InvalidInputException