相关疑难解决方法(0)

如何检测行的开头,或:“当前上下文中不存在名称‘getCharPositionInLine’”

我正在尝试创建一个行首标记:

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()方法不存在...

c# antlr4 antlr4cs

6
推荐指数
1
解决办法
1711
查看次数

标签 统计

antlr4 ×1

antlr4cs ×1

c# ×1