did_parser 1.0.0
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.
- checksums.yaml +7 -0
- data/Gemfile +12 -0
- data/Rakefile +28 -0
- data/did_parser.gemspec +31 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.cpp +10 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorListener.h +167 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp +10 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRErrorStrategy.h +121 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRFileStream.h +30 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +180 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ANTLRInputStream.h +79 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.cpp +61 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/BailErrorStrategy.h +59 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.cpp +25 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/BaseErrorListener.h +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.cpp +414 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/BufferedTokenStream.h +200 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.cpp +11 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CharStream.h +37 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.cpp +193 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonToken.h +158 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.cpp +39 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenFactory.h +74 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.cpp +78 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/CommonTokenStream.h +79 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.cpp +15 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ConsoleErrorListener.h +35 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +336 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/DefaultErrorStrategy.h +466 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp +84 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/DiagnosticErrorListener.h +80 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.cpp +64 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Exceptions.h +99 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.cpp +52 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/FailedPredicateException.h +32 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.cpp +18 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/InputMismatchException.h +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.cpp +12 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/IntStream.h +218 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.cpp +19 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/InterpreterRuleContext.h +45 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.cpp +294 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Lexer.h +196 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.cpp +60 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerInterpreter.h +46 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.cpp +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/LexerNoViableAltException.h +31 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.cpp +92 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ListTokenSource.h +88 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.cpp +46 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/NoViableAltException.h +42 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.cpp +668 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Parser.h +461 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.cpp +294 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserInterpreter.h +173 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.cpp +138 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ParserRuleContext.h +147 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.cpp +53 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/ProxyErrorListener.h +38 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.cpp +65 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RecognitionException.h +98 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.cpp +156 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Recognizer.h +159 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.cpp +144 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContext.h +141 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuleContextWithAltNum.h +32 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +54 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/RuntimeMetaData.h +155 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.cpp +9 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Token.h +92 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenFactory.h +30 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.cpp +9 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenSource.h +85 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.cpp +11 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStream.h +137 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +425 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/TokenStreamRewriter.h +295 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +208 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedCharStream.h +117 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp +270 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/UnbufferedTokenStream.h +115 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Version.h +42 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.cpp +64 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/Vocabulary.h +177 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.cpp +9 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/WritableToken.h +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-common.h +98 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/antlr4-runtime.h +169 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.cpp +158 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATN.h +132 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +106 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfig.h +157 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +232 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +156 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +54 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +48 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +629 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +32 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNSimulator.h +71 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.cpp +56 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNState.h +139 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.cpp +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNStateType.h +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ATNType.h +20 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +29 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ActionTransition.h +35 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp +16 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AmbiguityInfo.h +68 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +109 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +51 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/AtomTransition.h +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BasicState.h +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockEndState.h +26 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/BlockStartState.h +30 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp +14 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.h +47 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp +14 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionEventInfo.h +70 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.cpp +25 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionInfo.h +227 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.cpp +12 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/DecisionState.h +34 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +31 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +42 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.cpp +15 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ErrorInfo.h +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +189 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +76 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +67 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +44 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +615 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +199 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.cpp +15 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerAction.h +100 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +111 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +128 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerActionType.h +57 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +59 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +45 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +75 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +57 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +76 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerModeAction.h +57 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +53 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +53 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +57 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +51 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +51 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp +16 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LookaheadEventInfo.h +42 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/LoopEndState.h +26 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +22 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/NotSetTransition.h +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +16 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +25 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.cpp +102 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParseInfo.h +102 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +1383 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +911 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h +50 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +29 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +25 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +35 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +17 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +62 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredicateTransition.h +50 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +579 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContext.h +225 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp +56 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextCache.h +64 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp +167 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h +101 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h +71 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionContextType.h +21 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +202 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/PredictionMode.h +436 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +179 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +60 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +26 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RangeTransition.h +31 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStartState.h +26 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleStopState.h +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/RuleTransition.h +42 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +418 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContext.h +233 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SemanticContextType.h +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SerializedATNView.h +101 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.cpp +28 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SetTransition.h +38 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +86 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +37 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +19 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +25 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TokensStartState.h +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.cpp +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/Transition.h +65 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.cpp +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/TransitionType.h +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +21 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/atn/WildcardTransition.h +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.cpp +115 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFA.h +96 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +60 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFASerializer.h +32 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.cpp +59 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/DFAState.h +153 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +17 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +22 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +124 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.cpp +61 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Interval.h +84 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +508 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/IntervalSet.h +190 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +120 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/MurmurHash.h +102 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.cpp +4 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/misc/Predicate.h +21 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.cpp +8 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Any.h +16 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.cpp +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Arrays.h +149 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/BitSet.h +76 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.cpp +207 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/CPPUtils.h +65 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Casts.h +34 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Declarations.h +161 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.cpp +38 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/StringUtils.h +16 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Unicode.h +28 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.cpp +242 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/support/Utf8.h +54 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +129 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNode.h +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +54 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +43 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +66 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.h +53 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.cpp +12 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTree.h +111 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp +9 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeListener.h +39 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeProperty.h +50 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeType.h +22 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp +9 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +57 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +48 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +55 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNode.h +40 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +54 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +32 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.cpp +241 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/Trees.h +78 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp +9 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/Chunk.h +44 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp +69 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.h +132 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp +64 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.h +105 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +370 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.h +185 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp +77 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.h +117 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp +39 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TagChunk.h +86 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp +28 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TextChunk.h +51 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp +36 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.h +80 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.cpp +154 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPath.h +86 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp +31 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathElement.h +40 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +182 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +47 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp +13 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.h +22 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp +20 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.h +27 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp +30 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.h +26 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp +20 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.h +25 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp +33 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.h +26 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.h +23 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp +24 -0
- data/ext/did_parser/antlr4-upstream/runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.h +23 -0
- data/ext/did_parser/antlrgen/DIDLexer.cpp +225 -0
- data/ext/did_parser/antlrgen/DIDLexer.h +52 -0
- data/ext/did_parser/antlrgen/DIDLexer.interp +93 -0
- data/ext/did_parser/antlrgen/DIDLexer.tokens +42 -0
- data/ext/did_parser/antlrgen/DIDParser.cpp +2042 -0
- data/ext/did_parser/antlrgen/DIDParser.h +537 -0
- data/ext/did_parser/antlrgen/DIDParser.interp +74 -0
- data/ext/did_parser/antlrgen/DIDParser.tokens +42 -0
- data/ext/did_parser/antlrgen/DIDParserBaseListener.cpp +7 -0
- data/ext/did_parser/antlrgen/DIDParserBaseListener.h +104 -0
- data/ext/did_parser/antlrgen/DIDParserBaseVisitor.cpp +7 -0
- data/ext/did_parser/antlrgen/DIDParserBaseVisitor.h +124 -0
- data/ext/did_parser/antlrgen/DIDParserListener.cpp +7 -0
- data/ext/did_parser/antlrgen/DIDParserListener.h +97 -0
- data/ext/did_parser/antlrgen/DIDParserVisitor.cpp +7 -0
- data/ext/did_parser/antlrgen/DIDParserVisitor.h +76 -0
- data/ext/did_parser/did_parser.cpp +2996 -0
- data/ext/did_parser/extconf.rb +38 -0
- data/lib/did_parser/version.rb +3 -0
- data/lib/did_parser.rb +2 -0
- metadata +382 -0
|
@@ -0,0 +1,42 @@
|
|
|
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 "atn/Transition.h"
|
|
9
|
+
|
|
10
|
+
namespace antlr4 {
|
|
11
|
+
namespace atn {
|
|
12
|
+
|
|
13
|
+
class ANTLR4CPP_PUBLIC EpsilonTransition final : public Transition {
|
|
14
|
+
public:
|
|
15
|
+
static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::EPSILON; }
|
|
16
|
+
|
|
17
|
+
static bool is(const Transition *transition) { return transition != nullptr && is(*transition); }
|
|
18
|
+
|
|
19
|
+
explicit EpsilonTransition(ATNState *target);
|
|
20
|
+
EpsilonTransition(ATNState *target, size_t outermostPrecedenceReturn);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @return the rule index of a precedence rule for which this transition is
|
|
24
|
+
* returning from, where the precedence value is 0; otherwise, INVALID_INDEX.
|
|
25
|
+
*
|
|
26
|
+
* @see ATNConfig#isPrecedenceFilterSuppressed()
|
|
27
|
+
* @see ParserATNSimulator#applyPrecedenceFilter(ATNConfigSet)
|
|
28
|
+
* @since 4.4.1
|
|
29
|
+
*/
|
|
30
|
+
size_t outermostPrecedenceReturn() const;
|
|
31
|
+
|
|
32
|
+
virtual bool isEpsilon() const override;
|
|
33
|
+
virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override;
|
|
34
|
+
|
|
35
|
+
virtual std::string toString() const override;
|
|
36
|
+
|
|
37
|
+
private:
|
|
38
|
+
const size_t _outermostPrecedenceReturn; // A rule index.
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace atn
|
|
42
|
+
} // namespace antlr4
|
|
@@ -0,0 +1,15 @@
|
|
|
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 "atn/ATNConfigSet.h"
|
|
7
|
+
|
|
8
|
+
#include "atn/ErrorInfo.h"
|
|
9
|
+
|
|
10
|
+
using namespace antlr4;
|
|
11
|
+
using namespace antlr4::atn;
|
|
12
|
+
|
|
13
|
+
ErrorInfo::ErrorInfo(size_t decision, ATNConfigSet *configs, TokenStream *input, size_t startIndex, size_t stopIndex, bool fullCtx)
|
|
14
|
+
: DecisionEventInfo(decision, configs, input, startIndex, stopIndex, fullCtx) {
|
|
15
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 "atn/DecisionEventInfo.h"
|
|
9
|
+
|
|
10
|
+
namespace antlr4 {
|
|
11
|
+
namespace atn {
|
|
12
|
+
|
|
13
|
+
/// <summary>
|
|
14
|
+
/// This class represents profiling event information for a syntax error
|
|
15
|
+
/// identified during prediction. Syntax errors occur when the prediction
|
|
16
|
+
/// algorithm is unable to identify an alternative which would lead to a
|
|
17
|
+
/// successful parse.
|
|
18
|
+
/// </summary>
|
|
19
|
+
/// <seealso cref= Parser#notifyErrorListeners(Token, String, RecognitionException) </seealso>
|
|
20
|
+
/// <seealso cref= ANTLRErrorListener#syntaxError
|
|
21
|
+
///
|
|
22
|
+
/// @since 4.3 </seealso>
|
|
23
|
+
class ANTLR4CPP_PUBLIC ErrorInfo : public DecisionEventInfo {
|
|
24
|
+
public:
|
|
25
|
+
/// <summary>
|
|
26
|
+
/// Constructs a new instance of the <seealso cref="ErrorInfo"/> class with the
|
|
27
|
+
/// specified detailed syntax error information.
|
|
28
|
+
/// </summary>
|
|
29
|
+
/// <param name="decision"> The decision number </param>
|
|
30
|
+
/// <param name="configs"> The final configuration set reached during prediction
|
|
31
|
+
/// prior to reaching the <seealso cref="ATNSimulator#ERROR"/> state </param>
|
|
32
|
+
/// <param name="input"> The input token stream </param>
|
|
33
|
+
/// <param name="startIndex"> The start index for the current prediction </param>
|
|
34
|
+
/// <param name="stopIndex"> The index at which the syntax error was identified </param>
|
|
35
|
+
/// <param name="fullCtx"> {@code true} if the syntax error was identified during LL
|
|
36
|
+
/// prediction; otherwise, {@code false} if the syntax error was identified
|
|
37
|
+
/// during SLL prediction </param>
|
|
38
|
+
ErrorInfo(size_t decision, ATNConfigSet *configs, TokenStream *input, size_t startIndex, size_t stopIndex,
|
|
39
|
+
bool fullCtx);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace atn
|
|
43
|
+
} // namespace antlr4
|
|
@@ -0,0 +1,189 @@
|
|
|
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 "atn/RuleStopState.h"
|
|
7
|
+
#include "atn/Transition.h"
|
|
8
|
+
#include "atn/RuleTransition.h"
|
|
9
|
+
#include "atn/SingletonPredictionContext.h"
|
|
10
|
+
#include "atn/WildcardTransition.h"
|
|
11
|
+
#include "atn/NotSetTransition.h"
|
|
12
|
+
#include "misc/IntervalSet.h"
|
|
13
|
+
#include "atn/ATNConfig.h"
|
|
14
|
+
|
|
15
|
+
#include "support/CPPUtils.h"
|
|
16
|
+
|
|
17
|
+
#include "atn/LL1Analyzer.h"
|
|
18
|
+
|
|
19
|
+
using namespace antlr4;
|
|
20
|
+
using namespace antlr4::atn;
|
|
21
|
+
using namespace antlrcpp;
|
|
22
|
+
|
|
23
|
+
namespace {
|
|
24
|
+
|
|
25
|
+
struct ATNConfigHasher final {
|
|
26
|
+
size_t operator()(const ATNConfig& atn_config) const {
|
|
27
|
+
return atn_config.hashCode();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
struct ATNConfigComparer final {
|
|
32
|
+
bool operator()(const ATNConfig& lhs, const ATNConfig& rhs) const {
|
|
33
|
+
return lhs == rhs;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
class LL1AnalyzerImpl final {
|
|
38
|
+
public:
|
|
39
|
+
LL1AnalyzerImpl(const ATN& atn, misc::IntervalSet& look, bool seeThruPreds, bool addEOF) : _atn(atn), _look(look), _seeThruPreds(seeThruPreds), _addEOF(addEOF) {}
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
/// Compute set of tokens that can follow {@code s} in the ATN in the
|
|
43
|
+
/// specified {@code ctx}.
|
|
44
|
+
/// <p/>
|
|
45
|
+
/// If {@code ctx} is {@code null} and {@code stopState} or the end of the
|
|
46
|
+
/// rule containing {@code s} is reached, <seealso cref="Token#EPSILON"/> is added to
|
|
47
|
+
/// the result set. If {@code ctx} is not {@code null} and {@code addEOF} is
|
|
48
|
+
/// {@code true} and {@code stopState} or the end of the outermost rule is
|
|
49
|
+
/// reached, <seealso cref="Token#EOF"/> is added to the result set.
|
|
50
|
+
/// </summary>
|
|
51
|
+
/// <param name="s"> the ATN state. </param>
|
|
52
|
+
/// <param name="stopState"> the ATN state to stop at. This can be a
|
|
53
|
+
/// <seealso cref="BlockEndState"/> to detect epsilon paths through a closure. </param>
|
|
54
|
+
/// <param name="ctx"> The outer context, or {@code null} if the outer context should
|
|
55
|
+
/// not be used. </param>
|
|
56
|
+
/// <param name="look"> The result lookahead set. </param>
|
|
57
|
+
/// <param name="lookBusy"> A set used for preventing epsilon closures in the ATN
|
|
58
|
+
/// from causing a stack overflow. Outside code should pass
|
|
59
|
+
/// {@code new HashSet<ATNConfig>} for this argument. </param>
|
|
60
|
+
/// <param name="calledRuleStack"> A set used for preventing left recursion in the
|
|
61
|
+
/// ATN from causing a stack overflow. Outside code should pass
|
|
62
|
+
/// {@code new BitSet()} for this argument. </param>
|
|
63
|
+
/// <param name="seeThruPreds"> {@code true} to true semantic predicates as
|
|
64
|
+
/// implicitly {@code true} and "see through them", otherwise {@code false}
|
|
65
|
+
/// to treat semantic predicates as opaque and add <seealso cref="#HIT_PRED"/> to the
|
|
66
|
+
/// result if one is encountered. </param>
|
|
67
|
+
/// <param name="addEOF"> Add <seealso cref="Token#EOF"/> to the result if the end of the
|
|
68
|
+
/// outermost context is reached. This parameter has no effect if {@code ctx}
|
|
69
|
+
/// is {@code null}. </param>
|
|
70
|
+
void LOOK(ATNState *s, ATNState *stopState, Ref<const PredictionContext> const& ctx) {
|
|
71
|
+
if (!_lookBusy.insert(ATNConfig(s, 0, ctx)).second) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ml: s can never be null, hence no need to check if stopState is != null.
|
|
76
|
+
if (s == stopState) {
|
|
77
|
+
if (ctx == nullptr) {
|
|
78
|
+
_look.add(Token::EPSILON);
|
|
79
|
+
return;
|
|
80
|
+
} else if (ctx->isEmpty() && _addEOF) {
|
|
81
|
+
_look.add(Token::EOF);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (s->getStateType() == ATNStateType::RULE_STOP) {
|
|
87
|
+
if (ctx == nullptr) {
|
|
88
|
+
_look.add(Token::EPSILON);
|
|
89
|
+
return;
|
|
90
|
+
} else if (ctx->isEmpty() && _addEOF) {
|
|
91
|
+
_look.add(Token::EOF);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (ctx != PredictionContext::EMPTY) {
|
|
96
|
+
bool removed = _calledRuleStack.test(s->ruleIndex);
|
|
97
|
+
_calledRuleStack[s->ruleIndex] = false;
|
|
98
|
+
// run thru all possible stack tops in ctx
|
|
99
|
+
for (size_t i = 0; i < ctx->size(); i++) {
|
|
100
|
+
ATNState *returnState = _atn.states[ctx->getReturnState(i)];
|
|
101
|
+
LOOK(returnState, stopState, ctx->getParent(i));
|
|
102
|
+
}
|
|
103
|
+
if (removed) {
|
|
104
|
+
_calledRuleStack.set(s->ruleIndex);
|
|
105
|
+
}
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
size_t n = s->transitions.size();
|
|
111
|
+
for (size_t i = 0; i < n; i++) {
|
|
112
|
+
const Transition *t = s->transitions[i].get();
|
|
113
|
+
const auto tType = t->getTransitionType();
|
|
114
|
+
|
|
115
|
+
if (tType == TransitionType::RULE) {
|
|
116
|
+
if (_calledRuleStack[(static_cast<const RuleTransition*>(t))->target->ruleIndex]) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
Ref<const PredictionContext> newContext = SingletonPredictionContext::create(ctx, (static_cast<const RuleTransition*>(t))->followState->stateNumber);
|
|
121
|
+
|
|
122
|
+
_calledRuleStack.set((static_cast<const RuleTransition*>(t))->target->ruleIndex);
|
|
123
|
+
LOOK(t->target, stopState, newContext);
|
|
124
|
+
_calledRuleStack[(static_cast<const RuleTransition*>(t))->target->ruleIndex] = false;
|
|
125
|
+
|
|
126
|
+
} else if (tType == TransitionType::PREDICATE || tType == TransitionType::PRECEDENCE) {
|
|
127
|
+
if (_seeThruPreds) {
|
|
128
|
+
LOOK(t->target, stopState, ctx);
|
|
129
|
+
} else {
|
|
130
|
+
_look.add(LL1Analyzer::HIT_PRED);
|
|
131
|
+
}
|
|
132
|
+
} else if (t->isEpsilon()) {
|
|
133
|
+
LOOK(t->target, stopState, ctx);
|
|
134
|
+
} else if (tType == TransitionType::WILDCARD) {
|
|
135
|
+
_look.addAll(misc::IntervalSet::of(Token::MIN_USER_TOKEN_TYPE, static_cast<ssize_t>(_atn.maxTokenType)));
|
|
136
|
+
} else {
|
|
137
|
+
misc::IntervalSet set = t->label();
|
|
138
|
+
if (!set.isEmpty()) {
|
|
139
|
+
if (tType == TransitionType::NOT_SET) {
|
|
140
|
+
set = set.complement(misc::IntervalSet::of(Token::MIN_USER_TOKEN_TYPE, static_cast<ssize_t>(_atn.maxTokenType)));
|
|
141
|
+
}
|
|
142
|
+
_look.addAll(set);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
private:
|
|
149
|
+
const ATN& _atn;
|
|
150
|
+
misc::IntervalSet& _look;
|
|
151
|
+
antlrcpp::BitSet _calledRuleStack;
|
|
152
|
+
std::unordered_set<ATNConfig, ATNConfigHasher, ATNConfigComparer> _lookBusy;
|
|
153
|
+
bool _seeThruPreds;
|
|
154
|
+
bool _addEOF;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
std::vector<misc::IntervalSet> LL1Analyzer::getDecisionLookahead(ATNState *s) const {
|
|
160
|
+
std::vector<misc::IntervalSet> look;
|
|
161
|
+
|
|
162
|
+
if (s == nullptr) {
|
|
163
|
+
return look;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
look.resize(s->transitions.size()); // Fills all interval sets with defaults.
|
|
167
|
+
for (size_t alt = 0; alt < s->transitions.size(); alt++) {
|
|
168
|
+
LL1AnalyzerImpl impl(_atn, look[alt], false, false);
|
|
169
|
+
impl.LOOK(s->transitions[alt]->target, nullptr, PredictionContext::EMPTY);
|
|
170
|
+
// Wipe out lookahead for this alternative if we found nothing
|
|
171
|
+
// or we had a predicate when we !seeThruPreds
|
|
172
|
+
if (look[alt].size() == 0 || look[alt].contains(LL1Analyzer::HIT_PRED)) {
|
|
173
|
+
look[alt].clear();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return look;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
misc::IntervalSet LL1Analyzer::LOOK(ATNState *s, RuleContext *ctx) const {
|
|
180
|
+
return LOOK(s, nullptr, ctx);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
misc::IntervalSet LL1Analyzer::LOOK(ATNState *s, ATNState *stopState, RuleContext *ctx) const {
|
|
184
|
+
Ref<const PredictionContext> lookContext = ctx != nullptr ? PredictionContext::fromRuleContext(_atn, ctx) : nullptr;
|
|
185
|
+
misc::IntervalSet r;
|
|
186
|
+
LL1AnalyzerImpl impl(_atn, r, true, true);
|
|
187
|
+
impl.LOOK(s, stopState, lookContext);
|
|
188
|
+
return r;
|
|
189
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
#include "atn/ATNConfig.h"
|
|
10
|
+
#include "atn/PredictionContext.h"
|
|
11
|
+
#include "support/BitSet.h"
|
|
12
|
+
|
|
13
|
+
namespace antlr4 {
|
|
14
|
+
namespace atn {
|
|
15
|
+
|
|
16
|
+
class ANTLR4CPP_PUBLIC LL1Analyzer final {
|
|
17
|
+
public:
|
|
18
|
+
/// Special value added to the lookahead sets to indicate that we hit
|
|
19
|
+
/// a predicate during analysis if {@code seeThruPreds==false}.
|
|
20
|
+
static constexpr size_t HIT_PRED = Token::INVALID_TYPE;
|
|
21
|
+
|
|
22
|
+
explicit LL1Analyzer(const atn::ATN &atn) : _atn(atn) {}
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
/// Calculates the SLL(1) expected lookahead set for each outgoing transition
|
|
26
|
+
/// of an <seealso cref="ATNState"/>. The returned array has one element for each
|
|
27
|
+
/// outgoing transition in {@code s}. If the closure from transition
|
|
28
|
+
/// <em>i</em> leads to a semantic predicate before matching a symbol, the
|
|
29
|
+
/// element at index <em>i</em> of the result will be {@code null}.
|
|
30
|
+
/// </summary>
|
|
31
|
+
/// <param name="s"> the ATN state </param>
|
|
32
|
+
/// <returns> the expected symbols for each outgoing transition of {@code s}. </returns>
|
|
33
|
+
std::vector<misc::IntervalSet> getDecisionLookahead(ATNState *s) const;
|
|
34
|
+
|
|
35
|
+
/// <summary>
|
|
36
|
+
/// Compute set of tokens that can follow {@code s} in the ATN in the
|
|
37
|
+
/// specified {@code ctx}.
|
|
38
|
+
/// <p/>
|
|
39
|
+
/// If {@code ctx} is {@code null} and the end of the rule containing
|
|
40
|
+
/// {@code s} is reached, <seealso cref="Token#EPSILON"/> is added to the result set.
|
|
41
|
+
/// If {@code ctx} is not {@code null} and the end of the outermost rule is
|
|
42
|
+
/// reached, <seealso cref="Token#EOF"/> is added to the result set.
|
|
43
|
+
/// </summary>
|
|
44
|
+
/// <param name="s"> the ATN state </param>
|
|
45
|
+
/// <param name="ctx"> the complete parser context, or {@code null} if the context
|
|
46
|
+
/// should be ignored
|
|
47
|
+
/// </param>
|
|
48
|
+
/// <returns> The set of tokens that can follow {@code s} in the ATN in the
|
|
49
|
+
/// specified {@code ctx}. </returns>
|
|
50
|
+
misc::IntervalSet LOOK(ATNState *s, RuleContext *ctx) const;
|
|
51
|
+
|
|
52
|
+
/// <summary>
|
|
53
|
+
/// Compute set of tokens that can follow {@code s} in the ATN in the
|
|
54
|
+
/// specified {@code ctx}.
|
|
55
|
+
/// <p/>
|
|
56
|
+
/// If {@code ctx} is {@code null} and the end of the rule containing
|
|
57
|
+
/// {@code s} is reached, <seealso cref="Token#EPSILON"/> is added to the result set.
|
|
58
|
+
/// If {@code ctx} is not {@code null} and the end of the outermost rule is
|
|
59
|
+
/// reached, <seealso cref="Token#EOF"/> is added to the result set.
|
|
60
|
+
/// </summary>
|
|
61
|
+
/// <param name="s"> the ATN state </param>
|
|
62
|
+
/// <param name="stopState"> the ATN state to stop at. This can be a
|
|
63
|
+
/// <seealso cref="BlockEndState"/> to detect epsilon paths through a closure. </param>
|
|
64
|
+
/// <param name="ctx"> the complete parser context, or {@code null} if the context
|
|
65
|
+
/// should be ignored
|
|
66
|
+
/// </param>
|
|
67
|
+
/// <returns> The set of tokens that can follow {@code s} in the ATN in the
|
|
68
|
+
/// specified {@code ctx}. </returns>
|
|
69
|
+
misc::IntervalSet LOOK(ATNState *s, ATNState *stopState, RuleContext *ctx) const;
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
const atn::ATN &_atn;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace atn
|
|
76
|
+
} // namespace antlr4
|
|
@@ -0,0 +1,67 @@
|
|
|
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 "misc/MurmurHash.h"
|
|
7
|
+
#include "atn/DecisionState.h"
|
|
8
|
+
#include "atn/PredictionContext.h"
|
|
9
|
+
#include "SemanticContext.h"
|
|
10
|
+
#include "atn/LexerActionExecutor.h"
|
|
11
|
+
|
|
12
|
+
#include "support/CPPUtils.h"
|
|
13
|
+
#include "support/Casts.h"
|
|
14
|
+
|
|
15
|
+
#include "atn/LexerATNConfig.h"
|
|
16
|
+
|
|
17
|
+
using namespace antlr4::atn;
|
|
18
|
+
using namespace antlrcpp;
|
|
19
|
+
|
|
20
|
+
LexerATNConfig::LexerATNConfig(ATNState *state, int alt, Ref<const PredictionContext> context)
|
|
21
|
+
: ATNConfig(state, alt, std::move(context)) {}
|
|
22
|
+
|
|
23
|
+
LexerATNConfig::LexerATNConfig(ATNState *state, int alt, Ref<const PredictionContext> context, Ref<const LexerActionExecutor> lexerActionExecutor)
|
|
24
|
+
: ATNConfig(state, alt, std::move(context)), _lexerActionExecutor(std::move(lexerActionExecutor)) {}
|
|
25
|
+
|
|
26
|
+
LexerATNConfig::LexerATNConfig(LexerATNConfig const& other, ATNState *state)
|
|
27
|
+
: ATNConfig(other, state), _lexerActionExecutor(other._lexerActionExecutor), _passedThroughNonGreedyDecision(checkNonGreedyDecision(other, state)) {}
|
|
28
|
+
|
|
29
|
+
LexerATNConfig::LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref<const LexerActionExecutor> lexerActionExecutor)
|
|
30
|
+
: ATNConfig(other, state), _lexerActionExecutor(std::move(lexerActionExecutor)), _passedThroughNonGreedyDecision(checkNonGreedyDecision(other, state)) {}
|
|
31
|
+
|
|
32
|
+
LexerATNConfig::LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref<const PredictionContext> context)
|
|
33
|
+
: ATNConfig(other, state, std::move(context)), _lexerActionExecutor(other._lexerActionExecutor), _passedThroughNonGreedyDecision(checkNonGreedyDecision(other, state)) {}
|
|
34
|
+
|
|
35
|
+
size_t LexerATNConfig::hashCode() const {
|
|
36
|
+
size_t hashCode = misc::MurmurHash::initialize(7);
|
|
37
|
+
hashCode = misc::MurmurHash::update(hashCode, state->stateNumber);
|
|
38
|
+
hashCode = misc::MurmurHash::update(hashCode, alt);
|
|
39
|
+
hashCode = misc::MurmurHash::update(hashCode, context);
|
|
40
|
+
hashCode = misc::MurmurHash::update(hashCode, semanticContext);
|
|
41
|
+
hashCode = misc::MurmurHash::update(hashCode, _passedThroughNonGreedyDecision ? 1 : 0);
|
|
42
|
+
hashCode = misc::MurmurHash::update(hashCode, _lexerActionExecutor);
|
|
43
|
+
hashCode = misc::MurmurHash::finish(hashCode, 6);
|
|
44
|
+
return hashCode;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
bool LexerATNConfig::operator==(const LexerATNConfig& other) const
|
|
48
|
+
{
|
|
49
|
+
if (this == &other)
|
|
50
|
+
return true;
|
|
51
|
+
|
|
52
|
+
if (_passedThroughNonGreedyDecision != other._passedThroughNonGreedyDecision)
|
|
53
|
+
return false;
|
|
54
|
+
|
|
55
|
+
if (_lexerActionExecutor == nullptr)
|
|
56
|
+
return other._lexerActionExecutor == nullptr;
|
|
57
|
+
if (*_lexerActionExecutor != *(other._lexerActionExecutor)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return ATNConfig::operator==(other);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
bool LexerATNConfig::checkNonGreedyDecision(LexerATNConfig const& source, ATNState *target) {
|
|
65
|
+
return source._passedThroughNonGreedyDecision ||
|
|
66
|
+
(DecisionState::is(target) && downCast<DecisionState*>(target)->nonGreedy);
|
|
67
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 "atn/ATNConfig.h"
|
|
9
|
+
|
|
10
|
+
namespace antlr4 {
|
|
11
|
+
namespace atn {
|
|
12
|
+
|
|
13
|
+
class ANTLR4CPP_PUBLIC LexerATNConfig final : public ATNConfig {
|
|
14
|
+
public:
|
|
15
|
+
LexerATNConfig(ATNState *state, int alt, Ref<const PredictionContext> context);
|
|
16
|
+
LexerATNConfig(ATNState *state, int alt, Ref<const PredictionContext> context, Ref<const LexerActionExecutor> lexerActionExecutor);
|
|
17
|
+
|
|
18
|
+
LexerATNConfig(LexerATNConfig const& other, ATNState *state);
|
|
19
|
+
LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref<const LexerActionExecutor> lexerActionExecutor);
|
|
20
|
+
LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref<const PredictionContext> context);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Gets the {@link LexerActionExecutor} capable of executing the embedded
|
|
24
|
+
* action(s) for the current configuration.
|
|
25
|
+
*/
|
|
26
|
+
const Ref<const LexerActionExecutor>& getLexerActionExecutor() const { return _lexerActionExecutor; }
|
|
27
|
+
bool hasPassedThroughNonGreedyDecision() const { return _passedThroughNonGreedyDecision; }
|
|
28
|
+
|
|
29
|
+
virtual size_t hashCode() const override;
|
|
30
|
+
|
|
31
|
+
bool operator==(const LexerATNConfig& other) const;
|
|
32
|
+
|
|
33
|
+
private:
|
|
34
|
+
/**
|
|
35
|
+
* This is the backing field for {@link #getLexerActionExecutor}.
|
|
36
|
+
*/
|
|
37
|
+
const Ref<const LexerActionExecutor> _lexerActionExecutor;
|
|
38
|
+
const bool _passedThroughNonGreedyDecision = false;
|
|
39
|
+
|
|
40
|
+
static bool checkNonGreedyDecision(LexerATNConfig const& source, ATNState *target);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
} // namespace atn
|
|
44
|
+
} // namespace antlr4
|