racc 1.4.15 → 1.4.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/COPYING +22 -515
  3. data/Manifest.txt +3 -9
  4. data/README.ja.rdoc +3 -4
  5. data/README.rdoc +4 -4
  6. data/Rakefile +13 -55
  7. data/bin/racc +2 -4
  8. data/ext/racc/{cparse.c → cparse/cparse.c} +64 -31
  9. data/ext/racc/cparse/extconf.rb +8 -0
  10. data/lib/racc/exception.rb +3 -5
  11. data/lib/racc/grammar.rb +5 -7
  12. data/lib/racc/grammarfileparser.rb +4 -3
  13. data/lib/racc/info.rb +4 -6
  14. data/lib/racc/iset.rb +2 -2
  15. data/lib/racc/logfilegenerator.rb +2 -2
  16. data/lib/racc/parser-text.rb +14 -11
  17. data/lib/racc/parser.rb +14 -11
  18. data/lib/racc/parserfilegenerator.rb +5 -7
  19. data/lib/racc/state.rb +11 -13
  20. data/test/assets/intp.y +4 -4
  21. data/test/assets/mailp.y +27 -27
  22. data/test/assets/mof.y +12 -12
  23. data/test/assets/nullbug2.y +2 -2
  24. data/test/assets/recv.y +20 -20
  25. data/test/assets/syntax.y +1 -1
  26. data/test/assets/twowaysql.y +1 -1
  27. data/test/helper.rb +46 -35
  28. data/test/regress/cadenza +60 -60
  29. data/test/regress/cast +8 -8
  30. data/test/regress/csspool +167 -167
  31. data/test/regress/edtf +115 -115
  32. data/test/regress/huia +75 -75
  33. data/test/regress/journey +12 -12
  34. data/test/regress/liquor +54 -54
  35. data/test/regress/machete +37 -37
  36. data/test/regress/mediacloth +83 -83
  37. data/test/regress/mof +60 -60
  38. data/test/regress/namae +29 -29
  39. data/test/regress/nasl +174 -174
  40. data/test/regress/nokogiri-css +59 -59
  41. data/test/regress/opal +352 -352
  42. data/test/regress/php_serialization +20 -20
  43. data/test/regress/riml +261 -261
  44. data/test/regress/ruby18 +353 -353
  45. data/test/regress/ruby22 +433 -433
  46. data/test/regress/tp_plus +125 -125
  47. data/test/regress/twowaysql +30 -30
  48. data/test/test_chk_y.rb +1 -0
  49. data/test/test_racc_command.rb +5 -24
  50. data/test/test_scan_y.rb +1 -0
  51. data/test/testscanner.rb +1 -1
  52. metadata +9 -76
  53. data/ext/racc/depend +0 -1
  54. data/ext/racc/extconf.rb +0 -7
  55. data/test/assets/bibtex.y +0 -141
  56. data/test/assets/rdblockparser.y +0 -576
  57. data/test/assets/rdinlineparser.y +0 -561
  58. data/test/regress/bibtex +0 -474
  59. data/test/regress/rdblockparser +0 -1061
  60. data/test/regress/rdinlineparser +0 -1243
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.14
4
- # from Racc grammer file "".
3
+ # This file is automatically generated by Racc 1.4.16.pre.1
4
+ # from Racc grammar file "".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -35,7 +35,7 @@ def initialize options = {}
35
35
  @includes = options[:includes] || []
36
36
  @quiet = options[:quiet]
37
37
  @style = options[:style] || :cim # default to style CIM v2.2 syntax
38
-
38
+
39
39
  @lineno = 1
40
40
  @file = nil
41
41
  @iconv = nil
@@ -699,14 +699,14 @@ Racc_debug_parser = false
699
699
 
700
700
  module_eval(<<'.,.,', 'mof.y', 41)
701
701
  def _reduce_1(val, _values, result)
702
- result = Hash.new
702
+ result = Hash.new
703
703
  result
704
704
  end
705
705
  .,.,
706
706
 
707
707
  module_eval(<<'.,.,', 'mof.y', 43)
708
708
  def _reduce_2(val, _values, result)
709
- result = { @name => @result }
709
+ result = { @name => @result }
710
710
  result
711
711
  end
712
712
  .,.,
@@ -715,7 +715,7 @@ module_eval(<<'.,.,', 'mof.y', 45)
715
715
  def _reduce_3(val, _values, result)
716
716
  result = val[0]
717
717
  result[@name] = @result
718
-
718
+
719
719
  result
720
720
  end
721
721
  .,.,
@@ -726,7 +726,7 @@ module_eval(<<'.,.,', 'mof.y', 53)
726
726
  def _reduce_5(val, _values, result)
727
727
  #puts "Class '#{val[0].name}'"
728
728
  @result.classes << val[0]
729
-
729
+
730
730
  result
731
731
  end
732
732
  .,.,
@@ -735,14 +735,14 @@ module_eval(<<'.,.,', 'mof.y', 57)
735
735
  def _reduce_6(val, _values, result)
736
736
  @result.qualifiers << val[0]
737
737
  @qualifiers[val[0].name.downcase] = val[0]
738
-
738
+
739
739
  result
740
740
  end
741
741
  .,.,
742
742
 
743
743
  module_eval(<<'.,.,', 'mof.y', 61)
744
744
  def _reduce_7(val, _values, result)
745
- @result.instances << val[0]
745
+ @result.instances << val[0]
746
746
  result
747
747
  end
748
748
  .,.,
@@ -751,7 +751,7 @@ module_eval(<<'.,.,', 'mof.y', 71)
751
751
  def _reduce_8(val, _values, result)
752
752
  raise MOF::Helper::Error.new(@name,@lineno,@line,"Missing filename after '#pragma include'") unless val[3]
753
753
  open val[3], :pragma
754
-
754
+
755
755
  result
756
756
  end
757
757
  .,.,
@@ -763,7 +763,7 @@ module_eval(<<'.,.,', 'mof.y', 76)
763
763
  raise StyleError.new(@name,@lineno,@line,"Use '#pragma include' instead of '#include'") unless @style == :wmi
764
764
  raise MOF::Helper::Error.new(@name,@lineno,@line,"Missing filename after '#include'") unless val[2]
765
765
  open val[2], :pragma
766
-
766
+
767
767
  result
768
768
  end
769
769
  .,.,
@@ -772,14 +772,14 @@ module_eval(<<'.,.,', 'mof.y', 76)
772
772
 
773
773
  module_eval(<<'.,.,', 'mof.y', 88)
774
774
  def _reduce_12(val, _values, result)
775
- raise StyleError.new(@name,@lineno,@line,"#pragma parameter missing") unless @style == :wmi
775
+ raise StyleError.new(@name,@lineno,@line,"#pragma parameter missing") unless @style == :wmi
776
776
  result
777
777
  end
778
778
  .,.,
779
779
 
780
780
  module_eval(<<'.,.,', 'mof.y', 90)
781
781
  def _reduce_13(val, _values, result)
782
- result = val[1]
782
+ result = val[1]
783
783
  result
784
784
  end
785
785
  .,.,
@@ -792,7 +792,7 @@ module_eval(<<'.,.,', 'mof.y', 90)
792
792
 
793
793
  module_eval(<<'.,.,', 'mof.y', 101)
794
794
  def _reduce_17(val, _values, result)
795
- raise StyleError.new(@name,@lineno,@line,"#pragma parameter missing") unless @style == :wmi
795
+ raise StyleError.new(@name,@lineno,@line,"#pragma parameter missing") unless @style == :wmi
796
796
  result
797
797
  end
798
798
  .,.,
@@ -805,21 +805,21 @@ module_eval(<<'.,.,', 'mof.y', 112)
805
805
  features = val[6]
806
806
  # FIXME: features must not include references
807
807
  result = CIM::Class.new(val[2],qualifiers,val[3],val[4],features)
808
-
808
+
809
809
  result
810
810
  end
811
811
  .,.,
812
812
 
813
813
  module_eval(<<'.,.,', 'mof.y', 121)
814
814
  def _reduce_20(val, _values, result)
815
- result = []
815
+ result = []
816
816
  result
817
817
  end
818
818
  .,.,
819
819
 
820
820
  module_eval(<<'.,.,', 'mof.y', 123)
821
821
  def _reduce_21(val, _values, result)
822
- result = val[0] << val[1]
822
+ result = val[0] << val[1]
823
823
  result
824
824
  end
825
825
  .,.,
@@ -834,7 +834,7 @@ module_eval(<<'.,.,', 'mof.y', 123)
834
834
 
835
835
  module_eval(<<'.,.,', 'mof.y', 136)
836
836
  def _reduce_26(val, _values, result)
837
- result = CIM::QualifierSet.new val[0]
837
+ result = CIM::QualifierSet.new val[0]
838
838
  result
839
839
  end
840
840
  .,.,
@@ -842,14 +842,14 @@ module_eval(<<'.,.,', 'mof.y', 136)
842
842
  module_eval(<<'.,.,', 'mof.y', 141)
843
843
  def _reduce_27(val, _values, result)
844
844
  result = val[2]
845
- result.unshift val[1] if val[1]
845
+ result.unshift val[1] if val[1]
846
846
  result
847
847
  end
848
848
  .,.,
849
849
 
850
850
  module_eval(<<'.,.,', 'mof.y', 147)
851
851
  def _reduce_28(val, _values, result)
852
- result = []
852
+ result = []
853
853
  result
854
854
  end
855
855
  .,.,
@@ -858,7 +858,7 @@ module_eval(<<'.,.,', 'mof.y', 149)
858
858
  def _reduce_29(val, _values, result)
859
859
  result = val[0]
860
860
  result << val[2] if val[2]
861
-
861
+
862
862
  result
863
863
  end
864
864
  .,.,
@@ -882,7 +882,7 @@ module_eval(<<'.,.,', 'mof.y', 156)
882
882
  else
883
883
  result = CIM::Qualifier.new(qualifier,value,val[2])
884
884
  end
885
-
885
+
886
886
  result
887
887
  end
888
888
  .,.,
@@ -891,7 +891,7 @@ module_eval(<<'.,.,', 'mof.y', 156)
891
891
 
892
892
  module_eval(<<'.,.,', 'mof.y', 179)
893
893
  def _reduce_32(val, _values, result)
894
- result = CIM::QualifierFlavors.new val[1]
894
+ result = CIM::QualifierFlavors.new val[1]
895
895
  result
896
896
  end
897
897
  .,.,
@@ -902,7 +902,7 @@ module_eval(<<'.,.,', 'mof.y', 179)
902
902
 
903
903
  module_eval(<<'.,.,', 'mof.y', 189)
904
904
  def _reduce_35(val, _values, result)
905
- result = val[1]
905
+ result = val[1]
906
906
  result
907
907
  end
908
908
  .,.,
@@ -927,7 +927,7 @@ module_eval(<<'.,.,', 'mof.y', 196)
927
927
  when :amended, :toinstance
928
928
  raise StyleError.new(@name,@lineno,@line,"'#{val[0]}' is not a valid flavor") unless @style == :wmi
929
929
  end
930
-
930
+
931
931
  result
932
932
  end
933
933
  .,.,
@@ -942,28 +942,28 @@ module_eval(<<'.,.,', 'mof.y', 196)
942
942
 
943
943
  module_eval(<<'.,.,', 'mof.y', 215)
944
944
  def _reduce_48(val, _values, result)
945
- raise ParseError.new("Class name must be prefixed by '<schema>_'") unless val[0].include?("_") || @style == :wmi
945
+ raise ParseError.new("Class name must be prefixed by '<schema>_'") unless val[0].include?("_") || @style == :wmi
946
946
  result
947
947
  end
948
948
  .,.,
949
949
 
950
950
  module_eval(<<'.,.,', 'mof.y', 220)
951
951
  def _reduce_49(val, _values, result)
952
- result = val[1]
952
+ result = val[1]
953
953
  result
954
954
  end
955
955
  .,.,
956
956
 
957
957
  module_eval(<<'.,.,', 'mof.y', 225)
958
958
  def _reduce_50(val, _values, result)
959
- result = val[1]
959
+ result = val[1]
960
960
  result
961
961
  end
962
962
  .,.,
963
963
 
