antlr4-native 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15c061ecc5402e131b0bb299f653624452168b857a20010f6243e1415d74fe43
|
4
|
+
data.tar.gz: c9c1dcbdcb46daedcdfbe219dee93d1f18512fbbeeb26808a5d2acb3281db73c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c973edc74b86e8fbf2193832c3555aa1e93a52bc60dc9736752c0be35a18cee3a1dd5d68cb262603467e0586a4eb22c74b38589246eb6d34edba6d4e4fe54c2
|
7
|
+
data.tar.gz: e6b89735c4083c6c51b6260f751048aeec4187da2a93d286af7cf2778d490fb5d82a9dff958af7285229f790f3a8e1f537581a5946feda441ebf95e1bd93ffa8
|
data/README.md
CHANGED
@@ -79,9 +79,8 @@ Finally, if you override `#initialize` in your visitor subclasses, don't forget
|
|
79
79
|
|
80
80
|
## Caveats
|
81
81
|
|
82
|
-
1.
|
83
|
-
|
84
|
-
3. The description of this gem says "(almost) any ANTLR4 grammar" because many grammars contain target-specific code. For example, the Python3 grammar referenced in the examples above contains inline Java code that the C++ compiler won't understand. You'll need to port any such code to C++ before you'll be able to compile and use the native extension.
|
82
|
+
1. Due to an ANTLR limitation, parsers cannot be used in a multi-threaded environment, even if each parser instance is used entirely in the context of a single thread (i.e. parsers are not shared between threads). According to the ANTLR C++ developers, parsers should be threadsafe. Unfortunately firsthand experience has proven otherwise. Your mileage may vary.
|
83
|
+
1. The description of this gem says "(almost) any ANTLR4 grammar" because many grammars contain target-specific code. For example, the Python3 grammar referenced in the examples above contains inline Java code that the C++ compiler won't understand. You'll need to port any such code to C++ before you'll be able to compile and use the native extension.
|
85
84
|
|
86
85
|
## System Requirements
|
87
86
|
|
@@ -2,10 +2,10 @@ require 'fileutils'
|
|
2
2
|
|
3
3
|
module Antlr4Native
|
4
4
|
class Generator
|
5
|
-
ANTLR_VERSION = '4.
|
5
|
+
ANTLR_VERSION = '4.10.1'.freeze
|
6
6
|
|
7
7
|
ANTLR_JAR = File.expand_path(
|
8
|
-
File.join('..', '..', 'vendor',
|
8
|
+
File.join('..', '..', 'vendor', "antlr-#{ANTLR_VERSION}-complete.jar"), __dir__
|
9
9
|
).freeze
|
10
10
|
|
11
11
|
include StringHelpers
|
@@ -16,6 +16,7 @@ module Antlr4Native
|
|
16
16
|
@grammar_files = grammar_files
|
17
17
|
@output_dir = output_dir
|
18
18
|
@parser_root_method = parser_root_method
|
19
|
+
|
19
20
|
end
|
20
21
|
|
21
22
|
def generate
|
@@ -268,7 +269,7 @@ module Antlr4Native
|
|
268
269
|
this -> lexer -> reset();
|
269
270
|
this -> parser -> reset();
|
270
271
|
|
271
|
-
return result;
|
272
|
+
return std::any_cast<Object>(result);
|
272
273
|
}
|
273
274
|
|
274
275
|
~ParserProxy() {
|
@@ -48,7 +48,7 @@ module Antlr4Native
|
|
48
48
|
Object ruby_visit(ContextProxy* proxy) {
|
49
49
|
auto result = visit(proxy -> getOriginal());
|
50
50
|
try {
|
51
|
-
return
|
51
|
+
return std::any_cast<Object>(result);
|
52
52
|
} catch(std::bad_cast) {
|
53
53
|
return Qnil;
|
54
54
|
}
|
@@ -57,7 +57,7 @@ module Antlr4Native
|
|
57
57
|
Object ruby_visitChildren(ContextProxy* proxy) {
|
58
58
|
auto result = visitChildren(proxy -> getOriginal());
|
59
59
|
try {
|
60
|
-
return
|
60
|
+
return std::any_cast<Object>(result);
|
61
61
|
} catch(std::bad_cast) {
|
62
62
|
return Qnil;
|
63
63
|
}
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: antlr4-native
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -43,7 +43,7 @@ files:
|
|
43
43
|
- lib/antlr4-native/string_helpers.rb
|
44
44
|
- lib/antlr4-native/version.rb
|
45
45
|
- lib/antlr4-native/visitor_generator.rb
|
46
|
-
- vendor/
|
46
|
+
- vendor/antlr-4.10.1-complete.jar
|
47
47
|
homepage: http://github.com/camertron/antlr4-native-rb
|
48
48
|
licenses: []
|
49
49
|
metadata: {}
|
Binary file
|