You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ bin/rake antlr:runtime:clone # ok
$ bin/rake antlr:mysql:generate # ok
$ bin/rake antlr:mysql:compile
Running via Spring preloader in process 97444
checking forrice/rice.hppin /Users/seb/.gem/ruby/3.2.2/gems/rice-4.3.1/include... yes
checking for -lc++... yes
checking for -lstdc++... yes
creating Makefile
compiling my_sql_parser.cpp
compiling ../lib/antlr4-cpp-runtime/Vocabulary.cpp
compiling ../lib/antlr4-cpp-runtime/WritableToken.cpp
...
compiling ../lib/antlr4-cpp-runtime/atn/LexerCustomAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LexerIndexedCustomAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LexerModeAction.cpp
my_sql_parser.cpp:41070:12: error: expected ')'return Qnil;
^
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/special_consts.h:60:25: note: expanded from macro 'Qnil'#define Qnil RUBY_Qnil /**< @old{RUBY_Qnil} */
^
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/special_consts.h:358:40: note: expanded from macro 'RUBY_Qnil'#define RUBY_Qnil RBIMPL_CAST((VALUE)RUBY_Qnil)
^
my_sql_parser.cpp:41070:12: note: to match this '('
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/special_consts.h:60:25: note: expanded from macro 'Qnil'#define Qnil RUBY_Qnil /**< @old{RUBY_Qnil} */
^
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/special_consts.h:358:21: note: expanded from macro 'RUBY_Qnil'#define RUBY_Qnil RBIMPL_CAST((VALUE)RUBY_Qnil)
^
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/cast.h:43:5: note: expanded from macro 'RBIMPL_CAST'
(expr) \
^
my_sql_parser.cpp:41070:12: error: reference to non-static member functionmust be called; did you mean to call it with no arguments?return Qnil;
^~~~
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/special_consts.h:60:25: note: expanded from macro 'Qnil'#define Qnil RUBY_Qnil /**< @old{RUBY_Qnil} */
^~~~~~~~~
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/special_consts.h:358:33: note: expanded from macro 'RUBY_Qnil'#define RUBY_Qnil RBIMPL_CAST((VALUE)RUBY_Qnil)
^~~~~~~
/opt/rubies/3.2.2/include/ruby-3.2.0/ruby/internal/cast.h:43:6: note: expanded from macro 'RBIMPL_CAST'
(expr) \
^~~~
my_sql_parser.cpp:41076:12: error: expected ')'return Qnil;
^
(Many errors like that)
fatal error: too many errors emitted, stopping now [-ferror-limit=]
compiling ../lib/antlr4-cpp-runtime/atn/LexerMoreAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LexerPopModeAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LexerPushModeAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LexerSkipAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LexerTypeAction.cpp
compiling ../lib/antlr4-cpp-runtime/atn/LookaheadEventInfo.cpp
compiling ../lib/antlr4-cpp-runtime/atn/NotSetTransition.cpp
compiling ../lib/antlr4-cpp-runtime/atn/OrderedATNConfigSet.cpp
compiling ../lib/antlr4-cpp-runtime/atn/ParseInfo.cpp
compiling ../lib/antlr4-cpp-runtime/atn/ParserATNSimulator.cpp
20 errors generated.
make: *** [my_sql_parser.o] Error 1
make: *** Waiting for unfinished jobs....
You can find the full output in the Gist above.
I tested similar steps with the lua parser used in the spec of this repo and it compiles just fine.
I suspect that the MySQL grammar is generating invalid C++, but the file is enormous and I don't really speak C++.
I found #15 and antlr/grammars-v4#1905, which seem related, but the MySQL grammar already uses NULL_LITERAL and I tried renaming (TRUE|FALSE) to *_LITERAL in the lexer and parser, but it didn't change anything.
The text was updated successfully, but these errors were encountered:
Trying to use the MySQL grammar: https://github.com/antlr/grammars-v4/tree/master/sql/mysql/Positive-Technologies
Using rake task and the
extconf.rb
from https://gist.github.com/lavoiesl/efed2ed8886b32d778c5fd30bdb16390You can find the full output in the Gist above.
I tested similar steps with the lua parser used in the spec of this repo and it compiles just fine.
I suspect that the MySQL grammar is generating invalid C++, but the file is enormous and I don't really speak C++.
I found #15 and antlr/grammars-v4#1905, which seem related, but the MySQL grammar already uses
NULL_LITERAL
and I tried renaming(TRUE|FALSE)
to*_LITERAL
in the lexer and parser, but it didn't change anything.The text was updated successfully, but these errors were encountered: