我正在尝试将Python 3语法的嵌入式java部分(https://github.com/antlr/grammars-v4/blob/master/python3/Python3.g4)实现到C#。有几个属性是我在java中使用的,我无法在ANTLR4的C#运行时实现中找到它。在Python语法中将ANTLR4嵌入式java转换为C#
有人可以请我指出以下什么是等效的C#属性?
行100:
private CommonToken commonToken(int type, String text) {
int stop = this.getCharIndex() - 1;
int start = text.isEmpty() ? stop : stop - text.length() + 1;
return new CommonToken(this._tokenFactorySourcePair, type, DEFAULT_TOKEN_CHANNEL, start, stop);
}
在这里,我无法找到_tokenFactorySourcePair
属性
行132:
boolean atStartOfInput() {
return super.getCharPositionInLine() == 0 && super.getLine() == 1;
}
在这里,我无法找到getCharPositionInLine()
属性