fhirpath-rb 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/CLAUDE.md +52 -0
  4. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +10 -0
  5. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.h +167 -0
  6. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +10 -0
  7. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +121 -0
  8. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +23 -0
  9. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +30 -0
  10. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +180 -0
  11. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +79 -0
  12. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +61 -0
  13. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.h +59 -0
  14. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.cpp +25 -0
  15. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.h +36 -0
  16. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +414 -0
  17. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.h +200 -0
  18. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.cpp +11 -0
  19. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.h +37 -0
  20. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +193 -0
  21. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.h +158 -0
  22. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +39 -0
  23. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +74 -0
  24. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.cpp +78 -0
  25. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.h +79 -0
  26. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +15 -0
  27. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.h +35 -0
  28. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +336 -0
  29. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +466 -0
  30. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +84 -0
  31. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +80 -0
  32. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +64 -0
  33. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +99 -0
  34. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +52 -0
  35. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +32 -0
  36. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.cpp +18 -0
  37. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.h +24 -0
  38. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.cpp +12 -0
  39. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +218 -0
  40. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +19 -0
  41. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.h +45 -0
  42. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +294 -0
  43. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +196 -0
  44. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +60 -0
  45. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +46 -0
  46. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +36 -0
  47. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.h +31 -0
  48. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +92 -0
  49. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +88 -0
  50. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.cpp +46 -0
  51. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.h +42 -0
  52. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +668 -0
  53. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +461 -0
  54. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +294 -0
  55. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +173 -0
  56. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +138 -0
  57. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +147 -0
  58. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +53 -0
  59. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.h +38 -0
  60. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +65 -0
  61. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.h +98 -0
  62. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +156 -0
  63. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +159 -0
  64. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +144 -0
  65. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +141 -0
  66. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +27 -0
  67. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +32 -0
  68. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +54 -0
  69. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.h +155 -0
  70. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.cpp +9 -0
  71. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +92 -0
  72. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenFactory.h +30 -0
  73. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.cpp +9 -0
  74. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +85 -0
  75. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.cpp +11 -0
  76. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.h +137 -0
  77. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +425 -0
  78. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +295 -0
  79. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +208 -0
  80. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +117 -0
  81. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +270 -0
  82. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +115 -0
  83. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Version.h +42 -0
  84. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +64 -0
  85. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +177 -0
  86. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.cpp +9 -0
  87. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.h +23 -0
  88. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +98 -0
  89. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +169 -0
  90. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +158 -0
  91. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +132 -0
  92. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +106 -0
  93. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +157 -0
  94. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +232 -0
  95. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +156 -0
  96. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +54 -0
  97. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +48 -0
  98. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +629 -0
  99. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +32 -0
  100. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +33 -0
  101. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +71 -0
  102. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +56 -0
  103. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +139 -0
  104. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.cpp +33 -0
  105. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.h +36 -0
  106. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNType.h +20 -0
  107. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +29 -0
  108. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +35 -0
  109. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +16 -0
  110. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +68 -0
  111. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +109 -0
  112. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +51 -0
  113. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +27 -0
  114. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +33 -0
  115. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +24 -0
  116. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +23 -0
  117. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +26 -0
  118. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +30 -0
  119. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +14 -0
  120. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +47 -0
  121. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +14 -0
  122. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +70 -0
  123. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +25 -0
  124. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +227 -0
  125. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +12 -0
  126. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +34 -0
  127. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +31 -0
  128. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +42 -0
  129. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +15 -0
  130. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.h +43 -0
  131. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +189 -0
  132. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +76 -0
  133. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +67 -0
  134. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +44 -0
  135. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +615 -0
  136. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +199 -0
  137. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +15 -0
  138. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +100 -0
  139. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +111 -0
  140. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +128 -0
  141. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +57 -0
  142. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +43 -0
  143. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +59 -0
  144. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +45 -0
  145. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +75 -0
  146. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +57 -0
  147. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +76 -0
  148. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +43 -0
  149. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +57 -0
  150. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +36 -0
  151. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +53 -0
  152. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +36 -0
  153. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +53 -0
  154. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +43 -0
  155. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +57 -0
  156. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +36 -0
  157. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +51 -0
  158. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +43 -0
  159. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +51 -0
  160. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +16 -0
  161. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +42 -0
  162. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +26 -0
  163. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +22 -0
  164. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +27 -0
  165. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +16 -0
  166. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +25 -0
  167. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +102 -0
  168. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.h +102 -0
  169. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +1383 -0
  170. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +911 -0
  171. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h +50 -0
  172. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +29 -0
  173. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +25 -0
  174. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +23 -0
  175. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +35 -0
  176. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +17 -0
  177. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +62 -0
  178. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +24 -0
  179. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +50 -0
  180. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +579 -0
  181. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +225 -0
  182. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp +56 -0
  183. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.h +64 -0
  184. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp +167 -0
  185. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h +101 -0
  186. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h +71 -0
  187. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextType.h +21 -0
  188. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +202 -0
  189. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +436 -0
  190. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +179 -0
  191. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +60 -0
  192. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +26 -0
  193. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +31 -0
  194. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +26 -0
  195. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +27 -0
  196. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +33 -0
  197. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +42 -0
  198. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +418 -0
  199. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +233 -0
  200. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContextType.h +23 -0
  201. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SerializedATNView.h +101 -0
  202. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +28 -0
  203. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +38 -0
  204. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +86 -0
  205. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +43 -0
  206. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +24 -0
  207. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +37 -0
  208. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +19 -0
  209. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +25 -0
  210. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +24 -0
  211. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +36 -0
  212. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +65 -0
  213. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.cpp +27 -0
  214. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.h +33 -0
  215. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +21 -0
  216. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +27 -0
  217. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +115 -0
  218. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +96 -0
  219. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +60 -0
  220. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +32 -0
  221. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +59 -0
  222. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +153 -0
  223. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +17 -0
  224. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +22 -0
  225. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +124 -0
  226. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +33 -0
  227. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +61 -0
  228. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +84 -0
  229. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +508 -0
  230. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +190 -0
  231. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +120 -0
  232. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +102 -0
  233. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.cpp +4 -0
  234. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.h +21 -0
  235. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +8 -0
  236. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +16 -0
  237. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +43 -0
  238. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +149 -0
  239. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +76 -0
  240. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +207 -0
  241. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +65 -0
  242. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Casts.h +34 -0
  243. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +161 -0
  244. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +38 -0
  245. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +16 -0
  246. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Unicode.h +28 -0
  247. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.cpp +242 -0
  248. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.h +54 -0
  249. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +129 -0
  250. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +24 -0
  251. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +54 -0
  252. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +43 -0
  253. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +66 -0
  254. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +53 -0
  255. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +12 -0
  256. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +111 -0
  257. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +9 -0
  258. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +39 -0
  259. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +50 -0
  260. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeType.h +22 -0
  261. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +9 -0
  262. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +57 -0
  263. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +48 -0
  264. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +55 -0
  265. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +40 -0
  266. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +54 -0
  267. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +32 -0
  268. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +241 -0
  269. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.h +78 -0
  270. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +9 -0
  271. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +44 -0
  272. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +69 -0
  273. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +132 -0
  274. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +64 -0
  275. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +105 -0
  276. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +370 -0
  277. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +185 -0
  278. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +77 -0
  279. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +117 -0
  280. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +39 -0
  281. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +86 -0
  282. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +28 -0
  283. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +51 -0
  284. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +36 -0
  285. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +80 -0
  286. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +154 -0
  287. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.h +86 -0
  288. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +31 -0
  289. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +40 -0
  290. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +182 -0
  291. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +47 -0
  292. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +13 -0
  293. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +22 -0
  294. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +20 -0
  295. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +27 -0
  296. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +30 -0
  297. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +26 -0
  298. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +20 -0
  299. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +25 -0
  300. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +33 -0
  301. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +26 -0
  302. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +23 -0
  303. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +23 -0
  304. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +24 -0
  305. data/ext/fhir_path_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +23 -0
  306. data/ext/fhir_path_parser/antlrgen/FHIRPathBaseListener.cpp +7 -0
  307. data/ext/fhir_path_parser/antlrgen/FHIRPathBaseListener.h +149 -0
  308. data/ext/fhir_path_parser/antlrgen/FHIRPathBaseVisitor.cpp +7 -0
  309. data/ext/fhir_path_parser/antlrgen/FHIRPathBaseVisitor.h +184 -0
  310. data/ext/fhir_path_parser/antlrgen/FHIRPathLexer.cpp +316 -0
  311. data/ext/fhir_path_parser/antlrgen/FHIRPathLexer.h +59 -0
  312. data/ext/fhir_path_parser/antlrgen/FHIRPathListener.cpp +7 -0
  313. data/ext/fhir_path_parser/antlrgen/FHIRPathListener.h +142 -0
  314. data/ext/fhir_path_parser/antlrgen/FHIRPathParser.cpp +2517 -0
  315. data/ext/fhir_path_parser/antlrgen/FHIRPathParser.h +649 -0
  316. data/ext/fhir_path_parser/antlrgen/FHIRPathVisitor.cpp +7 -0
  317. data/ext/fhir_path_parser/antlrgen/FHIRPathVisitor.h +106 -0
  318. data/ext/fhir_path_parser/fhir_path_parser.cpp +3161 -0
  319. data/lib/fhirpath/version.rb +1 -1
  320. metadata +316 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 386fdadfc9286fb53c26e7b958d24b794931720c5f289e846290def5f85d032d
