openpinescript 0.1.1__py3-none-any.whl
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.
- openpinescript/__init__.py +129 -0
- openpinescript/__main__.py +5 -0
- openpinescript/_cli.py +24 -0
- openpinescript/_engine/LICENSE +674 -0
- openpinescript/_engine/VERSION +1 -0
- openpinescript/_engine/dist/cli.mjs +108691 -0
- openpinescript/_engine/node_modules/antlr4ng/LICENSE.txt +29 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATN.cjs +3159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATN.js +3159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATN.mjs +3139 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNConfig.cjs +911 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNConfig.js +911 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNConfig.mjs +891 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNConfigSet.cjs +3781 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNConfigSet.js +3781 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNConfigSet.mjs +3761 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNDeserializationOptions.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNDeserializationOptions.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNDeserializationOptions.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNDeserializer.cjs +4300 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNDeserializer.js +4300 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNDeserializer.mjs +4280 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNSerializer.cjs +4798 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNSerializer.js +4798 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNSerializer.mjs +4778 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNSimulator.cjs +982 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNSimulator.js +982 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNSimulator.mjs +962 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNState.cjs +85 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNState.js +85 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ATNState.mjs +67 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AbstractPredicateTransition.cjs +78 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AbstractPredicateTransition.js +78 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AbstractPredicateTransition.mjs +58 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ActionTransition.cjs +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ActionTransition.js +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ActionTransition.mjs +76 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AmbiguityInfo.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AmbiguityInfo.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AmbiguityInfo.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ArrayPredictionContext.cjs +243 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ArrayPredictionContext.js +243 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ArrayPredictionContext.mjs +223 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AtomTransition.cjs +904 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AtomTransition.js +904 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/AtomTransition.mjs +884 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BasicBlockStartState.cjs +112 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BasicBlockStartState.js +112 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BasicBlockStartState.mjs +92 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BasicState.cjs +95 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BasicState.js +95 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BasicState.mjs +75 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BlockEndState.cjs +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BlockEndState.js +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BlockEndState.mjs +76 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BlockStartState.cjs +104 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BlockStartState.js +104 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/BlockStartState.mjs +84 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/CodePointTransitions.cjs +947 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/CodePointTransitions.js +947 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/CodePointTransitions.mjs +927 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ContextSensitivityInfo.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ContextSensitivityInfo.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ContextSensitivityInfo.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionEventInfo.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionEventInfo.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionEventInfo.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionInfo.cjs +206 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionInfo.js +206 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionInfo.mjs +188 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionState.cjs +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionState.js +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/DecisionState.mjs +76 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/EmptyPredictionContext.cjs +237 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/EmptyPredictionContext.js +237 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/EmptyPredictionContext.mjs +217 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/EpsilonTransition.cjs +103 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/EpsilonTransition.js +103 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/EpsilonTransition.mjs +83 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LL1Analyzer.cjs +3159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LL1Analyzer.js +3159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LL1Analyzer.mjs +3139 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerATNConfig.cjs +961 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerATNConfig.js +961 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerATNConfig.mjs +941 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerATNSimulator.cjs +5604 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerATNSimulator.js +5604 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerATNSimulator.mjs +5584 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerAction.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerAction.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerAction.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerActionExecutor.cjs +305 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerActionExecutor.js +305 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerActionExecutor.mjs +285 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerActionType.cjs +42 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerActionType.js +42 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerActionType.mjs +22 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerChannelAction.cjs +163 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerChannelAction.js +163 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerChannelAction.mjs +143 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerCustomAction.cjs +169 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerCustomAction.js +169 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerCustomAction.mjs +149 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerIndexedCustomAction.cjs +142 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerIndexedCustomAction.js +142 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerIndexedCustomAction.mjs +122 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerModeAction.cjs +163 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerModeAction.js +163 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerModeAction.mjs +143 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerMoreAction.cjs +73 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerMoreAction.js +73 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerMoreAction.mjs +53 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerPopModeAction.cjs +73 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerPopModeAction.js +73 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerPopModeAction.mjs +53 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerPushModeAction.cjs +163 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerPushModeAction.js +163 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerPushModeAction.mjs +143 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerSkipAction.cjs +71 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerSkipAction.js +71 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerSkipAction.mjs +51 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerTypeAction.cjs +159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerTypeAction.js +159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LexerTypeAction.mjs +139 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LookaheadEventInfo.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LookaheadEventInfo.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LookaheadEventInfo.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LoopEndState.cjs +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LoopEndState.js +96 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/LoopEndState.mjs +76 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/NotSetTransition.cjs +921 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/NotSetTransition.js +921 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/NotSetTransition.mjs +901 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/OrderedATNConfigSet.cjs +3824 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/OrderedATNConfigSet.js +3824 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/OrderedATNConfigSet.mjs +3804 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ParseInfo.cjs +156 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ParseInfo.js +156 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ParseInfo.mjs +138 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ParserATNSimulator.cjs +6082 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ParserATNSimulator.js +6082 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ParserATNSimulator.mjs +6062 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PlusBlockStartState.cjs +113 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PlusBlockStartState.js +113 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PlusBlockStartState.mjs +93 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PlusLoopbackState.cjs +104 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PlusLoopbackState.js +104 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PlusLoopbackState.mjs +84 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PrecedencePredicateTransition.cjs +887 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PrecedencePredicateTransition.js +887 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PrecedencePredicateTransition.mjs +867 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredicateEvalInfo.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredicateEvalInfo.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredicateEvalInfo.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredicateTransition.cjs +892 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredicateTransition.js +892 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredicateTransition.mjs +872 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContext.cjs +153 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContext.js +153 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContext.mjs +133 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContextCache.cjs +715 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContextCache.js +715 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContextCache.mjs +695 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContextUtils.cjs +3604 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContextUtils.js +3604 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionContextUtils.mjs +3584 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionMode.cjs +4284 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionMode.js +4284 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/PredictionMode.mjs +4264 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ProfilingATNSimulator.cjs +6467 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ProfilingATNSimulator.js +6467 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/ProfilingATNSimulator.mjs +6447 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RangeTransition.cjs +905 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RangeTransition.js +905 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RangeTransition.mjs +885 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleStartState.cjs +97 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleStartState.js +97 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleStartState.mjs +77 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleStopState.cjs +95 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleStopState.js +95 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleStopState.mjs +75 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleTransition.cjs +93 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleTransition.js +93 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/RuleTransition.mjs +73 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SemanticContext.cjs +807 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SemanticContext.js +807 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SemanticContext.mjs +787 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SetTransition.cjs +905 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SetTransition.js +905 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SetTransition.mjs +885 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SingletonPredictionContext.cjs +207 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SingletonPredictionContext.js +207 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/SingletonPredictionContext.mjs +187 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarBlockStartState.cjs +112 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarBlockStartState.js +112 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarBlockStartState.mjs +92 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarLoopEntryState.cjs +117 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarLoopEntryState.js +117 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarLoopEntryState.mjs +97 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarLoopbackState.cjs +95 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarLoopbackState.js +95 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/StarLoopbackState.mjs +75 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/TokensStartState.cjs +104 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/TokensStartState.js +104 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/TokensStartState.mjs +84 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/Transition.cjs +66 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/Transition.js +66 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/Transition.mjs +48 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/WildcardTransition.cjs +84 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/WildcardTransition.js +84 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/WildcardTransition.mjs +64 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/helpers.cjs +246 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/helpers.js +246 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/helpers.mjs +226 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/index.cjs +9485 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/index.js +9485 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/atn/index.mjs +9465 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFA.cjs +559 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFA.js +559 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFA.mjs +539 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFASerializer.cjs +76 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFASerializer.js +76 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFASerializer.mjs +58 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFAState.cjs +136 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFAState.js +136 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFAState.mjs +116 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFAStateEqualityComparator.cjs +150 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFAStateEqualityComparator.js +150 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/DFAStateEqualityComparator.mjs +130 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/LexerDFASerializer.cjs +237 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/LexerDFASerializer.js +237 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/LexerDFASerializer.mjs +217 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/PredPrediction.cjs +31 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/PredPrediction.js +31 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/PredPrediction.mjs +13 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/index.cjs +571 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/index.js +571 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/dfa/index.mjs +551 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/index.cjs +17501 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/index.mjs +17481 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/BitSet.cjs +208 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/BitSet.js +208 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/BitSet.mjs +190 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/DefaultEqualityComparator.cjs +68 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/DefaultEqualityComparator.js +68 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/DefaultEqualityComparator.mjs +48 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/EqualityComparator.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/EqualityComparator.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/EqualityComparator.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/HashMap.cjs +545 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/HashMap.js +545 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/HashMap.mjs +525 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/HashSet.cjs +438 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/HashSet.js +438 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/HashSet.mjs +418 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/InterpreterDataReader.cjs +4420 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/InterpreterDataReader.js +4420 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/InterpreterDataReader.mjs +4400 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/Interval.cjs +133 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/Interval.js +133 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/Interval.mjs +115 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/IntervalSet.cjs +834 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/IntervalSet.js +834 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/IntervalSet.mjs +814 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/MapKeyEqualityOperator.cjs +40 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/MapKeyEqualityOperator.js +40 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/MapKeyEqualityOperator.mjs +22 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/MultiMap.cjs +55 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/MultiMap.js +55 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/MultiMap.mjs +37 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/ObjectEqualityComparator.cjs +43 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/ObjectEqualityComparator.js +43 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/ObjectEqualityComparator.mjs +25 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/OrderedHashMap.cjs +610 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/OrderedHashMap.js +610 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/OrderedHashMap.mjs +590 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/OrderedHashSet.cjs +470 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/OrderedHashSet.js +470 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/OrderedHashSet.mjs +450 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/ParseCancellationException.cjs +34 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/ParseCancellationException.js +34 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/ParseCancellationException.mjs +16 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/index.cjs +4643 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/index.js +4643 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/misc/index.mjs +4623 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/AbstractParseTreeVisitor.cjs +63 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/AbstractParseTreeVisitor.js +63 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/AbstractParseTreeVisitor.mjs +45 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ErrorNode.cjs +211 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ErrorNode.js +211 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ErrorNode.mjs +191 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTree.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTree.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTree.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeListener.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeListener.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeListener.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeVisitor.cjs +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeVisitor.js +17 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeVisitor.mjs +0 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeWalker.cjs +267 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeWalker.js +267 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/ParseTreeWalker.mjs +247 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/TerminalNode.cjs +201 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/TerminalNode.js +201 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/TerminalNode.mjs +181 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/Trees.cjs +3159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/Trees.js +3159 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/Trees.mjs +3139 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/index.cjs +16018 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/index.js +16018 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/tree/index.mjs +15998 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/DoubleDict.cjs +568 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/DoubleDict.js +568 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/DoubleDict.mjs +548 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/MurmurHash.cjs +98 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/MurmurHash.js +98 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/MurmurHash.mjs +80 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/helpers.cjs +78 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/helpers.js +78 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/helpers.mjs +60 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/index.cjs +625 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/index.js +625 -0
- openpinescript/_engine/node_modules/antlr4ng/dist/utils/index.mjs +605 -0
- openpinescript/_engine/node_modules/antlr4ng/package.json +72 -0
- openpinescript/_engine/package.json +94 -0
- openpinescript/_runtime.py +29 -0
- openpinescript-0.1.1.dist-info/METADATA +140 -0
- openpinescript-0.1.1.dist-info/RECORD +332 -0
- openpinescript-0.1.1.dist-info/WHEEL +4 -0
- openpinescript-0.1.1.dist-info/entry_points.txt +2 -0
- openpinescript-0.1.1.dist-info/licenses/LICENSE +674 -0
|
@@ -0,0 +1,885 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/IntStream.ts
|
|
5
|
+
var IntStream;
|
|
6
|
+
((IntStream2) => {
|
|
7
|
+
IntStream2.EOF = -1;
|
|
8
|
+
IntStream2.UNKNOWN_SOURCE_NAME = "<unknown>";
|
|
9
|
+
})(IntStream || (IntStream = {}));
|
|
10
|
+
|
|
11
|
+
// src/Token.ts
|
|
12
|
+
var Token;
|
|
13
|
+
((Token2) => {
|
|
14
|
+
Token2.INVALID_TYPE = 0;
|
|
15
|
+
Token2.EPSILON = -2;
|
|
16
|
+
Token2.MIN_USER_TOKEN_TYPE = 1;
|
|
17
|
+
Token2.EOF = IntStream.EOF;
|
|
18
|
+
Token2.DEFAULT_CHANNEL = 0;
|
|
19
|
+
Token2.HIDDEN_CHANNEL = 1;
|
|
20
|
+
Token2.MIN_USER_CHANNEL_VALUE = 2;
|
|
21
|
+
})(Token || (Token = {}));
|
|
22
|
+
|
|
23
|
+
// src/misc/Interval.ts
|
|
24
|
+
var Interval = class _Interval {
|
|
25
|
+
static {
|
|
26
|
+
__name(this, "Interval");
|
|
27
|
+
}
|
|
28
|
+
static INVALID_INTERVAL = new _Interval(-1, -2);
|
|
29
|
+
static INTERVAL_POOL_MAX_VALUE = 1e3;
|
|
30
|
+
static cache = [];
|
|
31
|
+
start;
|
|
32
|
+
stop;
|
|
33
|
+
cachedHashCode;
|
|
34
|
+
constructor(start, stop) {
|
|
35
|
+
this.start = start;
|
|
36
|
+
this.stop = stop;
|
|
37
|
+
this.cachedHashCode = Math.imul(651 + start, 31) + stop;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new interval from the given values.
|
|
41
|
+
*
|
|
42
|
+
* Interval objects are used readonly so share all with the
|
|
43
|
+
* same single value a==b up to some max size. Use an array as a perfect hash.
|
|
44
|
+
* Return shared object for 0..INTERVAL_POOL_MAX_VALUE or a new
|
|
45
|
+
* Interval object with a..a in it. On Java.g4, 218623 IntervalSets
|
|
46
|
+
* have a..a (set with 1 element).
|
|
47
|
+
*
|
|
48
|
+
* @param a The start of the interval.
|
|
49
|
+
* @param b The end of the interval (inclusive).
|
|
50
|
+
*
|
|
51
|
+
* @returns A cached or new interval.
|
|
52
|
+
*/
|
|
53
|
+
static of(a, b) {
|
|
54
|
+
if (a !== b || a < 0 || a > _Interval.INTERVAL_POOL_MAX_VALUE) {
|
|
55
|
+
return new _Interval(a, b);
|
|
56
|
+
}
|
|
57
|
+
if (!_Interval.cache[a]) {
|
|
58
|
+
_Interval.cache[a] = new _Interval(a, a);
|
|
59
|
+
}
|
|
60
|
+
return _Interval.cache[a];
|
|
61
|
+
}
|
|
62
|
+
equals(o) {
|
|
63
|
+
return this.start === o.start && this.stop === o.stop;
|
|
64
|
+
}
|
|
65
|
+
hashCode() {
|
|
66
|
+
return this.cachedHashCode;
|
|
67
|
+
}
|
|
68
|
+
/** Does this start completely before other? Disjoint */
|
|
69
|
+
startsBeforeDisjoint(other) {
|
|
70
|
+
return this.start < other.start && this.stop < other.start;
|
|
71
|
+
}
|
|
72
|
+
/** Does this start at or before other? Nondisjoint */
|
|
73
|
+
startsBeforeNonDisjoint(other) {
|
|
74
|
+
return this.start <= other.start && this.stop >= other.start;
|
|
75
|
+
}
|
|
76
|
+
/** Does this.start start after other.stop? May or may not be disjoint */
|
|
77
|
+
startsAfter(other) {
|
|
78
|
+
return this.start > other.start;
|
|
79
|
+
}
|
|
80
|
+
/** Does this start completely after other? Disjoint */
|
|
81
|
+
startsAfterDisjoint(other) {
|
|
82
|
+
return this.start > other.stop;
|
|
83
|
+
}
|
|
84
|
+
/** Does this start after other? NonDisjoint */
|
|
85
|
+
startsAfterNonDisjoint(other) {
|
|
86
|
+
return this.start > other.start && this.start <= other.stop;
|
|
87
|
+
}
|
|
88
|
+
/** Are both ranges disjoint? I.e., no overlap? */
|
|
89
|
+
disjoint(other) {
|
|
90
|
+
return this.startsBeforeDisjoint(other) || this.startsAfterDisjoint(other);
|
|
91
|
+
}
|
|
92
|
+
/** Are two intervals adjacent such as 0..41 and 42..42? */
|
|
93
|
+
adjacent(other) {
|
|
94
|
+
return this.start === other.stop + 1 || this.stop === other.start - 1;
|
|
95
|
+
}
|
|
96
|
+
properlyContains(other) {
|
|
97
|
+
return other.start >= this.start && other.stop <= this.stop;
|
|
98
|
+
}
|
|
99
|
+
/** Return the interval computed from combining this and other */
|
|
100
|
+
union(other) {
|
|
101
|
+
return _Interval.of(Math.min(this.start, other.start), Math.max(this.stop, other.stop));
|
|
102
|
+
}
|
|
103
|
+
/** Return the interval in common between this and o */
|
|
104
|
+
intersection(other) {
|
|
105
|
+
return _Interval.of(Math.max(this.start, other.start), Math.min(this.stop, other.stop));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Return the interval with elements from this not in other;
|
|
109
|
+
* other must not be totally enclosed (properly contained)
|
|
110
|
+
* within this, which would result in two disjoint intervals
|
|
111
|
+
* instead of the single one returned by this method.
|
|
112
|
+
*/
|
|
113
|
+
differenceNotProperlyContained(other) {
|
|
114
|
+
let diff = null;
|
|
115
|
+
if (other.startsBeforeNonDisjoint(this)) {
|
|
116
|
+
diff = _Interval.of(Math.max(this.start, other.stop + 1), this.stop);
|
|
117
|
+
} else if (other.startsAfterNonDisjoint(this)) {
|
|
118
|
+
diff = _Interval.of(this.start, other.start - 1);
|
|
119
|
+
}
|
|
120
|
+
return diff;
|
|
121
|
+
}
|
|
122
|
+
toString() {
|
|
123
|
+
return `${this.start}..${this.stop}`;
|
|
124
|
+
}
|
|
125
|
+
get length() {
|
|
126
|
+
if (this.stop < this.start) {
|
|
127
|
+
return 0;
|
|
128
|
+
}
|
|
129
|
+
return this.stop - this.start + 1;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// src/Vocabulary.ts
|
|
134
|
+
var Vocabulary = class _Vocabulary {
|
|
135
|
+
static {
|
|
136
|
+
__name(this, "Vocabulary");
|
|
137
|
+
}
|
|
138
|
+
static EMPTY_NAMES = [];
|
|
139
|
+
/**
|
|
140
|
+
* Gets an empty {@link Vocabulary} instance.
|
|
141
|
+
*
|
|
142
|
+
*
|
|
143
|
+
* No literal or symbol names are assigned to token types, so
|
|
144
|
+
* {@link #getDisplayName(int)} returns the numeric value for all tokens
|
|
145
|
+
* except {@link Token#EOF}.
|
|
146
|
+
*/
|
|
147
|
+
static EMPTY_VOCABULARY = new _Vocabulary(_Vocabulary.EMPTY_NAMES, _Vocabulary.EMPTY_NAMES, _Vocabulary.EMPTY_NAMES);
|
|
148
|
+
maxTokenType;
|
|
149
|
+
literalNames;
|
|
150
|
+
symbolicNames;
|
|
151
|
+
displayNames;
|
|
152
|
+
/**
|
|
153
|
+
* Constructs a new instance of {@link Vocabulary} from the specified
|
|
154
|
+
* literal, symbolic, and display token names.
|
|
155
|
+
*
|
|
156
|
+
* @param literalNames The literal names assigned to tokens, or `null`
|
|
157
|
+
* if no literal names are assigned.
|
|
158
|
+
* @param symbolicNames The symbolic names assigned to tokens, or
|
|
159
|
+
* `null` if no symbolic names are assigned.
|
|
160
|
+
* @param displayNames The display names assigned to tokens, or `null`
|
|
161
|
+
* to use the values in `literalNames` and `symbolicNames` as
|
|
162
|
+
* the source of display names, as described in
|
|
163
|
+
* {@link #getDisplayName(int)}.
|
|
164
|
+
*/
|
|
165
|
+
constructor(literalNames, symbolicNames, displayNames) {
|
|
166
|
+
this.literalNames = literalNames ?? _Vocabulary.EMPTY_NAMES;
|
|
167
|
+
this.symbolicNames = symbolicNames ?? _Vocabulary.EMPTY_NAMES;
|
|
168
|
+
this.displayNames = displayNames ?? _Vocabulary.EMPTY_NAMES;
|
|
169
|
+
this.maxTokenType = Math.max(this.displayNames.length, Math.max(
|
|
170
|
+
this.literalNames.length,
|
|
171
|
+
this.symbolicNames.length
|
|
172
|
+
)) - 1;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Returns a {@link Vocabulary} instance from the specified set of token
|
|
176
|
+
* names. This method acts as a compatibility layer for the single
|
|
177
|
+
* `tokenNames` array generated by previous releases of ANTLR.
|
|
178
|
+
*
|
|
179
|
+
* The resulting vocabulary instance returns `null` for
|
|
180
|
+
* {@link getLiteralName getLiteralName(int)} and {@link getSymbolicName getSymbolicName(int)}, and the
|
|
181
|
+
* value from `tokenNames` for the display names.
|
|
182
|
+
*
|
|
183
|
+
* @param tokenNames The token names, or `null` if no token names are
|
|
184
|
+
* available.
|
|
185
|
+
* @returns A {@link Vocabulary} instance which uses `tokenNames` for
|
|
186
|
+
* the display names of tokens.
|
|
187
|
+
*/
|
|
188
|
+
static fromTokenNames(tokenNames) {
|
|
189
|
+
if (tokenNames == null || tokenNames.length === 0) {
|
|
190
|
+
return _Vocabulary.EMPTY_VOCABULARY;
|
|
191
|
+
}
|
|
192
|
+
const literalNames = [...tokenNames];
|
|
193
|
+
const symbolicNames = [...tokenNames];
|
|
194
|
+
for (let i = 0; i < tokenNames.length; i++) {
|
|
195
|
+
const tokenName = tokenNames[i];
|
|
196
|
+
if (tokenName == null) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (tokenName.length > 0) {
|
|
200
|
+
const firstChar = tokenName.codePointAt(0);
|
|
201
|
+
if (firstChar === 39) {
|
|
202
|
+
symbolicNames[i] = null;
|
|
203
|
+
continue;
|
|
204
|
+
} else if (firstChar >= 65 && firstChar <= 90) {
|
|
205
|
+
literalNames[i] = null;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
literalNames[i] = null;
|
|
210
|
+
symbolicNames[i] = null;
|
|
211
|
+
}
|
|
212
|
+
return new _Vocabulary(literalNames, symbolicNames, tokenNames);
|
|
213
|
+
}
|
|
214
|
+
getMaxTokenType() {
|
|
215
|
+
return this.maxTokenType;
|
|
216
|
+
}
|
|
217
|
+
getLiteralName(tokenType) {
|
|
218
|
+
if (tokenType >= 0 && tokenType < this.literalNames.length) {
|
|
219
|
+
return this.literalNames[tokenType];
|
|
220
|
+
}
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
getSymbolicName(tokenType) {
|
|
224
|
+
if (tokenType >= 0 && tokenType < this.symbolicNames.length) {
|
|
225
|
+
return this.symbolicNames[tokenType];
|
|
226
|
+
}
|
|
227
|
+
if (tokenType === Token.EOF) {
|
|
228
|
+
return "EOF";
|
|
229
|
+
}
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
getDisplayName(tokenType) {
|
|
233
|
+
if (tokenType >= 0 && tokenType < this.displayNames.length) {
|
|
234
|
+
const displayName = this.displayNames[tokenType];
|
|
235
|
+
if (displayName != null) {
|
|
236
|
+
return displayName;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const literalName = this.getLiteralName(tokenType);
|
|
240
|
+
if (literalName != null) {
|
|
241
|
+
return literalName;
|
|
242
|
+
}
|
|
243
|
+
const symbolicName = this.getSymbolicName(tokenType);
|
|
244
|
+
if (symbolicName != null) {
|
|
245
|
+
return symbolicName;
|
|
246
|
+
}
|
|
247
|
+
return `${tokenType}`;
|
|
248
|
+
}
|
|
249
|
+
getLiteralNames() {
|
|
250
|
+
return this.literalNames;
|
|
251
|
+
}
|
|
252
|
+
getSymbolicNames() {
|
|
253
|
+
return this.symbolicNames;
|
|
254
|
+
}
|
|
255
|
+
getDisplayNames() {
|
|
256
|
+
return this.displayNames;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
// src/utils/MurmurHash.ts
|
|
261
|
+
var c1 = 3432918353;
|
|
262
|
+
var c2 = 461845907;
|
|
263
|
+
var r1 = 15;
|
|
264
|
+
var r2 = 13;
|
|
265
|
+
var m = 5;
|
|
266
|
+
var n = 3864292196;
|
|
267
|
+
var MurmurHash = class _MurmurHash {
|
|
268
|
+
static {
|
|
269
|
+
__name(this, "MurmurHash");
|
|
270
|
+
}
|
|
271
|
+
static defaultSeed = 701;
|
|
272
|
+
constructor() {
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Initialize the hash using the specified {@code seed}.
|
|
276
|
+
*
|
|
277
|
+
* @param seed the seed
|
|
278
|
+
*
|
|
279
|
+
* @returns the intermediate hash value
|
|
280
|
+
*/
|
|
281
|
+
static initialize(seed = _MurmurHash.defaultSeed) {
|
|
282
|
+
return seed;
|
|
283
|
+
}
|
|
284
|
+
static updateFromComparable(hash, value) {
|
|
285
|
+
return this.update(hash, value?.hashCode() ?? 0);
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Update the intermediate hash value for the next input {@code value}.
|
|
289
|
+
*
|
|
290
|
+
* @param hash The intermediate hash value.
|
|
291
|
+
* @param value the value to add to the current hash.
|
|
292
|
+
*
|
|
293
|
+
* @returns the updated intermediate hash value
|
|
294
|
+
*/
|
|
295
|
+
static update(hash, value) {
|
|
296
|
+
value = Math.imul(value, c1);
|
|
297
|
+
value = value << r1 | value >>> 32 - r1;
|
|
298
|
+
value = Math.imul(value, c2);
|
|
299
|
+
hash = hash ^ value;
|
|
300
|
+
hash = hash << r2 | hash >>> 32 - r2;
|
|
301
|
+
hash = Math.imul(hash, m) + n;
|
|
302
|
+
return hash;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Apply the final computation steps to the intermediate value {@code hash}
|
|
306
|
+
* to form the final result of the MurmurHash 3 hash function.
|
|
307
|
+
*
|
|
308
|
+
* @param hash The intermediate hash value.
|
|
309
|
+
* @param entryCount The number of values added to the hash.
|
|
310
|
+
*
|
|
311
|
+
* @returns the final hash result
|
|
312
|
+
*/
|
|
313
|
+
static finish(hash, entryCount) {
|
|
314
|
+
hash ^= entryCount * 4;
|
|
315
|
+
hash ^= hash >>> 16;
|
|
316
|
+
hash = Math.imul(hash, 2246822507);
|
|
317
|
+
hash ^= hash >>> 13;
|
|
318
|
+
hash = Math.imul(hash, 3266489909);
|
|
319
|
+
hash ^= hash >>> 16;
|
|
320
|
+
return hash;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* An all-in-one convenience method to compute a hash for a single value.
|
|
324
|
+
*
|
|
325
|
+
* @param value The value to hash.
|
|
326
|
+
* @param seed The seed for the hash value.
|
|
327
|
+
*
|
|
328
|
+
* @returns The computed hash.
|
|
329
|
+
*/
|
|
330
|
+
static hashCode(value, seed) {
|
|
331
|
+
return _MurmurHash.finish(_MurmurHash.update(seed ?? _MurmurHash.defaultSeed, value), 1);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
// src/misc/IntervalSet.ts
|
|
336
|
+
var IntervalSet = class _IntervalSet {
|
|
337
|
+
static {
|
|
338
|
+
__name(this, "IntervalSet");
|
|
339
|
+
}
|
|
340
|
+
/** The list of sorted, disjoint intervals. */
|
|
341
|
+
intervals = [];
|
|
342
|
+
cachedHashCode;
|
|
343
|
+
constructor(set) {
|
|
344
|
+
if (set) {
|
|
345
|
+
if (Array.isArray(set)) {
|
|
346
|
+
for (const el of set) {
|
|
347
|
+
this.addOne(el);
|
|
348
|
+
}
|
|
349
|
+
} else {
|
|
350
|
+
this.addSet(set);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/** Create a set with all ints within range [a..b] (inclusive) */
|
|
355
|
+
static of(a, b) {
|
|
356
|
+
const s = new _IntervalSet();
|
|
357
|
+
s.addRange(a, b);
|
|
358
|
+
return s;
|
|
359
|
+
}
|
|
360
|
+
/** Combine all sets in the array and return the union of them */
|
|
361
|
+
static or(sets) {
|
|
362
|
+
const result = new _IntervalSet();
|
|
363
|
+
for (const set of sets) {
|
|
364
|
+
result.addSet(set);
|
|
365
|
+
}
|
|
366
|
+
return result;
|
|
367
|
+
}
|
|
368
|
+
[Symbol.iterator]() {
|
|
369
|
+
return this.intervals[Symbol.iterator]();
|
|
370
|
+
}
|
|
371
|
+
get(index) {
|
|
372
|
+
return this.intervals[index];
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Returns the minimum value contained in the set if not isNil().
|
|
376
|
+
*
|
|
377
|
+
* @returns the minimum value contained in the set.
|
|
378
|
+
*/
|
|
379
|
+
get minElement() {
|
|
380
|
+
if (this.intervals.length === 0) {
|
|
381
|
+
return Token.INVALID_TYPE;
|
|
382
|
+
}
|
|
383
|
+
return this.intervals[0].start;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Returns the maximum value contained in the set if not isNil().
|
|
387
|
+
*
|
|
388
|
+
* @returns the maximum value contained in the set.
|
|
389
|
+
*/
|
|
390
|
+
get maxElement() {
|
|
391
|
+
if (this.intervals.length === 0) {
|
|
392
|
+
return Token.INVALID_TYPE;
|
|
393
|
+
}
|
|
394
|
+
return this.intervals[this.intervals.length - 1].stop;
|
|
395
|
+
}
|
|
396
|
+
clear() {
|
|
397
|
+
this.cachedHashCode = void 0;
|
|
398
|
+
this.intervals = [];
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Add a single element to the set. An isolated element is stored
|
|
402
|
+
* as a range el..el.
|
|
403
|
+
*/
|
|
404
|
+
addOne(v) {
|
|
405
|
+
this.addInterval(new Interval(v, v));
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Add interval; i.e., add all integers from a to b to set.
|
|
409
|
+
* If b < a, do nothing.
|
|
410
|
+
* Keep list in sorted order (by left range value).
|
|
411
|
+
* If overlap, combine ranges. For example,
|
|
412
|
+
* If this is {1..5, 10..20}, adding 6..7 yields
|
|
413
|
+
* {1..5, 6..7, 10..20}. Adding 4..8 yields {1..8, 10..20}.
|
|
414
|
+
*/
|
|
415
|
+
addRange(l, h) {
|
|
416
|
+
this.addInterval(new Interval(l, h));
|
|
417
|
+
}
|
|
418
|
+
addInterval(addition) {
|
|
419
|
+
this.cachedHashCode = void 0;
|
|
420
|
+
if (this.intervals.length === 0) {
|
|
421
|
+
this.intervals.push(addition);
|
|
422
|
+
} else {
|
|
423
|
+
for (let pos = 0; pos < this.intervals.length; pos++) {
|
|
424
|
+
const existing = this.intervals[pos];
|
|
425
|
+
if (addition.equals(existing)) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (addition.adjacent(existing) || !addition.disjoint(existing)) {
|
|
429
|
+
const bigger = addition.union(existing);
|
|
430
|
+
this.intervals[pos] = bigger;
|
|
431
|
+
for (let sub = pos + 1; sub < this.intervals.length; ) {
|
|
432
|
+
const next = this.intervals[sub];
|
|
433
|
+
if (!bigger.adjacent(next) && bigger.disjoint(next)) {
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
this.intervals.splice(sub, 1);
|
|
437
|
+
this.intervals[pos] = bigger.union(next);
|
|
438
|
+
}
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
if (addition.startsBeforeDisjoint(existing)) {
|
|
442
|
+
this.intervals.splice(pos, 0, addition);
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
this.intervals.push(addition);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
addSet(other) {
|
|
450
|
+
other.intervals.forEach((toAdd) => {
|
|
451
|
+
return this.addInterval(toAdd);
|
|
452
|
+
}, this);
|
|
453
|
+
return this;
|
|
454
|
+
}
|
|
455
|
+
complementWithVocabulary(vocabulary) {
|
|
456
|
+
const result = new _IntervalSet();
|
|
457
|
+
if (!vocabulary) {
|
|
458
|
+
return result;
|
|
459
|
+
}
|
|
460
|
+
if (vocabulary.length === 0) {
|
|
461
|
+
return result;
|
|
462
|
+
}
|
|
463
|
+
result.addSet(vocabulary);
|
|
464
|
+
return result.subtract(this);
|
|
465
|
+
}
|
|
466
|
+
complement(minElement, maxElement) {
|
|
467
|
+
const result = new _IntervalSet();
|
|
468
|
+
result.addInterval(new Interval(minElement, maxElement));
|
|
469
|
+
return result.subtract(this);
|
|
470
|
+
}
|
|
471
|
+
/** combine all sets in the array returned the or'd value */
|
|
472
|
+
or(sets) {
|
|
473
|
+
const result = new _IntervalSet();
|
|
474
|
+
result.addSet(this);
|
|
475
|
+
sets.forEach((set) => {
|
|
476
|
+
return result.addSet(set);
|
|
477
|
+
});
|
|
478
|
+
return result;
|
|
479
|
+
}
|
|
480
|
+
and(other) {
|
|
481
|
+
if (other.length === 0) {
|
|
482
|
+
return new _IntervalSet();
|
|
483
|
+
}
|
|
484
|
+
const myIntervals = this.intervals;
|
|
485
|
+
const theirIntervals = other.intervals;
|
|
486
|
+
let intersection;
|
|
487
|
+
const mySize = myIntervals.length;
|
|
488
|
+
const theirSize = theirIntervals.length;
|
|
489
|
+
let i = 0;
|
|
490
|
+
let j = 0;
|
|
491
|
+
while (i < mySize && j < theirSize) {
|
|
492
|
+
const mine = myIntervals[i];
|
|
493
|
+
const theirs = theirIntervals[j];
|
|
494
|
+
if (mine.startsBeforeDisjoint(theirs)) {
|
|
495
|
+
i++;
|
|
496
|
+
} else if (theirs.startsBeforeDisjoint(mine)) {
|
|
497
|
+
j++;
|
|
498
|
+
} else if (mine.properlyContains(theirs)) {
|
|
499
|
+
if (!intersection) {
|
|
500
|
+
intersection = new _IntervalSet();
|
|
501
|
+
}
|
|
502
|
+
intersection.addInterval(mine.intersection(theirs));
|
|
503
|
+
j++;
|
|
504
|
+
} else if (theirs.properlyContains(mine)) {
|
|
505
|
+
if (!intersection) {
|
|
506
|
+
intersection = new _IntervalSet();
|
|
507
|
+
}
|
|
508
|
+
intersection.addInterval(mine.intersection(theirs));
|
|
509
|
+
i++;
|
|
510
|
+
} else if (!mine.disjoint(theirs)) {
|
|
511
|
+
if (!intersection) {
|
|
512
|
+
intersection = new _IntervalSet();
|
|
513
|
+
}
|
|
514
|
+
intersection.addInterval(mine.intersection(theirs));
|
|
515
|
+
if (mine.startsAfterNonDisjoint(theirs)) {
|
|
516
|
+
j++;
|
|
517
|
+
} else if (theirs.startsAfterNonDisjoint(mine)) {
|
|
518
|
+
i++;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
if (!intersection) {
|
|
523
|
+
return new _IntervalSet();
|
|
524
|
+
}
|
|
525
|
+
return intersection;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Compute the set difference between two interval sets. The specific
|
|
529
|
+
* operation is `left - right`. If either of the input sets is
|
|
530
|
+
* `null`, it is treated as though it was an empty set.
|
|
531
|
+
*/
|
|
532
|
+
subtract(other) {
|
|
533
|
+
if (this.length === 0) {
|
|
534
|
+
return new _IntervalSet();
|
|
535
|
+
}
|
|
536
|
+
const result = new _IntervalSet(this);
|
|
537
|
+
if (other.length === 0) {
|
|
538
|
+
return result;
|
|
539
|
+
}
|
|
540
|
+
let resultI = 0;
|
|
541
|
+
let rightI = 0;
|
|
542
|
+
while (resultI < result.intervals.length && rightI < other.intervals.length) {
|
|
543
|
+
const resultInterval = result.intervals[resultI];
|
|
544
|
+
const rightInterval = other.intervals[rightI];
|
|
545
|
+
if (rightInterval.stop < resultInterval.start) {
|
|
546
|
+
rightI++;
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
549
|
+
if (rightInterval.start > resultInterval.stop) {
|
|
550
|
+
resultI++;
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
let beforeCurrent;
|
|
554
|
+
let afterCurrent;
|
|
555
|
+
if (rightInterval.start > resultInterval.start) {
|
|
556
|
+
beforeCurrent = new Interval(resultInterval.start, rightInterval.start - 1);
|
|
557
|
+
}
|
|
558
|
+
if (rightInterval.stop < resultInterval.stop) {
|
|
559
|
+
afterCurrent = new Interval(rightInterval.stop + 1, resultInterval.stop);
|
|
560
|
+
}
|
|
561
|
+
if (beforeCurrent) {
|
|
562
|
+
if (afterCurrent) {
|
|
563
|
+
result.intervals[resultI] = beforeCurrent;
|
|
564
|
+
result.intervals.splice(resultI + 1, 0, afterCurrent);
|
|
565
|
+
resultI++;
|
|
566
|
+
rightI++;
|
|
567
|
+
} else {
|
|
568
|
+
result.intervals[resultI] = beforeCurrent;
|
|
569
|
+
resultI++;
|
|
570
|
+
}
|
|
571
|
+
} else {
|
|
572
|
+
if (afterCurrent) {
|
|
573
|
+
result.intervals[resultI] = afterCurrent;
|
|
574
|
+
rightI++;
|
|
575
|
+
} else {
|
|
576
|
+
result.intervals.splice(resultI, 1);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return result;
|
|
581
|
+
}
|
|
582
|
+
contains(el) {
|
|
583
|
+
const n2 = this.intervals.length;
|
|
584
|
+
let l = 0;
|
|
585
|
+
let r = n2 - 1;
|
|
586
|
+
while (l <= r) {
|
|
587
|
+
const m2 = Math.floor((l + r) / 2);
|
|
588
|
+
const interval = this.intervals[m2];
|
|
589
|
+
if (interval.stop < el) {
|
|
590
|
+
l = m2 + 1;
|
|
591
|
+
} else if (interval.start > el) {
|
|
592
|
+
r = m2 - 1;
|
|
593
|
+
} else {
|
|
594
|
+
return true;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
599
|
+
removeRange(toRemove) {
|
|
600
|
+
this.cachedHashCode = void 0;
|
|
601
|
+
if (toRemove.start === toRemove.stop) {
|
|
602
|
+
this.removeOne(toRemove.start);
|
|
603
|
+
} else if (this.intervals !== null) {
|
|
604
|
+
let pos = 0;
|
|
605
|
+
for (const existing of this.intervals) {
|
|
606
|
+
if (toRemove.stop <= existing.start) {
|
|
607
|
+
return;
|
|
608
|
+
} else if (toRemove.start > existing.start && toRemove.stop < existing.stop) {
|
|
609
|
+
this.intervals[pos] = new Interval(existing.start, toRemove.start);
|
|
610
|
+
const x = new Interval(toRemove.stop, existing.stop);
|
|
611
|
+
this.intervals.splice(pos, 0, x);
|
|
612
|
+
return;
|
|
613
|
+
} else if (toRemove.start <= existing.start && toRemove.stop >= existing.stop) {
|
|
614
|
+
this.intervals.splice(pos, 1);
|
|
615
|
+
pos = pos - 1;
|
|
616
|
+
} else if (toRemove.start < existing.stop) {
|
|
617
|
+
this.intervals[pos] = new Interval(existing.start, toRemove.start);
|
|
618
|
+
} else if (toRemove.stop < existing.stop) {
|
|
619
|
+
this.intervals[pos] = new Interval(toRemove.stop, existing.stop);
|
|
620
|
+
}
|
|
621
|
+
pos += 1;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
removeOne(value) {
|
|
626
|
+
this.cachedHashCode = void 0;
|
|
627
|
+
for (let i = 0; i < this.intervals.length; i++) {
|
|
628
|
+
const existing = this.intervals[i];
|
|
629
|
+
if (value < existing.start) {
|
|
630
|
+
return;
|
|
631
|
+
} else if (value === existing.start && value === existing.stop) {
|
|
632
|
+
this.intervals.splice(i, 1);
|
|
633
|
+
return;
|
|
634
|
+
} else if (value === existing.start) {
|
|
635
|
+
this.intervals[i] = new Interval(existing.start + 1, existing.stop);
|
|
636
|
+
return;
|
|
637
|
+
} else if (value === existing.stop) {
|
|
638
|
+
this.intervals[i] = new Interval(existing.start, existing.stop - 1);
|
|
639
|
+
return;
|
|
640
|
+
} else if (value < existing.stop) {
|
|
641
|
+
const replace = new Interval(existing.start, value - 1);
|
|
642
|
+
this.intervals[i] = new Interval(value + 1, existing.stop);
|
|
643
|
+
this.intervals.splice(i, 0, replace);
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
hashCode() {
|
|
649
|
+
if (this.cachedHashCode === void 0) {
|
|
650
|
+
let hash = MurmurHash.initialize();
|
|
651
|
+
for (const interval of this.intervals) {
|
|
652
|
+
hash = MurmurHash.update(hash, interval.start);
|
|
653
|
+
hash = MurmurHash.update(hash, interval.stop);
|
|
654
|
+
}
|
|
655
|
+
this.cachedHashCode = MurmurHash.finish(hash, this.intervals.length * 2);
|
|
656
|
+
}
|
|
657
|
+
return this.cachedHashCode;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Are two IntervalSets equal? Because all intervals are sorted and disjoint, equals is a simple linear walk over
|
|
661
|
+
* both lists to make sure they are the same. Interval.equals() is used by the List.equals() method to check
|
|
662
|
+
* the ranges.
|
|
663
|
+
*/
|
|
664
|
+
equals(other) {
|
|
665
|
+
if (this === other) {
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
if (this.intervals.length !== other.intervals.length) {
|
|
669
|
+
return false;
|
|
670
|
+
}
|
|
671
|
+
for (let i = 0; i < this.intervals.length; i++) {
|
|
672
|
+
if (!this.intervals[i].equals(other.intervals[i])) {
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
toString(elementsAreChar) {
|
|
679
|
+
if (this.intervals.length === 0) {
|
|
680
|
+
return "{}";
|
|
681
|
+
}
|
|
682
|
+
let result = "";
|
|
683
|
+
if (this.length > 1) {
|
|
684
|
+
result += "{";
|
|
685
|
+
}
|
|
686
|
+
for (let i = 0; i < this.intervals.length; ++i) {
|
|
687
|
+
const interval = this.intervals[i];
|
|
688
|
+
const start = interval.start;
|
|
689
|
+
const stop = interval.stop;
|
|
690
|
+
if (start === stop) {
|
|
691
|
+
if (start === Token.EOF) {
|
|
692
|
+
result += "<EOF>";
|
|
693
|
+
} else if (elementsAreChar) {
|
|
694
|
+
result += "'" + String.fromCodePoint(start) + "'";
|
|
695
|
+
} else {
|
|
696
|
+
result += start;
|
|
697
|
+
}
|
|
698
|
+
} else {
|
|
699
|
+
if (elementsAreChar) {
|
|
700
|
+
result += "'" + String.fromCodePoint(start) + "'..'" + String.fromCodePoint(stop) + "'";
|
|
701
|
+
} else {
|
|
702
|
+
result += start + ".." + stop;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (i < this.intervals.length - 1) {
|
|
706
|
+
result += ", ";
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
if (this.length > 1) {
|
|
710
|
+
result += "}";
|
|
711
|
+
}
|
|
712
|
+
return result;
|
|
713
|
+
}
|
|
714
|
+
toStringWithVocabulary(vocabulary) {
|
|
715
|
+
if (this.intervals.length === 0) {
|
|
716
|
+
return "{}";
|
|
717
|
+
}
|
|
718
|
+
let result = "";
|
|
719
|
+
if (this.length > 1) {
|
|
720
|
+
result += "{";
|
|
721
|
+
}
|
|
722
|
+
for (let i = 0; i < this.intervals.length; ++i) {
|
|
723
|
+
const interval = this.intervals[i];
|
|
724
|
+
const start = interval.start;
|
|
725
|
+
const stop = interval.stop;
|
|
726
|
+
if (start === stop) {
|
|
727
|
+
if (start === Token.EOF) {
|
|
728
|
+
result += "<EOF>";
|
|
729
|
+
} else {
|
|
730
|
+
result += this.elementName(vocabulary, start);
|
|
731
|
+
}
|
|
732
|
+
} else {
|
|
733
|
+
for (let i2 = start; i2 <= stop; ++i2) {
|
|
734
|
+
if (i2 > start) {
|
|
735
|
+
result += ", ";
|
|
736
|
+
}
|
|
737
|
+
result += this.elementName(vocabulary, i2);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (i < this.intervals.length - 1) {
|
|
741
|
+
result += ", ";
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
if (this.length > 1) {
|
|
745
|
+
result += "}";
|
|
746
|
+
}
|
|
747
|
+
return result;
|
|
748
|
+
}
|
|
749
|
+
toStringWithRuleNames(ruleNames) {
|
|
750
|
+
if (this.intervals.length === 0) {
|
|
751
|
+
return "{}";
|
|
752
|
+
}
|
|
753
|
+
let result = "";
|
|
754
|
+
if (this.length > 1) {
|
|
755
|
+
result += "{";
|
|
756
|
+
}
|
|
757
|
+
const vocabulary = Vocabulary.fromTokenNames(ruleNames);
|
|
758
|
+
for (let i = 0; i < this.intervals.length; ++i) {
|
|
759
|
+
const interval = this.intervals[i];
|
|
760
|
+
const start = interval.start;
|
|
761
|
+
const stop = interval.stop;
|
|
762
|
+
if (start === stop) {
|
|
763
|
+
if (start === Token.EOF) {
|
|
764
|
+
result += "<EOF>";
|
|
765
|
+
} else {
|
|
766
|
+
result += this.elementName(vocabulary, start);
|
|
767
|
+
}
|
|
768
|
+
} else {
|
|
769
|
+
for (let i2 = start; i2 <= stop; ++i2) {
|
|
770
|
+
if (i2 > start) {
|
|
771
|
+
result += ", ";
|
|
772
|
+
}
|
|
773
|
+
result += this.elementName(vocabulary, i2);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
if (i < this.intervals.length - 1) {
|
|
777
|
+
result += ", ";
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
if (this.length > 1) {
|
|
781
|
+
result += "}";
|
|
782
|
+
}
|
|
783
|
+
return result;
|
|
784
|
+
}
|
|
785
|
+
toArray() {
|
|
786
|
+
const data = [];
|
|
787
|
+
for (const interval of this.intervals) {
|
|
788
|
+
for (let j = interval.start; j <= interval.stop; j++) {
|
|
789
|
+
data.push(j);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
return data;
|
|
793
|
+
}
|
|
794
|
+
/** @returns the number of elements in this set. */
|
|
795
|
+
get length() {
|
|
796
|
+
let result = 0;
|
|
797
|
+
for (const interval of this.intervals) {
|
|
798
|
+
result += interval.length;
|
|
799
|
+
}
|
|
800
|
+
return result;
|
|
801
|
+
}
|
|
802
|
+
elementName(vocabulary, token) {
|
|
803
|
+
if (token === Token.EOF) {
|
|
804
|
+
return "<EOF>";
|
|
805
|
+
}
|
|
806
|
+
if (token === Token.EPSILON) {
|
|
807
|
+
return "<EPSILON>";
|
|
808
|
+
}
|
|
809
|
+
return vocabulary.getDisplayName(token);
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
// src/atn/Transition.ts
|
|
814
|
+
var Transition = class {
|
|
815
|
+
static {
|
|
816
|
+
__name(this, "Transition");
|
|
817
|
+
}
|
|
818
|
+
static INVALID = 0;
|
|
819
|
+
static EPSILON = 1;
|
|
820
|
+
static RANGE = 2;
|
|
821
|
+
static RULE = 3;
|
|
822
|
+
static PREDICATE = 4;
|
|
823
|
+
// e.g., {isType(input.LT(1))}
|
|
824
|
+
static ATOM = 5;
|
|
825
|
+
static ACTION = 6;
|
|
826
|
+
static SET = 7;
|
|
827
|
+
// ~(A|B) or ~atom, wildcard, which convert to next
|
|
828
|
+
static NOT_SET = 8;
|
|
829
|
+
static WILDCARD = 9;
|
|
830
|
+
static PRECEDENCE = 10;
|
|
831
|
+
/** The target of this transition. */
|
|
832
|
+
target;
|
|
833
|
+
constructor(target) {
|
|
834
|
+
this.target = target;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* Determines if the transition is an "epsilon" transition.
|
|
838
|
+
*
|
|
839
|
+
* The default implementation returns `false`.
|
|
840
|
+
*
|
|
841
|
+
* @returns `true` if traversing this transition in the ATN does not
|
|
842
|
+
* consume an input symbol; otherwise, `false` if traversing this
|
|
843
|
+
* transition consumes (matches) an input symbol.
|
|
844
|
+
*/
|
|
845
|
+
get isEpsilon() {
|
|
846
|
+
return false;
|
|
847
|
+
}
|
|
848
|
+
get label() {
|
|
849
|
+
return null;
|
|
850
|
+
}
|
|
851
|
+
toString() {
|
|
852
|
+
return "";
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
// src/atn/RangeTransition.ts
|
|
857
|
+
var RangeTransition = class extends Transition {
|
|
858
|
+
static {
|
|
859
|
+
__name(this, "RangeTransition");
|
|
860
|
+
}
|
|
861
|
+
start;
|
|
862
|
+
stop;
|
|
863
|
+
#label = new IntervalSet();
|
|
864
|
+
constructor(target, start, stop) {
|
|
865
|
+
super(target);
|
|
866
|
+
this.start = start;
|
|
867
|
+
this.stop = stop;
|
|
868
|
+
this.#label.addRange(start, stop);
|
|
869
|
+
}
|
|
870
|
+
get label() {
|
|
871
|
+
return this.#label;
|
|
872
|
+
}
|
|
873
|
+
get transitionType() {
|
|
874
|
+
return Transition.RANGE;
|
|
875
|
+
}
|
|
876
|
+
matches(symbol, _minVocabSymbol, _maxVocabSymbol) {
|
|
877
|
+
return symbol >= this.start && symbol <= this.stop;
|
|
878
|
+
}
|
|
879
|
+
toString() {
|
|
880
|
+
return "'" + String.fromCharCode(this.start) + "'..'" + String.fromCharCode(this.stop) + "'";
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
export {
|
|
884
|
+
RangeTransition
|
|
885
|
+
};
|