lib/regextest/front/bracket-parser.rb in regextest-0.1.5 vs lib/regextest/front/bracket-parser.rb in regextest-0.1.6
- old
+ new
@@ -1,8 +1,8 @@
#
# DO NOT MODIFY!!!!
-# This file is automatically generated by Racc 1.4.12
+# This file is automatically generated by Racc 1.4.14
# from Racc grammer file "".
#
require 'racc/parser.rb'
@@ -13,11 +13,11 @@
require 'regextest/front/char-class' # parser class for a char-class element
require 'regextest/front/bracket' # parser class for a bracket
class RegextestFrontBracketParser < Racc::Parser
-module_eval(<<'...end bracket-parser.y/module_eval...', 'bracket-parser.y', 73)
+module_eval(<<'...end bracket-parser.y/module_eval...', 'bracket-parser.y', 76)
# modules for sharing procedures with main (regex) parser
include Regextest::Front::Range
include Regextest::Front::Letter
include Regextest::Front::CharClass
include Regextest::Front::Bracket
@@ -63,101 +63,105 @@
...end bracket-parser.y/module_eval...
##### State transition tables begin ###
racc_action_table = [
3, 14, 9, 10, 11, 12, 13, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 3, 14, 9,
- 10, 11, 12, 13, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 3, 14, 9, 10, 11, 12,
+ 18, 19, 20, 21, 22, 23, 24, 25, 3, 14,
+ 9, 10, 11, 12, 13, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 3, 14, 9, 10,
+ 11, 12, 13, 15, 16, 17, 18, 19, 20, 21,
+ 22, 23, 24, 25, 3, 14, 9, 10, 11, 12,
13, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 3, 14, 9, 10, 11, 12, 13, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 14, 9,
- 10, 11, 12, 13, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 14, 9, 10, 11, 12, 13,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 14, 9, 10, 11, 12, 13, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 14, 26, 35, 11,
- 12, 13, 15, 16, 17, 18, 19, 25, 32, 26,
- 26, 36, 29 ]
+ 24, 25, 14, 9, 10, 11, 12, 13, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 14,
+ 9, 10, 11, 12, 13, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 14, 9, 10, 11,
+ 12, 13, 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 14, 27, 36, 11, 12, 13, 15,
+ 16, 17, 18, 19, 20, 26, 33, 27, 27, 37,
+ 30 ]
racc_action_check = [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 27, 27,
+ 0, 0, 0, 0, 0, 0, 0, 0, 27, 27,
27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 4, 4, 4, 4, 4, 4,
+ 27, 27, 27, 27, 27, 27, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 29, 30, 30, 29,
- 29, 29, 29, 29, 29, 29, 29, 1, 25, 1,
- 31, 31, 6 ]
+ 3, 3, 3, 30, 31, 31, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 1, 26, 1, 32, 32,
+ 6 ]
racc_action_pointer = [
- -3, 127, nil, 96, 80, nil, 128, nil, nil, 31,
- 48, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, 128, 14, 64, nil, 112,
- 115, 128, nil, nil, nil, nil, nil ]
+ -3, 135, nil, 102, 85, nil, 136, nil, nil, 33,
+ 51, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, 136, 15, 68, nil,
+ 119, 122, 136, nil, nil, nil, nil, nil ]
racc_action_default = [
- -28, -28, -1, -4, -5, -6, -9, -10, -11, -28,
- -28, -14, -15, -16, -17, -18, -19, -20, -21, -22,
- -23, -24, -25, -26, -27, -28, -28, -3, -7, -28,
- -28, -28, 37, -2, -8, -12, -13 ]
+ -30, -30, -1, -4, -5, -6, -10, -11, -12, -30,
+ -30, -15, -16, -17, -18, -19, -20, -21, -22, -23,
+ -24, -25, -26, -27, -28, -29, -30, -30, -3, -7,
+ -9, -30, -30, 38, -2, -8, -13, -14 ]
racc_goto_table = [
- 28, 1, 27, 33, 34, nil, nil, nil, nil, nil,
- 30, 31, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 28 ]
+ 29, 1, 28, 34, 35, nil, nil, nil, nil, nil,
+ 31, 32, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, 29 ]
racc_goto_check = [
4, 1, 3, 2, 5, nil, nil, nil, nil, nil,
1, 1, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 4 ]
+ nil, nil, nil, nil, 4 ]
racc_goto_pointer = [
- nil, 1, -23, -1, -4, -25, nil, nil ]
+ nil, 1, -24, -1, -4, -26, nil, nil ]
racc_goto_default = [
nil, nil, 2, 4, 5, 6, 7, 8 ]
racc_reduce_table = [
0, 0, :racc_error,
- 1, 21, :_reduce_1,
- 3, 21, :_reduce_2,
- 2, 22, :_reduce_3,
- 1, 22, :_reduce_4,
- 1, 22, :_reduce_none,
- 1, 23, :_reduce_6,
- 2, 23, :_reduce_7,
- 3, 24, :_reduce_8,
- 1, 24, :_reduce_9,
- 1, 24, :_reduce_10,
- 1, 24, :_reduce_11,
- 3, 27, :_reduce_12,
- 3, 27, :_reduce_13,
- 1, 25, :_reduce_14,
- 1, 25, :_reduce_15,
- 1, 25, :_reduce_16,
- 1, 25, :_reduce_17,
- 1, 25, :_reduce_18,
- 1, 25, :_reduce_19,
- 1, 25, :_reduce_20,
- 1, 25, :_reduce_21,
- 1, 25, :_reduce_22,
+ 1, 22, :_reduce_1,
+ 3, 22, :_reduce_2,
+ 2, 23, :_reduce_3,
+ 1, 23, :_reduce_4,
+ 1, 23, :_reduce_none,
+ 1, 24, :_reduce_6,
+ 2, 24, :_reduce_7,
+ 3, 25, :_reduce_8,
+ 2, 25, :_reduce_9,
+ 1, 25, :_reduce_10,
+ 1, 25, :_reduce_11,
+ 1, 25, :_reduce_12,
+ 3, 28, :_reduce_13,
+ 3, 28, :_reduce_14,
+ 1, 26, :_reduce_15,
+ 1, 26, :_reduce_16,
+ 1, 26, :_reduce_17,
+ 1, 26, :_reduce_18,
+ 1, 26, :_reduce_19,
+ 1, 26, :_reduce_20,
+ 1, 26, :_reduce_21,
+ 1, 26, :_reduce_22,
1, 26, :_reduce_23,
1, 26, :_reduce_24,
- 1, 26, :_reduce_25,
- 1, 26, :_reduce_26,
- 1, 26, :_reduce_27 ]
+ 1, 27, :_reduce_25,
+ 1, 27, :_reduce_26,
+ 1, 27, :_reduce_27,
+ 1, 27, :_reduce_28,
+ 1, 27, :_reduce_29 ]
-racc_reduce_n = 28
+racc_reduce_n = 30
-racc_shift_n = 37
+racc_shift_n = 38
racc_token_table = {
false => 0,
:error => 1,
:LEX_AND_AND => 2,
@@ -168,20 +172,21 @@
:LEX_CHAR => 7,
:LEX_OCTET => 8,
:LEX_SIMPLE_ESCAPE => 9,
:LEX_CODE_LITERAL => 10,
:LEX_CONTROL_LETTER => 11,
- :LEX_META_LETTER => 12,
- :LEX_ESCAPED_LETTER => 13,
- :LEX_UNICODE => 14,
- :LEX_POSIX_CHAR_CLASS => 15,
- :LEX_SIMPLIFIED_CLASS => 16,
- :LEX_UNICODE_CLASS => 17,
- :LEX_SPECIAL_LETTER => 18,
- :LEX_SPACE => 19 }
+ :LEX_META_CONTROL_LETTER => 12,
+ :LEX_META_LETTER => 13,
+ :LEX_ESCAPED_LETTER => 14,
+ :LEX_UNICODE => 15,
+ :LEX_POSIX_CHAR_CLASS => 16,
+ :LEX_SIMPLIFIED_CLASS => 17,
+ :LEX_UNICODE_CLASS => 18,
+ :LEX_SPECIAL_LETTER => 19,
+ :LEX_SPACE => 20 }
-racc_nt_base = 20
+racc_nt_base = 21
racc_use_result_var = false
Racc_arg = [
racc_action_table,
@@ -210,10 +215,11 @@
"LEX_CHAR",
"LEX_OCTET",
"LEX_SIMPLE_ESCAPE",
"LEX_CODE_LITERAL",
"LEX_CONTROL_LETTER",
+ "LEX_META_CONTROL_LETTER",
"LEX_META_LETTER",
"LEX_ESCAPED_LETTER",
"LEX_UNICODE",
"LEX_POSIX_CHAR_CLASS",
"LEX_SIMPLIFIED_CLASS",
@@ -279,11 +285,11 @@
end
.,.,
module_eval(<<'.,.,', 'bracket-parser.y', 31)
def _reduce_9(val, _values)
- val[0]
+ CharClass.new(val[0]).add(TLetter.new(:LEX_CHAR, val[1]))
end
.,.,
module_eval(<<'.,.,', 'bracket-parser.y', 33)
def _reduce_10(val, _values)
@@ -295,101 +301,113 @@
def _reduce_11(val, _values)
val[0]
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 39)
+module_eval(<<'.,.,', 'bracket-parser.y', 37)
def _reduce_12(val, _values)
- Bracket.new(val[0], val[1])
+ val[0]
end
.,.,
module_eval(<<'.,.,', 'bracket-parser.y', 41)
def _reduce_13(val, _values)
Bracket.new(val[0], val[1])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 44)
+module_eval(<<'.,.,', 'bracket-parser.y', 43)
def _reduce_14(val, _values)
- TLetter.new(:LEX_CHAR, val[0])
+ Bracket.new(val[0], val[1])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 45)
+module_eval(<<'.,.,', 'bracket-parser.y', 46)
def _reduce_15(val, _values)
- TLetter.new(:LEX_OCTET, val[0])
+ TLetter.new(:LEX_CHAR, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 46)
+module_eval(<<'.,.,', 'bracket-parser.y', 47)
def _reduce_16(val, _values)
- TLetter.new(:LEX_SIMPLE_ESCAPE, val[0])
+ TLetter.new(:LEX_OCTET, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 47)
+module_eval(<<'.,.,', 'bracket-parser.y', 48)
def _reduce_17(val, _values)
- TLetter.new(:LEX_CHAR, val[0])
+ TLetter.new(:LEX_SIMPLE_ESCAPE, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 48)
+module_eval(<<'.,.,', 'bracket-parser.y', 49)
def _reduce_18(val, _values)
- TLetter.new(:LEX_CODE_LITERAL, val[0])
+ TLetter.new(:LEX_CHAR, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 49)
+module_eval(<<'.,.,', 'bracket-parser.y', 50)
def _reduce_19(val, _values)
- TLetter.new(:LEX_CONTROL_LETTER, val[0])
+ TLetter.new(:LEX_CODE_LITERAL, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 50)
+module_eval(<<'.,.,', 'bracket-parser.y', 51)
def _reduce_20(val, _values)
TLetter.new(:LEX_CONTROL_LETTER, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 51)
+module_eval(<<'.,.,', 'bracket-parser.y', 52)
def _reduce_21(val, _values)
- TLetter.new(:LEX_ESCAPED_LETTER, val[0])
+ TLetter.new(:LEX_META_CONTROL_LETTER, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 52)
+module_eval(<<'.,.,', 'bracket-parser.y', 53)
def _reduce_22(val, _values)
- TLetter.new(:LEX_UNICODE, val[0])
+ TLetter.new(:LEX_CONTROL_LETTER, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 55)
+module_eval(<<'.,.,', 'bracket-parser.y', 54)
def _reduce_23(val, _values)
- TLetter.new(:LEX_POSIX_CHAR_CLASS, val[0])
+ TLetter.new(:LEX_ESCAPED_LETTER, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 56)
+module_eval(<<'.,.,', 'bracket-parser.y', 55)
def _reduce_24(val, _values)
- TLetter.new(:LEX_SIMPLIFIED_CLASS, val[0])
+ TLetter.new(:LEX_UNICODE, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 57)
+module_eval(<<'.,.,', 'bracket-parser.y', 58)
def _reduce_25(val, _values)
- TLetter.new(:LEX_UNICODE_CLASS, val[0])
+ TLetter.new(:LEX_POSIX_CHAR_CLASS, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 58)
+module_eval(<<'.,.,', 'bracket-parser.y', 59)
def _reduce_26(val, _values)
- TLetter.new(:LEX_SPECIAL_LETTER, val[0])
+ TLetter.new(:LEX_SIMPLIFIED_CLASS, val[0])
end
.,.,
-module_eval(<<'.,.,', 'bracket-parser.y', 59)
+module_eval(<<'.,.,', 'bracket-parser.y', 60)
def _reduce_27(val, _values)
+ TLetter.new(:LEX_UNICODE_CLASS_BRACKET, val[0])
+ end
+.,.,
+
+module_eval(<<'.,.,', 'bracket-parser.y', 61)
+ def _reduce_28(val, _values)
+ TLetter.new(:LEX_SPECIAL_LETTER, val[0])
+ end
+.,.,
+
+module_eval(<<'.,.,', 'bracket-parser.y', 62)
+ def _reduce_29(val, _values)
TLetter.new(:LEX_SPACE, val[0])
end
.,.,
def _reduce_none(val, _values)