@Override
	public int getLine() {
		if ( originalTokenIndex>=0 ) return g.originalTokenStream.get(originalTokenIndex).getLine();
		return super.getLine();
	}
A CommonToken that can also track it's original location,
 derived from options on the element ref like BEGIN&lt;line=34,...&gt;.
tool/src/org/antlr/v4/parse/GrammarToken.java