964
964
  module_eval(<<'.,.,', 'mof.y', 230)
965
965
  def _reduce_51(val, _values, result)
966
- result = val[1]
966
+ result = val[1]
967
967
  result
968
968
  end
969
969
  .,.,
@@ -976,7 +976,7 @@ module_eval(<<'.,.,', 'mof.y', 236)
976
976
  type = val[1]
977
977
  end
978
978
  result = CIM::Property.new(type,val[2],val[0],val[4])
979
-
979
+
980
980
  result
981
981
  end
982
982
  .,.,
@@ -986,14 +986,14 @@ module_eval(<<'.,.,', 'mof.y', 247)
986
986
  if val[4]
987
987
  raise StyleError.new(@name,@lineno,@line,"Array not allowed in reference declaration") unless @style == :wmi
988
988
  end
989
- result = CIM::Reference.new(val[1],val[2],val[0],val[4])
989
+ result = CIM::Reference.new(val[1],val[2],val[0],val[4])
990
990
  result
991
991
  end
992
992
  .,.,
993
993
 
994
994
  module_eval(<<'.,.,', 'mof.y', 255)
995
995
  def _reduce_54(val, _values, result)
996
- result = CIM::Method.new(val[1],val[2],val[0],val[4])
996
+ result = CIM::Method.new(val[1],val[2],val[0],val[4])
997
997
  result
998
998
  end
999
999
  .,.,
@@ -1004,7 +1004,7 @@ module_eval(<<'.,.,', 'mof.y', 261)
1004
1004
  def _reduce_56(val, _values, result)
1005
1005
  # tmplprov.mof has 'string Property;'
1006
1006
  raise StyleError.new(@name,@lineno,@line,"Invalid keyword '#{val[0]}' used for property name") unless @style == :wmi
1007
-
1007
+
1008
1008
  result
1009
1009
  end
1010
1010
  .,.,
@@ -1013,7 +1013,7 @@ module_eval(<<'.,.,', 'mof.y', 261)
1013
1013
 
1014
1014
  module_eval(<<'.,.,', 'mof.y', 269)
1015
1015
  def _reduce_58(val, _values, result)
1016
- result = "Indication"
1016
+ result = "Indication"
1017
1017
  result
1018
1018
  end
1019
1019
  .,.,
@@ -1050,7 +1050,7 @@ module_eval(<<'.,.,', 'mof.y', 269)
1050
1050
 
1051
1051
  module_eval(<<'.,.,', 'mof.y', 292)
1052
1052
  def _reduce_74(val, _values, result)
1053
- raise StyleError.new(@name,@lineno,@line,"'void' is not a valid datatype") unless @style == :wmi
1053
+ raise StyleError.new(@name,@lineno,@line,"'void' is not a valid datatype") unless @style == :wmi
1054
1054
  result
1055
1055
  end
1056
1056
  .,.,
@@ -1060,14 +1060,14 @@ module_eval(<<'.,.,', 'mof.y', 297)
1060
1060
  # WMI uses class names as data types (without REF ?!)
1061
1061
  raise StyleError.new(@name,@lineno,@line,"Expected 'ref' keyword after classname '#{val[0]}'") unless @style == :wmi
1062
1062
  result = CIM::ReferenceType.new val[0]
1063
-
1063
+
1064
1064
  result
1065
1065
  end
1066
1066
  .,.,
1067
1067
 
1068
1068
  module_eval(<<'.,.,', 'mof.y', 303)
1069
1069
  def _reduce_76(val, _values, result)
1070
- result = CIM::ReferenceType.new val[0]
1070
+ result = CIM::ReferenceType.new val[0]
1071
1071
  result
1072
1072
  end
1073
1073
  .,.,
@@ -1078,21 +1078,21 @@ module_eval(<<'.,.,', 'mof.y', 303)
1078
1078
 
1079
1079
  module_eval(<<'.,.,', 'mof.y', 313)
1080
1080
  def _reduce_79(val, _values, result)
1081
- result = val[1].unshift val[0]
1081
+ result = val[1].unshift val[0]
1082
1082
  result
1083
1083
  end
1084
1084
  .,.,
1085
1085
 
