Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: use of undeclared identifier 'self' #14

Open
NightProg opened this issue Jan 12, 2024 · 0 comments
Open

error: use of undeclared identifier 'self' #14

NightProg opened this issue Jan 12, 2024 · 0 comments

Comments

@NightProg
Copy link

Hello, I have multiple error when compiling the generated parser and lexer.
ANTLR version: 4.13.0
Os: Macos
Command used: antlr -Dlanguage=Cpp -o ${CMAKE_CURRENT_SOURCE_DIR}/src/LythonCompiler/Parser/ANTLR/ ${CMAKE_CURRENT_SOURCE_DIR}/src/LythonCompiler/Parser/ANTLR/Python3Parser.g4
the error:

/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19168:11: error: use of undeclared identifier 'self'
    if (!(self.isEqualCurrentTokenText("case"))) throw FailedPredicateException(this, "self.isEqualCurrentTokenText(\"case\")");
          ^
/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19224:11: error: use of undeclared identifier 'self'
    if (!(self.isEqualCurrentTokenText("_"))) throw FailedPredicateException(this, "self.isEqualCurrentTokenText(\"_\")");
          ^
/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19280:11: error: use of undeclared identifier 'self'
    if (!(self.isEqualCurrentTokenText("type"))) throw FailedPredicateException(this, "self.isEqualCurrentTokenText(\"type\")");
          ^
/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19329:20: error: use of undeclared identifier 'self'
    case 1: return self.isnotEqualCurrentTokenText("_");
                   ^
/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19419:21: error: use of undeclared identifier 'self'
    case 10: return self.isEqualCurrentTokenText("match");
                    ^
/Users//./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19429:21: error: use of undeclared identifier 'self'
    case 11: return self.isEqualCurrentTokenText("case");
                    ^
/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19439:21: error: use of undeclared identifier 'self'
    case 12: return self.isEqualCurrentTokenText("_");
                    ^
/Users/./Documents/lython-cpp/src/LythonCompiler/Parser/ANTLR/PythonParser.cpp:19449:21: error: use of undeclared identifier 'self'
    case 13: return self.isEqualCurrentTokenText("type");

the grammar file used is located here: https://github.com/antlr/grammars-v4/tree/master/python/python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant