lib/antlr4-native/generator.rb in antlr4-native-2.0.1 vs lib/antlr4-native/generator.rb in antlr4-native-2.1.0
- old
+ new
@@ -1,23 +1,24 @@
require 'fileutils'
module Antlr4Native
class Generator
- ANTLR_VERSION = '4.8'.freeze
+ ANTLR_VERSION = '4.10.1'.freeze
ANTLR_JAR = File.expand_path(
- File.join('..', '..', 'vendor', 'antlr4-4.8-1-complete.jar'), __dir__
+ File.join('..', '..', 'vendor', "antlr-#{ANTLR_VERSION}-complete.jar"), __dir__
).freeze
include StringHelpers
attr_reader :grammar_files, :output_dir, :parser_root_method
def initialize(grammar_files:, output_dir:, parser_root_method:)
@grammar_files = grammar_files
@output_dir = output_dir
@parser_root_method = parser_root_method
+
end
def generate
generate_antlr_code
write_interop_file
@@ -266,10 +267,10 @@
// reset for the next visit call
this -> lexer -> reset();
this -> parser -> reset();
- return result;
+ return std::any_cast<Object>(result);
}
~ParserProxy() {
delete this -> parser;
delete this -> tokens;