Search in sources :

Example 1 with JavaLexer

use of com.intellij.lang.java.lexer.JavaLexer in project intellij-community by JetBrains.

the class PsiLiteralStub method getLiteralType.

@NotNull
public IElementType getLiteralType() {
    IElementType type = myLiteralType;
    if (type == null) {
        JavaLexer lexer = new JavaLexer(LanguageLevel.HIGHEST);
        lexer.start(myLiteralText);
        myLiteralType = type = lexer.getTokenType();
        assert type != null : myLiteralText;
    }
    return type;
}
Also used : IElementType(com.intellij.psi.tree.IElementType) JavaLexer(com.intellij.lang.java.lexer.JavaLexer) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JavaLexer (com.intellij.lang.java.lexer.JavaLexer)1 IElementType (com.intellij.psi.tree.IElementType)1 NotNull (org.jetbrains.annotations.NotNull)1