-
Notifications
You must be signed in to change notification settings - Fork 2
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
Performance with generated Ruby parser #5
Comments
Tracked in MODLanguage/antlr4-ruby-runtime#9 . |
Solution: use https://github.com/camertron/antlr4-native-rb or https://github.com/camertron/antlr-gemerator to create C++ target with Ruby bindings. |
Problem: https://github.com/camertron/antlr4-native-rb uses the Rice gem, which doesn't work on Windows... this means we will either have to port antlr4-native-rb to use FFI or use the pure Ruby version for Windows. |
To test whether antlr4-gemerator works I've done some testing but unable to get it to compile: macOS setup
Generating the parser:
Compilation fails:
And these errors about I checked the actual generated Object BooleanTypeContextProxy::BOOLEAN() {
if (orig == nullptr) {
return Qnil; // <===== this line
}
[...]
} This post points to the Ruby source i.e. on my enum ruby_special_consts {
#if USE_FLONUM
RUBY_Qfalse = 0x00, /* ...0000 0000 */
RUBY_Qtrue = 0x14, /* ...0001 0100 */
RUBY_Qnil = 0x08, /* ...0000 1000 */
[...]
#else
RUBY_Qfalse = 0, /* ...0000 0000 */
RUBY_Qtrue = 2, /* ...0000 0010 */
RUBY_Qnil = 4, /* ...0000 0100 */
[...]
#endif
RUBY_SPECIAL_SHIFT = 8
};
[...]
#define RUBY_Qnil ((VALUE)RUBY_Qnil)
[...]
#define Qnil RUBY_Qnil
The |
I suppose the "reference to non-static member function must be called" error is explained here: https://stackoverflow.com/a/26331779 |
From @zakjan :
The text was updated successfully, but these errors were encountered: