error: use of undeclared identifier 'self'
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Tái hiện lệnh đã báo cáo bằng grammar Python3 từ grammars-v4/python/python3 và kiểm tra src/LythonCompiler/Parser/ANTLR/PythonParser.cpp được sinh ra xung quanh các lỗi predicate đã liệt kê. Truy vết cách các predicate của grammar trở thành C++ và xác nhận rằng parser được sinh ra biên dịch mà không có các tham chiếu đến chính nó chưa được khai báo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C++
- Star
- 80
- Fork
- 33
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của antlr/antlr4-cpp
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
antlr/antlr4-cpp#13 ·
-
About antlrcpp::Any derived.Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
antlr/antlr4-cpp#12 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
antlr/antlr4-cpp#11 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
antlr/antlr4-cpp#10 ·
Tất cả issue của antlr/antlr4-cpp
Issue tương tự
-
Status: Needs confirmation Status: Needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug-unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-combat P-low S-ready-to-start task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug intrinsic medium priority rt_lib
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày