我正在尝试创建一个行首标记:
lexer grammar ScriptLexer;
BOL : {getCharPositionInLine() == 0;}; // Beginning Of Line token
Run Code Online (Sandbox Code Playgroud)
但上面发出错误
The name 'getCharPositionInLine' does not exist in the current context
Run Code Online (Sandbox Code Playgroud)
当它创建此代码时:
private void BOL_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 0: getCharPositionInLine() == 0; break;
}
}
Run Code Online (Sandbox Code Playgroud)
当getCharPositionInLine()方法不存在...