-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Milestone
Description
It hits nonlinearity OR it is merging incorrectly. I suspect the latter.
Run
$ cd ~/antlr/code/antlr4/runtime/Cpp
$ cmake . -DTRACE_ATN=ON -DCMAKE_BUILD_TYPE=Debug
$ make # which makes dist/libantlr4-runtime.dylib
Unzip the file test.zip into a test dir to get test. Then from test dir:
$ ln -s ~/antlr/code/antlr4/runtime/Cpp/dist/libantlr4-runtime.dylib
$ clang++ -g -std=c++17 -I /Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/src -L. -lantlr4-runtime *.cpp
$ ./a.out input
Comparing Java / C++ trace, we see Java reuses a context but C++ doesn't:
If we have merged #3817 then you can get with output this assuming ~/tmp/bug/input
is your test dir:
$ ~/antlr/code/antlr4/runtime-testsuite
$ bash ~/antlr/code/antlr4/scripts/traceatn.sh ~/tmp/bug/T.g4 stat -target Java ~/tmp/bug/input > /tmp/java
$ bash ~/antlr/code/antlr4/scripts/traceatn.sh ~/tmp/bug/T.g4 stat -target Cpp ~/tmp/bug/input > /tmp/cpp
$ diff /tmp/java /tmp/cpp