I had a look at the Lexer source. The Lexer answers to nextToken() calls (from the parser). I haven't found that it keeps track of previous tokens. And there is no direct access to CARET. Given this input :
xyz ^abc
and this grammar :
lexer grammar TLexer;
ID : [a-zA-Z] [a-zA-Z0-9]* {System.out.println("ID ");} ;
CARET : '^' {System.out.println("CARET ");} ;
WS : [ \r\n] ;
RTN : CARET ID {System.out.println("RTN " + _tokenStartCharIndex);} ;
the output is :
$ antlr4 TLexer.g4
$ javac TLexer.java
$ grun TLexer tokens -tokens -diagnostics -trace input.txt
ID
RTN 4
[@0,0:2='xyz',<1>,1:0]
[@1,3:3=' ',<3>,1:3]
[@2,4:7='^abc',<4>,1:4]
[@3,8:8='\n',<3>,1:8]
[@4,9:8='<EOF>',<-1>,2:9]
The lexer gives you a single token of type <4> (RTN) for the input ^abc
.