Can get token start and stop index from Token interface now

This commit is contained in:
Sam Harwell 2012-02-23 11:19:03 -06:00
parent 4ae58868d7
commit d7dbef2782
1 changed files with 2 additions and 4 deletions

View File

@ -84,10 +84,8 @@ public class CommonToken implements WritableToken, Serializable {
charPositionInLine = oldToken.getCharPositionInLine();
channel = oldToken.getChannel();
source = oldToken.getTokenSource();
if ( oldToken instanceof CommonToken ) {
start = ((CommonToken)oldToken).start;
stop = ((CommonToken)oldToken).stop;
}
start = oldToken.getStartIndex();
stop = oldToken.getStopIndex();
}
@Override