this.c = input.LA(1);
}
}
protected void extractInformationFromTreeNodeStream(IntStream input) {
TreeNodeStream nodes = (TreeNodeStream)input;
this.node = nodes.LT(1);
TreeAdaptor adaptor = nodes.getTreeAdaptor();
Token payload = adaptor.getToken(node);
if ( payload!=null ) {
this.token = payload;
if ( payload.getLine()<= 0 ) {
// imaginary node; no line/pos info; scan backwards
int i = -1;
Object priorNode = nodes.LT(i);
while ( priorNode!=null ) {
Token priorPayload = adaptor.getToken(priorNode);
if ( priorPayload!=null && priorPayload.getLine()>0 ) {
// we found the most recent real line / pos info
this.line = priorPayload.getLine();
this.charPositionInLine = priorPayload.getCharPositionInLine();
this.approximateLineInfo = true;
break;
}
--i;
priorNode = nodes.LT(i);
}
}
else { // node created from real token
this.line = payload.getLine();
this.charPositionInLine = payload.getCharPositionInLine();