1086
1086
  module_eval(<<'.,.,', 'mof.y', 318)
1087
1087
  def _reduce_80(val, _values, result)
1088
- result = []
1088
+ result = []
1089
1089
  result
1090
1090
  end
1091
1091
  .,.,
1092
1092
 
1093
1093
  module_eval(<<'.,.,', 'mof.y', 320)
1094
1094
  def _reduce_81(val, _values, result)
1095
- result = val[0] << val[2]
1095
+ result = val[0] << val[2]
1096
1096
  result
1097
1097
  end
1098
1098
  .,.,
@@ -1105,7 +1105,7 @@ module_eval(<<'.,.,', 'mof.y', 325)
1105
1105
  type = val[1]
1106
1106
  end
1107
1107
  result = CIM::Property.new(type,val[2],val[0])
1108
-
1108
+
1109
1109
  result
1110
1110
  end
1111
1111
  .,.,
@@ -1124,21 +1124,21 @@ module_eval(<<'.,.,', 'mof.y', 325)
1124
1124
 
1125
1125
  module_eval(<<'.,.,', 'mof.y', 351)
1126
1126
  def _reduce_89(val, _values, result)
1127
- raise "Default parameter value not allowed in syntax style '{@style}'" unless @style == :wmi
1127
+ raise "Default parameter value not allowed in syntax style '{@style}'" unless @style == :wmi
1128
1128
  result
1129
1129
  end
1130
1130
  .,.,
1131
1131
 
1132
1132
  module_eval(<<'.,.,', 'mof.y', 356)
1133
1133
  def _reduce_90(val, _values, result)
1134
- result = val[1]
1134
+ result = val[1]
1135
1135
  result
1136
1136
  end
1137
1137
  .,.,
1138
1138
 
1139
1139
  module_eval(<<'.,.,', 'mof.y', 361)
1140
1140
  def _reduce_91(val, _values, result)
1141
- result = -1
1141
+ result = -1
1142
1142
  result
1143
1143
  end
1144
1144
  .,.,
@@ -1151,7 +1151,7 @@ module_eval(<<'.,.,', 'mof.y', 361)
1151
1151
 
1152
1152
  module_eval(<<'.,.,', 'mof.y', 372)
1153
1153
  def _reduce_95(val, _values, result)
1154
- result = val[1]
1154
+ result = val[1]
1155
1155
  result
1156
1156
  end
1157
1157
  .,.,
@@ -1164,7 +1164,7 @@ module_eval(<<'.,.,', 'mof.y', 372)
1164
1164
 
1165
1165
  module_eval(<<'.,.,', 'mof.y', 383)
1166
1166
  def _reduce_99(val, _values, result)
1167
- result = val[1]
1167
+ result = val[1]
1168
1168
  result
1169
1169
  end
1170
1170
  .,.,
@@ -1173,14 +1173,14 @@ module_eval(<<'.,.,', 'mof.y', 383)
1173
1173
 
1174
1174
  module_eval(<<'.,.,', 'mof.y', 389)
1175
1175
  def _reduce_101(val, _values, result)
1176
- result = [ val[0] ]
1176
+ result = [ val[0] ]
1177
1177
  result
1178
1178
  end
1179
1179
  .,.,
1180
1180
 
1181
1181
  module_eval(<<'.,.,', 'mof.y', 391)
1182
1182
  def _reduce_102(val, _values, result)
1183
- result = val[0] << val[2]
1183
+ result = val[0] << val[2]
1184
1184
  result
1185
1185
  end
1186
1186
  .,.,
@@ -1199,7 +1199,7 @@ module_eval(<<'.,.,', 'mof.y', 391)
1199
1199
 
1200
1200
  module_eval(<<'.,.,', 'mof.y', 402)
1201
1201
  def _reduce_109(val, _values, result)
1202
- raise "Instance as property value not allowed in syntax style '{@style}'" unless @style == :wmi
1202
+ raise "Instance as property value not allowed in syntax style '{@style}'" unless @style == :wmi
1203
1203
  result
1204
1204
  end
1205
1205
  .,.,
@@ -1218,7 +1218,7 @@ module_eval(<<'.,.,', 'mof.y', 402)
1218
1218
 
