public CommonToken(Token oldToken) {type = oldToken.getType();line = oldToken.getLine();index = oldToken.getTokenIndex();charPositionInLine = oldToken.getCharPositionInLine();channel = oldToken.getChannel();start = oldToken.getStartIndex();stop = oldToken.getStopIndex();if (oldToken instanceof CommonToken) {text = ((CommonToken)oldToken).text;source = ((CommonToken)oldToken).source;}else {text = oldToken.getText();source = new Pair<TokenSource, CharStream>(oldToken.getTokenSource(), oldToken.getInputStream());}}
public CommonToken(IToken oldToken){_type = oldToken.Type;_line = oldToken.Line;index = oldToken.TokenIndex;charPositionInLine = oldToken.Column;_channel = oldToken.Channel;start = oldToken.StartIndex;stop = oldToken.StopIndex;if (oldToken is Antlr4.Runtime.CommonToken){_text = ((Antlr4.Runtime.CommonToken)oldToken)._text;source = ((Antlr4.Runtime.CommonToken)oldToken).source;}else{_text = oldToken.Text;source = Tuple.Create(oldToken.TokenSource, oldToken.InputStream);}}