4
- data.tar.gz: e3f288571780f12833b512ad1ca730fd9783534eb93898192d431f21102bb152
3
+ metadata.gz: 698e1507f8b58721cf71927b13b456791d4055f47564d9ae1828e722aee9fdb5
4
+ data.tar.gz: 75d902543883669eb47e44f84833523c0c52612d147c9f3eb8c42debaf742994
5
5
  SHA512:
6
- metadata.gz: bc6396439374fc4072acc765b8300265972e68daab0458ed585f230e291c8e03b7bcf96c0eee50ea33eda8d03b831a26d0220387f1dd57f44c8916c9c0283a45
7
- data.tar.gz: aa748f5c286c44eaade1a1cc99e6ce66bd8335d60cba9f9ef9f2c76460fa8f3cda91adb5d4c31abb29d46972c36eba0fab2f2eae09f5ea598350c60968039cdc
6
+ metadata.gz: f7de67754cd7b219cc456519cc4516f43bc5f189cfecb460f79dc926a1d9fcc7f255889a9b21ff807cf133b8e3630ba6f82cb11fc4fa2f3869488588c8758887
7
+ data.tar.gz: 5f87c96b7178408b61b401b3c05bf1438a459098f1b7a0a06a2316c82079bdaec5d58e5ec453e5a923b9c303f7990edef2f889c38a8250814cefa16b0436e2f8
data/.rubocop.yml CHANGED
@@ -1,5 +1,9 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 3.0
3
+ # Standalone app with its own Gemfile/CI/.rubocop.yml (server/.rubocop.yml) - not part of this
4
+ # gem's bundle or lint run.
5
+ Exclude:
6
+ - "server/**/*"
3
7
 
