expressir 0.2.5-x64-mingw32 → 0.2.11-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (534) hide show
  1. checksums.yaml +5 -5
  2. data/.cross_rubies +30 -0
  3. data/.github/workflows/rake.yml +45 -46
  4. data/.github/workflows/release.yml +83 -75
  5. data/.gitignore +17 -15
  6. data/.gitmodules +3 -3
  7. data/.rspec +2 -2
  8. data/.rubocop.yml +508 -508
  9. data/Gemfile +4 -6
  10. data/README.adoc +147 -147
  11. data/Rakefile +11 -17
  12. data/bin/console +12 -12
  13. data/bin/rspec +29 -29
  14. data/bin/setup +8 -8
  15. data/demo.rb +18 -18
  16. data/docs/development.md +90 -90
  17. data/exe/expressir +20 -20
  18. data/exe/generate-parser +47 -47
  19. data/expressir.gemspec +43 -40
  20. data/lib/expressir.rb +21 -21
  21. data/lib/expressir/cli.rb +27 -27
  22. data/lib/expressir/cli/ui.rb +36 -36
  23. data/lib/expressir/config.rb +23 -23
  24. data/lib/expressir/express.rb +11 -11
  25. data/lib/expressir/express/aggregate_dimension.rb +38 -38
  26. data/lib/expressir/express/attribute.rb +15 -15
  27. data/lib/expressir/express/comment.rb +7 -7
  28. data/lib/expressir/express/defined_type.rb +36 -36
  29. data/lib/expressir/express/derived.rb +65 -65
  30. data/lib/expressir/express/derived_aggregate.rb +43 -43
  31. data/lib/expressir/express/entity.rb +137 -137
  32. data/lib/expressir/express/explicit.rb +70 -70
  33. data/lib/expressir/express/explicit_aggregate.rb +46 -46
  34. data/lib/expressir/express/explicit_or_derived.rb +16 -16
  35. data/lib/expressir/express/global_rule.rb +44 -44
  36. data/lib/expressir/express/interface_specification.rb +51 -51
  37. data/lib/expressir/express/interfaced_item.rb +38 -38
  38. data/lib/expressir/express/inverse.rb +46 -46
  39. data/lib/expressir/express/inverse_aggregate.rb +37 -37
  40. data/lib/expressir/express/model_element.rb +7 -7
  41. data/lib/expressir/express/named_type.rb +19 -19
  42. data/lib/expressir/express/remark.rb +8 -8
  43. data/lib/expressir/express/repository.rb +306 -306
  44. data/lib/expressir/express/schema_definition.rb +96 -96
  45. data/lib/expressir/express/subtype_constraint.rb +14 -14
  46. data/lib/expressir/express/type.rb +26 -26
  47. data/lib/expressir/express/type_aggregate.rb +42 -42
  48. data/lib/expressir/express/type_enum.rb +29 -29
  49. data/lib/expressir/express/type_parser.rb +45 -45
  50. data/lib/expressir/express/type_select.rb +82 -82
  51. data/lib/expressir/express/unique_rule.rb +35 -35
  52. data/lib/expressir/express/where_rule.rb +32 -32
  53. data/lib/expressir/express_exp/2.4/express_parser.so +0 -0
  54. data/lib/expressir/express_exp/2.5/express_parser.so +0 -0
  55. data/lib/expressir/express_exp/2.6/express_parser.so +0 -0
  56. data/lib/expressir/express_exp/2.7/express_parser.so +0 -0
  57. data/lib/expressir/express_exp/3.0/express_parser.so +0 -0
  58. data/lib/expressir/express_exp/formatter.rb +1500 -1449
  59. data/lib/expressir/express_exp/parser.rb +53 -35
  60. data/lib/expressir/express_exp/visitor.rb +2551 -2450
  61. data/lib/expressir/express_parser.rb +30 -30
  62. data/lib/expressir/model.rb +67 -64
  63. data/lib/expressir/model/attribute.rb +28 -26
  64. data/lib/expressir/model/constant.rb +18 -16
  65. data/lib/expressir/model/entity.rb +38 -45
  66. data/lib/expressir/model/enumeration_item.rb +12 -10
  67. data/lib/expressir/model/expressions/aggregate_initializer.rb +12 -12
  68. data/lib/expressir/model/expressions/aggregate_item.rb +14 -14
  69. data/lib/expressir/model/expressions/attribute_reference.rb +14 -14
  70. data/lib/expressir/model/expressions/binary_expression.rb +39 -39
  71. data/lib/expressir/model/expressions/call.rb +14 -14
  72. data/lib/expressir/model/expressions/entity_constructor.rb +14 -14
  73. data/lib/expressir/model/expressions/group_reference.rb +14 -14
  74. data/lib/expressir/model/expressions/index_reference.rb +16 -16
  75. data/lib/expressir/model/expressions/interval.rb +20 -20
  76. data/lib/expressir/model/expressions/query_expression.rb +27 -25
  77. data/lib/expressir/model/expressions/simple_reference.rb +12 -12
  78. data/lib/expressir/model/expressions/unary_expression.rb +18 -18
  79. data/lib/expressir/model/function.rb +55 -61
  80. data/lib/expressir/model/identifier.rb +9 -8
  81. data/lib/expressir/model/informal_proposition.rb +13 -0
  82. data/lib/expressir/model/interface.rb +17 -17
  83. data/lib/expressir/model/literals/binary.rb +12 -12
  84. data/lib/expressir/model/literals/integer.rb +12 -12
  85. data/lib/expressir/model/literals/logical.rb +16 -16
  86. data/lib/expressir/model/literals/real.rb +12 -12
  87. data/lib/expressir/model/literals/string.rb +14 -14
  88. data/lib/expressir/model/model_element.rb +73 -0
  89. data/lib/expressir/model/parameter.rb +18 -16
  90. data/lib/expressir/model/procedure.rb +53 -59
  91. data/lib/expressir/model/renamed_ref.rb +12 -12
  92. data/lib/expressir/model/repository.rb +18 -18
  93. data/lib/expressir/model/rule.rb +58 -61
  94. data/lib/expressir/model/schema.rb +55 -66
  95. data/lib/expressir/model/scope.rb +70 -16
  96. data/lib/expressir/model/statements/alias.rb +27 -25
  97. data/lib/expressir/model/statements/assignment.rb +14 -14
  98. data/lib/expressir/model/statements/call.rb +14 -14
  99. data/lib/expressir/model/statements/case.rb +16 -16
  100. data/lib/expressir/model/statements/case_action.rb +14 -14
  101. data/lib/expressir/model/statements/compound.rb +12 -12
  102. data/lib/expressir/model/statements/escape.rb +7 -7
  103. data/lib/expressir/model/statements/if.rb +16 -16
  104. data/lib/expressir/model/statements/null.rb +7 -7
  105. data/lib/expressir/model/statements/repeat.rb +35 -33
  106. data/lib/expressir/model/statements/return.rb +12 -12
  107. data/lib/expressir/model/statements/skip.rb +7 -7
  108. data/lib/expressir/model/subtype_constraint.rb +28 -26
  109. data/lib/expressir/model/type.rb +33 -23
  110. data/lib/expressir/model/types/aggregate.rb +18 -16
  111. data/lib/expressir/model/types/array.rb +20 -20
  112. data/lib/expressir/model/types/bag.rb +16 -16
  113. data/lib/expressir/model/types/binary.rb +14 -14
  114. data/lib/expressir/model/types/boolean.rb +7 -7
  115. data/lib/expressir/model/types/enumeration.rb +18 -18
  116. data/lib/expressir/model/types/generic.rb +14 -12
  117. data/lib/expressir/model/types/generic_entity.rb +14 -12
  118. data/lib/expressir/model/types/integer.rb +7 -7
  119. data/lib/expressir/model/types/list.rb +18 -18
  120. data/lib/expressir/model/types/logical.rb +7 -7
  121. data/lib/expressir/model/types/number.rb +7 -7
  122. data/lib/expressir/model/types/real.rb +12 -12
  123. data/lib/expressir/model/types/select.rb +20 -20
  124. data/lib/expressir/model/types/set.rb +16 -16
  125. data/lib/expressir/model/types/string.rb +14 -14
  126. data/lib/expressir/model/unique.rb +16 -14
  127. data/lib/expressir/model/variable.rb +18 -16
  128. data/lib/expressir/model/where.rb +16 -14
  129. data/lib/expressir/parser.rb +6 -6
  130. data/lib/expressir/parser/owl_parser.rb +8 -8
  131. data/lib/expressir/version.rb +3 -3
  132. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.exp +9589 -9589
  133. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.owl +36619 -36619
  134. data/original/examples/ap233/ap233e1_arm_lf_stepmod-2010-11-12.xml +13293 -13293
  135. data/original/examples/employment/eclipse/.project +17 -17
  136. data/original/examples/employment/eclipse/Express/employment_schema.exp +33 -33
  137. data/original/examples/employment/eclipse/Express/employment_schema.xmi +77 -77
  138. data/original/examples/employment/eclipse/Express/employment_schema.xml +92 -92
  139. data/original/examples/employment/eclipse/Models/Employment.uml +4 -4
  140. data/original/examples/employment/eclipse/Models/Employment.umldi +240 -240
  141. data/original/examples/employment/eclipse/readme.txt +6 -6
  142. data/original/examples/employment/employment_schema.exp +33 -33
  143. data/original/examples/employment/employment_schema.rb +232 -232
  144. data/original/examples/employment/employment_schema.xml +92 -92
  145. data/original/examples/employment/employment_schema___module.rb +46 -46
  146. data/original/examples/employment/employment_schema___p28attr.rb +126 -126
  147. data/original/examples/employment/employment_schema___p28inst.rb +26 -26
  148. data/original/examples/employment/example_employment_data.xml +1 -1
  149. data/original/examples/employment/example_employment_data_copy.xml +1 -1
  150. data/original/examples/employment/example_employment_reader.rb +30 -30
  151. data/original/examples/employment/example_employment_writer.rb +51 -51
  152. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.exp +3710 -3710
  153. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.owl +35880 -35880
  154. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xmi +15357 -15357
  155. data/original/examples/plcs/ap239e1_arm_lf_dexlib_2010-01-06.xml +9467 -9467
  156. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.exp +8404 -8404
  157. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.owl +43147 -43147
  158. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xmi +18341 -18341
  159. data/original/examples/plcs/ap239e2_arm_lf_stepmod-2010-01-25.xml +11631 -11631
  160. data/original/examples/syntax/remark.exp +189 -145
  161. data/original/examples/syntax/remark_formatted.exp +213 -174
  162. data/original/examples/syntax/simple.exp +3 -0
  163. data/original/examples/syntax/source.exp +16 -0
  164. data/original/examples/syntax/syntax.exp +323 -310
  165. data/original/examples/syntax/syntax_formatted.exp +753 -1186
  166. data/original/exp2ruby.rb +525 -525
  167. data/original/expsm.rb +34 -34
  168. data/original/mapping_owl.rb +1018 -1018
  169. data/original/mapping_sysml.rb +2281 -2281
  170. data/original/mapping_uml2.rb +598 -598
  171. data/original/mapping_uml2_eclipse.rb +433 -433
  172. data/original/reeper.rb +134 -134
  173. data/rakelib/cross-ruby.rake +308 -0
  174. data/spec/acceptance/express_to_owl_spec.rb +18 -18
  175. data/spec/acceptance/version_spec.rb +12 -12
  176. data/spec/expressir/express/repository_spec.rb +25 -25
  177. data/spec/expressir/express_exp/ap233_spec.rb +22 -22
  178. data/spec/expressir/express_exp/format_remark_spec.rb +28 -28
  179. data/spec/expressir/express_exp/format_syntax_spec.rb +28 -28
  180. data/spec/expressir/express_exp/head_source_spec.rb +38 -0
  181. data/spec/expressir/express_exp/parse_multiple_spec.rb +32 -0
  182. data/spec/expressir/express_exp/parse_remark_spec.rb +411 -345
  183. data/spec/expressir/express_exp/parse_syntax_spec.rb +3048 -2998
  184. data/spec/expressir/express_exp/source_spec.rb +29 -0
  185. data/spec/expressir/model/model_element_spec.rb +77 -0
  186. data/spec/expressir/model/{find_spec.rb → scope_spec.rb} +123 -110
  187. data/spec/expressr_spec.rb +5 -5
  188. data/spec/spec_helper.rb +17 -17
  189. data/spec/support/console_helper.rb +29 -29
  190. metadata +41 -371
  191. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/CMakeLists.txt +0 -118
  192. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj +0 -637
  193. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters +0 -984
  194. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj +0 -652
  195. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters +0 -990
  196. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj +0 -652
  197. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters +0 -990
  198. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj +0 -652
  199. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters +0 -990
  200. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/Info.plist +0 -26
  201. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp-ios/antlrcpp_ios.h +0 -17
  202. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +0 -3024
  203. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  204. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  205. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4.xcscheme +0 -76
  206. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_ios.xcscheme +0 -80
  207. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/antlrcpp.xcodeproj/xcshareddata/xcschemes/antlr4_static.xcscheme +0 -80
  208. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +0 -10
  209. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.h +0 -167
  210. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +0 -10
  211. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +0 -121
  212. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +0 -34
  213. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +0 -27
  214. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +0 -155
  215. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +0 -69
  216. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +0 -61
  217. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.h +0 -59
  218. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.cpp +0 -25
  219. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.h +0 -36
  220. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +0 -414
  221. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.h +0 -200
  222. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.cpp +0 -11
  223. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.h +0 -37
  224. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +0 -195
  225. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.h +0 -158
  226. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +0 -39
  227. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +0 -74
  228. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.cpp +0 -78
  229. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.h +0 -79
  230. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +0 -15
  231. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.h +0 -35
  232. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +0 -333
  233. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +0 -466
  234. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +0 -84
  235. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +0 -80
  236. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +0 -64
  237. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +0 -99
  238. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +0 -51
  239. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +0 -32
  240. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.cpp +0 -18
  241. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.h +0 -24
  242. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.cpp +0 -12
  243. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +0 -218
  244. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +0 -19
  245. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.h +0 -45
  246. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +0 -295
  247. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +0 -196
  248. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +0 -75
  249. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +0 -52
  250. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +0 -36
  251. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.h +0 -31
  252. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +0 -92
  253. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +0 -88
  254. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.cpp +0 -46
  255. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.h +0 -42
  256. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +0 -648
  257. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +0 -467
  258. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +0 -306
  259. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +0 -179
  260. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +0 -141
  261. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +0 -147
  262. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +0 -53
  263. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.h +0 -38
  264. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +0 -66
  265. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.h +0 -98
  266. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +0 -167
  267. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +0 -164
  268. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +0 -143
  269. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +0 -137
  270. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +0 -27
  271. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +0 -32
  272. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +0 -53
  273. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.h +0 -155
  274. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.cpp +0 -9
  275. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +0 -92
  276. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenFactory.h +0 -30
  277. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.cpp +0 -9
  278. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +0 -85
  279. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.cpp +0 -11
  280. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.h +0 -137
  281. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +0 -425
  282. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +0 -293
  283. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +0 -211
  284. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +0 -123
  285. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +0 -270
  286. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +0 -115
  287. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +0 -104
  288. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +0 -193
  289. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.cpp +0 -9
  290. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.h +0 -23
  291. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +0 -137
  292. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +0 -167
  293. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +0 -209
  294. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +0 -112
  295. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +0 -113
  296. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +0 -148
  297. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +0 -228
  298. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +0 -110
  299. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +0 -64
  300. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +0 -50
  301. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +0 -758
  302. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +0 -85
  303. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp +0 -621
  304. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSerializer.h +0 -61
  305. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +0 -63
  306. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +0 -87
  307. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +0 -72
  308. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +0 -133
  309. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNType.h +0 -20
  310. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp +0 -14
  311. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h +0 -24
  312. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +0 -33
  313. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +0 -33
  314. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +0 -16
  315. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +0 -68
  316. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +0 -82
  317. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +0 -43
  318. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +0 -31
  319. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +0 -30
  320. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp +0 -12
  321. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +0 -22
  322. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.cpp +0 -12
  323. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +0 -21
  324. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.cpp +0 -15
  325. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +0 -24
  326. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.cpp +0 -9
  327. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +0 -21
  328. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +0 -14
  329. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +0 -47
  330. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +0 -14
  331. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +0 -70
  332. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +0 -25
  333. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +0 -227
  334. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +0 -17
  335. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +0 -30
  336. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp +0 -35
  337. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h +0 -27
  338. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +0 -35
  339. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +0 -39
  340. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +0 -15
  341. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.h +0 -43
  342. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +0 -158
  343. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +0 -109
  344. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +0 -84
  345. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +0 -44
  346. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +0 -628
  347. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +0 -210
  348. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +0 -9
  349. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +0 -66
  350. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +0 -107
  351. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +0 -115
  352. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +0 -55
  353. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +0 -55
  354. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +0 -63
  355. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +0 -62
  356. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +0 -87
  357. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +0 -63
  358. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +0 -82
  359. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +0 -56
  360. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +0 -61
  361. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +0 -47
  362. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +0 -57
  363. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +0 -47
  364. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +0 -57
  365. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +0 -56
  366. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +0 -61
  367. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +0 -47
  368. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +0 -55
  369. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +0 -56
  370. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +0 -55
  371. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +0 -16
  372. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +0 -42
  373. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.cpp +0 -12
  374. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +0 -22
  375. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Makefile +0 -67
  376. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +0 -27
  377. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +0 -25
  378. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +0 -12
  379. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +0 -20
  380. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +0 -102
  381. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.h +0 -102
  382. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +0 -1366
  383. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +0 -904
  384. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp +0 -12
  385. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +0 -25
  386. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp +0 -12
  387. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +0 -22
  388. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +0 -32
  389. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +0 -29
  390. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +0 -17
  391. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +0 -62
  392. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +0 -34
  393. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +0 -39
  394. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +0 -662
  395. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +0 -254
  396. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +0 -201
  397. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +0 -436
  398. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +0 -179
  399. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +0 -60
  400. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +0 -30
  401. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +0 -29
  402. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.cpp +0 -16
  403. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +0 -25
  404. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.cpp +0 -12
  405. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +0 -25
  406. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +0 -37
  407. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +0 -40
  408. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +0 -377
  409. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +0 -222
  410. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +0 -32
  411. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +0 -30
  412. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +0 -81
  413. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +0 -36
  414. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp +0 -12
  415. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +0 -21
  416. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp +0 -15
  417. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +0 -35
  418. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +0 -19
  419. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +0 -21
  420. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.cpp +0 -12
  421. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +0 -21
  422. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +0 -44
  423. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +0 -76
  424. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +0 -25
  425. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +0 -25
  426. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +0 -127
  427. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +0 -91
  428. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +0 -67
  429. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +0 -32
  430. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +0 -100
  431. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +0 -144
  432. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +0 -20
  433. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +0 -23
  434. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +0 -124
  435. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +0 -31
  436. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +0 -89
  437. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +0 -84
  438. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +0 -521
  439. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +0 -198
  440. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +0 -134
  441. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +0 -76
  442. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.cpp +0 -4
  443. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.h +0 -21
  444. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +0 -13
  445. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +0 -170
  446. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +0 -43
  447. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +0 -110
  448. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +0 -76
  449. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +0 -248
  450. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +0 -78
  451. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +0 -163
  452. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +0 -36
  453. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +0 -54
  454. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.cpp +0 -303
  455. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/support/guid.h +0 -112
  456. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +0 -128
  457. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.cpp +0 -9
  458. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +0 -19
  459. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +0 -23
  460. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +0 -33
  461. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +0 -71
  462. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +0 -53
  463. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +0 -15
  464. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +0 -102
  465. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +0 -9
  466. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +0 -39
  467. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +0 -50
  468. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +0 -9
  469. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +0 -57
  470. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +0 -49
  471. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +0 -31
  472. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.cpp +0 -9
  473. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +0 -32
  474. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +0 -57
  475. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +0 -33
  476. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +0 -241
  477. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.h +0 -78
  478. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +0 -9
  479. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +0 -44
  480. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +0 -69
  481. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +0 -132
  482. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +0 -64
  483. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +0 -105
  484. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +0 -371
  485. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +0 -185
  486. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +0 -77
  487. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +0 -117
  488. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +0 -39
  489. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +0 -86
  490. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +0 -28
  491. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +0 -51
  492. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +0 -36
  493. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +0 -80
  494. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +0 -154
  495. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.h +0 -86
  496. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +0 -31
  497. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +0 -40
  498. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +0 -173
  499. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.g4 +0 -64
  500. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +0 -56
  501. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.tokens +0 -12
  502. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +0 -13
  503. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +0 -22
  504. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +0 -20
  505. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +0 -27
  506. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +0 -30
  507. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +0 -26
  508. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +0 -20
  509. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +0 -25
  510. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +0 -33
  511. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +0 -26
  512. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +0 -23
  513. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +0 -23
  514. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +0 -24
  515. data/ext/express-parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +0 -23
  516. data/ext/express-parser/antlrgen/Express.interp +0 -532
  517. data/ext/express-parser/antlrgen/Express.tokens +0 -190
  518. data/ext/express-parser/antlrgen/ExpressBaseListener.cpp +0 -7
  519. data/ext/express-parser/antlrgen/ExpressBaseListener.h +0 -623
  520. data/ext/express-parser/antlrgen/ExpressBaseVisitor.cpp +0 -7
  521. data/ext/express-parser/antlrgen/ExpressBaseVisitor.h +0 -816
  522. data/ext/express-parser/antlrgen/ExpressLexer.cpp +0 -1169
  523. data/ext/express-parser/antlrgen/ExpressLexer.h +0 -85
  524. data/ext/express-parser/antlrgen/ExpressLexer.interp +0 -534
  525. data/ext/express-parser/antlrgen/ExpressLexer.tokens +0 -190
  526. data/ext/express-parser/antlrgen/ExpressListener.cpp +0 -7
  527. data/ext/express-parser/antlrgen/ExpressListener.h +0 -616
  528. data/ext/express-parser/antlrgen/ExpressParser.cpp +0 -17284
  529. data/ext/express-parser/antlrgen/ExpressParser.h +0 -3696
  530. data/ext/express-parser/antlrgen/ExpressVisitor.cpp +0 -7
  531. data/ext/express-parser/antlrgen/ExpressVisitor.h +0 -422
  532. data/ext/express-parser/express_parser.cpp +0 -17931
  533. data/ext/express-parser/extconf.rb +0 -34
  534. data/lib/express_parser.so +0 -0
