class PSITokenSource extends TokenSource
Make a PsiBuilder look like a source of ANTLR tokens. PsiBuilder
provides tokens created by the lexer created in
ParserDefinition#createLexer(Project)
. This is the bridge
between the ANTLR lexer and parser objects. Normally we just create
a org.antlr.v4.runtime.CommonTokenStream
but the IDE has
control and asks our ParserDefinition for the lexer and parser. This
is how we hook them together. When IDE ask ParserDefinition for a
parser, we will create one of these attached to the PsiBuilder.
- Alphabetic
- By Inheritance
- PSITokenSource
- TokenSource
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PSITokenSource(builder: PsiBuilder)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def getCharPositionInLine(): Int
- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getInputStream(): CharStream
- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- def getLine(): Int
- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- def getSourceName(): String
- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- def getTokenFactory(): TokenFactory[_ <: AnyRef]
- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nextToken(): Token
Create an ANTLR Token from the current token type of the builder then advance the builder to next token (which ultimately calls an ANTLR lexer).
Create an ANTLR Token from the current token type of the builder then advance the builder to next token (which ultimately calls an ANTLR lexer). The
ANTLRLexerAdaptor
creates tokens via an ANTLR lexer but converts toTokenIElementType
and here we have to convert back to an ANTLR token using what info we can get from the builder. We lose info such as the original channel. So, whitespace and comments (typically hidden channel) will look like real tokens. Jetbrains usesParserDefinition#getWhitespaceTokens()
andParserDefinition#getCommentTokens()
to strip these before our ANTLR parser sees them.- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def setTokenFactory(tokenFactory: TokenFactory[_ <: AnyRef]): Unit
- Definition Classes
- PSITokenSource → TokenSource
- Annotations
- @Override()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)