Java 类org.antlr.v4.runtime.TokenFactory 实例源码

项目:intellij-plugin-v4    文件:ParsingUtils.java   
public static Token nextRealToken(CommonTokenStream tokens, int i) {
    int n = tokens.size();
    i++; // search after current i token
    if ( i>=n || i<0 ) return null;
    Token t = tokens.get(i);
    while ( t.getChannel()==Token.HIDDEN_CHANNEL ) {
        if ( t.getType()==Token.EOF ) {
            TokenSource tokenSource = tokens.getTokenSource();
            if ( tokenSource==null ) {
                return new CommonToken(Token.EOF, "EOF");
            }
            TokenFactory<?> tokenFactory = tokenSource.getTokenFactory();
            if ( tokenFactory==null ) {
                return new CommonToken(Token.EOF, "EOF");
            }
            return tokenFactory.create(Token.EOF, "EOF");
        }
        i++;
        if ( i>=n ) return null; // just in case no EOF
        t = tokens.get(i);
    }
    return t;
}
项目:elasticsearch_my    文件:StashingTokenFactory.java   
public StashingTokenFactory(TokenFactory<T> delegate) {
    this.delegate = delegate;
}
项目:grakn    文件:ChannelTokenSource.java   
@Override
public void setTokenFactory(TokenFactory<?> factory) {
    source().setTokenFactory(factory);
}
项目:grakn    文件:ChannelTokenSource.java   
@Override
public TokenFactory<?> getTokenFactory() {
    return source().getTokenFactory();
}
项目:jetbrains-plugin-st4    文件:STLexer.java   
@Override
public void setTokenFactory(TokenFactory<?> tokenFactory) {
    this.tokenFactory = tokenFactory;
}
项目:jetbrains-plugin-st4    文件:STLexer.java   
@Override
public TokenFactory<?> getTokenFactory() {
    return tokenFactory;
}
项目:jetbrains    文件:PSITokenSource.java   
@Override
public void setTokenFactory(TokenFactory<?> tokenFactory) {
    this.tokenFactory = tokenFactory;
}
项目:jetbrains    文件:PSITokenSource.java   
@Override
public TokenFactory<?> getTokenFactory() {
    return tokenFactory;
}
项目:rpgleparser    文件:WrappedTokenSource.java   
@Override
public TokenFactory<?> getTokenFactory() {
    return tokenSource.getTokenFactory();
}
项目:rpgleparser    文件:WrappedTokenSource.java   
@Override
public void setTokenFactory(TokenFactory<?> tokenFactory) {
    tokenSource.setTokenFactory(tokenFactory);
}
项目:mini-markdown    文件:CharsAsTokens.java   
@Override
public TokenFactory<?> getTokenFactory() {
    return CommonTokenFactory.DEFAULT;
}
项目:mini-markdown    文件:CharsAsTokens.java   
@Override
public void setTokenFactory(TokenFactory<?> factory) {
}
项目:goworks    文件:GrammarHighlighterLexerWrapper.java   
@Override
public TokenFactory getTokenFactory() {
    return grammarLexer.getTokenFactory();
}
项目:goworks    文件:GrammarHighlighterLexerWrapper.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    grammarLexer.setTokenFactory(tokenFactory);
}
项目:goworks    文件:TemplateHighlighterLexer.java   
@Override
public TokenFactory getTokenFactory() {
    return groupLexer.getTokenFactory();
}
项目:goworks    文件:TemplateHighlighterLexer.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    groupLexer.setTokenFactory(tokenFactory);
}
项目:goworks    文件:GoHighlighterLexerWrapper.java   
@Override
public TokenFactory getTokenFactory() {
    return lexer.getTokenFactory();
}
项目:goworks    文件:GoHighlighterLexerWrapper.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    lexer.setTokenFactory(tokenFactory);
}
项目:goworks    文件:CodeCompletionTokenSource.java   
@Override
public TokenFactory getTokenFactory() {
    return tokenFactory;
}
项目:goworks    文件:CodeCompletionTokenSource.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    source.setTokenFactory(tokenFactory);
    this.tokenFactory = tokenFactory != null ? tokenFactory : CommonTokenFactory.DEFAULT;
}
项目:goworks    文件:TaggerTokenSource.java   
@Override
public TokenFactory getTokenFactory() {
    return tokenFactory;
}
项目:goworks    文件:TaggerTokenSource.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    Parameters.notNull("tokenFactory", tokenFactory);
    this.tokenFactory = tokenFactory;
}
项目:intellij-plugin-v4    文件:PsiTokenSource.java   
@Override
public void setTokenFactory(TokenFactory<?> factory) {
    this.factory = factory;
}
项目:intellij-plugin-v4    文件:PsiTokenSource.java   
@Override
public TokenFactory<?> getTokenFactory() {
    return factory;
}
项目:antlrworks2    文件:GrammarHighlighterLexerWrapper.java   
@Override
public TokenFactory getTokenFactory() {
    return grammarLexer.getTokenFactory();
}
项目:antlrworks2    文件:GrammarHighlighterLexerWrapper.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    grammarLexer.setTokenFactory(tokenFactory);
}
项目:antlrworks2    文件:TemplateHighlighterLexer.java   
@Override
public TokenFactory getTokenFactory() {
    return groupLexer.getTokenFactory();
}
项目:antlrworks2    文件:TemplateHighlighterLexer.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    groupLexer.setTokenFactory(tokenFactory);
}
项目:antlrworks2    文件:CodeCompletionTokenSource.java   
@Override
public TokenFactory getTokenFactory() {
    return tokenFactory;
}
项目:antlrworks2    文件:CodeCompletionTokenSource.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    source.setTokenFactory(tokenFactory);
    this.tokenFactory = tokenFactory != null ? tokenFactory : CommonTokenFactory.DEFAULT;
}
项目:antlrworks2    文件:TaggerTokenSource.java   
@Override
public TokenFactory getTokenFactory() {
    return tokenFactory;
}
项目:antlrworks2    文件:TaggerTokenSource.java   
@Override
public void setTokenFactory(TokenFactory tokenFactory) {
    Parameters.notNull("tokenFactory", tokenFactory);
    this.tokenFactory = tokenFactory;
}