lib/nagios_parser/config/parser.rb in nagios_parser-1.2.2 vs lib/nagios_parser/config/parser.rb in nagios_parser-1.3.0
- old
+ new
@@ -1,20 +1,21 @@
#
# DO NOT MODIFY!!!!
-# This file is automatically generated by Racc 1.4.6
+# This file is automatically generated by Racc 1.4.7
# from Racc grammer file "".
#
require 'racc/parser.rb'
require 'strscan'
+require 'nagios_parser/result'
module NagiosParser
module Config
class Parser < Racc::Parser
-module_eval(<<'...end parser.y/module_eval...', 'parser.y', 19)
+module_eval(<<'...end parser.y/module_eval...', 'parser.y', 20)
def create_token(string)
result = []
scanner = StringScanner.new(string)
@@ -43,41 +44,41 @@
def self.parse(string)
new.parse(string)
end
def parse(string)
- @result = {}
+ @result = NagiosParser::Result.new(:multi_value => %w{cfg_file cfg_dir})
@token = create_token(string)
do_parse
- @result
+ @result.to_hash
end
def next_token
@token.shift
end
...end parser.y/module_eval...
##### State transition tables begin ###
racc_action_table = [
- 5, 1, 1, 4, 7 ]
+ 4, 6, 3, 3, 7 ]
racc_action_check = [
- 2, 0, 2, 1, 5 ]
+ 1, 3, 1, 0, 4 ]
racc_action_pointer = [
- -1, 0, 0, nil, nil, 4, nil, nil ]
+ 1, 0, nil, -2, 4, nil, nil, nil ]
racc_action_default = [
- -4, -4, -4, -1, -3, -4, -2, 8 ]
+ -4, -4, -1, -4, -4, -2, -3, 8 ]
racc_goto_table = [
- 3, 2, 6 ]
+ 2, 5, 1 ]
racc_goto_check = [
- 2, 1, 2 ]
+ 2, 2, 1 ]
racc_goto_pointer = [
- nil, 1, 0 ]
+ nil, 2, 0 ]
racc_goto_default = [
nil, nil, nil ]
racc_reduce_table = [