List of usage examples for org.antlr.v4.runtime Token getTokenSource
TokenSource getTokenSource();
From source file:org.ledyba.sora.parser.FortranTokenStream.java
License:Open Source License
public void addTokenTo(int index, int type, String text, int line, int col) { Token last = this.tokens.get(index); Pair<TokenSource, CharStream> src = new Pair<>(last.getTokenSource(), last.getInputStream()); FortranToken token = new FortranToken(src, type, Token.DEFAULT_CHANNEL, 0, 0); token.setLine(line);//from w w w. j a v a2 s . c o m token.setCharPositionInLine(col); this.addTokenTo(index, token); }