@@ -1,904 +0,0 @@
1
- /* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
2
- * Use of this file is governed by the BSD 3-clause license that
3
- * can be found in the LICENSE.txt file in the project root.
4
- */
5
-
6
- #pragma once
7
-
8
- #include "PredictionMode.h"
9
- #include "dfa/DFAState.h"
10
- #include "atn/ATNSimulator.h"
11
- #include "atn/PredictionContext.h"
12
- #include "SemanticContext.h"
13
- #include "atn/ATNConfig.h"
14
-
15
- namespace antlr4 {
16
- namespace atn {
17
-
18
- /**
19
- * The embodiment of the adaptive LL(*), ALL(*), parsing strategy.
20
- *
21
- * <p>
22
- * The basic complexity of the adaptive strategy makes it harder to understand.
23
- * We begin with ATN simulation to build paths in a DFA. Subsequent prediction
24
- * requests go through the DFA first. If they reach a state without an edge for
25
- * the current symbol, the algorithm fails over to the ATN simulation to
26
- * complete the DFA path for the current input (until it finds a conflict state
27
- * or uniquely predicting state).</p>
28
- *
29
- * <p>
30
- * All of that is done without using the outer context because we want to create
31
- * a DFA that is not dependent upon the rule invocation stack when we do a
32
- * prediction. One DFA works in all contexts. We avoid using context not
33
- * necessarily because it's slower, although it can be, but because of the DFA
34
- * caching problem. The closure routine only considers the rule invocation stack
35
- * created during prediction beginning in the decision rule. For example, if
36
- * prediction occurs without invoking another rule's ATN, there are no context
37
- * stacks in the configurations. When lack of context leads to a conflict, we
38
- * don't know if it's an ambiguity or a weakness in the strong LL(*) parsing
39
- * strategy (versus full LL(*)).</p>
40
- *
41
- * <p>
42
- * When SLL yields a configuration set with conflict, we rewind the input and
43
- * retry the ATN simulation, this time using full outer context without adding
44
- * to the DFA. Configuration context stacks will be the full invocation stacks
45
- * from the start rule. If we get a conflict using full context, then we can
46
- * definitively say we have a true ambiguity for that input sequence. If we
47
- * don't get a conflict, it implies that the decision is sensitive to the outer
48
- * context. (It is not context-sensitive in the sense of context-sensitive
49
- * grammars.)</p>
50
- *
51
- * <p>
52
- * The next time we reach this DFA state with an SLL conflict, through DFA
53
- * simulation, we will again retry the ATN simulation using full context mode.
54
- * This is slow because we can't save the results and have to "interpret" the
55
- * ATN each time we get that input.</p>
56
- *
57
- * <p>
58
- * <strong>CACHING FULL CONTEXT PREDICTIONS</strong></p>
59
- *
60
- * <p>
61
- * We could cache results from full context to predicted alternative easily and
62
- * that saves a lot of time but doesn't work in presence of predicates. The set
63
- * of visible predicates from the ATN start state changes depending on the
64
- * context, because closure can fall off the end of a rule. I tried to cache
65
- * tuples (stack context, semantic context, predicted alt) but it was slower
66
- * than interpreting and much more complicated. Also required a huge amount of
67
- * memory. The goal is not to create the world's fastest parser anyway. I'd like
68
- * to keep this algorithm simple. By launching multiple threads, we can improve
69
- * the speed of parsing across a large number of files.</p>
70
- *
71
- * <p>
72
- * There is no strict ordering between the amount of input used by SLL vs LL,
73
- * which makes it really hard to build a cache for full context. Let's say that
74
- * we have input A B C that leads to an SLL conflict with full context X. That
75
- * implies that using X we might only use A B but we could also use A B C D to
76
- * resolve conflict. Input A B C D could predict alternative 1 in one position
77
- * in the input and A B C E could predict alternative 2 in another position in
78
- * input. The conflicting SLL configurations could still be non-unique in the
79
- * full context prediction, which would lead us to requiring more input than the
80
- * original A B C. To make a prediction cache work, we have to track the exact
81
- * input used during the previous prediction. That amounts to a cache that maps
82
- * X to a specific DFA for that context.</p>
83
- *
84
- * <p>
85
- * Something should be done for left-recursive expression predictions. They are
86
- * likely LL(1) + pred eval. Easier to do the whole SLL unless error and retry
87
- * with full LL thing Sam does.</p>
88
- *
89
- * <p>
90
- * <strong>AVOIDING FULL CONTEXT PREDICTION</strong></p>
91
- *
92
- * <p>
93
- * We avoid doing full context retry when the outer context is empty, we did not
94
- * dip into the outer context by falling off the end of the decision state rule,
95
- * or when we force SLL mode.</p>
96
- *
97
- * <p>
98
- * As an example of the not dip into outer context case, consider as super
99
- * constructor calls versus function calls. One grammar might look like
100
- * this:</p>
101
- *
102
- * <pre>
103
- * ctorBody
104
- * : '{' superCall? stat* '}'
105
- * ;
106
- * </pre>
107
- *
108
- * <p>
109
- * Or, you might see something like</p>
110
- *
111
- * <pre>
112
- * stat
113
- * : superCall ';'
114
- * | expression ';'
115
- * | ...
116
- * ;
117
- * </pre>
118
- *
119
- * <p>
120
- * In both cases I believe that no closure operations will dip into the outer
121
- * context. In the first case ctorBody in the worst case will stop at the '}'.
122
- * In the 2nd case it should stop at the ';'. Both cases should stay within the
123
- * entry rule and not dip into the outer context.</p>
124
- *
125
- * <p>
126
- * <strong>PREDICATES</strong></p>
127
- *
128
- * <p>
129
- * Predicates are always evaluated if present in either SLL or LL both. SLL and
130
- * LL simulation deals with predicates differently. SLL collects predicates as
131
- * it performs closure operations like ANTLR v3 did. It delays predicate
132
- * evaluation until it reaches and accept state. This allows us to cache the SLL
133
- * ATN simulation whereas, if we had evaluated predicates on-the-fly during
134
- * closure, the DFA state configuration sets would be different and we couldn't
135
- * build up a suitable DFA.</p>
136
- *
137
- * <p>
138
- * When building a DFA accept state during ATN simulation, we evaluate any
139
- * predicates and return the sole semantically valid alternative. If there is
140
- * more than 1 alternative, we report an ambiguity. If there are 0 alternatives,
141
- * we throw an exception. Alternatives without predicates act like they have
142
- * true predicates. The simple way to think about it is to strip away all
143
- * alternatives with false predicates and choose the minimum alternative that
144
- * remains.</p>
145
- *
146
- * <p>
147
- * When we start in the DFA and reach an accept state that's predicated, we test
148
- * those and return the minimum semantically viable alternative. If no
149
- * alternatives are viable, we throw an exception.</p>
150
- *
151
- * <p>
152
- * During full LL ATN simulation, closure always evaluates predicates and
153
- * on-the-fly. This is crucial to reducing the configuration set size during
154
- * closure. It hits a landmine when parsing with the Java grammar, for example,
155
- * without this on-the-fly evaluation.</p>
156
- *
157
- * <p>
158
- * <strong>SHARING DFA</strong></p>
159
- *
160
- * <p>
161
- * All instances of the same parser share the same decision DFAs through a
162
- * static field. Each instance gets its own ATN simulator but they share the
163
- * same {@link #decisionToDFA} field. They also share a
164
- * {@link PredictionContextCache} object that makes sure that all
165
- * {@link PredictionContext} objects are shared among the DFA states. This makes
166
- * a big size difference.</p>
167
- *
168
- * <p>
169
- * <strong>THREAD SAFETY</strong></p>
170
- *
171
- * <p>
172
- * The {@link ParserATNSimulator} locks on the {@link #decisionToDFA} field when
173
- * it adds a new DFA object to that array. {@link #addDFAEdge}
174
- * locks on the DFA for the current decision when setting the
175
- * {@link DFAState#edges} field. {@link #addDFAState} locks on
176
- * the DFA for the current decision when looking up a DFA state to see if it
177
- * already exists. We must make sure that all requests to add DFA states that
178
- * are equivalent result in the same shared DFA object. This is because lots of
179
- * threads will be trying to update the DFA at once. The
180
- * {@link #addDFAState} method also locks inside the DFA lock
181
- * but this time on the shared context cache when it rebuilds the
182
- * configurations' {@link PredictionContext} objects using cached
183
- * subgraphs/nodes. No other locking occurs, even during DFA simulation. This is
184
- * safe as long as we can guarantee that all threads referencing
185
- * {@code s.edge[t]} get the same physical target {@link DFAState}, or
186
- * {@code null}. Once into the DFA, the DFA simulation does not reference the
187
- * {@link DFA#states} map. It follows the {@link DFAState#edges} field to new
188
- * targets. The DFA simulator will either find {@link DFAState#edges} to be
189
- * {@code null}, to be non-{@code null} and {@code dfa.edges[t]} null, or
190
- * {@code dfa.edges[t]} to be non-null. The
191
- * {@link #addDFAEdge} method could be racing to set the field
192
- * but in either case the DFA simulator works; if {@code null}, and requests ATN
193
- * simulation. It could also race trying to get {@code dfa.edges[t]}, but either
194
- * way it will work because it's not doing a test and set operation.</p>
195
- *
196
- * <p>
197
- * <strong>Starting with SLL then failing to combined SLL/LL (Two-Stage
198
- * Parsing)</strong></p>
199
- *
200
- * <p>
201
- * Sam pointed out that if SLL does not give a syntax error, then there is no
202
- * point in doing full LL, which is slower. We only have to try LL if we get a
203
- * syntax error. For maximum speed, Sam starts the parser set to pure SLL
204
- * mode with the {@link BailErrorStrategy}:</p>
205
- *
206
- * <pre>
207
- * parser.{@link Parser#getInterpreter() getInterpreter()}.{@link #setPredictionMode setPredictionMode}{@code (}{@link PredictionMode#SLL}{@code )};
208
- * parser.{@link Parser#setErrorHandler setErrorHandler}(new {@link BailErrorStrategy}());
209
- * </pre>
210
- *
211
- * <p>
212
- * If it does not get a syntax error, then we're done. If it does get a syntax
213
- * error, we need to retry with the combined SLL/LL strategy.</p>
214
- *
215
- * <p>
216
- * The reason this works is as follows. If there are no SLL conflicts, then the
217
- * grammar is SLL (at least for that input set). If there is an SLL conflict,
218
- * the full LL analysis must yield a set of viable alternatives which is a
219
- * subset of the alternatives reported by SLL. If the LL set is a singleton,
220
- * then the grammar is LL but not SLL. If the LL set is the same size as the SLL
221
- * set, the decision is SLL. If the LL set has size &gt; 1, then that decision
222
- * is truly ambiguous on the current input. If the LL set is smaller, then the
223
- * SLL conflict resolution might choose an alternative that the full LL would
224
- * rule out as a possibility based upon better context information. If that's
225
- * the case, then the SLL parse will definitely get an error because the full LL
226
- * analysis says it's not viable. If SLL conflict resolution chooses an
227
- * alternative within the LL set, them both SLL and LL would choose the same
228
- * alternative because they both choose the minimum of multiple conflicting
229
- * alternatives.</p>
230
- *
231
- * <p>
232
- * Let's say we have a set of SLL conflicting alternatives {@code {1, 2, 3}} and
233
- * a smaller LL set called <em>s</em>. If <em>s</em> is {@code {2, 3}}, then SLL
234
- * parsing will get an error because SLL will pursue alternative 1. If
235
- * <em>s</em> is {@code {1, 2}} or {@code {1, 3}} then both SLL and LL will
236
- * choose the same alternative because alternative one is the minimum of either
237
- * set. If <em>s</em> is {@code {2}} or {@code {3}} then SLL will get a syntax
238
- * error. If <em>s</em> is {@code {1}} then SLL will succeed.</p>
239
- *
240
- * <p>
241
- * Of course, if the input is invalid, then we will get an error for sure in
242
- * both SLL and LL parsing. Erroneous input will therefore require 2 passes over
243
- * the input.</p>
244
- */
245
- class ANTLR4CPP_PUBLIC ParserATNSimulator : public ATNSimulator {
246
- public:
247
- /// Testing only!
248
- ParserATNSimulator(const ATN &atn, std::vector<dfa::DFA> &decisionToDFA,
249
- PredictionContextCache &sharedContextCache);
250
-
251
- ParserATNSimulator(Parser *parser, const ATN &atn, std::vector<dfa::DFA> &decisionToDFA,
252
- PredictionContextCache &sharedContextCache);
253
-
254
- virtual void reset() override;
255
- virtual void clearDFA() override;
256
- virtual size_t adaptivePredict(TokenStream *input, size_t decision, ParserRuleContext *outerContext);
257
-
258
- static const bool TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT;
259
-
260
- std::vector<dfa::DFA> &decisionToDFA;
261
-
262
- /** Implements first-edge (loop entry) elimination as an optimization
263
- * during closure operations. See antlr/antlr4#1398.
264
- *
265
- * The optimization is to avoid adding the loop entry config when
266
- * the exit path can only lead back to the same
267
- * StarLoopEntryState after popping context at the rule end state
268
- * (traversing only epsilon edges, so we're still in closure, in
269
- * this same rule).
270
- *
271
- * We need to detect any state that can reach loop entry on
272
- * epsilon w/o exiting rule. We don't have to look at FOLLOW
273
- * links, just ensure that all stack tops for config refer to key
274
- * states in LR rule.
275
- *
276
- * To verify we are in the right situation we must first check
277
- * closure is at a StarLoopEntryState generated during LR removal.
278
- * Then we check that each stack top of context is a return state
279
- * from one of these cases:
280
- *
281
- * 1. 'not' expr, '(' type ')' expr. The return state points at loop entry state
282
- * 2. expr op expr. The return state is the block end of internal block of (...)*
283
- * 3. 'between' expr 'and' expr. The return state of 2nd expr reference.
284
- * That state points at block end of internal block of (...)*.
285
- * 4. expr '?' expr ':' expr. The return state points at block end,
286
- * which points at loop entry state.
287
- *
288
- * If any is true for each stack top, then closure does not add a
289
- * config to the current config set for edge[0], the loop entry branch.
290
- *
291
- * Conditions fail if any context for the current config is:
292
- *
293
- * a. empty (we'd fall out of expr to do a global FOLLOW which could
294
- * even be to some weird spot in expr) or,
295
- * b. lies outside of expr or,
296
- * c. lies within expr but at a state not the BlockEndState
297
- * generated during LR removal
298
- *
299
- * Do we need to evaluate predicates ever in closure for this case?
300
- *
301
- * No. Predicates, including precedence predicates, are only
302
- * evaluated when computing a DFA start state. I.e., only before
303
- * the lookahead (but not parser) consumes a token.
304
- *
305
- * There are no epsilon edges allowed in LR rule alt blocks or in
306
- * the "primary" part (ID here). If closure is in
307
- * StarLoopEntryState any lookahead operation will have consumed a
308
- * token as there are no epsilon-paths that lead to
309
- * StarLoopEntryState. We do not have to evaluate predicates
310
- * therefore if we are in the generated StarLoopEntryState of a LR
311
- * rule. Note that when making a prediction starting at that
312
- * decision point, decision d=2, compute-start-state performs
313
- * closure starting at edges[0], edges[1] emanating from
314
- * StarLoopEntryState. That means it is not performing closure on
315
- * StarLoopEntryState during compute-start-state.
316
- *
317
- * How do we know this always gives same prediction answer?
318
- *
319
- * Without predicates, loop entry and exit paths are ambiguous
320
- * upon remaining input +b (in, say, a+b). Either paths lead to
321
- * valid parses. Closure can lead to consuming + immediately or by
322
- * falling out of this call to expr back into expr and loop back
323
- * again to StarLoopEntryState to match +b. In this special case,
324
- * we choose the more efficient path, which is to take the bypass
325
- * path.
326
- *
327
- * The lookahead language has not changed because closure chooses
328
- * one path over the other. Both paths lead to consuming the same
329
- * remaining input during a lookahead operation. If the next token
330
- * is an operator, lookahead will enter the choice block with
331
- * operators. If it is not, lookahead will exit expr. Same as if
332
- * closure had chosen to enter the choice block immediately.
333
- *
334
- * Closure is examining one config (some loopentrystate, some alt,
335
- * context) which means it is considering exactly one alt. Closure
336
- * always copies the same alt to any derived configs.
337
- *
338
- * How do we know this optimization doesn't mess up precedence in
339
- * our parse trees?
340
- *
341
- * Looking through expr from left edge of stat only has to confirm
342
- * that an input, say, a+b+c; begins with any valid interpretation
343
- * of an expression. The precedence actually doesn't matter when
344
- * making a decision in stat seeing through expr. It is only when
345
- * parsing rule expr that we must use the precedence to get the
346
- * right interpretation and, hence, parse tree.
347
- */
348
- bool canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig *config) const;
349
- virtual std::string getRuleName(size_t index);
350
-
351
- virtual Ref<ATNConfig> precedenceTransition(Ref<ATNConfig> const& config, PrecedencePredicateTransition *pt,
352
- bool collectPredicates, bool inContext, bool fullCtx);
353
-
354
- void setPredictionMode(PredictionMode newMode);
355
- PredictionMode getPredictionMode();
356
-
357
- Parser* getParser();
358
-
359
- virtual std::string getTokenName(size_t t);
360
-
361
- virtual std::string getLookaheadName(TokenStream *input);
362
-
363
- /// <summary>
364
- /// Used for debugging in adaptivePredict around execATN but I cut
365
- /// it out for clarity now that alg. works well. We can leave this
366
- /// "dead" code for a bit.
367
- /// </summary>
368
- virtual void dumpDeadEndConfigs(NoViableAltException &nvae);
369
-
370
- protected:
371
- Parser *const parser;
372
-
373
- /// <summary>
374
- /// Each prediction operation uses a cache for merge of prediction contexts.
375
- /// Don't keep around as it wastes huge amounts of memory. The merge cache
376
- /// isn't synchronized but we're ok since two threads shouldn't reuse same
377
- /// parser/atnsim object because it can only handle one input at a time.
378
- /// This maps graphs a and b to merged result c. (a,b)->c. We can avoid
379
- /// the merge if we ever see a and b again. Note that (b,a)->c should
380
- /// also be examined during cache lookup.
381
- /// </summary>
382
- PredictionContextMergeCache mergeCache;
383
-
384
- // LAME globals to avoid parameters!!!!! I need these down deep in predTransition
385
- TokenStream *_input;
386
- size_t _startIndex;
387
- ParserRuleContext *_outerContext;
388
- dfa::DFA *_dfa; // Reference into the decisionToDFA vector.
389
-
390
- /// <summary>
391
- /// Performs ATN simulation to compute a predicted alternative based
392
- /// upon the remaining input, but also updates the DFA cache to avoid
393
- /// having to traverse the ATN again for the same input sequence.
394
- ///
395
- /// There are some key conditions we're looking for after computing a new
396
- /// set of ATN configs (proposed DFA state):
397
- /// if the set is empty, there is no viable alternative for current symbol
398
- /// does the state uniquely predict an alternative?
399
- /// does the state have a conflict that would prevent us from
400
- /// putting it on the work list?
401
- ///
402
- /// We also have some key operations to do:
403
- /// add an edge from previous DFA state to potentially new DFA state, D,
404
- /// upon current symbol but only if adding to work list, which means in all
405
- /// cases except no viable alternative (and possibly non-greedy decisions?)
406
- /// collecting predicates and adding semantic context to DFA accept states
407
- /// adding rule context to context-sensitive DFA accept states
408
- /// consuming an input symbol
409
- /// reporting a conflict
410
- /// reporting an ambiguity
411
- /// reporting a context sensitivity
412
- /// reporting insufficient predicates
413
- ///
414
- /// cover these cases:
415
- /// dead end
416
- /// single alt
417
- /// single alt + preds
418
- /// conflict
419
- /// conflict + preds
420
- /// </summary>
421
- virtual size_t execATN(dfa::DFA &dfa, dfa::DFAState *s0, TokenStream *input, size_t startIndex,
422
- ParserRuleContext *outerContext);
423
-
424
- /// <summary>
425
- /// Get an existing target state for an edge in the DFA. If the target state
426
- /// for the edge has not yet been computed or is otherwise not available,
427
- /// this method returns {@code null}.
428
- /// </summary>
429
- /// <param name="previousD"> The current DFA state </param>
430
- /// <param name="t"> The next input symbol </param>
431
- /// <returns> The existing target DFA state for the given input symbol
432
- /// {@code t}, or {@code null} if the target state for this edge is not
433
- /// already cached </returns>
434
- virtual dfa::DFAState* getExistingTargetState(dfa::DFAState *previousD, size_t t);
435
-
436
- /// <summary>
437
- /// Compute a target state for an edge in the DFA, and attempt to add the
438
- /// computed state and corresponding edge to the DFA.
439
- /// </summary>
440
- /// <param name="dfa"> The DFA </param>
441
- /// <param name="previousD"> The current DFA state </param>
442
- /// <param name="t"> The next input symbol
443
- /// </param>
444
- /// <returns> The computed target DFA state for the given input symbol
445
- /// {@code t}. If {@code t} does not lead to a valid DFA state, this method
446
- /// returns <seealso cref="#ERROR"/>. </returns>
447
- virtual dfa::DFAState *computeTargetState(dfa::DFA &dfa, dfa::DFAState *previousD, size_t t);
448
-
449
- virtual void predicateDFAState(dfa::DFAState *dfaState, DecisionState *decisionState);
450
-
451
- // comes back with reach.uniqueAlt set to a valid alt
452
- virtual size_t execATNWithFullContext(dfa::DFA &dfa, dfa::DFAState *D, ATNConfigSet *s0,
453
- TokenStream *input, size_t startIndex, ParserRuleContext *outerContext); // how far we got before failing over
454
-
455
- virtual std::unique_ptr<ATNConfigSet> computeReachSet(ATNConfigSet *closure, size_t t, bool fullCtx);
456
-
457
- /// <summary>
458
- /// Return a configuration set containing only the configurations from
459
- /// {@code configs} which are in a <seealso cref="RuleStopState"/>. If all
460
- /// configurations in {@code configs} are already in a rule stop state, this
461
- /// method simply returns {@code configs}.
462
- /// <p/>
463
- /// When {@code lookToEndOfRule} is true, this method uses
464
- /// <seealso cref="ATN#nextTokens"/> for each configuration in {@code configs} which is
465
- /// not already in a rule stop state to see if a rule stop state is reachable
466
- /// from the configuration via epsilon-only transitions.
467
- /// </summary>
468
- /// <param name="configs"> the configuration set to update </param>
469
- /// <param name="lookToEndOfRule"> when true, this method checks for rule stop states
470
- /// reachable by epsilon-only transitions from each configuration in
471
- /// {@code configs}.
472
- /// </param>
473
- /// <returns> {@code configs} if all configurations in {@code configs} are in a
474
- /// rule stop state, otherwise return a new configuration set containing only
475
- /// the configurations from {@code configs} which are in a rule stop state </returns>
476
- virtual ATNConfigSet* removeAllConfigsNotInRuleStopState(ATNConfigSet *configs, bool lookToEndOfRule);
477
-
478
- virtual std::unique_ptr<ATNConfigSet> computeStartState(ATNState *p, RuleContext *ctx, bool fullCtx);
479
-
480
- /* parrt internal source braindump that doesn't mess up
481
- * external API spec.
482
-
483
- applyPrecedenceFilter is an optimization to avoid highly
484
- nonlinear prediction of expressions and other left recursive
485
- rules. The precedence predicates such as {3>=prec}? Are highly
486
- context-sensitive in that they can only be properly evaluated
487
- in the context of the proper prec argument. Without pruning,
488
- these predicates are normal predicates evaluated when we reach
489
- conflict state (or unique prediction). As we cannot evaluate
490
- these predicates out of context, the resulting conflict leads
491
- to full LL evaluation and nonlinear prediction which shows up
492
- very clearly with fairly large expressions.
493
-
494
- Example grammar:
495
-
496
- e : e '*' e
497
- | e '+' e
498
- | INT
499
- ;
500
-
501
- We convert that to the following:
502
-
503
- e[int prec]
504
- : INT
505
- ( {3>=prec}? '*' e[4]
506
- | {2>=prec}? '+' e[3]
507
- )*
508
- ;
509
-
510
- The (..)* loop has a decision for the inner block as well as
511
- an enter or exit decision, which is what concerns us here. At
512
- the 1st + of input 1+2+3, the loop entry sees both predicates
513
- and the loop exit also sees both predicates by falling off the
514
- edge of e. This is because we have no stack information with
515
- SLL and find the follow of e, which will hit the return states
516
- inside the loop after e[4] and e[3], which brings it back to
517
- the enter or exit decision. In this case, we know that we
518
- cannot evaluate those predicates because we have fallen off
519
- the edge of the stack and will in general not know which prec
520
- parameter is the right one to use in the predicate.
521
-
522
- Because we have special information, that these are precedence
523
- predicates, we can resolve them without failing over to full
524
- LL despite their context sensitive nature. We make an
525
- assumption that prec[-1] <= prec[0], meaning that the current
526
- precedence level is greater than or equal to the precedence
527
- level of recursive invocations above us in the stack. For
528
- example, if predicate {3>=prec}? is true of the current prec,
529
- then one option is to enter the loop to match it now. The
530
- other option is to exit the loop and the left recursive rule
531
- to match the current operator in rule invocation further up
532
- the stack. But, we know that all of those prec are lower or
533
- the same value and so we can decide to enter the loop instead
534
- of matching it later. That means we can strip out the other
535
- configuration for the exit branch.
536
-
537
- So imagine we have (14,1,$,{2>=prec}?) and then
538
- (14,2,$-dipsIntoOuterContext,{2>=prec}?). The optimization
539
- allows us to collapse these two configurations. We know that
540
- if {2>=prec}? is true for the current prec parameter, it will
541
- also be true for any prec from an invoking e call, indicated
542
- by dipsIntoOuterContext. As the predicates are both true, we
543
- have the option to evaluate them early in the decision start
544
- state. We do this by stripping both predicates and choosing to
545
- enter the loop as it is consistent with the notion of operator
546
- precedence. It's also how the full LL conflict resolution
547
- would work.
548
-
549
- The solution requires a different DFA start state for each
550
- precedence level.
551
-
552
- The basic filter mechanism is to remove configurations of the
553
- form (p, 2, pi) if (p, 1, pi) exists for the same p and pi. In
554
- other words, for the same ATN state and predicate context,
555
- remove any configuration associated with an exit branch if
556
- there is a configuration associated with the enter branch.
557
-
558
- It's also the case that the filter evaluates precedence
559
- predicates and resolves conflicts according to precedence
560
- levels. For example, for input 1+2+3 at the first +, we see
561
- prediction filtering
562
-
563
- [(11,1,[$],{3>=prec}?), (14,1,[$],{2>=prec}?), (5,2,[$],up=1),
564
- (11,2,[$],up=1), (14,2,[$],up=1)],hasSemanticContext=true,dipsIntoOuterContext
565
-
566
- to
567
-
568
- [(11,1,[$]), (14,1,[$]), (5,2,[$],up=1)],dipsIntoOuterContext
569
-
570
- This filters because {3>=prec}? evals to true and collapses
571
- (11,1,[$],{3>=prec}?) and (11,2,[$],up=1) since early conflict
572
- resolution based upon rules of operator precedence fits with
573
- our usual match first alt upon conflict.
574
-
575
- We noticed a problem where a recursive call resets precedence
576
- to 0. Sam's fix: each config has flag indicating if it has
577
- returned from an expr[0] call. then just don't filter any
578
- config with that flag set. flag is carried along in
579
- closure(). so to avoid adding field, set bit just under sign
580
- bit of dipsIntoOuterContext (SUPPRESS_PRECEDENCE_FILTER).
581
- With the change you filter "unless (p, 2, pi) was reached
582
- after leaving the rule stop state of the LR rule containing
583
- state p, corresponding to a rule invocation with precedence
584
- level 0"
585
- */
586
-
587
- /**
588
- * This method transforms the start state computed by
589
- * {@link #computeStartState} to the special start state used by a
590
- * precedence DFA for a particular precedence value. The transformation
591
- * process applies the following changes to the start state's configuration
592
- * set.
593
- *
594
- * <ol>
595
- * <li>Evaluate the precedence predicates for each configuration using
596
- * {@link SemanticContext#evalPrecedence}.</li>
597
- * <li>When {@link ATNConfig#isPrecedenceFilterSuppressed} is {@code false},
598
- * remove all configurations which predict an alternative greater than 1,
599
- * for which another configuration that predicts alternative 1 is in the
600
- * same ATN state with the same prediction context. This transformation is
601
- * valid for the following reasons:
602
- * <ul>
603
- * <li>The closure block cannot contain any epsilon transitions which bypass
604
- * the body of the closure, so all states reachable via alternative 1 are
605
- * part of the precedence alternatives of the transformed left-recursive
606
- * rule.</li>
607
- * <li>The "primary" portion of a left recursive rule cannot contain an
608
- * epsilon transition, so the only way an alternative other than 1 can exist
609
- * in a state that is also reachable via alternative 1 is by nesting calls
610
- * to the left-recursive rule, with the outer calls not being at the
611
- * preferred precedence level. The
612
- * {@link ATNConfig#isPrecedenceFilterSuppressed} property marks ATN
613
- * configurations which do not meet this condition, and therefore are not
614
- * eligible for elimination during the filtering process.</li>
615
- * </ul>
616
- * </li>
617
- * </ol>
618
- *
619
- * <p>
620
- * The prediction context must be considered by this filter to address
621
- * situations like the following.
622
- * </p>
623
- * <code>
624
- * <pre>
625
- * grammar TA;
626
- * prog: statement* EOF;
627
- * statement: letterA | statement letterA 'b' ;
628
- * letterA: 'a';
629
- * </pre>
630
- * </code>
631
- * <p>
632
- * If the above grammar, the ATN state immediately before the token
633
- * reference {@code 'a'} in {@code letterA} is reachable from the left edge
634
- * of both the primary and closure blocks of the left-recursive rule
635
- * {@code statement}. The prediction context associated with each of these
636
- * configurations distinguishes between them, and prevents the alternative
637
- * which stepped out to {@code prog} (and then back in to {@code statement}
638
- * from being eliminated by the filter.
639
- * </p>
640
- *
641
- * @param configs The configuration set computed by
642
- * {@link #computeStartState} as the start state for the DFA.
643
- * @return The transformed configuration set representing the start state
644
- * for a precedence DFA at a particular precedence level (determined by
645
- * calling {@link Parser#getPrecedence}).
646
- */
647
- std::unique_ptr<ATNConfigSet> applyPrecedenceFilter(ATNConfigSet *configs);
648
-
649
- virtual ATNState *getReachableTarget(Transition *trans, size_t ttype);
650
-
651
- virtual std::vector<Ref<SemanticContext>> getPredsForAmbigAlts(const antlrcpp::BitSet &ambigAlts,
652
- ATNConfigSet *configs, size_t nalts);
653
-
654
- virtual std::vector<dfa::DFAState::PredPrediction*> getPredicatePredictions(const antlrcpp::BitSet &ambigAlts,
655
- std::vector<Ref<SemanticContext>> const& altToPred);
656
-
657
- /**
658
- * This method is used to improve the localization of error messages by
659
- * choosing an alternative rather than throwing a
660
- * {@link NoViableAltException} in particular prediction scenarios where the
661
- * {@link #ERROR} state was reached during ATN simulation.
662
- *
663
- * <p>
664
- * The default implementation of this method uses the following
665
- * algorithm to identify an ATN configuration which successfully parsed the
666
- * decision entry rule. Choosing such an alternative ensures that the
667
- * {@link ParserRuleContext} returned by the calling rule will be complete
668
- * and valid, and the syntax error will be reported later at a more
669
- * localized location.</p>
670
- *
671
- * <ul>
672
- * <li>If a syntactically valid path or paths reach the end of the decision rule and
673
- * they are semantically valid if predicated, return the min associated alt.</li>
674
- * <li>Else, if a semantically invalid but syntactically valid path exist
675
- * or paths exist, return the minimum associated alt.
676
- * </li>
677
- * <li>Otherwise, return {@link ATN#INVALID_ALT_NUMBER}.</li>
678
- * </ul>
679
- *
680
- * <p>
681
- * In some scenarios, the algorithm described above could predict an
682
- * alternative which will result in a {@link FailedPredicateException} in
683
- * the parser. Specifically, this could occur if the <em>only</em> configuration
684
- * capable of successfully parsing to the end of the decision rule is
685
- * blocked by a semantic predicate. By choosing this alternative within
686
- * {@link #adaptivePredict} instead of throwing a
687
- * {@link NoViableAltException}, the resulting
688
- * {@link FailedPredicateException} in the parser will identify the specific
689
- * predicate which is preventing the parser from successfully parsing the
690
- * decision rule, which helps developers identify and correct logic errors
691
- * in semantic predicates.
692
- * </p>
693
- *
694
- * @param configs The ATN configurations which were valid immediately before
695
- * the {@link #ERROR} state was reached
696
- * @param outerContext The is the \gamma_0 initial parser context from the paper
697
- * or the parser stack at the instant before prediction commences.
698
- *
699
- * @return The value to return from {@link #adaptivePredict}, or
700
- * {@link ATN#INVALID_ALT_NUMBER} if a suitable alternative was not
701
- * identified and {@link #adaptivePredict} should report an error instead.
702
- */
703
- size_t getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(ATNConfigSet *configs,
704
- ParserRuleContext *outerContext);
705
-
706
- virtual size_t getAltThatFinishedDecisionEntryRule(ATNConfigSet *configs);
707
-
708
- /** Walk the list of configurations and split them according to
709
- * those that have preds evaluating to true/false. If no pred, assume
710
- * true pred and include in succeeded set. Returns Pair of sets.
711
- *
712
- * Create a new set so as not to alter the incoming parameter.
713
- *
714
- * Assumption: the input stream has been restored to the starting point
715
- * prediction, which is where predicates need to evaluate.
716
- */
717
- std::pair<ATNConfigSet *, ATNConfigSet *> splitAccordingToSemanticValidity(ATNConfigSet *configs,
718
- ParserRuleContext *outerContext);
719
-
720
- /// <summary>
721
- /// Look through a list of predicate/alt pairs, returning alts for the
722
- /// pairs that win. A {@code NONE} predicate indicates an alt containing an
723
- /// unpredicated config which behaves as "always true." If !complete
724
- /// then we stop at the first predicate that evaluates to true. This
725
- /// includes pairs with null predicates.
726
- /// </summary>
727
- virtual antlrcpp::BitSet evalSemanticContext(std::vector<dfa::DFAState::PredPrediction*> predPredictions,
728
- ParserRuleContext *outerContext, bool complete);
729
-
730
- /**
731
- * Evaluate a semantic context within a specific parser context.
732
- *
733
- * <p>
734
- * This method might not be called for every semantic context evaluated
735
- * during the prediction process. In particular, we currently do not
736
- * evaluate the following but it may change in the future:</p>
737
- *
738
- * <ul>
739
- * <li>Precedence predicates (represented by
740
- * {@link SemanticContext.PrecedencePredicate}) are not currently evaluated
741
- * through this method.</li>
742
- * <li>Operator predicates (represented by {@link SemanticContext.AND} and
743
- * {@link SemanticContext.OR}) are evaluated as a single semantic
744
- * context, rather than evaluating the operands individually.
745
- * Implementations which require evaluation results from individual
746
- * predicates should override this method to explicitly handle evaluation of
747
- * the operands within operator predicates.</li>
748
- * </ul>
749
- *
750
- * @param pred The semantic context to evaluate
751
- * @param parserCallStack The parser context in which to evaluate the
752
- * semantic context
753
- * @param alt The alternative which is guarded by {@code pred}
754
- * @param fullCtx {@code true} if the evaluation is occurring during LL
755
- * prediction; otherwise, {@code false} if the evaluation is occurring
756
- * during SLL prediction
757
- *
758
- * @since 4.3
759
- */
760
- virtual bool evalSemanticContext(Ref<SemanticContext> const& pred, ParserRuleContext *parserCallStack,
761
- size_t alt, bool fullCtx);
762
-
763
- /* TODO: If we are doing predicates, there is no point in pursuing
764
- closure operations if we reach a DFA state that uniquely predicts
765
- alternative. We will not be caching that DFA state and it is a
766
- waste to pursue the closure. Might have to advance when we do
767
- ambig detection thought :(
768
- */
769
- virtual void closure(Ref<ATNConfig> const& config, ATNConfigSet *configs, ATNConfig::Set &closureBusy,
770
- bool collectPredicates, bool fullCtx, bool treatEofAsEpsilon);
771
-
772
- virtual void closureCheckingStopState(Ref<ATNConfig> const& config, ATNConfigSet *configs, ATNConfig::Set &closureBusy,
773
- bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon);
774
-
775
- /// Do the actual work of walking epsilon edges.
776
- virtual void closure_(Ref<ATNConfig> const& config, ATNConfigSet *configs, ATNConfig::Set &closureBusy,
777
- bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon);
778
-
779
- virtual Ref<ATNConfig> getEpsilonTarget(Ref<ATNConfig> const& config, Transition *t, bool collectPredicates,
780
- bool inContext, bool fullCtx, bool treatEofAsEpsilon);
781
- virtual Ref<ATNConfig> actionTransition(Ref<ATNConfig> const& config, ActionTransition *t);
782
-
783
- virtual Ref<ATNConfig> predTransition(Ref<ATNConfig> const& config, PredicateTransition *pt, bool collectPredicates,
784
- bool inContext, bool fullCtx);
785
-
786
- virtual Ref<ATNConfig> ruleTransition(Ref<ATNConfig> const& config, RuleTransition *t);
787
-
788
- /**
789
- * Gets a {@link BitSet} containing the alternatives in {@code configs}
790
- * which are part of one or more conflicting alternative subsets.
791
- *
792
- * @param configs The {@link ATNConfigSet} to analyze.
793
- * @return The alternatives in {@code configs} which are part of one or more
794
- * conflicting alternative subsets. If {@code configs} does not contain any
795
- * conflicting subsets, this method returns an empty {@link BitSet}.
796
- */
797
- virtual antlrcpp::BitSet getConflictingAlts(ATNConfigSet *configs);
798
-
799
- /// <summary>
800
- /// Sam pointed out a problem with the previous definition, v3, of
801
- /// ambiguous states. If we have another state associated with conflicting
802
- /// alternatives, we should keep going. For example, the following grammar
803
- ///
804
- /// s : (ID | ID ID?) ';' ;
805
- ///
806
- /// When the ATN simulation reaches the state before ';', it has a DFA
807
- /// state that looks like: [12|1|[], 6|2|[], 12|2|[]]. Naturally
808
- /// 12|1|[] and 12|2|[] conflict, but we cannot stop processing this node
809
- /// because alternative to has another way to continue, via [6|2|[]].
810
- /// The key is that we have a single state that has config's only associated
811
- /// with a single alternative, 2, and crucially the state transitions
812
- /// among the configurations are all non-epsilon transitions. That means
813
- /// we don't consider any conflicts that include alternative 2. So, we
814
- /// ignore the conflict between alts 1 and 2. We ignore a set of
815
- /// conflicting alts when there is an intersection with an alternative
816
- /// associated with a single alt state in the state->config-list map.
817
- ///
818
- /// It's also the case that we might have two conflicting configurations but
819
- /// also a 3rd nonconflicting configuration for a different alternative:
820
- /// [1|1|[], 1|2|[], 8|3|[]]. This can come about from grammar:
821
- ///
822
- /// a : A | A | A B ;
823
- ///
824
- /// After matching input A, we reach the stop state for rule A, state 1.
825
- /// State 8 is the state right before B. Clearly alternatives 1 and 2
826
- /// conflict and no amount of further lookahead will separate the two.
827
- /// However, alternative 3 will be able to continue and so we do not
828
- /// stop working on this state. In the previous example, we're concerned
829
- /// with states associated with the conflicting alternatives. Here alt
830
- /// 3 is not associated with the conflicting configs, but since we can continue
831
- /// looking for input reasonably, I don't declare the state done. We
832
- /// ignore a set of conflicting alts when we have an alternative
833
- /// that we still need to pursue.
834
- /// </summary>
835
-
836
- virtual antlrcpp::BitSet getConflictingAltsOrUniqueAlt(ATNConfigSet *configs);
837
-
838
- virtual NoViableAltException noViableAlt(TokenStream *input, ParserRuleContext *outerContext,
839
- ATNConfigSet *configs, size_t startIndex, bool deleteConfigs);
840
-
841
- static size_t getUniqueAlt(ATNConfigSet *configs);
842
-
843
- /// <summary>
844
- /// Add an edge to the DFA, if possible. This method calls
845
- /// <seealso cref="#addDFAState"/> to ensure the {@code to} state is present in the
846
- /// DFA. If {@code from} is {@code null}, or if {@code t} is outside the
847
- /// range of edges that can be represented in the DFA tables, this method
848
- /// returns without adding the edge to the DFA.
849
- /// <p/>
850
- /// If {@code to} is {@code null}, this method returns {@code null}.
851
- /// Otherwise, this method returns the <seealso cref="DFAState"/> returned by calling
852
- /// <seealso cref="#addDFAState"/> for the {@code to} state.
853
- /// </summary>
854
- /// <param name="dfa"> The DFA </param>
855
- /// <param name="from"> The source state for the edge </param>
856
- /// <param name="t"> The input symbol </param>
857
- /// <param name="to"> The target state for the edge
858
- /// </param>
859
- /// <returns> If {@code to} is {@code null}, this method returns {@code null};
860
- /// otherwise this method returns the result of calling <seealso cref="#addDFAState"/>
861
- /// on {@code to} </returns>
862
- virtual dfa::DFAState *addDFAEdge(dfa::DFA &dfa, dfa::DFAState *from, ssize_t t, dfa::DFAState *to);
863
-
864
- /// <summary>
865
- /// Add state {@code D} to the DFA if it is not already present, and return
866
- /// the actual instance stored in the DFA. If a state equivalent to {@code D}
867
- /// is already in the DFA, the existing state is returned. Otherwise this
868
- /// method returns {@code D} after adding it to the DFA.
869
- /// <p/>
870
- /// If {@code D} is <seealso cref="#ERROR"/>, this method returns <seealso cref="#ERROR"/> and
871
- /// does not change the DFA.
872
- /// </summary>
873
- /// <param name="dfa"> The dfa </param>
874
- /// <param name="D"> The DFA state to add </param>
875
- /// <returns> The state stored in the DFA. This will be either the existing
876
- /// state if {@code D} is already in the DFA, or {@code D} itself if the
877
- /// state was not already present. </returns>
878
- virtual dfa::DFAState *addDFAState(dfa::DFA &dfa, dfa::DFAState *D);
879
-
880
- virtual void reportAttemptingFullContext(dfa::DFA &dfa, const antlrcpp::BitSet &conflictingAlts,
881
- ATNConfigSet *configs, size_t startIndex, size_t stopIndex);
882
-
883
- virtual void reportContextSensitivity(dfa::DFA &dfa, size_t prediction, ATNConfigSet *configs,
884
- size_t startIndex, size_t stopIndex);
885
-
886
- /// If context sensitive parsing, we know it's ambiguity not conflict.
887
- virtual void reportAmbiguity(dfa::DFA &dfa,
888
- dfa::DFAState *D, // the DFA state from execATN() that had SLL conflicts
889
- size_t startIndex, size_t stopIndex,
890
- bool exact,
891
- const antlrcpp::BitSet &ambigAlts,
892
- ATNConfigSet *configs); // configs that LL not SLL considered conflicting
893
-
894
- private:
895
- // SLL, LL, or LL + exact ambig detection?
896
- PredictionMode _mode;
897
-
898
- static bool getLrLoopSetting();
899
- void InitializeInstanceFields();
900
- };
901
-
902
- } // namespace atn
903
- } // namespace antlr4
904
-