1219
1219
  module_eval(<<'.,.,', 'mof.y', 416)
1220
1220
  def _reduce_116(val, _values, result)
1221
- result = val[0] + val[1]
1221
+ result = val[0] + val[1]
1222
1222
  result
1223
1223
  end
1224
1224
  .,.,
@@ -1251,7 +1251,7 @@ module_eval(<<'.,.,', 'mof.y', 416)
1251
1251
 
1252
1252
  module_eval(<<'.,.,', 'mof.y', 471)
1253
1253
  def _reduce_130(val, _values, result)
1254
- result = CIM::QualifierDeclaration.new( val[1], val[2][0], val[2][1], val[3], val[4])
1254
+ result = CIM::QualifierDeclaration.new( val[1], val[2][0], val[2][1], val[3], val[4])
1255
1255
  result
1256
1256
  end
1257
1257
  .,.,
@@ -1274,28 +1274,28 @@ module_eval(<<'.,.,', 'mof.y', 490)
1274
1274
  def _reduce_138(val, _values, result)
1275
1275
  type = val[2].nil? ? val[1] : CIM::Array.new(val[2],val[1])
1276
1276
  result = [ type, val[3] ]
1277
-
1277
+
1278
1278
  result
1279
1279
  end
1280
1280
  .,.,
1281
1281
 
1282
1282
  module_eval(<<'.,.,', 'mof.y', 497)
1283
1283
  def _reduce_139(val, _values, result)
1284
- result = CIM::QualifierScopes.new(val[3])
1284
+ result = CIM::QualifierScopes.new(val[3])
1285
1285
  result
1286
1286
  end
1287
1287
  .,.,
1288
1288
 
1289
1289
  module_eval(<<'.,.,', 'mof.y', 502)
1290
1290
  def _reduce_140(val, _values, result)
1291
- result = [ val[0] ]
1291
+ result = [ val[0] ]
1292
1292
  result
1293
1293
  end
1294
1294
  .,.,
1295
1295
 
1296
1296
  module_eval(<<'.,.,', 'mof.y', 504)
1297
1297
  def _reduce_141(val, _values, result)
1298
- result = val[0] << val[2]
1298
+ result = val[0] << val[2]
1299
1299
  result
1300
1300
  end
1301
1301
  .,.,
@@ -1322,21 +1322,21 @@ module_eval(<<'.,.,', 'mof.y', 504)
1322
1322
 
1323
1323
  module_eval(<<'.,.,', 'mof.y', 522)
1324
1324
  def _reduce_152(val, _values, result)
1325
- result = CIM::QualifierFlavors.new val[3]
1325
+ result = CIM::QualifierFlavors.new val[3]
1326
1326
  result
1327
1327
  end
1328
1328
  .,.,
1329
1329
 
1330
1330
  module_eval(<<'.,.,', 'mof.y', 527)
1331
1331
  def _reduce_153(val, _values, result)
1332
- result = [ val[0] ]
1332
+ result = [ val[0] ]
1333
1333
  result
1334
1334
  end
1335
1335
  .,.,
1336
1336
 
1337
1337
  module_eval(<<'.,.,', 'mof.y', 529)
1338
1338
  def _reduce_154(val, _values, result)
1339
- result = val[0] << val[2]
1339
+ result = val[0] << val[2]
1340
1340
  result
1341
1341
  end
1342
1342
  .,.,
@@ -1353,7 +1353,7 @@ module_eval(<<'.,.,', 'mof.y', 529)
1353
1353
 
1354
1354
  module_eval(<<'.,.,', 'mof.y', 553)
1355
1355
  def _reduce_160(val, _values, result)
1356
- raise "Instance property '#{val[1]} must have a value" unless @style == :wmi
1356
+ raise "Instance property '#{val[1]} must have a value" unless @style == :wmi
1357
1357
  result
1358
1358
  end
1359
1359
  .,.,
@@ -1363,6 +1363,6 @@ def _reduce_none(val, _values, result)
1363
1363
  end
1364
1364
 
1365
1365
  end # class Parser
1366
- end # module MOF
1366
+ end # module MOF
1367
1367
 
1368
1368