4
8
  Style/StringLiterals:
5
9
  EnforcedStyle: double_quotes
data/CLAUDE.md CHANGED
@@ -57,3 +57,55 @@ miss otherwise.
57
57
  (the default Rake task) and must stay clean.
58
58
  - No implementation code should be added speculatively — this file describes the target shape
59
59
  so future work has a map, not a request to build it all now.
60
+
61
+ ## Release process ("bump")
62
+
63
+ The maintainer typing **"bump"** (or "bump X.Y.Z") to Claude is standing, in-the-moment
64
+ authorization for the full state-changing sequence below — commit, push, tag, push tag, and
65
+ GitHub release — for that one release only. No separate confirmation is needed per step; run
66
+ the whole sequence end-to-end without pausing to ask "should I push now?" etc.
67
+
68
+ **Version to release:**
69
+ - Plain **"bump"** → increment the patch version (Z in X.Y.Z) of whatever's currently in
70
+ `lib/fhirpath/version.rb`.
71
+ - **"bump X.Y.Z"** (an explicit version, e.g. for a minor/major bump like `0.2.0`) → set the
72
+ version to exactly that string instead of incrementing.
73
+
74
+ **Steps, in order:**
75
+ 1. `git status` — working tree must be clean and up to date with `origin/main` before starting.
76
+ If it isn't (uncommitted changes, unrelated local commits), stop and ask rather than
77
+ assuming they should be swept into the release.
78
+ 2. Edit `lib/fhirpath/version.rb` to the new version.
79
+ 3. Run `bundle exec rake` (specs + RuboCop) and confirm it's green. If parser sources aren't
80
+ already built, run `bundle exec rake parser:setup compile` first (see rakelib/parser.rake).
81
+ 4. **Mandatory packaging sanity check** — this is the step that was skipped before 0.1.1/0.1.2
82
+ shipped a broken native extension (the gemspec's generated-files glob had silently gone
83
+ missing and nothing caught it until a user hit a `LoadError` in production):
84
+ - `gem build fhirpath-rb.gemspec`
85
+ - Install the built `.gem` into a throwaway isolated `GEM_HOME` (e.g. under a scratch dir),
86
+ with `env -u BUNDLE_GEMFILE -u RUBYOPT` to avoid this repo's own bundler env leaking in,
87
+ and with `GEM_PATH` pointing at a location that already has `rice`/`fhir_models` installed
88
+ (or allow network) so dependencies resolve.
89
+ - From that isolated `GEM_HOME`, `require "fhirpath"` and call `Fhirpath.evaluate` on a
90
+ trivial resource. Confirm the native extension (`fhir_path_parser.bundle`/`.so`) actually
91
+ got compiled into that GEM_HOME's `extensions/` dir and the require succeeds.
92
+ - Clean up the scratch gem/dirs afterward. If this check fails, stop — do not tag or release
93
+ a broken build; fix the gemspec/extension setup first.
94
+ 5. `git add lib/fhirpath/version.rb` (plus any other files that were part of this bump, e.g. a
95
+ packaging fix) and commit as `Bump X.Y.Z`, with whatever commit attribution footer is
96
+ currently in effect for the session.
97
+ 6. `git push origin main`.
98
+ 7. `git tag -a vX.Y.Z -m "Version X.Y.Z"` and `git push origin vX.Y.Z`.
99
+ 8. `gh release create vX.Y.Z --title "vX.Y.Z" --generate-notes` — this triggers
100
+ `.github/workflows/release.yml`, which publishes to rubygems.org via Trusted Publishing.
101
+ 9. `gh run watch <run-id> --exit-status` (find the run with `gh run list --workflow=release.yml
102
+ --limit 1`) and confirm it completes successfully.
103
+ 10. Final live-artifact check: in a scratch dir, `gem install fhirpath-rb -v X.Y.Z` from
104
+ rubygems.org (not the local build) and `require "fhirpath"` to confirm what's actually
105
+ published works, not just what was built locally.
106
+ 11. Report back: new version, release URL, and confirmation that the published gem loads.
107
+
108
+ If step 4 or 10 fails, the release is broken in the same way 0.1.1/0.1.2 were — do not consider
109
+ the release done, and do not stop at "gem pushed successfully" as the definition of success.
110
+ `gem push` succeeding only means RubyGems accepted the upload; it says nothing about whether
111
+ the native extension actually compiles for an installer.
@@ -0,0 +1,10 @@
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
+ #include "ANTLRErrorListener.h"
7
+
8
+ antlr4::ANTLRErrorListener::~ANTLRErrorListener()
9
+ {
10
+ }
@@ -0,0 +1,167 @@
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 "RecognitionException.h"
9
+
10
+ namespace antlrcpp {
11
+ class BitSet;
12
+ }
13
+
14
+ namespace antlr4 {
15
+
16
+ /// How to emit recognition errors (an interface in Java).
17
+ class ANTLR4CPP_PUBLIC ANTLRErrorListener {
18
+ public:
19
+ virtual ~ANTLRErrorListener();
20
+
21
+ /// <summary>
22
+ /// Upon syntax error, notify any interested parties. This is not how to
23
+ /// recover from errors or compute error messages. <seealso cref="ANTLRErrorStrategy"/>
24
+ /// specifies how to recover from syntax errors and how to compute error
25
+ /// messages. This listener's job is simply to emit a computed message,
26
+ /// though it has enough information to create its own message in many cases.
27
+ /// <p/>
28
+ /// The <seealso cref="RecognitionException"/> is non-null for all syntax errors except
29
+ /// when we discover mismatched token errors that we can recover from
30
+ /// in-line, without returning from the surrounding rule (via the single
31
+ /// token insertion and deletion mechanism).
32
+ /// </summary>
33
+ /// <param name="recognizer">
34
+ /// What parser got the error. From this
35
+ /// object, you can access the context as well
36
+ /// as the input stream. </param>
37
+ /// <param name="offendingSymbol">
38
+ /// The offending token in the input token
39
+ /// stream, unless recognizer is a lexer (then it's null). If
40
+ /// no viable alternative error, {@code e} has token at which we
41
+ /// started production for the decision. </param>
42
+ /// <param name="line">
43
+ /// The line number in the input where the error occurred. </param>
44
+ /// <param name="charPositionInLine">
45
+ /// The character position within that line where the error occurred. </param>
46
+ /// <param name="msg">
47
+ /// The message to emit. </param>
48
+ /// <param name="e">
49
+ /// The exception generated by the parser that led to
50
+ /// the reporting of an error. It is null in the case where
51
+ /// the parser was able to recover in line without exiting the
52
+ /// surrounding rule. </param>
53
+ virtual void syntaxError(Recognizer *recognizer, Token *offendingSymbol, size_t line,
54
+ size_t charPositionInLine, const std::string &msg, std::exception_ptr e) = 0;
55
+
56
+ /**
57
+ * This method is called by the parser when a full-context prediction
58
+ * results in an ambiguity.
59
+ *
60
+ * <p>Each full-context prediction which does not result in a syntax error
61
+ * will call either {@link #reportContextSensitivity} or
62
+ * {@link #reportAmbiguity}.</p>
63
+ *
64
+ * <p>When {@code ambigAlts} is not null, it contains the set of potentially
65
+ * viable alternatives identified by the prediction algorithm. When
66
+ * {@code ambigAlts} is null, use {@link ATNConfigSet#getAlts} to obtain the
67
+ * represented alternatives from the {@code configs} argument.</p>
68
+ *
69
+ * <p>When {@code exact} is {@code true}, <em>all</em> of the potentially
70
+ * viable alternatives are truly viable, i.e. this is reporting an exact
71
+ * ambiguity. When {@code exact} is {@code false}, <em>at least two</em> of
72
+ * the potentially viable alternatives are viable for the current input, but
73
+ * the prediction algorithm terminated as soon as it determined that at
74
+ * least the <em>minimum</em> potentially viable alternative is truly
75
+ * viable.</p>
76
+ *
77
+ * <p>When the {@link PredictionMode#LL_EXACT_AMBIG_DETECTION} prediction
78
+ * mode is used, the parser is required to identify exact ambiguities so
79
+ * {@code exact} will always be {@code true}.</p>
80
+ *
81
+ * <p>This method is not used by lexers.</p>
82
+ *
83
+ * @param recognizer the parser instance
84
+ * @param dfa the DFA for the current decision
85
+ * @param startIndex the input index where the decision started
86
+ * @param stopIndex the input input where the ambiguity was identified
87
+ * @param exact {@code true} if the ambiguity is exactly known, otherwise
88
+ * {@code false}. This is always {@code true} when
89
+ * {@link PredictionMode#LL_EXACT_AMBIG_DETECTION} is used.
90
+ * @param ambigAlts the potentially ambiguous alternatives, or {@code null}
91
+ * to indicate that the potentially ambiguous alternatives are the complete
92
+ * set of represented alternatives in {@code configs}
93
+ * @param configs the ATN configuration set where the ambiguity was
94
+ * identified
95
+ */
96
+ virtual void reportAmbiguity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex, bool exact,
97
+ const antlrcpp::BitSet &ambigAlts, atn::ATNConfigSet *configs) = 0;
98
+
99
+ /**
100
+ * This method is called when an SLL conflict occurs and the parser is about
101
+ * to use the full context information to make an LL decision.
102
+ *
103
+ * <p>If one or more configurations in {@code configs} contains a semantic
104
+ * predicate, the predicates are evaluated before this method is called. The
105
+ * subset of alternatives which are still viable after predicates are
106
+ * evaluated is reported in {@code conflictingAlts}.</p>
107
+ *
108
+ * <p>This method is not used by lexers.</p>
109
+ *
110
+ * @param recognizer the parser instance
111
+ * @param dfa the DFA for the current decision
112
+ * @param startIndex the input index where the decision started
113
+ * @param stopIndex the input index where the SLL conflict occurred
114
+ * @param conflictingAlts The specific conflicting alternatives. If this is
115
+ * {@code null}, the conflicting alternatives are all alternatives
116
+ * represented in {@code configs}. At the moment, conflictingAlts is non-null
117
+ * (for the reference implementation, but Sam's optimized version can see this
118
+ * as null).
119
+ * @param configs the ATN configuration set where the SLL conflict was
120
+ * detected
121
+ */
122
+ virtual void reportAttemptingFullContext(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
123
+ const antlrcpp::BitSet &conflictingAlts, atn::ATNConfigSet *configs) = 0;
124
+
125
+ /**
126
+ * This method is called by the parser when a full-context prediction has a
127
+ * unique result.
128
+ *
129
+ * <p>Each full-context prediction which does not result in a syntax error
130
+ * will call either {@link #reportContextSensitivity} or
131
+ * {@link #reportAmbiguity}.</p>
132
+ *
133
+ * <p>For prediction implementations that only evaluate full-context
134
+ * predictions when an SLL conflict is found (including the default
135
+ * {@link ParserATNSimulator} implementation), this method reports cases
136
+ * where SLL conflicts were resolved to unique full-context predictions,
137
+ * i.e. the decision was context-sensitive. This report does not necessarily
138
+ * indicate a problem, and it may appear even in completely unambiguous
139
+ * grammars.</p>
140
+ *
141
+ * <p>{@code configs} may have more than one represented alternative if the
142
+ * full-context prediction algorithm does not evaluate predicates before
143
+ * beginning the full-context prediction. In all cases, the final prediction
144
+ * is passed as the {@code prediction} argument.</p>
145
+ *
146
+ * <p>Note that the definition of "context sensitivity" in this method
147
+ * differs from the concept in {@link DecisionInfo#contextSensitivities}.
148
+ * This method reports all instances where an SLL conflict occurred but LL
149
+ * parsing produced a unique result, whether or not that unique result
150
+ * matches the minimum alternative in the SLL conflicting set.</p>
151
+ *
152
+ * <p>This method is not used by lexers.</p>
153
+ *
154
+ * @param recognizer the parser instance
155
+ * @param dfa the DFA for the current decision
156
+ * @param startIndex the input index where the decision started
157
+ * @param stopIndex the input index where the context sensitivity was
158
+ * finally determined
159
+ * @param prediction the unambiguous result of the full-context prediction
160
+ * @param configs the ATN configuration set where the unambiguous prediction
161
+ * was determined
162
+ */
163
+ virtual void reportContextSensitivity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
164
+ size_t prediction, atn::ATNConfigSet *configs) = 0;
165
+ };
166
+
167
+ } // namespace antlr4
@@ -0,0 +1,10 @@
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
+ #include "ANTLRErrorStrategy.h"
7
+
8
+ antlr4::ANTLRErrorStrategy::~ANTLRErrorStrategy()
9
+ {
10
+ }
@@ -0,0 +1,121 @@
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 "Token.h"
9
+
10
+ namespace antlr4 {
11
+
12
+ /// <summary>
13
+ /// The interface for defining strategies to deal with syntax errors encountered
14
+ /// during a parse by ANTLR-generated parsers. We distinguish between three
15
+ /// different kinds of errors:
16
+ ///
17
+ /// <ul>
18
+ /// <li>The parser could not figure out which path to take in the ATN (none of
19
+ /// the available alternatives could possibly match)</li>
20
+ /// <li>The current input does not match what we were looking for</li>
21
+ /// <li>A predicate evaluated to false</li>
22
+ /// </ul>
23
+ ///
24
+ /// Implementations of this interface report syntax errors by calling
25
+ /// <seealso cref="Parser#notifyErrorListeners"/>.
26
+ /// <p/>
27
+ /// TODO: what to do about lexers
28
+ /// </summary>
29
+ class ANTLR4CPP_PUBLIC ANTLRErrorStrategy {
30
+ public:
31
+
32
+ /// <summary>
33
+ /// Reset the error handler state for the specified {@code recognizer}. </summary>
34
+ /// <param name="recognizer"> the parser instance </param>
35
+ virtual ~ANTLRErrorStrategy();
36
+
37
+ virtual void reset(Parser *recognizer) = 0;
38
+
39
+ /**
40
+ * This method is called when an unexpected symbol is encountered during an
41
+ * inline match operation, such as {@link Parser#match}. If the error
42
+ * strategy successfully recovers from the match failure, this method
43
+ * returns the {@link Token} instance which should be treated as the
44
+ * successful result of the match.
45
+ *
46
+ * <p>This method handles the consumption of any tokens - the caller should
47
+ * <b>not</b> call {@link Parser#consume} after a successful recovery.</p>
48
+ *
49
+ * <p>Note that the calling code will not report an error if this method
50
+ * returns successfully. The error strategy implementation is responsible
51
+ * for calling {@link Parser#notifyErrorListeners} as appropriate.</p>
52
+ *
53
+ * @param recognizer the parser instance
54
+ * @throws RecognitionException if the error strategy was not able to
55
+ * recover from the unexpected input symbol
56
+ */
57
+ virtual Token* recoverInline(Parser *recognizer) = 0;
58
+
59
+ /// <summary>
60
+ /// This method is called to recover from exception {@code e}. This method is
61
+ /// called after <seealso cref="#reportError"/> by the default exception handler
62
+ /// generated for a rule method.
63
+ /// </summary>
64
+ /// <seealso cref= #reportError
65
+ /// </seealso>
66
+ /// <param name="recognizer"> the parser instance </param>
67
+ /// <param name="e"> the recognition exception to recover from </param>
68
+ /// <exception cref="RecognitionException"> if the error strategy could not recover from
69
+ /// the recognition exception </exception>
70
+ virtual void recover(Parser *recognizer, std::exception_ptr e) = 0;
71
+
72
+ /// <summary>
73
+ /// This method provides the error handler with an opportunity to handle
74
+ /// syntactic or semantic errors in the input stream before they result in a
75
+ /// <seealso cref="RecognitionException"/>.
76
+ /// <p/>
77
+ /// The generated code currently contains calls to <seealso cref="#sync"/> after
78
+ /// entering the decision state of a closure block ({@code (...)*} or
79
+ /// {@code (...)+}).
80
+ /// <p/>
81
+ /// For an implementation based on Jim Idle's "magic sync" mechanism, see
82
+ /// <seealso cref="DefaultErrorStrategy#sync"/>.
83
+ /// </summary>
84
+ /// <seealso cref= DefaultErrorStrategy#sync
85
+ /// </seealso>
86
+ /// <param name="recognizer"> the parser instance </param>
87
+ /// <exception cref="RecognitionException"> if an error is detected by the error
88
+ /// strategy but cannot be automatically recovered at the current state in
89
+ /// the parsing process </exception>
90
+ virtual void sync(Parser *recognizer) = 0;
91
+
92
+ /// <summary>
93
+ /// Tests whether or not {@code recognizer} is in the process of recovering
94
+ /// from an error. In error recovery mode, <seealso cref="Parser#consume"/> adds
95
+ /// symbols to the parse tree by calling
96
+ /// {@link Parser#createErrorNode(ParserRuleContext, Token)} then
97
+ /// {@link ParserRuleContext#addErrorNode(ErrorNode)} instead of
98
+ /// {@link Parser#createTerminalNode(ParserRuleContext, Token)}.
99
+ /// </summary>
100
+ /// <param name="recognizer"> the parser instance </param>
101
+ /// <returns> {@code true} if the parser is currently recovering from a parse
102
+ /// error, otherwise {@code false} </returns>
103
+ virtual bool inErrorRecoveryMode(Parser *recognizer) = 0;
104
+
105
+ /// <summary>
106
+ /// This method is called by when the parser successfully matches an input
107
+ /// symbol.
108
+ /// </summary>
109
+ /// <param name="recognizer"> the parser instance </param>
110
+ virtual void reportMatch(Parser *recognizer) = 0;
111
+
112
+ /// <summary>
113
+ /// Report any kind of <seealso cref="RecognitionException"/>. This method is called by
114
+ /// the default exception handler generated for a rule method.
115
+ /// </summary>
116
+ /// <param name="recognizer"> the parser instance </param>
117
+ /// <param name="e"> the recognition exception to report </param>
118
+ virtual void reportError(Parser *recognizer, const RecognitionException &e) = 0;
119
+ };
120
+
121
+ } // namespace antlr4
@@ -0,0 +1,23 @@
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
+ #include "ANTLRFileStream.h"
7
+
8
+ using namespace antlr4;
9
+
10
+ void ANTLRFileStream::loadFromFile(const std::string &fileName) {
11
+ _fileName = fileName;
12
+ if (_fileName.empty()) {
13
+ return;
14
+ }
15
+
16
+ std::ifstream stream(fileName, std::ios::binary);
17
+
18
+ ANTLRInputStream::load(stream);
19
+ }
20
+
21
+ std::string ANTLRFileStream::getSourceName() const {
22
+ return _fileName;
23
+ }
@@ -0,0 +1,30 @@
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 "ANTLRInputStream.h"
9
+
10
+ namespace antlr4 {
11
+
12
+ /// This is an ANTLRInputStream that is loaded from a file all at once
13
+ /// when you construct the object (or call load()).
14
+ // TODO: this class needs testing.
15
+ class ANTLR4CPP_PUBLIC ANTLRFileStream : public ANTLRInputStream {
16
+ public:
17
+ ANTLRFileStream() = default;
18
+ ANTLRFileStream(const std::string &) = delete;
19
+ ANTLRFileStream(const char *data, size_t length) = delete;
20
+ ANTLRFileStream(std::istream &stream) = delete;
21
+
22
+ // Assumes a file name encoded in UTF-8 and file content in the same encoding (with or w/o BOM).
23
+ virtual void loadFromFile(const std::string &fileName);
24
+ virtual std::string getSourceName() const override;
25
+
26
+ private:
27
+ std::string _fileName; // UTF-8 encoded file name.
28
+ };
29
+
30
+ } // namespace antlr4
@@ -0,0 +1,180 @@
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
+ #include <string.h>
7
+
8
+ #include "Exceptions.h"
9
+ #include "misc/Interval.h"
10
+ #include "IntStream.h"
11
+
12
+ #include "support/Utf8.h"
13
+ #include "support/CPPUtils.h"
14
+
15
+ #include "ANTLRInputStream.h"
16
+
17
+ using namespace antlr4;
18
+ using namespace antlrcpp;
19
+
20
+ using misc::Interval;
21
+
22
+ ANTLRInputStream::ANTLRInputStream() {
23
+ InitializeInstanceFields();
24
+ }
25
+
26
+ ANTLRInputStream::ANTLRInputStream(std::string_view input): ANTLRInputStream() {
27
+ load(input.data(), input.length());
28
+ }
29
+
30
+ ANTLRInputStream::ANTLRInputStream(const char *data, size_t length) {
31
+ load(data, length);
32
+ }
33
+
34
+ ANTLRInputStream::ANTLRInputStream(std::istream &stream): ANTLRInputStream() {
35
+ load(stream);
36
+ }
37
+
38
+ void ANTLRInputStream::load(const std::string &input, bool lenient) {
39
+ load(input.data(), input.size(), lenient);
40
+ }
41
+
42
+ void ANTLRInputStream::load(const char *data, size_t length, bool lenient) {
43
+ // Remove the UTF-8 BOM if present.
44
+ const char *bom = "\xef\xbb\xbf";
45
+ if (length >= 3 && strncmp(data, bom, 3) == 0) {
46
+ data += 3;
47
+ length -= 3;
48
+ }
49
+ if (lenient) {
50
+ _data = Utf8::lenientDecode(std::string_view(data, length));
51
+ } else {
52
+ auto maybe_utf32 = Utf8::strictDecode(std::string_view(data, length));
53
+ if (!maybe_utf32.has_value()) {
54
+ throw IllegalArgumentException("UTF-8 string contains an illegal byte sequence");
55
+ }
56
+ _data = std::move(maybe_utf32).value();
57
+ }
58
+ p = 0;
59
+ }
60
+
61
+ void ANTLRInputStream::load(std::istream &stream, bool lenient) {
62
+ if (!stream.good() || stream.eof()) // No fail, bad or EOF.
63
+ return;
64
+
65
+ _data.clear();
66
+
67
+ std::string s((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
68
+ load(s.data(), s.length(), lenient);
69
+ }
70
+
71
+ void ANTLRInputStream::reset() {
72
+ p = 0;
73
+ }
74
+
75
+ void ANTLRInputStream::consume() {
76
+ if (p >= _data.size()) {
77
+ assert(LA(1) == IntStream::EOF);
78
+ throw IllegalStateException("cannot consume EOF");
79
+ }
80
+
81
+ if (p < _data.size()) {
82
+ p++;
83
+ }
84
+ }
85
+
86
+ size_t ANTLRInputStream::LA(ssize_t i) {
87
+ if (i == 0) {
88
+ return 0; // undefined
89
+ }
90
+
91
+ ssize_t position = static_cast<ssize_t>(p);
92
+ if (i < 0) {
93
+ i++; // e.g., translate LA(-1) to use offset i=0; then _data[p+0-1]
94
+ if ((position + i - 1) < 0) {
95
+ return IntStream::EOF; // invalid; no char before first char
96
+ }
97
+ }
98
+
99
+ if ((position + i - 1) >= static_cast<ssize_t>(_data.size())) {
100
+ return IntStream::EOF;
101
+ }
102
+
103
+ return _data[static_cast<size_t>((position + i - 1))];
104
+ }
105
+
106
+ size_t ANTLRInputStream::LT(ssize_t i) {
107
+ return LA(i);
108
+ }
109
+
110
+ size_t ANTLRInputStream::index() {
111
+ return p;
112
+ }
113
+
114
+ size_t ANTLRInputStream::size() {
115
+ return _data.size();
116
+ }
117
+
118
+ // Mark/release do nothing. We have entire buffer.
119
+ ssize_t ANTLRInputStream::mark() {
120
+ return -1;
121
+ }
122
+
123
+ void ANTLRInputStream::release(ssize_t /* marker */) {
124
+ }
125
+
126
+ void ANTLRInputStream::seek(size_t index) {
127
+ if (index <= p) {
128
+ p = index; // just jump; don't update stream state (line, ...)
129
+ return;
130
+ }
131
+ // seek forward, consume until p hits index or n (whichever comes first)
132
+ index = std::min(index, _data.size());
133
+ while (p < index) {
134
+ consume();
135
+ }
136
+ }
137
+
138
+ std::string ANTLRInputStream::getText(const Interval &interval) {
139
+ if (interval.a < 0 || interval.b < 0) {
140
+ return "";
141
+ }
142
+
143
+ size_t start = static_cast<size_t>(interval.a);
144
+ size_t stop = static_cast<size_t>(interval.b);
145
+
146
+
147
+ if (stop >= _data.size()) {
148
+ stop = _data.size() - 1;
149
+ }
150
+
151
+ size_t count = stop - start + 1;
152
+ if (start >= _data.size()) {
153
+ return "";
154
+ }
155
+
156
+ auto maybeUtf8 = Utf8::strictEncode(std::u32string_view(_data).substr(start, count));
157
+ if (!maybeUtf8.has_value()) {
158
+ throw IllegalArgumentException("Input stream contains invalid Unicode code points");
159
+ }
160
+ return std::move(maybeUtf8).value();
161
+ }
162
+
163
+ std::string ANTLRInputStream::getSourceName() const {
164
+ if (name.empty()) {
165
+ return IntStream::UNKNOWN_SOURCE_NAME;
166
+ }
167
+ return name;
168
+ }
169
+
170
+ std::string ANTLRInputStream::toString() const {
171
+ auto maybeUtf8 = Utf8::strictEncode(_data);
172
+ if (!maybeUtf8.has_value()) {
173
+ throw IllegalArgumentException("Input stream contains invalid Unicode code points");
174
+ }
175
+ return std::move(maybeUtf8).value();
176
+ }
177
+
178
+ void ANTLRInputStream::InitializeInstanceFields() {
179
+ p = 0;
180
+ }