@opra/client 0.11.1 → 0.11.2
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.
- package/cjs/index.min.mjs +1 -0
- package/esm/index.min.mjs +1 -0
- package/package.json +6 -19
- package/typings/client-error.d.ts +1 -1
- package/typings/http/http-client.d.ts +1 -1
- package/typings/http/http-collection-service.d.ts +1 -1
- package/typings/http/http-request.d.ts +1 -1
- package/typings/http/http-singleton-service.d.ts +1 -1
- package/typings/http/http-types.d.ts +1 -1
- package/typings/http/requests/batch-request.d.ts +1 -1
- package/typings/http/requests/collection-create-request.d.ts +1 -1
- package/typings/http/requests/collection-delete-many-request.d.ts +1 -1
- package/typings/http/requests/collection-delete-request.d.ts +1 -1
- package/typings/http/requests/collection-get-request.d.ts +1 -1
- package/typings/http/requests/collection-search-request.d.ts +1 -1
- package/typings/http/requests/collection-update-many-request.d.ts +1 -1
- package/typings/http/requests/collection-update-request.d.ts +1 -1
- package/typings/http/requests/http-singleton-get-request.d.ts +1 -1
- package/typings/interfaces/http-options.interface.d.ts +1 -1
- package/typings/interfaces/http-request-config.interface.d.ts +1 -1
- package/cjs/934.min.cjs +0 -1
- package/cjs/main.min.cjs +0 -2
- package/cjs/main.min.cjs.LICENSE.txt +0 -13
- package/esm/934.min.mjs +0 -1
- package/esm/main.min.mjs +0 -2
- package/esm/main.min.mjs.LICENSE.txt +0 -13
- package/typings/antlr4ts/ANTLRErrorListener.d.ts +0 -43
- package/typings/antlr4ts/ANTLRErrorStrategy.d.ts +0 -109
- package/typings/antlr4ts/ANTLRInputStream.d.ts +0 -51
- package/typings/antlr4ts/BailErrorStrategy.d.ts +0 -48
- package/typings/antlr4ts/BufferedTokenStream.d.ts +0 -143
- package/typings/antlr4ts/CharStream.d.ts +0 -26
- package/typings/antlr4ts/CharStreams.d.ts +0 -54
- package/typings/antlr4ts/CodePointBuffer.d.ts +0 -40
- package/typings/antlr4ts/CodePointCharStream.d.ts +0 -45
- package/typings/antlr4ts/CommonToken.d.ts +0 -116
- package/typings/antlr4ts/CommonTokenFactory.d.ts +0 -53
- package/typings/antlr4ts/CommonTokenStream.d.ts +0 -52
- package/typings/antlr4ts/ConsoleErrorListener.d.ts +0 -29
- package/typings/antlr4ts/Decorators.d.ts +0 -8
- package/typings/antlr4ts/DefaultErrorStrategy.d.ts +0 -347
- package/typings/antlr4ts/Dependents.d.ts +0 -69
- package/typings/antlr4ts/DiagnosticErrorListener.d.ts +0 -60
- package/typings/antlr4ts/FailedPredicateException.d.ts +0 -21
- package/typings/antlr4ts/InputMismatchException.d.ts +0 -14
- package/typings/antlr4ts/IntStream.d.ts +0 -197
- package/typings/antlr4ts/InterpreterRuleContext.d.ts +0 -33
- package/typings/antlr4ts/Lexer.d.ts +0 -141
- package/typings/antlr4ts/LexerInterpreter.d.ts +0 -23
- package/typings/antlr4ts/LexerNoViableAltException.d.ts +0 -19
- package/typings/antlr4ts/ListTokenSource.d.ts +0 -86
- package/typings/antlr4ts/NoViableAltException.d.ts +0 -30
- package/typings/antlr4ts/Parser.d.ts +0 -372
- package/typings/antlr4ts/ParserErrorListener.d.ts +0 -112
- package/typings/antlr4ts/ParserInterpreter.d.ts +0 -151
- package/typings/antlr4ts/ParserRuleContext.d.ts +0 -169
- package/typings/antlr4ts/ProxyErrorListener.d.ts +0 -20
- package/typings/antlr4ts/ProxyParserErrorListener.d.ts +0 -21
- package/typings/antlr4ts/RecognitionException.d.ts +0 -87
- package/typings/antlr4ts/Recognizer.d.ts +0 -101
- package/typings/antlr4ts/RuleContext.d.ts +0 -124
- package/typings/antlr4ts/RuleContextWithAltNum.d.ts +0 -22
- package/typings/antlr4ts/RuleDependency.d.ts +0 -32
- package/typings/antlr4ts/RuleVersion.d.ts +0 -11
- package/typings/antlr4ts/Token.d.ts +0 -83
- package/typings/antlr4ts/TokenFactory.d.ts +0 -23
- package/typings/antlr4ts/TokenSource.d.ts +0 -67
- package/typings/antlr4ts/TokenStream.d.ts +0 -145
- package/typings/antlr4ts/TokenStreamRewriter.d.ts +0 -216
- package/typings/antlr4ts/Vocabulary.d.ts +0 -117
- package/typings/antlr4ts/VocabularyImpl.d.ts +0 -47
- package/typings/antlr4ts/WritableToken.d.ts +0 -13
- package/typings/antlr4ts/atn/ATN.d.ts +0 -123
- package/typings/antlr4ts/atn/ATNConfig.d.ts +0 -140
- package/typings/antlr4ts/atn/ATNConfigSet.d.ts +0 -113
- package/typings/antlr4ts/atn/ATNDeserializationOptions.d.ts +0 -26
- package/typings/antlr4ts/atn/ATNDeserializer.d.ts +0 -86
- package/typings/antlr4ts/atn/ATNSimulator.d.ts +0 -28
- package/typings/antlr4ts/atn/ATNState.d.ts +0 -111
- package/typings/antlr4ts/atn/ATNStateType.d.ts +0 -19
- package/typings/antlr4ts/atn/ATNType.d.ts +0 -19
- package/typings/antlr4ts/atn/AbstractPredicateTransition.d.ts +0 -13
- package/typings/antlr4ts/atn/ActionTransition.d.ts +0 -17
- package/typings/antlr4ts/atn/AmbiguityInfo.d.ts +0 -60
- package/typings/antlr4ts/atn/AtomTransition.d.ts +0 -18
- package/typings/antlr4ts/atn/BasicBlockStartState.d.ts +0 -13
- package/typings/antlr4ts/atn/BasicState.d.ts +0 -13
- package/typings/antlr4ts/atn/BlockEndState.d.ts +0 -12
- package/typings/antlr4ts/atn/BlockStartState.d.ts +0 -10
- package/typings/antlr4ts/atn/CodePointTransitions.d.ts +0 -27
- package/typings/antlr4ts/atn/ConflictInfo.d.ts +0 -35
- package/typings/antlr4ts/atn/ContextSensitivityInfo.d.ts +0 -39
- package/typings/antlr4ts/atn/DecisionEventInfo.d.ts +0 -54
- package/typings/antlr4ts/atn/DecisionInfo.d.ts +0 -201
- package/typings/antlr4ts/atn/DecisionState.d.ts +0 -10
- package/typings/antlr4ts/atn/EpsilonTransition.d.ts +0 -24
- package/typings/antlr4ts/atn/ErrorInfo.d.ts +0 -32
- package/typings/antlr4ts/atn/InvalidState.d.ts +0 -13
- package/typings/antlr4ts/atn/LL1Analyzer.d.ts +0 -98
- package/typings/antlr4ts/atn/LexerATNSimulator.d.ts +0 -153
- package/typings/antlr4ts/atn/LexerAction.d.ts +0 -47
- package/typings/antlr4ts/atn/LexerActionExecutor.d.ts +0 -104
- package/typings/antlr4ts/atn/LexerActionType.d.ts +0 -44
- package/typings/antlr4ts/atn/LexerChannelAction.d.ts +0 -48
- package/typings/antlr4ts/atn/LexerCustomAction.d.ts +0 -73
- package/typings/antlr4ts/atn/LexerIndexedCustomAction.d.ts +0 -74
- package/typings/antlr4ts/atn/LexerModeAction.d.ts +0 -48
- package/typings/antlr4ts/atn/LexerMoreAction.d.ts +0 -47
- package/typings/antlr4ts/atn/LexerPopModeAction.d.ts +0 -47
- package/typings/antlr4ts/atn/LexerPushModeAction.d.ts +0 -48
- package/typings/antlr4ts/atn/LexerSkipAction.d.ts +0 -47
- package/typings/antlr4ts/atn/LexerTypeAction.d.ts +0 -47
- package/typings/antlr4ts/atn/LookaheadEventInfo.d.ts +0 -37
- package/typings/antlr4ts/atn/LoopEndState.d.ts +0 -11
- package/typings/antlr4ts/atn/NotSetTransition.d.ts +0 -14
- package/typings/antlr4ts/atn/OrderedATNConfigSet.d.ts +0 -23
- package/typings/antlr4ts/atn/ParseInfo.d.ts +0 -79
- package/typings/antlr4ts/atn/ParserATNSimulator.d.ts +0 -567
- package/typings/antlr4ts/atn/PlusBlockStartState.d.ts +0 -16
- package/typings/antlr4ts/atn/PlusLoopbackState.d.ts +0 -12
- package/typings/antlr4ts/atn/PrecedencePredicateTransition.d.ts +0 -21
- package/typings/antlr4ts/atn/PredicateEvalInfo.d.ts +0 -54
- package/typings/antlr4ts/atn/PredicateTransition.d.ts +0 -25
- package/typings/antlr4ts/atn/PredictionContext.d.ts +0 -89
- package/typings/antlr4ts/atn/PredictionContextCache.d.ts +0 -40
- package/typings/antlr4ts/atn/PredictionMode.d.ts +0 -89
- package/typings/antlr4ts/atn/ProfilingATNSimulator.d.ts +0 -55
- package/typings/antlr4ts/atn/RangeTransition.d.ts +0 -17
- package/typings/antlr4ts/atn/RuleStartState.d.ts +0 -13
- package/typings/antlr4ts/atn/RuleStopState.d.ts +0 -15
- package/typings/antlr4ts/atn/RuleTransition.d.ts +0 -22
- package/typings/antlr4ts/atn/SemanticContext.d.ts +0 -143
- package/typings/antlr4ts/atn/SetTransition.d.ts +0 -17
- package/typings/antlr4ts/atn/SimulatorState.d.ts +0 -17
- package/typings/antlr4ts/atn/StarBlockStartState.d.ts +0 -10
- package/typings/antlr4ts/atn/StarLoopEntryState.d.ts +0 -37
- package/typings/antlr4ts/atn/StarLoopbackState.d.ts +0 -11
- package/typings/antlr4ts/atn/TokensStartState.d.ts +0 -10
- package/typings/antlr4ts/atn/Transition.d.ts +0 -38
- package/typings/antlr4ts/atn/TransitionType.d.ts +0 -16
- package/typings/antlr4ts/atn/WildcardTransition.d.ts +0 -13
- package/typings/antlr4ts/atn/index.d.ts +0 -73
- package/typings/antlr4ts/dfa/AcceptStateInfo.d.ts +0 -33
- package/typings/antlr4ts/dfa/DFA.d.ts +0 -94
- package/typings/antlr4ts/dfa/DFASerializer.d.ts +0 -23
- package/typings/antlr4ts/dfa/DFAState.d.ts +0 -95
- package/typings/antlr4ts/dfa/LexerDFASerializer.d.ts +0 -10
- package/typings/antlr4ts/dfa/index.d.ts +0 -9
- package/typings/antlr4ts/index.d.ts +0 -49
- package/typings/antlr4ts/misc/Args.d.ts +0 -13
- package/typings/antlr4ts/misc/Array2DHashMap.d.ts +0 -20
- package/typings/antlr4ts/misc/Array2DHashSet.d.ts +0 -62
- package/typings/antlr4ts/misc/ArrayEqualityComparator.d.ts +0 -32
- package/typings/antlr4ts/misc/Arrays.d.ts +0 -18
- package/typings/antlr4ts/misc/BitSet.d.ts +0 -268
- package/typings/antlr4ts/misc/Character.d.ts +0 -7
- package/typings/antlr4ts/misc/DefaultEqualityComparator.d.ts +0 -31
- package/typings/antlr4ts/misc/EqualityComparator.d.ts +0 -29
- package/typings/antlr4ts/misc/IntSet.d.ts +0 -129
- package/typings/antlr4ts/misc/IntegerList.d.ts +0 -69
- package/typings/antlr4ts/misc/IntegerStack.d.ts +0 -15
- package/typings/antlr4ts/misc/InterpreterDataReader.d.ts +0 -39
- package/typings/antlr4ts/misc/Interval.d.ts +0 -57
- package/typings/antlr4ts/misc/IntervalSet.d.ts +0 -96
- package/typings/antlr4ts/misc/MultiMap.d.ts +0 -9
- package/typings/antlr4ts/misc/MurmurHash.d.ts +0 -45
- package/typings/antlr4ts/misc/ObjectEqualityComparator.d.ts +0 -32
- package/typings/antlr4ts/misc/ParseCancellationException.d.ts +0 -18
- package/typings/antlr4ts/misc/Stubs.d.ts +0 -31
- package/typings/antlr4ts/misc/UUID.d.ts +0 -13
- package/typings/antlr4ts/misc/Utils.d.ts +0 -15
- package/typings/antlr4ts/misc/index.d.ts +0 -25
- package/typings/antlr4ts/tree/AbstractParseTreeVisitor.d.ts +0 -103
- package/typings/antlr4ts/tree/ErrorNode.d.ts +0 -17
- package/typings/antlr4ts/tree/ParseTree.d.ts +0 -36
- package/typings/antlr4ts/tree/ParseTreeListener.d.ts +0 -26
- package/typings/antlr4ts/tree/ParseTreeProperty.d.ts +0 -28
- package/typings/antlr4ts/tree/ParseTreeVisitor.d.ts +0 -48
- package/typings/antlr4ts/tree/ParseTreeWalker.d.ts +0 -35
- package/typings/antlr4ts/tree/RuleNode.d.ts +0 -21
- package/typings/antlr4ts/tree/SyntaxTree.d.ts +0 -29
- package/typings/antlr4ts/tree/TerminalNode.d.ts +0 -27
- package/typings/antlr4ts/tree/Tree.d.ts +0 -36
- package/typings/antlr4ts/tree/Trees.d.ts +0 -75
- package/typings/antlr4ts/tree/index.d.ts +0 -16
- package/typings/antlr4ts/tree/pattern/Chunk.d.ts +0 -17
- package/typings/antlr4ts/tree/pattern/ParseTreeMatch.d.ts +0 -124
- package/typings/antlr4ts/tree/pattern/ParseTreePattern.d.ts +0 -98
- package/typings/antlr4ts/tree/pattern/ParseTreePatternMatcher.d.ts +0 -166
- package/typings/antlr4ts/tree/pattern/RuleTagToken.d.ts +0 -122
- package/typings/antlr4ts/tree/pattern/TagChunk.d.ts +0 -59
- package/typings/antlr4ts/tree/pattern/TextChunk.d.ts +0 -35
- package/typings/antlr4ts/tree/pattern/TokenTagToken.d.ts +0 -56
- package/typings/antlr4ts/tree/pattern/index.d.ts +0 -9
- package/typings/antlr4ts/tree/xpath/XPath.d.ts +0 -66
- package/typings/antlr4ts/tree/xpath/XPathElement.d.ts +0 -19
- package/typings/antlr4ts/tree/xpath/XPathLexer.d.ts +0 -36
- package/typings/antlr4ts/tree/xpath/XPathLexerErrorListener.d.ts +0 -10
- package/typings/antlr4ts/tree/xpath/XPathRuleAnywhereElement.d.ts +0 -14
- package/typings/antlr4ts/tree/xpath/XPathRuleElement.d.ts +0 -11
- package/typings/antlr4ts/tree/xpath/XPathTokenAnywhereElement.d.ts +0 -11
- package/typings/antlr4ts/tree/xpath/XPathTokenElement.d.ts +0 -11
- package/typings/antlr4ts/tree/xpath/XPathWildcardAnywhereElement.d.ts +0 -10
- package/typings/antlr4ts/tree/xpath/XPathWildcardElement.d.ts +0 -10
- package/typings/antlr4ts/tree/xpath/index.d.ts +0 -14
- package/typings/common/constants.d.ts +0 -0
- package/typings/common/exception/enums/issue-severity.enum.d.ts +0 -13
- package/typings/common/exception/error-issue.d.ts +0 -9
- package/typings/common/exception/http-errors/bad-request.error.d.ts +0 -10
- package/typings/common/exception/http-errors/failed-dependency.error.d.ts +0 -9
- package/typings/common/exception/http-errors/forbidden.error.d.ts +0 -11
- package/typings/common/exception/http-errors/internal-server.error.d.ts +0 -9
- package/typings/common/exception/http-errors/method-not-allowed.error.d.ts +0 -10
- package/typings/common/exception/http-errors/not-acceptable.error.d.ts +0 -10
- package/typings/common/exception/http-errors/not-found.error.d.ts +0 -13
- package/typings/common/exception/http-errors/unauthorized.error.d.ts +0 -10
- package/typings/common/exception/http-errors/unprocessable-entity.error.d.ts +0 -9
- package/typings/common/exception/index.d.ts +0 -15
- package/typings/common/exception/opra-exception.d.ts +0 -15
- package/typings/common/exception/resource-errors/resource-conflict.error.d.ts +0 -5
- package/typings/common/exception/resource-errors/resource-not-found.error.d.ts +0 -4
- package/typings/common/exception/wrap-exception.d.ts +0 -2
- package/typings/common/filter/antlr/OpraFilterLexer.d.ts +0 -78
- package/typings/common/filter/antlr/OpraFilterParser.d.ts +0 -365
- package/typings/common/filter/antlr/OpraFilterVisitor.d.ts +0 -290
- package/typings/common/filter/ast/abstract/ast.d.ts +0 -5
- package/typings/common/filter/ast/abstract/expression.d.ts +0 -3
- package/typings/common/filter/ast/abstract/literal.d.ts +0 -6
- package/typings/common/filter/ast/abstract/term.d.ts +0 -3
- package/typings/common/filter/ast/expressions/arithmetic-expression.d.ts +0 -13
- package/typings/common/filter/ast/expressions/array-expression.d.ts +0 -7
- package/typings/common/filter/ast/expressions/comparison-expression.d.ts +0 -10
- package/typings/common/filter/ast/expressions/logical-expression.d.ts +0 -8
- package/typings/common/filter/ast/expressions/parentheses-expression.d.ts +0 -6
- package/typings/common/filter/ast/index.d.ts +0 -16
- package/typings/common/filter/ast/terms/boolean-literal.d.ts +0 -5
- package/typings/common/filter/ast/terms/date-literal.d.ts +0 -6
- package/typings/common/filter/ast/terms/external-constant.d.ts +0 -5
- package/typings/common/filter/ast/terms/null-literal.d.ts +0 -5
- package/typings/common/filter/ast/terms/number-literal.d.ts +0 -6
- package/typings/common/filter/ast/terms/qualified-identifier.d.ts +0 -4
- package/typings/common/filter/ast/terms/string-literal.d.ts +0 -5
- package/typings/common/filter/ast/terms/time-literal.d.ts +0 -6
- package/typings/common/filter/build.d.ts +0 -31
- package/typings/common/filter/error-listener.d.ts +0 -8
- package/typings/common/filter/errors.d.ts +0 -20
- package/typings/common/filter/filter-tree-visitor.d.ts +0 -30
- package/typings/common/filter/index.d.ts +0 -5
- package/typings/common/filter/parse.d.ts +0 -2
- package/typings/common/filter/utils.d.ts +0 -2
- package/typings/common/helpers/index.d.ts +0 -1
- package/typings/common/helpers/responsive-map.d.ts +0 -18
- package/typings/common/http/enums/http-headers.enum.d.ts +0 -379
- package/typings/common/http/enums/http-status.enum.d.ts +0 -290
- package/typings/common/http/http-request.d.ts +0 -34
- package/typings/common/http/index.d.ts +0 -6
- package/typings/common/http/interfaces/client-http-headers.interface.d.ts +0 -65
- package/typings/common/http/interfaces/server-http-headers.interface.d.ts +0 -1
- package/typings/common/http/multipart/batch-multipart.d.ts +0 -31
- package/typings/common/http/multipart/http-request-content.d.ts +0 -8
- package/typings/common/http/multipart/http-response-content.d.ts +0 -7
- package/typings/common/http/multipart/index.d.ts +0 -1
- package/typings/common/http/utils/normalize-headers.d.ts +0 -1
- package/typings/common/i18n/i18n.d.ts +0 -28
- package/typings/common/i18n/index.d.ts +0 -5
- package/typings/common/i18n/string-utils.d.ts +0 -2
- package/typings/common/i18n/translate.d.ts +0 -4
- package/typings/common/index.d.ts +0 -10
- package/typings/common/schema/constants.d.ts +0 -8
- package/typings/common/schema/decorators/opr-collection-resource.decorator.d.ts +0 -8
- package/typings/common/schema/decorators/opr-complex-type.decorator.d.ts +0 -6
- package/typings/common/schema/decorators/opr-field.decorator.d.ts +0 -3
- package/typings/common/schema/decorators/opr-resolver.decorator.d.ts +0 -8
- package/typings/common/schema/decorators/opr-simple-type.decorator.d.ts +0 -6
- package/typings/common/schema/decorators/opr-singleton-resource.decorator.d.ts +0 -8
- package/typings/common/schema/implementation/data-type/builtin/any.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/base64-binary.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/bigint.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/boolean.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/date-string.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/date.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/guid.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/integer.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/number.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/object.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin/string.type.d.ts +0 -2
- package/typings/common/schema/implementation/data-type/builtin-data-types.d.ts +0 -4
- package/typings/common/schema/implementation/data-type/complex-type.d.ts +0 -29
- package/typings/common/schema/implementation/data-type/data-type.d.ts +0 -16
- package/typings/common/schema/implementation/data-type/simple-type.d.ts +0 -12
- package/typings/common/schema/implementation/data-type/union-type.d.ts +0 -16
- package/typings/common/schema/implementation/document-builder.d.ts +0 -16
- package/typings/common/schema/implementation/opra-document.d.ts +0 -44
- package/typings/common/schema/implementation/query/collection-count-query.d.ts +0 -14
- package/typings/common/schema/implementation/query/collection-create-query.d.ts +0 -18
- package/typings/common/schema/implementation/query/collection-delete-many-query.d.ts +0 -14
- package/typings/common/schema/implementation/query/collection-delete-query.d.ts +0 -10
- package/typings/common/schema/implementation/query/collection-get-query.d.ts +0 -21
- package/typings/common/schema/implementation/query/collection-search-query.d.ts +0 -30
- package/typings/common/schema/implementation/query/collection-update-many-query.d.ts +0 -15
- package/typings/common/schema/implementation/query/collection-update-query.d.ts +0 -19
- package/typings/common/schema/implementation/query/field-get-query.d.ts +0 -30
- package/typings/common/schema/implementation/query/index.d.ts +0 -27
- package/typings/common/schema/implementation/query/singleton-get-query.d.ts +0 -20
- package/typings/common/schema/implementation/resource/collection-resource-info.d.ts +0 -19
- package/typings/common/schema/implementation/resource/container-resource-info.d.ts +0 -13
- package/typings/common/schema/implementation/resource/resource-info.d.ts +0 -17
- package/typings/common/schema/implementation/resource/singleton-resource-info.d.ts +0 -14
- package/typings/common/schema/implementation/schema-builder/extract-resource-metadata.util.d.ts +0 -3
- package/typings/common/schema/implementation/schema-builder/extract-type-metadata.util.d.ts +0 -4
- package/typings/common/schema/index.d.ts +0 -25
- package/typings/common/schema/interfaces/child-field-query.interface.d.ts +0 -4
- package/typings/common/schema/interfaces/data-type.metadata.d.ts +0 -18
- package/typings/common/schema/interfaces/resource-container.interface.d.ts +0 -8
- package/typings/common/schema/interfaces/resource.metadata.d.ts +0 -18
- package/typings/common/schema/opra-schema.definition.d.ts +0 -178
- package/typings/common/schema/type-helpers/extend-type.helper.d.ts +0 -3
- package/typings/common/schema/type-helpers/mixin-type.helper.d.ts +0 -2
- package/typings/common/schema/type-helpers/mixin.utils.d.ts +0 -3
- package/typings/common/schema/types.d.ts +0 -14
- package/typings/common/schema/utils/class.utils.d.ts +0 -2
- package/typings/common/schema/utils/clone-object.util.d.ts +0 -1
- package/typings/common/schema/utils/inspect.util.d.ts +0 -4
- package/typings/common/schema/utils/normalize-field-array.util.d.ts +0 -3
- package/typings/common/schema/utils/path-to-tree.util.d.ts +0 -4
- package/typings/common/schema/utils/string-compare.util.d.ts +0 -1
- package/typings/common/url/formats/boolean-format.d.ts +0 -5
- package/typings/common/url/formats/date-format.d.ts +0 -16
- package/typings/common/url/formats/filter-format.d.ts +0 -6
- package/typings/common/url/formats/format.d.ts +0 -4
- package/typings/common/url/formats/integer-format.d.ts +0 -9
- package/typings/common/url/formats/number-format.d.ts +0 -12
- package/typings/common/url/formats/string-format.d.ts +0 -14
- package/typings/common/url/index.d.ts +0 -5
- package/typings/common/url/opra-url-path-component.d.ts +0 -15
- package/typings/common/url/opra-url-path.d.ts +0 -30
- package/typings/common/url/opra-url-search-params.d.ts +0 -44
- package/typings/common/url/opra-url.d.ts +0 -79
- package/typings/common/url/utils/path-utils.d.ts +0 -8
- package/typings/common/utils/index.d.ts +0 -3
- package/typings/common/utils/is-url.d.ts +0 -1
- package/typings/common/utils/path-to-tree.d.ts +0 -4
- package/typings/common/utils/type-guards.d.ts +0 -9
- package/umd/934.min.cjs +0 -1
- package/umd/main.min.cjs +0 -2
- package/umd/main.min.cjs.LICENSE.txt +0 -13
|
@@ -1,567 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2016 The ANTLR Project. All rights reserved.
|
|
3
|
-
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
|
|
4
|
-
*/
|
|
5
|
-
import { ActionTransition } from "./ActionTransition";
|
|
6
|
-
import { Array2DHashSet } from "../misc/Array2DHashSet";
|
|
7
|
-
import { ATN } from "./ATN";
|
|
8
|
-
import { ATNConfig } from "./ATNConfig";
|
|
9
|
-
import { ATNConfigSet } from "./ATNConfigSet";
|
|
10
|
-
import { ATNSimulator } from "./ATNSimulator";
|
|
11
|
-
import { ATNState } from "./ATNState";
|
|
12
|
-
import { BitSet } from "../misc/BitSet";
|
|
13
|
-
import { DFA } from "../dfa/DFA";
|
|
14
|
-
import { DFAState } from "../dfa/DFAState";
|
|
15
|
-
import { IntegerList } from "../misc/IntegerList";
|
|
16
|
-
import { NoViableAltException } from "../NoViableAltException";
|
|
17
|
-
import { Parser } from "../Parser";
|
|
18
|
-
import { ParserRuleContext } from "../ParserRuleContext";
|
|
19
|
-
import { PrecedencePredicateTransition } from "./PrecedencePredicateTransition";
|
|
20
|
-
import { PredicateTransition } from "./PredicateTransition";
|
|
21
|
-
import { PredictionContextCache } from "./PredictionContextCache";
|
|
22
|
-
import { PredictionMode } from "./PredictionMode";
|
|
23
|
-
import { RuleContext } from "../RuleContext";
|
|
24
|
-
import { RuleTransition } from "./RuleTransition";
|
|
25
|
-
import { SemanticContext } from "./SemanticContext";
|
|
26
|
-
import { SimulatorState } from "./SimulatorState";
|
|
27
|
-
import { TokenStream } from "../TokenStream";
|
|
28
|
-
import { Transition } from "./Transition";
|
|
29
|
-
/**
|
|
30
|
-
* The embodiment of the adaptive LL(*), ALL(*), parsing strategy.
|
|
31
|
-
*
|
|
32
|
-
* The basic complexity of the adaptive strategy makes it harder to understand.
|
|
33
|
-
* We begin with ATN simulation to build paths in a DFA. Subsequent prediction
|
|
34
|
-
* requests go through the DFA first. If they reach a state without an edge for
|
|
35
|
-
* the current symbol, the algorithm fails over to the ATN simulation to
|
|
36
|
-
* complete the DFA path for the current input (until it finds a conflict state
|
|
37
|
-
* or uniquely predicting state).
|
|
38
|
-
*
|
|
39
|
-
* All of that is done without using the outer context because we want to create
|
|
40
|
-
* a DFA that is not dependent upon the rule invocation stack when we do a
|
|
41
|
-
* prediction. One DFA works in all contexts. We avoid using context not
|
|
42
|
-
* necessarily because it's slower, although it can be, but because of the DFA
|
|
43
|
-
* caching problem. The closure routine only considers the rule invocation stack
|
|
44
|
-
* created during prediction beginning in the decision rule. For example, if
|
|
45
|
-
* prediction occurs without invoking another rule's ATN, there are no context
|
|
46
|
-
* stacks in the configurations. When lack of context leads to a conflict, we
|
|
47
|
-
* don't know if it's an ambiguity or a weakness in the strong LL(*) parsing
|
|
48
|
-
* strategy (versus full LL(*)).
|
|
49
|
-
*
|
|
50
|
-
* When SLL yields a configuration set with conflict, we rewind the input and
|
|
51
|
-
* retry the ATN simulation, this time using full outer context without adding
|
|
52
|
-
* to the DFA. Configuration context stacks will be the full invocation stacks
|
|
53
|
-
* from the start rule. If we get a conflict using full context, then we can
|
|
54
|
-
* definitively say we have a true ambiguity for that input sequence. If we
|
|
55
|
-
* don't get a conflict, it implies that the decision is sensitive to the outer
|
|
56
|
-
* context. (It is not context-sensitive in the sense of context-sensitive
|
|
57
|
-
* grammars.)
|
|
58
|
-
*
|
|
59
|
-
* The next time we reach this DFA state with an SLL conflict, through DFA
|
|
60
|
-
* simulation, we will again retry the ATN simulation using full context mode.
|
|
61
|
-
* This is slow because we can't save the results and have to "interpret" the
|
|
62
|
-
* ATN each time we get that input.
|
|
63
|
-
*
|
|
64
|
-
* **CACHING FULL CONTEXT PREDICTIONS**
|
|
65
|
-
*
|
|
66
|
-
* We could cache results from full context to predicted alternative easily and
|
|
67
|
-
* that saves a lot of time but doesn't work in presence of predicates. The set
|
|
68
|
-
* of visible predicates from the ATN start state changes depending on the
|
|
69
|
-
* context, because closure can fall off the end of a rule. I tried to cache
|
|
70
|
-
* tuples (stack context, semantic context, predicted alt) but it was slower
|
|
71
|
-
* than interpreting and much more complicated. Also required a huge amount of
|
|
72
|
-
* memory. The goal is not to create the world's fastest parser anyway. I'd like
|
|
73
|
-
* to keep this algorithm simple. By launching multiple threads, we can improve
|
|
74
|
-
* the speed of parsing across a large number of files.
|
|
75
|
-
*
|
|
76
|
-
* There is no strict ordering between the amount of input used by SLL vs LL,
|
|
77
|
-
* which makes it really hard to build a cache for full context. Let's say that
|
|
78
|
-
* we have input A B C that leads to an SLL conflict with full context X. That
|
|
79
|
-
* implies that using X we might only use A B but we could also use A B C D to
|
|
80
|
-
* resolve conflict. Input A B C D could predict alternative 1 in one position
|
|
81
|
-
* in the input and A B C E could predict alternative 2 in another position in
|
|
82
|
-
* input. The conflicting SLL configurations could still be non-unique in the
|
|
83
|
-
* full context prediction, which would lead us to requiring more input than the
|
|
84
|
-
* original A B C. To make a prediction cache work, we have to track the exact
|
|
85
|
-
* input used during the previous prediction. That amounts to a cache that maps
|
|
86
|
-
* X to a specific DFA for that context.
|
|
87
|
-
*
|
|
88
|
-
* Something should be done for left-recursive expression predictions. They are
|
|
89
|
-
* likely LL(1) + pred eval. Easier to do the whole SLL unless error and retry
|
|
90
|
-
* with full LL thing Sam does.
|
|
91
|
-
*
|
|
92
|
-
* **AVOIDING FULL CONTEXT PREDICTION**
|
|
93
|
-
*
|
|
94
|
-
* We avoid doing full context retry when the outer context is empty, we did not
|
|
95
|
-
* dip into the outer context by falling off the end of the decision state rule,
|
|
96
|
-
* or when we force SLL mode.
|
|
97
|
-
*
|
|
98
|
-
* As an example of the not dip into outer context case, consider as super
|
|
99
|
-
* constructor calls versus function calls. One grammar might look like
|
|
100
|
-
* this:
|
|
101
|
-
*
|
|
102
|
-
* ```antlr
|
|
103
|
-
* ctorBody
|
|
104
|
-
* : '{' superCall? stat* '}'
|
|
105
|
-
* ;
|
|
106
|
-
* ```
|
|
107
|
-
*
|
|
108
|
-
* Or, you might see something like
|
|
109
|
-
*
|
|
110
|
-
* ```antlr
|
|
111
|
-
* stat
|
|
112
|
-
* : superCall ';'
|
|
113
|
-
* | expression ';'
|
|
114
|
-
* | ...
|
|
115
|
-
* ;
|
|
116
|
-
* ```
|
|
117
|
-
*
|
|
118
|
-
* In both cases I believe that no closure operations will dip into the outer
|
|
119
|
-
* context. In the first case ctorBody in the worst case will stop at the '}'.
|
|
120
|
-
* In the 2nd case it should stop at the ';'. Both cases should stay within the
|
|
121
|
-
* entry rule and not dip into the outer context.
|
|
122
|
-
*
|
|
123
|
-
* **PREDICATES**
|
|
124
|
-
*
|
|
125
|
-
* Predicates are always evaluated if present in either SLL or LL both. SLL and
|
|
126
|
-
* LL simulation deals with predicates differently. SLL collects predicates as
|
|
127
|
-
* it performs closure operations like ANTLR v3 did. It delays predicate
|
|
128
|
-
* evaluation until it reaches and accept state. This allows us to cache the SLL
|
|
129
|
-
* ATN simulation whereas, if we had evaluated predicates on-the-fly during
|
|
130
|
-
* closure, the DFA state configuration sets would be different and we couldn't
|
|
131
|
-
* build up a suitable DFA.
|
|
132
|
-
*
|
|
133
|
-
* When building a DFA accept state during ATN simulation, we evaluate any
|
|
134
|
-
* predicates and return the sole semantically valid alternative. If there is
|
|
135
|
-
* more than 1 alternative, we report an ambiguity. If there are 0 alternatives,
|
|
136
|
-
* we throw an exception. Alternatives without predicates act like they have
|
|
137
|
-
* true predicates. The simple way to think about it is to strip away all
|
|
138
|
-
* alternatives with false predicates and choose the minimum alternative that
|
|
139
|
-
* remains.
|
|
140
|
-
*
|
|
141
|
-
* When we start in the DFA and reach an accept state that's predicated, we test
|
|
142
|
-
* those and return the minimum semantically viable alternative. If no
|
|
143
|
-
* alternatives are viable, we throw an exception.
|
|
144
|
-
*
|
|
145
|
-
* During full LL ATN simulation, closure always evaluates predicates and
|
|
146
|
-
* on-the-fly. This is crucial to reducing the configuration set size during
|
|
147
|
-
* closure. It hits a landmine when parsing with the Java grammar, for example,
|
|
148
|
-
* without this on-the-fly evaluation.
|
|
149
|
-
*
|
|
150
|
-
* **SHARING DFA**
|
|
151
|
-
*
|
|
152
|
-
* All instances of the same parser share the same decision DFAs through a
|
|
153
|
-
* static field. Each instance gets its own ATN simulator but they share the
|
|
154
|
-
* same {@link ATN#decisionToDFA} field. They also share a
|
|
155
|
-
* {@link PredictionContextCache} object that makes sure that all
|
|
156
|
-
* {@link PredictionContext} objects are shared among the DFA states. This makes
|
|
157
|
-
* a big size difference.
|
|
158
|
-
*
|
|
159
|
-
* **THREAD SAFETY**
|
|
160
|
-
*
|
|
161
|
-
* The {@link ParserATNSimulator} locks on the {@link ATN#decisionToDFA} field when
|
|
162
|
-
* it adds a new DFA object to that array. {@link #addDFAEdge}
|
|
163
|
-
* locks on the DFA for the current decision when setting the
|
|
164
|
-
* {@link DFAState#edges} field. {@link #addDFAState} locks on
|
|
165
|
-
* the DFA for the current decision when looking up a DFA state to see if it
|
|
166
|
-
* already exists. We must make sure that all requests to add DFA states that
|
|
167
|
-
* are equivalent result in the same shared DFA object. This is because lots of
|
|
168
|
-
* threads will be trying to update the DFA at once. The
|
|
169
|
-
* {@link #addDFAState} method also locks inside the DFA lock
|
|
170
|
-
* but this time on the shared context cache when it rebuilds the
|
|
171
|
-
* configurations' {@link PredictionContext} objects using cached
|
|
172
|
-
* subgraphs/nodes. No other locking occurs, even during DFA simulation. This is
|
|
173
|
-
* safe as long as we can guarantee that all threads referencing
|
|
174
|
-
* `s.edge[t]` get the same physical target {@link DFAState}, or
|
|
175
|
-
* `undefined`. Once into the DFA, the DFA simulation does not reference the
|
|
176
|
-
* {@link DFA#states} map. It follows the {@link DFAState#edges} field to new
|
|
177
|
-
* targets. The DFA simulator will either find {@link DFAState#edges} to be
|
|
178
|
-
* `undefined`, to be non-`undefined` and `dfa.edges[t]` undefined, or
|
|
179
|
-
* `dfa.edges[t]` to be non-undefined. The
|
|
180
|
-
* {@link #addDFAEdge} method could be racing to set the field
|
|
181
|
-
* but in either case the DFA simulator works; if `undefined`, and requests ATN
|
|
182
|
-
* simulation. It could also race trying to get `dfa.edges[t]`, but either
|
|
183
|
-
* way it will work because it's not doing a test and set operation.
|
|
184
|
-
*
|
|
185
|
-
* **Starting with SLL then failing to combined SLL/LL (Two-Stage
|
|
186
|
-
* Parsing)**
|
|
187
|
-
*
|
|
188
|
-
* Sam pointed out that if SLL does not give a syntax error, then there is no
|
|
189
|
-
* point in doing full LL, which is slower. We only have to try LL if we get a
|
|
190
|
-
* syntax error. For maximum speed, Sam starts the parser set to pure SLL
|
|
191
|
-
* mode with the {@link BailErrorStrategy}:
|
|
192
|
-
*
|
|
193
|
-
* ```
|
|
194
|
-
* parser.interpreter.{@link #setPredictionMode setPredictionMode}`(`{@link PredictionMode#SLL}`)`;
|
|
195
|
-
* parser.{@link Parser#setErrorHandler setErrorHandler}(new {@link BailErrorStrategy}());
|
|
196
|
-
* ```
|
|
197
|
-
*
|
|
198
|
-
* If it does not get a syntax error, then we're done. If it does get a syntax
|
|
199
|
-
* error, we need to retry with the combined SLL/LL strategy.
|
|
200
|
-
*
|
|
201
|
-
* The reason this works is as follows. If there are no SLL conflicts, then the
|
|
202
|
-
* grammar is SLL (at least for that input set). If there is an SLL conflict,
|
|
203
|
-
* the full LL analysis must yield a set of viable alternatives which is a
|
|
204
|
-
* subset of the alternatives reported by SLL. If the LL set is a singleton,
|
|
205
|
-
* then the grammar is LL but not SLL. If the LL set is the same size as the SLL
|
|
206
|
-
* set, the decision is SLL. If the LL set has size > 1, then that decision
|
|
207
|
-
* is truly ambiguous on the current input. If the LL set is smaller, then the
|
|
208
|
-
* SLL conflict resolution might choose an alternative that the full LL would
|
|
209
|
-
* rule out as a possibility based upon better context information. If that's
|
|
210
|
-
* the case, then the SLL parse will definitely get an error because the full LL
|
|
211
|
-
* analysis says it's not viable. If SLL conflict resolution chooses an
|
|
212
|
-
* alternative within the LL set, them both SLL and LL would choose the same
|
|
213
|
-
* alternative because they both choose the minimum of multiple conflicting
|
|
214
|
-
* alternatives.
|
|
215
|
-
*
|
|
216
|
-
* Let's say we have a set of SLL conflicting alternatives `{1, 2, 3}` and
|
|
217
|
-
* a smaller LL set called *s*. If *s* is `{2, 3}`, then SLL
|
|
218
|
-
* parsing will get an error because SLL will pursue alternative 1. If
|
|
219
|
-
* *s* is `{1, 2}` or `{1, 3}` then both SLL and LL will
|
|
220
|
-
* choose the same alternative because alternative one is the minimum of either
|
|
221
|
-
* set. If *s* is `{2}` or `{3}` then SLL will get a syntax
|
|
222
|
-
* error. If *s* is `{1}` then SLL will succeed.
|
|
223
|
-
*
|
|
224
|
-
* Of course, if the input is invalid, then we will get an error for sure in
|
|
225
|
-
* both SLL and LL parsing. Erroneous input will therefore require 2 passes over
|
|
226
|
-
* the input.
|
|
227
|
-
*/
|
|
228
|
-
export declare class ParserATNSimulator extends ATNSimulator {
|
|
229
|
-
static debug: boolean;
|
|
230
|
-
static dfa_debug: boolean;
|
|
231
|
-
static retry_debug: boolean;
|
|
232
|
-
private predictionMode;
|
|
233
|
-
force_global_context: boolean;
|
|
234
|
-
always_try_local_context: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* Determines whether the DFA is used for full-context predictions. When
|
|
237
|
-
* `true`, the DFA stores transition information for both full-context
|
|
238
|
-
* and SLL parsing; otherwise, the DFA only stores SLL transition
|
|
239
|
-
* information.
|
|
240
|
-
*
|
|
241
|
-
* For some grammars, enabling the full-context DFA can result in a
|
|
242
|
-
* substantial performance improvement. However, this improvement typically
|
|
243
|
-
* comes at the expense of memory used for storing the cached DFA states,
|
|
244
|
-
* configuration sets, and prediction contexts.
|
|
245
|
-
*
|
|
246
|
-
* The default value is `false`.
|
|
247
|
-
*/
|
|
248
|
-
enable_global_context_dfa: boolean;
|
|
249
|
-
optimize_unique_closure: boolean;
|
|
250
|
-
optimize_ll1: boolean;
|
|
251
|
-
optimize_tail_calls: boolean;
|
|
252
|
-
tail_call_preserves_sll: boolean;
|
|
253
|
-
treat_sllk1_conflict_as_ambiguity: boolean;
|
|
254
|
-
protected _parser: Parser;
|
|
255
|
-
/**
|
|
256
|
-
* When `true`, ambiguous alternatives are reported when they are
|
|
257
|
-
* encountered within {@link #execATN}. When `false`, these messages
|
|
258
|
-
* are suppressed. The default is `false`.
|
|
259
|
-
*
|
|
260
|
-
* When messages about ambiguous alternatives are not required, setting this
|
|
261
|
-
* to `false` enables additional internal optimizations which may lose
|
|
262
|
-
* this information.
|
|
263
|
-
*/
|
|
264
|
-
reportAmbiguities: boolean;
|
|
265
|
-
/** By default we do full context-sensitive LL(*) parsing not
|
|
266
|
-
* Strong LL(*) parsing. If we fail with Strong LL(*) we
|
|
267
|
-
* try full LL(*). That means we rewind and use context information
|
|
268
|
-
* when closure operations fall off the end of the rule that
|
|
269
|
-
* holds the decision were evaluating.
|
|
270
|
-
*/
|
|
271
|
-
protected userWantsCtxSensitive: boolean;
|
|
272
|
-
private dfa?;
|
|
273
|
-
constructor(atn: ATN, parser: Parser);
|
|
274
|
-
getPredictionMode(): PredictionMode;
|
|
275
|
-
setPredictionMode(predictionMode: PredictionMode): void;
|
|
276
|
-
reset(): void;
|
|
277
|
-
adaptivePredict(/*@NotNull*/ input: TokenStream, decision: number, outerContext: ParserRuleContext | undefined): number;
|
|
278
|
-
adaptivePredict(/*@NotNull*/ input: TokenStream, decision: number, outerContext: ParserRuleContext | undefined, useContext: boolean): number;
|
|
279
|
-
protected getStartState(dfa: DFA, input: TokenStream, outerContext: ParserRuleContext, useContext: boolean): SimulatorState | undefined;
|
|
280
|
-
protected execDFA(dfa: DFA, input: TokenStream, startIndex: number, state: SimulatorState): number;
|
|
281
|
-
/**
|
|
282
|
-
* Determines if a particular DFA state should be treated as an accept state
|
|
283
|
-
* for the current prediction mode. In addition to the `useContext`
|
|
284
|
-
* parameter, the {@link #getPredictionMode()} method provides the
|
|
285
|
-
* prediction mode controlling the prediction algorithm as a whole.
|
|
286
|
-
*
|
|
287
|
-
* The default implementation simply returns the value of
|
|
288
|
-
* `DFAState.isAcceptState` except for conflict states when
|
|
289
|
-
* `useContext` is `true` and {@link #getPredictionMode()} is
|
|
290
|
-
* {@link PredictionMode#LL_EXACT_AMBIG_DETECTION}. In that case, only
|
|
291
|
-
* conflict states where {@link ATNConfigSet#isExactConflict} is
|
|
292
|
-
* `true` are considered accept states.
|
|
293
|
-
*
|
|
294
|
-
* @param state The DFA state to check.
|
|
295
|
-
* @param useContext `true` if the prediction algorithm is currently
|
|
296
|
-
* considering the full parser context; otherwise, `false` if the
|
|
297
|
-
* algorithm is currently performing a local context prediction.
|
|
298
|
-
*
|
|
299
|
-
* @returns `true` if the specified `state` is an accept state;
|
|
300
|
-
* otherwise, `false`.
|
|
301
|
-
*/
|
|
302
|
-
protected isAcceptState(state: DFAState, useContext: boolean): boolean;
|
|
303
|
-
/** Performs ATN simulation to compute a predicted alternative based
|
|
304
|
-
* upon the remaining input, but also updates the DFA cache to avoid
|
|
305
|
-
* having to traverse the ATN again for the same input sequence.
|
|
306
|
-
*
|
|
307
|
-
* There are some key conditions we're looking for after computing a new
|
|
308
|
-
* set of ATN configs (proposed DFA state):
|
|
309
|
-
*
|
|
310
|
-
* * if the set is empty, there is no viable alternative for current symbol
|
|
311
|
-
* * does the state uniquely predict an alternative?
|
|
312
|
-
* * does the state have a conflict that would prevent us from
|
|
313
|
-
* putting it on the work list?
|
|
314
|
-
* * if in non-greedy decision is there a config at a rule stop state?
|
|
315
|
-
*
|
|
316
|
-
* We also have some key operations to do:
|
|
317
|
-
*
|
|
318
|
-
* * add an edge from previous DFA state to potentially new DFA state, D,
|
|
319
|
-
* upon current symbol but only if adding to work list, which means in all
|
|
320
|
-
* cases except no viable alternative (and possibly non-greedy decisions?)
|
|
321
|
-
* * collecting predicates and adding semantic context to DFA accept states
|
|
322
|
-
* * adding rule context to context-sensitive DFA accept states
|
|
323
|
-
* * consuming an input symbol
|
|
324
|
-
* * reporting a conflict
|
|
325
|
-
* * reporting an ambiguity
|
|
326
|
-
* * reporting a context sensitivity
|
|
327
|
-
* * reporting insufficient predicates
|
|
328
|
-
*
|
|
329
|
-
* We should isolate those operations, which are side-effecting, to the
|
|
330
|
-
* main work loop. We can isolate lots of code into other functions, but
|
|
331
|
-
* they should be side effect free. They can return package that
|
|
332
|
-
* indicates whether we should report something, whether we need to add a
|
|
333
|
-
* DFA edge, whether we need to augment accept state with semantic
|
|
334
|
-
* context or rule invocation context. Actually, it seems like we always
|
|
335
|
-
* add predicates if they exist, so that can simply be done in the main
|
|
336
|
-
* loop for any accept state creation or modification request.
|
|
337
|
-
*
|
|
338
|
-
* cover these cases:
|
|
339
|
-
* dead end
|
|
340
|
-
* single alt
|
|
341
|
-
* single alt + preds
|
|
342
|
-
* conflict
|
|
343
|
-
* conflict + preds
|
|
344
|
-
*
|
|
345
|
-
* TODO: greedy + those
|
|
346
|
-
*/
|
|
347
|
-
protected execATN(dfa: DFA, input: TokenStream, startIndex: number, initialState: SimulatorState): number;
|
|
348
|
-
/**
|
|
349
|
-
* This method is used to improve the localization of error messages by
|
|
350
|
-
* choosing an alternative rather than throwing a
|
|
351
|
-
* {@link NoViableAltException} in particular prediction scenarios where the
|
|
352
|
-
* {@link #ERROR} state was reached during ATN simulation.
|
|
353
|
-
*
|
|
354
|
-
* The default implementation of this method uses the following
|
|
355
|
-
* algorithm to identify an ATN configuration which successfully parsed the
|
|
356
|
-
* decision entry rule. Choosing such an alternative ensures that the
|
|
357
|
-
* {@link ParserRuleContext} returned by the calling rule will be complete
|
|
358
|
-
* and valid, and the syntax error will be reported later at a more
|
|
359
|
-
* localized location.
|
|
360
|
-
*
|
|
361
|
-
* * If no configuration in `configs` reached the end of the
|
|
362
|
-
* decision rule, return {@link ATN#INVALID_ALT_NUMBER}.
|
|
363
|
-
* * If all configurations in `configs` which reached the end of the
|
|
364
|
-
* decision rule predict the same alternative, return that alternative.
|
|
365
|
-
* * If the configurations in `configs` which reached the end of the
|
|
366
|
-
* decision rule predict multiple alternatives (call this *S*),
|
|
367
|
-
* choose an alternative in the following order.
|
|
368
|
-
*
|
|
369
|
-
* 1. Filter the configurations in `configs` to only those
|
|
370
|
-
* configurations which remain viable after evaluating semantic predicates.
|
|
371
|
-
* If the set of these filtered configurations which also reached the end of
|
|
372
|
-
* the decision rule is not empty, return the minimum alternative
|
|
373
|
-
* represented in this set.
|
|
374
|
-
* 1. Otherwise, choose the minimum alternative in *S*.
|
|
375
|
-
*
|
|
376
|
-
* In some scenarios, the algorithm described above could predict an
|
|
377
|
-
* alternative which will result in a {@link FailedPredicateException} in
|
|
378
|
-
* parser. Specifically, this could occur if the *only* configuration
|
|
379
|
-
* capable of successfully parsing to the end of the decision rule is
|
|
380
|
-
* blocked by a semantic predicate. By choosing this alternative within
|
|
381
|
-
* {@link #adaptivePredict} instead of throwing a
|
|
382
|
-
* {@link NoViableAltException}, the resulting
|
|
383
|
-
* {@link FailedPredicateException} in the parser will identify the specific
|
|
384
|
-
* predicate which is preventing the parser from successfully parsing the
|
|
385
|
-
* decision rule, which helps developers identify and correct logic errors
|
|
386
|
-
* in semantic predicates.
|
|
387
|
-
*
|
|
388
|
-
* @param input The input {@link TokenStream}
|
|
389
|
-
* @param startIndex The start index for the current prediction, which is
|
|
390
|
-
* the input index where any semantic context in `configs` should be
|
|
391
|
-
* evaluated
|
|
392
|
-
* @param previous The ATN simulation state immediately before the
|
|
393
|
-
* {@link #ERROR} state was reached
|
|
394
|
-
*
|
|
395
|
-
* @returns The value to return from {@link #adaptivePredict}, or
|
|
396
|
-
* {@link ATN#INVALID_ALT_NUMBER} if a suitable alternative was not
|
|
397
|
-
* identified and {@link #adaptivePredict} should report an error instead.
|
|
398
|
-
*/
|
|
399
|
-
protected handleNoViableAlt(input: TokenStream, startIndex: number, previous: SimulatorState): number;
|
|
400
|
-
protected computeReachSet(dfa: DFA, previous: SimulatorState, t: number, contextCache: PredictionContextCache): SimulatorState | undefined;
|
|
401
|
-
/**
|
|
402
|
-
* Get an existing target state for an edge in the DFA. If the target state
|
|
403
|
-
* for the edge has not yet been computed or is otherwise not available,
|
|
404
|
-
* this method returns `undefined`.
|
|
405
|
-
*
|
|
406
|
-
* @param s The current DFA state
|
|
407
|
-
* @param t The next input symbol
|
|
408
|
-
* @returns The existing target DFA state for the given input symbol
|
|
409
|
-
* `t`, or `undefined` if the target state for this edge is not
|
|
410
|
-
* already cached
|
|
411
|
-
*/
|
|
412
|
-
protected getExistingTargetState(s: DFAState, t: number): DFAState | undefined;
|
|
413
|
-
/**
|
|
414
|
-
* Compute a target state for an edge in the DFA, and attempt to add the
|
|
415
|
-
* computed state and corresponding edge to the DFA.
|
|
416
|
-
*
|
|
417
|
-
* @param dfa
|
|
418
|
-
* @param s The current DFA state
|
|
419
|
-
* @param remainingGlobalContext
|
|
420
|
-
* @param t The next input symbol
|
|
421
|
-
* @param useContext
|
|
422
|
-
* @param contextCache
|
|
423
|
-
*
|
|
424
|
-
* @returns The computed target DFA state for the given input symbol
|
|
425
|
-
* `t`. If `t` does not lead to a valid DFA state, this method
|
|
426
|
-
* returns {@link #ERROR}.
|
|
427
|
-
*/
|
|
428
|
-
protected computeTargetState(dfa: DFA, s: DFAState, remainingGlobalContext: ParserRuleContext | undefined, t: number, useContext: boolean, contextCache: PredictionContextCache): [DFAState, ParserRuleContext | undefined];
|
|
429
|
-
/**
|
|
430
|
-
* Return a configuration set containing only the configurations from
|
|
431
|
-
* `configs` which are in a {@link RuleStopState}. If all
|
|
432
|
-
* configurations in `configs` are already in a rule stop state, this
|
|
433
|
-
* method simply returns `configs`.
|
|
434
|
-
*
|
|
435
|
-
* @param configs the configuration set to update
|
|
436
|
-
* @param contextCache the {@link PredictionContext} cache
|
|
437
|
-
*
|
|
438
|
-
* @returns `configs` if all configurations in `configs` are in a
|
|
439
|
-
* rule stop state, otherwise return a new configuration set containing only
|
|
440
|
-
* the configurations from `configs` which are in a rule stop state
|
|
441
|
-
*/
|
|
442
|
-
protected removeAllConfigsNotInRuleStopState(configs: ATNConfigSet, contextCache: PredictionContextCache): ATNConfigSet;
|
|
443
|
-
protected computeStartState(dfa: DFA, globalContext: ParserRuleContext, useContext: boolean): SimulatorState;
|
|
444
|
-
/**
|
|
445
|
-
* This method transforms the start state computed by
|
|
446
|
-
* {@link #computeStartState} to the special start state used by a
|
|
447
|
-
* precedence DFA for a particular precedence value. The transformation
|
|
448
|
-
* process applies the following changes to the start state's configuration
|
|
449
|
-
* set.
|
|
450
|
-
*
|
|
451
|
-
* 1. Evaluate the precedence predicates for each configuration using
|
|
452
|
-
* {@link SemanticContext#evalPrecedence}.
|
|
453
|
-
* 1. When {@link ATNConfig#isPrecedenceFilterSuppressed} is `false`,
|
|
454
|
-
* remove all configurations which predict an alternative greater than 1,
|
|
455
|
-
* for which another configuration that predicts alternative 1 is in the
|
|
456
|
-
* same ATN state with the same prediction context. This transformation is
|
|
457
|
-
* valid for the following reasons:
|
|
458
|
-
*
|
|
459
|
-
* * The closure block cannot contain any epsilon transitions which bypass
|
|
460
|
-
* the body of the closure, so all states reachable via alternative 1 are
|
|
461
|
-
* part of the precedence alternatives of the transformed left-recursive
|
|
462
|
-
* rule.
|
|
463
|
-
* * The "primary" portion of a left recursive rule cannot contain an
|
|
464
|
-
* epsilon transition, so the only way an alternative other than 1 can exist
|
|
465
|
-
* in a state that is also reachable via alternative 1 is by nesting calls
|
|
466
|
-
* to the left-recursive rule, with the outer calls not being at the
|
|
467
|
-
* preferred precedence level. The
|
|
468
|
-
* {@link ATNConfig#isPrecedenceFilterSuppressed} property marks ATN
|
|
469
|
-
* configurations which do not meet this condition, and therefore are not
|
|
470
|
-
* eligible for elimination during the filtering process.
|
|
471
|
-
*
|
|
472
|
-
* The prediction context must be considered by this filter to address
|
|
473
|
-
* situations like the following.
|
|
474
|
-
*
|
|
475
|
-
* ```antlr
|
|
476
|
-
* grammar TA;
|
|
477
|
-
* prog: statement* EOF;
|
|
478
|
-
* statement: letterA | statement letterA 'b' ;
|
|
479
|
-
* letterA: 'a';
|
|
480
|
-
* ```
|
|
481
|
-
*
|
|
482
|
-
* If the above grammar, the ATN state immediately before the token
|
|
483
|
-
* reference `'a'` in `letterA` is reachable from the left edge
|
|
484
|
-
* of both the primary and closure blocks of the left-recursive rule
|
|
485
|
-
* `statement`. The prediction context associated with each of these
|
|
486
|
-
* configurations distinguishes between them, and prevents the alternative
|
|
487
|
-
* which stepped out to `prog` (and then back in to `statement`
|
|
488
|
-
* from being eliminated by the filter.
|
|
489
|
-
*
|
|
490
|
-
* @param configs The configuration set computed by
|
|
491
|
-
* {@link #computeStartState} as the start state for the DFA.
|
|
492
|
-
* @returns The transformed configuration set representing the start state
|
|
493
|
-
* for a precedence DFA at a particular precedence level (determined by
|
|
494
|
-
* calling {@link Parser#getPrecedence}).
|
|
495
|
-
*/
|
|
496
|
-
protected applyPrecedenceFilter(configs: ATNConfigSet, globalContext: ParserRuleContext, contextCache: PredictionContextCache): ATNConfigSet;
|
|
497
|
-
protected getReachableTarget(source: ATNConfig, trans: Transition, ttype: number): ATNState | undefined;
|
|
498
|
-
/** collect and set D's semantic context */
|
|
499
|
-
protected predicateDFAState(D: DFAState, configs: ATNConfigSet, nalts: number): DFAState.PredPrediction[] | undefined;
|
|
500
|
-
protected getPredsForAmbigAlts(ambigAlts: BitSet, configs: ATNConfigSet, nalts: number): SemanticContext[] | undefined;
|
|
501
|
-
protected getPredicatePredictions(ambigAlts: BitSet | undefined, altToPred: SemanticContext[]): DFAState.PredPrediction[] | undefined;
|
|
502
|
-
/** Look through a list of predicate/alt pairs, returning alts for the
|
|
503
|
-
* pairs that win. An `undefined` predicate indicates an alt containing an
|
|
504
|
-
* unpredicated config which behaves as "always true."
|
|
505
|
-
*/
|
|
506
|
-
protected evalSemanticContext(predPredictions: DFAState.PredPrediction[], outerContext: ParserRuleContext, complete: boolean): BitSet;
|
|
507
|
-
/**
|
|
508
|
-
* Evaluate a semantic context within a specific parser context.
|
|
509
|
-
*
|
|
510
|
-
* This method might not be called for every semantic context evaluated
|
|
511
|
-
* during the prediction process. In particular, we currently do not
|
|
512
|
-
* evaluate the following but it may change in the future:
|
|
513
|
-
*
|
|
514
|
-
* * Precedence predicates (represented by
|
|
515
|
-
* {@link SemanticContext.PrecedencePredicate}) are not currently evaluated
|
|
516
|
-
* through this method.
|
|
517
|
-
* * Operator predicates (represented by {@link SemanticContext.AND} and
|
|
518
|
-
* {@link SemanticContext.OR}) are evaluated as a single semantic
|
|
519
|
-
* context, rather than evaluating the operands individually.
|
|
520
|
-
* Implementations which require evaluation results from individual
|
|
521
|
-
* predicates should override this method to explicitly handle evaluation of
|
|
522
|
-
* the operands within operator predicates.
|
|
523
|
-
*
|
|
524
|
-
* @param pred The semantic context to evaluate
|
|
525
|
-
* @param parserCallStack The parser context in which to evaluate the
|
|
526
|
-
* semantic context
|
|
527
|
-
* @param alt The alternative which is guarded by `pred`
|
|
528
|
-
*
|
|
529
|
-
* @since 4.3
|
|
530
|
-
*/
|
|
531
|
-
protected evalSemanticContextImpl(pred: SemanticContext, parserCallStack: ParserRuleContext, alt: number): boolean;
|
|
532
|
-
protected closure(sourceConfigs: ATNConfigSet, configs: ATNConfigSet, collectPredicates: boolean, hasMoreContext: boolean, contextCache: PredictionContextCache, treatEofAsEpsilon: boolean): void;
|
|
533
|
-
protected closureImpl(config: ATNConfig, configs: ATNConfigSet, intermediate: ATNConfigSet, closureBusy: Array2DHashSet<ATNConfig>, collectPredicates: boolean, hasMoreContexts: boolean, contextCache: PredictionContextCache, depth: number, treatEofAsEpsilon: boolean): void;
|
|
534
|
-
getRuleName(index: number): string;
|
|
535
|
-
protected getEpsilonTarget(config: ATNConfig, t: Transition, collectPredicates: boolean, inContext: boolean, contextCache: PredictionContextCache, treatEofAsEpsilon: boolean): ATNConfig | undefined;
|
|
536
|
-
protected actionTransition(config: ATNConfig, t: ActionTransition): ATNConfig;
|
|
537
|
-
protected precedenceTransition(config: ATNConfig, pt: PrecedencePredicateTransition, collectPredicates: boolean, inContext: boolean): ATNConfig;
|
|
538
|
-
protected predTransition(config: ATNConfig, pt: PredicateTransition, collectPredicates: boolean, inContext: boolean): ATNConfig;
|
|
539
|
-
protected ruleTransition(config: ATNConfig, t: RuleTransition, contextCache: PredictionContextCache): ATNConfig;
|
|
540
|
-
private static STATE_ALT_SORT_COMPARATOR;
|
|
541
|
-
private isConflicted;
|
|
542
|
-
protected getConflictingAltsFromConfigSet(configs: ATNConfigSet): BitSet | undefined;
|
|
543
|
-
getTokenName(t: number): string;
|
|
544
|
-
getLookaheadName(input: TokenStream): string;
|
|
545
|
-
dumpDeadEndConfigs(nvae: NoViableAltException): void;
|
|
546
|
-
protected noViableAlt(input: TokenStream, outerContext: ParserRuleContext, configs: ATNConfigSet, startIndex: number): NoViableAltException;
|
|
547
|
-
protected getUniqueAlt(configs: Iterable<ATNConfig>): number;
|
|
548
|
-
protected configWithAltAtStopState(configs: Iterable<ATNConfig>, alt: number): boolean;
|
|
549
|
-
protected addDFAEdge(dfa: DFA, fromState: DFAState, t: number, contextTransitions: IntegerList | undefined, toConfigs: ATNConfigSet, contextCache: PredictionContextCache): DFAState;
|
|
550
|
-
protected setDFAEdge(p: DFAState, t: number, q: DFAState): void;
|
|
551
|
-
/** See comment on LexerInterpreter.addDFAState. */
|
|
552
|
-
protected addDFAContextState(dfa: DFA, configs: ATNConfigSet, returnContext: number, contextCache: PredictionContextCache): DFAState;
|
|
553
|
-
/** See comment on LexerInterpreter.addDFAState. */
|
|
554
|
-
protected addDFAState(dfa: DFA, configs: ATNConfigSet, contextCache: PredictionContextCache): DFAState;
|
|
555
|
-
protected createDFAState(dfa: DFA, configs: ATNConfigSet): DFAState;
|
|
556
|
-
protected reportAttemptingFullContext(dfa: DFA, conflictingAlts: BitSet | undefined, conflictState: SimulatorState, startIndex: number, stopIndex: number): void;
|
|
557
|
-
protected reportContextSensitivity(dfa: DFA, prediction: number, acceptState: SimulatorState, startIndex: number, stopIndex: number): void;
|
|
558
|
-
/** If context sensitive parsing, we know it's ambiguity not conflict */
|
|
559
|
-
protected reportAmbiguity(dfa: DFA, D: DFAState, // the DFA state from execATN(): void that had SLL conflicts
|
|
560
|
-
startIndex: number, stopIndex: number, exact: boolean, ambigAlts: BitSet, configs: ATNConfigSet): void;
|
|
561
|
-
protected getReturnState(context: RuleContext): number;
|
|
562
|
-
protected skipTailCalls(context: ParserRuleContext): ParserRuleContext;
|
|
563
|
-
/**
|
|
564
|
-
* @since 4.3
|
|
565
|
-
*/
|
|
566
|
-
get parser(): Parser;
|
|
567
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2016 The ANTLR Project. All rights reserved.
|
|
3
|
-
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
|
|
4
|
-
*/
|
|
5
|
-
import { ATNStateType } from "./ATNStateType";
|
|
6
|
-
import { BlockStartState } from "./BlockStartState";
|
|
7
|
-
import { PlusLoopbackState } from "./PlusLoopbackState";
|
|
8
|
-
/** Start of `(A|B|...)+` loop. Technically a decision state, but
|
|
9
|
-
* we don't use for code generation; somebody might need it, so I'm defining
|
|
10
|
-
* it for completeness. In reality, the {@link PlusLoopbackState} node is the
|
|
11
|
-
* real decision-making note for `A+`.
|
|
12
|
-
*/
|
|
13
|
-
export declare class PlusBlockStartState extends BlockStartState {
|
|
14
|
-
loopBackState: PlusLoopbackState;
|
|
15
|
-
get stateType(): ATNStateType;
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2016 The ANTLR Project. All rights reserved.
|
|
3
|
-
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
|
|
4
|
-
*/
|
|
5
|
-
import { ATNStateType } from "./ATNStateType";
|
|
6
|
-
import { DecisionState } from "./DecisionState";
|
|
7
|
-
/** Decision state for `A+` and `(A|B)+`. It has two transitions:
|
|
8
|
-
* one to the loop back to start of the block and one to exit.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PlusLoopbackState extends DecisionState {
|
|
11
|
-
get stateType(): ATNStateType;
|
|
12
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2016 The ANTLR Project. All rights reserved.
|
|
3
|
-
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
|
|
4
|
-
*/
|
|
5
|
-
import { AbstractPredicateTransition } from "./AbstractPredicateTransition";
|
|
6
|
-
import { ATNState } from "./ATNState";
|
|
7
|
-
import { SemanticContext } from "./SemanticContext";
|
|
8
|
-
import { TransitionType } from "./TransitionType";
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @author Sam Harwell
|
|
12
|
-
*/
|
|
13
|
-
export declare class PrecedencePredicateTransition extends AbstractPredicateTransition {
|
|
14
|
-
precedence: number;
|
|
15
|
-
constructor(target: ATNState, precedence: number);
|
|
16
|
-
get serializationType(): TransitionType;
|
|
17
|
-
get isEpsilon(): boolean;
|
|
18
|
-
matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
|
|
19
|
-
get predicate(): SemanticContext.PrecedencePredicate;
|
|
20
|
-
toString(): string;
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2016 The ANTLR Project. All rights reserved.
|
|
3
|
-
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
|
|
4
|
-
*/
|
|
5
|
-
import { DecisionEventInfo } from "./DecisionEventInfo";
|
|
6
|
-
import { SemanticContext } from "./SemanticContext";
|
|
7
|
-
import { SimulatorState } from "./SimulatorState";
|
|
8
|
-
import { TokenStream } from "../TokenStream";
|
|
9
|
-
/**
|
|
10
|
-
* This class represents profiling event information for semantic predicate
|
|
11
|
-
* evaluations which occur during prediction.
|
|
12
|
-
*
|
|
13
|
-
* @see ParserATNSimulator#evalSemanticContext
|
|
14
|
-
*
|
|
15
|
-
* @since 4.3
|
|
16
|
-
*/
|
|
17
|
-
export declare class PredicateEvalInfo extends DecisionEventInfo {
|
|
18
|
-
/**
|
|
19
|
-
* The semantic context which was evaluated.
|
|
20
|
-
*/
|
|
21
|
-
semctx: SemanticContext;
|
|
22
|
-
/**
|
|
23
|
-
* The alternative number for the decision which is guarded by the semantic
|
|
24
|
-
* context {@link #semctx}. Note that other ATN
|
|
25
|
-
* configurations may predict the same alternative which are guarded by
|
|
26
|
-
* other semantic contexts and/or {@link SemanticContext#NONE}.
|
|
27
|
-
*/
|
|
28
|
-
predictedAlt: number;
|
|
29
|
-
/**
|
|
30
|
-
* The result of evaluating the semantic context {@link #semctx}.
|
|
31
|
-
*/
|
|
32
|
-
evalResult: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Constructs a new instance of the {@link PredicateEvalInfo} class with the
|
|
35
|
-
* specified detailed predicate evaluation information.
|
|
36
|
-
*
|
|
37
|
-
* @param state The simulator state
|
|
38
|
-
* @param decision The decision number
|
|
39
|
-
* @param input The input token stream
|
|
40
|
-
* @param startIndex The start index for the current prediction
|
|
41
|
-
* @param stopIndex The index at which the predicate evaluation was
|
|
42
|
-
* triggered. Note that the input stream may be reset to other positions for
|
|
43
|
-
* the actual evaluation of individual predicates.
|
|
44
|
-
* @param semctx The semantic context which was evaluated
|
|
45
|
-
* @param evalResult The results of evaluating the semantic context
|
|
46
|
-
* @param predictedAlt The alternative number for the decision which is
|
|
47
|
-
* guarded by the semantic context `semctx`. See {@link #predictedAlt}
|
|
48
|
-
* for more information.
|
|
49
|
-
*
|
|
50
|
-
* @see ParserATNSimulator#evalSemanticContext(SemanticContext, ParserRuleContext, int)
|
|
51
|
-
* @see SemanticContext#eval(Recognizer, RuleContext)
|
|
52
|
-
*/
|
|
53
|
-
constructor(state: SimulatorState, decision: number, input: TokenStream, startIndex: number, stopIndex: number, semctx: SemanticContext, evalResult: boolean, predictedAlt: number);
|
|
54
|
-
}
|