@opra/client 0.8.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/714.min.cjs +1 -1
- package/cjs/antlr4ts.min.cjs +1 -1
- package/cjs/main.min.cjs +1 -1
- package/cjs/opra-common.min.cjs +1 -1
- package/cjs/vendors.min.cjs +1 -1
- package/esm/714.min.mjs +1 -1
- package/esm/antlr4ts.min.mjs +1 -1
- package/esm/main.min.mjs +1 -1
- package/esm/opra-common.min.mjs +1 -1
- package/esm/vendors.min.mjs +1 -1
- package/package.json +23 -15
- package/typings/antlr4ts/ANTLRErrorListener.d.ts +43 -0
- package/typings/antlr4ts/ANTLRErrorStrategy.d.ts +109 -0
- package/typings/antlr4ts/ANTLRInputStream.d.ts +51 -0
- package/typings/antlr4ts/BailErrorStrategy.d.ts +48 -0
- package/typings/antlr4ts/BufferedTokenStream.d.ts +143 -0
- package/typings/antlr4ts/CharStream.d.ts +26 -0
- package/typings/antlr4ts/CharStreams.d.ts +54 -0
- package/typings/antlr4ts/CodePointBuffer.d.ts +40 -0
- package/typings/antlr4ts/CodePointCharStream.d.ts +45 -0
- package/typings/antlr4ts/CommonToken.d.ts +116 -0
- package/typings/antlr4ts/CommonTokenFactory.d.ts +53 -0
- package/typings/antlr4ts/CommonTokenStream.d.ts +52 -0
- package/typings/antlr4ts/ConsoleErrorListener.d.ts +29 -0
- package/typings/antlr4ts/Decorators.d.ts +8 -0
- package/typings/antlr4ts/DefaultErrorStrategy.d.ts +347 -0
- package/typings/antlr4ts/Dependents.d.ts +69 -0
- package/typings/antlr4ts/DiagnosticErrorListener.d.ts +60 -0
- package/typings/antlr4ts/FailedPredicateException.d.ts +21 -0
- package/typings/antlr4ts/InputMismatchException.d.ts +14 -0
- package/typings/antlr4ts/IntStream.d.ts +197 -0
- package/typings/antlr4ts/InterpreterRuleContext.d.ts +33 -0
- package/typings/antlr4ts/Lexer.d.ts +141 -0
- package/typings/antlr4ts/LexerInterpreter.d.ts +23 -0
- package/typings/antlr4ts/LexerNoViableAltException.d.ts +19 -0
- package/typings/antlr4ts/ListTokenSource.d.ts +86 -0
- package/typings/antlr4ts/NoViableAltException.d.ts +30 -0
- package/typings/antlr4ts/Parser.d.ts +372 -0
- package/typings/antlr4ts/ParserErrorListener.d.ts +112 -0
- package/typings/antlr4ts/ParserInterpreter.d.ts +151 -0
- package/typings/antlr4ts/ParserRuleContext.d.ts +169 -0
- package/typings/antlr4ts/ProxyErrorListener.d.ts +20 -0
- package/typings/antlr4ts/ProxyParserErrorListener.d.ts +21 -0
- package/typings/antlr4ts/RecognitionException.d.ts +87 -0
- package/typings/antlr4ts/Recognizer.d.ts +101 -0
- package/typings/antlr4ts/RuleContext.d.ts +124 -0
- package/typings/antlr4ts/RuleContextWithAltNum.d.ts +22 -0
- package/typings/antlr4ts/RuleDependency.d.ts +32 -0
- package/typings/antlr4ts/RuleVersion.d.ts +11 -0
- package/typings/antlr4ts/Token.d.ts +83 -0
- package/typings/antlr4ts/TokenFactory.d.ts +23 -0
- package/typings/antlr4ts/TokenSource.d.ts +67 -0
- package/typings/antlr4ts/TokenStream.d.ts +145 -0
- package/typings/antlr4ts/TokenStreamRewriter.d.ts +216 -0
- package/typings/antlr4ts/Vocabulary.d.ts +117 -0
- package/typings/antlr4ts/VocabularyImpl.d.ts +47 -0
- package/typings/antlr4ts/WritableToken.d.ts +13 -0
- package/typings/antlr4ts/atn/ATN.d.ts +123 -0
- package/typings/antlr4ts/atn/ATNConfig.d.ts +140 -0
- package/typings/antlr4ts/atn/ATNConfigSet.d.ts +113 -0
- package/typings/antlr4ts/atn/ATNDeserializationOptions.d.ts +26 -0
- package/typings/antlr4ts/atn/ATNDeserializer.d.ts +86 -0
- package/typings/antlr4ts/atn/ATNSimulator.d.ts +28 -0
- package/typings/antlr4ts/atn/ATNState.d.ts +111 -0
- package/typings/antlr4ts/atn/ATNStateType.d.ts +19 -0
- package/typings/antlr4ts/atn/ATNType.d.ts +19 -0
- package/typings/antlr4ts/atn/AbstractPredicateTransition.d.ts +13 -0
- package/typings/antlr4ts/atn/ActionTransition.d.ts +17 -0
- package/typings/antlr4ts/atn/AmbiguityInfo.d.ts +60 -0
- package/typings/antlr4ts/atn/AtomTransition.d.ts +18 -0
- package/typings/antlr4ts/atn/BasicBlockStartState.d.ts +13 -0
- package/typings/antlr4ts/atn/BasicState.d.ts +13 -0
- package/typings/antlr4ts/atn/BlockEndState.d.ts +12 -0
- package/typings/antlr4ts/atn/BlockStartState.d.ts +10 -0
- package/typings/antlr4ts/atn/CodePointTransitions.d.ts +27 -0
- package/typings/antlr4ts/atn/ConflictInfo.d.ts +35 -0
- package/typings/antlr4ts/atn/ContextSensitivityInfo.d.ts +39 -0
- package/typings/antlr4ts/atn/DecisionEventInfo.d.ts +54 -0
- package/typings/antlr4ts/atn/DecisionInfo.d.ts +201 -0
- package/typings/antlr4ts/atn/DecisionState.d.ts +10 -0
- package/typings/antlr4ts/atn/EpsilonTransition.d.ts +24 -0
- package/typings/antlr4ts/atn/ErrorInfo.d.ts +32 -0
- package/typings/antlr4ts/atn/InvalidState.d.ts +13 -0
- package/typings/antlr4ts/atn/LL1Analyzer.d.ts +98 -0
- package/typings/antlr4ts/atn/LexerATNSimulator.d.ts +153 -0
- package/typings/antlr4ts/atn/LexerAction.d.ts +47 -0
- package/typings/antlr4ts/atn/LexerActionExecutor.d.ts +104 -0
- package/typings/antlr4ts/atn/LexerActionType.d.ts +44 -0
- package/typings/antlr4ts/atn/LexerChannelAction.d.ts +48 -0
- package/typings/antlr4ts/atn/LexerCustomAction.d.ts +73 -0
- package/typings/antlr4ts/atn/LexerIndexedCustomAction.d.ts +74 -0
- package/typings/antlr4ts/atn/LexerModeAction.d.ts +48 -0
- package/typings/antlr4ts/atn/LexerMoreAction.d.ts +47 -0
- package/typings/antlr4ts/atn/LexerPopModeAction.d.ts +47 -0
- package/typings/antlr4ts/atn/LexerPushModeAction.d.ts +48 -0
- package/typings/antlr4ts/atn/LexerSkipAction.d.ts +47 -0
- package/typings/antlr4ts/atn/LexerTypeAction.d.ts +47 -0
- package/typings/antlr4ts/atn/LookaheadEventInfo.d.ts +37 -0
- package/typings/antlr4ts/atn/LoopEndState.d.ts +11 -0
- package/typings/antlr4ts/atn/NotSetTransition.d.ts +14 -0
- package/typings/antlr4ts/atn/OrderedATNConfigSet.d.ts +23 -0
- package/typings/antlr4ts/atn/ParseInfo.d.ts +79 -0
- package/typings/antlr4ts/atn/ParserATNSimulator.d.ts +567 -0
- package/typings/antlr4ts/atn/PlusBlockStartState.d.ts +16 -0
- package/typings/antlr4ts/atn/PlusLoopbackState.d.ts +12 -0
- package/typings/antlr4ts/atn/PrecedencePredicateTransition.d.ts +21 -0
- package/typings/antlr4ts/atn/PredicateEvalInfo.d.ts +54 -0
- package/typings/antlr4ts/atn/PredicateTransition.d.ts +25 -0
- package/typings/antlr4ts/atn/PredictionContext.d.ts +89 -0
- package/typings/antlr4ts/atn/PredictionContextCache.d.ts +40 -0
- package/typings/antlr4ts/atn/PredictionMode.d.ts +89 -0
- package/typings/antlr4ts/atn/ProfilingATNSimulator.d.ts +55 -0
- package/typings/antlr4ts/atn/RangeTransition.d.ts +17 -0
- package/typings/antlr4ts/atn/RuleStartState.d.ts +13 -0
- package/typings/antlr4ts/atn/RuleStopState.d.ts +15 -0
- package/typings/antlr4ts/atn/RuleTransition.d.ts +22 -0
- package/typings/antlr4ts/atn/SemanticContext.d.ts +143 -0
- package/typings/antlr4ts/atn/SetTransition.d.ts +17 -0
- package/typings/antlr4ts/atn/SimulatorState.d.ts +17 -0
- package/typings/antlr4ts/atn/StarBlockStartState.d.ts +10 -0
- package/typings/antlr4ts/atn/StarLoopEntryState.d.ts +37 -0
- package/typings/antlr4ts/atn/StarLoopbackState.d.ts +11 -0
- package/typings/antlr4ts/atn/TokensStartState.d.ts +10 -0
- package/typings/antlr4ts/atn/Transition.d.ts +38 -0
- package/typings/antlr4ts/atn/TransitionType.d.ts +16 -0
- package/typings/antlr4ts/atn/WildcardTransition.d.ts +13 -0
- package/typings/antlr4ts/atn/index.d.ts +73 -0
- package/typings/antlr4ts/dfa/AcceptStateInfo.d.ts +33 -0
- package/typings/antlr4ts/dfa/DFA.d.ts +94 -0
- package/typings/antlr4ts/dfa/DFASerializer.d.ts +23 -0
- package/typings/antlr4ts/dfa/DFAState.d.ts +95 -0
- package/typings/antlr4ts/dfa/LexerDFASerializer.d.ts +10 -0
- package/typings/antlr4ts/dfa/index.d.ts +9 -0
- package/typings/antlr4ts/index.d.ts +49 -0
- package/typings/antlr4ts/misc/Args.d.ts +13 -0
- package/typings/antlr4ts/misc/Array2DHashMap.d.ts +20 -0
- package/typings/antlr4ts/misc/Array2DHashSet.d.ts +62 -0
- package/typings/antlr4ts/misc/ArrayEqualityComparator.d.ts +32 -0
- package/typings/antlr4ts/misc/Arrays.d.ts +18 -0
- package/typings/antlr4ts/misc/BitSet.d.ts +268 -0
- package/typings/antlr4ts/misc/Character.d.ts +7 -0
- package/typings/antlr4ts/misc/DefaultEqualityComparator.d.ts +31 -0
- package/typings/antlr4ts/misc/EqualityComparator.d.ts +29 -0
- package/typings/antlr4ts/misc/IntSet.d.ts +129 -0
- package/typings/antlr4ts/misc/IntegerList.d.ts +69 -0
- package/typings/antlr4ts/misc/IntegerStack.d.ts +15 -0
- package/typings/antlr4ts/misc/InterpreterDataReader.d.ts +39 -0
- package/typings/antlr4ts/misc/Interval.d.ts +57 -0
- package/typings/antlr4ts/misc/IntervalSet.d.ts +96 -0
- package/typings/antlr4ts/misc/MultiMap.d.ts +9 -0
- package/typings/antlr4ts/misc/MurmurHash.d.ts +45 -0
- package/typings/antlr4ts/misc/ObjectEqualityComparator.d.ts +32 -0
- package/typings/antlr4ts/misc/ParseCancellationException.d.ts +18 -0
- package/typings/antlr4ts/misc/Stubs.d.ts +31 -0
- package/typings/antlr4ts/misc/UUID.d.ts +13 -0
- package/typings/antlr4ts/misc/Utils.d.ts +15 -0
- package/typings/antlr4ts/misc/index.d.ts +25 -0
- package/typings/antlr4ts/tree/AbstractParseTreeVisitor.d.ts +103 -0
- package/typings/antlr4ts/tree/ErrorNode.d.ts +17 -0
- package/typings/antlr4ts/tree/ParseTree.d.ts +36 -0
- package/typings/antlr4ts/tree/ParseTreeListener.d.ts +26 -0
- package/typings/antlr4ts/tree/ParseTreeProperty.d.ts +28 -0
- package/typings/antlr4ts/tree/ParseTreeVisitor.d.ts +48 -0
- package/typings/antlr4ts/tree/ParseTreeWalker.d.ts +35 -0
- package/typings/antlr4ts/tree/RuleNode.d.ts +21 -0
- package/typings/antlr4ts/tree/SyntaxTree.d.ts +29 -0
- package/typings/antlr4ts/tree/TerminalNode.d.ts +27 -0
- package/typings/antlr4ts/tree/Tree.d.ts +36 -0
- package/typings/antlr4ts/tree/Trees.d.ts +75 -0
- package/typings/antlr4ts/tree/index.d.ts +16 -0
- package/typings/antlr4ts/tree/pattern/Chunk.d.ts +17 -0
- package/typings/antlr4ts/tree/pattern/ParseTreeMatch.d.ts +124 -0
- package/typings/antlr4ts/tree/pattern/ParseTreePattern.d.ts +98 -0
- package/typings/antlr4ts/tree/pattern/ParseTreePatternMatcher.d.ts +166 -0
- package/typings/antlr4ts/tree/pattern/RuleTagToken.d.ts +122 -0
- package/typings/antlr4ts/tree/pattern/TagChunk.d.ts +59 -0
- package/typings/antlr4ts/tree/pattern/TextChunk.d.ts +35 -0
- package/typings/antlr4ts/tree/pattern/TokenTagToken.d.ts +56 -0
- package/typings/antlr4ts/tree/pattern/index.d.ts +9 -0
- package/typings/antlr4ts/tree/xpath/XPath.d.ts +66 -0
- package/typings/antlr4ts/tree/xpath/XPathElement.d.ts +19 -0
- package/typings/antlr4ts/tree/xpath/XPathLexer.d.ts +36 -0
- package/typings/antlr4ts/tree/xpath/XPathLexerErrorListener.d.ts +10 -0
- package/typings/antlr4ts/tree/xpath/XPathRuleAnywhereElement.d.ts +14 -0
- package/typings/antlr4ts/tree/xpath/XPathRuleElement.d.ts +11 -0
- package/typings/antlr4ts/tree/xpath/XPathTokenAnywhereElement.d.ts +11 -0
- package/typings/antlr4ts/tree/xpath/XPathTokenElement.d.ts +11 -0
- package/typings/antlr4ts/tree/xpath/XPathWildcardAnywhereElement.d.ts +10 -0
- package/typings/antlr4ts/tree/xpath/XPathWildcardElement.d.ts +10 -0
- package/typings/antlr4ts/tree/xpath/index.d.ts +14 -0
- package/typings/common/filter/antlr/OpraFilterLexer.d.ts +4 -4
- package/typings/common/filter/antlr/OpraFilterParser.d.ts +8 -8
- package/typings/common/filter/antlr/OpraFilterVisitor.d.ts +1 -1
- package/typings/common/filter/error-listener.d.ts +2 -2
- package/typings/common/filter/errors.d.ts +2 -2
- package/typings/common/filter/filter-tree-visitor.d.ts +1 -1
- package/typings/common/filter/parse.d.ts +1 -1
- package/umd/714.min.cjs +1 -1
- package/umd/antlr4ts.min.cjs +1 -1
- package/umd/main.min.cjs +1 -1
- package/umd/opra-common.min.cjs +1 -1
- package/umd/vendors.min.cjs +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
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 { ATNState } from "./ATNState";
|
|
6
|
+
import { IntervalSet } from "../misc/IntervalSet";
|
|
7
|
+
import { TransitionType } from "./TransitionType";
|
|
8
|
+
/** An ATN transition between any two ATN states. Subclasses define
|
|
9
|
+
* atom, set, epsilon, action, predicate, rule transitions.
|
|
10
|
+
*
|
|
11
|
+
* This is a one way link. It emanates from a state (usually via a list of
|
|
12
|
+
* transitions) and has a target state.
|
|
13
|
+
*
|
|
14
|
+
* Since we never have to change the ATN transitions once we construct it,
|
|
15
|
+
* we can fix these transitions as specific classes. The DFA transitions
|
|
16
|
+
* on the other hand need to update the labels as it adds transitions to
|
|
17
|
+
* the states. We'll use the term Edge for the DFA to distinguish them from
|
|
18
|
+
* ATN transitions.
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class Transition {
|
|
21
|
+
static readonly serializationNames: string[];
|
|
22
|
+
/** The target of this transition. */
|
|
23
|
+
target: ATNState;
|
|
24
|
+
constructor(target: ATNState);
|
|
25
|
+
abstract readonly serializationType: TransitionType;
|
|
26
|
+
/**
|
|
27
|
+
* Determines if the transition is an "epsilon" transition.
|
|
28
|
+
*
|
|
29
|
+
* The default implementation returns `false`.
|
|
30
|
+
*
|
|
31
|
+
* @returns `true` if traversing this transition in the ATN does not
|
|
32
|
+
* consume an input symbol; otherwise, `false` if traversing this
|
|
33
|
+
* transition consumes (matches) an input symbol.
|
|
34
|
+
*/
|
|
35
|
+
get isEpsilon(): boolean;
|
|
36
|
+
get label(): IntervalSet | undefined;
|
|
37
|
+
abstract matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export declare const enum TransitionType {
|
|
6
|
+
EPSILON = 1,
|
|
7
|
+
RANGE = 2,
|
|
8
|
+
RULE = 3,
|
|
9
|
+
PREDICATE = 4,
|
|
10
|
+
ATOM = 5,
|
|
11
|
+
ACTION = 6,
|
|
12
|
+
SET = 7,
|
|
13
|
+
NOT_SET = 8,
|
|
14
|
+
WILDCARD = 9,
|
|
15
|
+
PRECEDENCE = 10
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 { ATNState } from "./ATNState";
|
|
6
|
+
import { Transition } from "./Transition";
|
|
7
|
+
import { TransitionType } from "./TransitionType";
|
|
8
|
+
export declare class WildcardTransition extends Transition {
|
|
9
|
+
constructor(target: ATNState);
|
|
10
|
+
get serializationType(): TransitionType;
|
|
11
|
+
matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
|
|
12
|
+
toString(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
export * from "./AbstractPredicateTransition";
|
|
6
|
+
export * from "./ActionTransition";
|
|
7
|
+
export * from "./AmbiguityInfo";
|
|
8
|
+
export * from "./ATN";
|
|
9
|
+
export * from "./ATNConfig";
|
|
10
|
+
export * from "./ATNConfigSet";
|
|
11
|
+
export * from "./ATNDeserializationOptions";
|
|
12
|
+
export * from "./ATNDeserializer";
|
|
13
|
+
export * from "./ATNSimulator";
|
|
14
|
+
export * from "./ATNState";
|
|
15
|
+
export * from "./ATNStateType";
|
|
16
|
+
export * from "./ATNType";
|
|
17
|
+
export * from "./AtomTransition";
|
|
18
|
+
export * from "./BasicBlockStartState";
|
|
19
|
+
export * from "./BasicState";
|
|
20
|
+
export * from "./BlockEndState";
|
|
21
|
+
export * from "./BlockStartState";
|
|
22
|
+
export * from "./CodePointTransitions";
|
|
23
|
+
export * from "./ConflictInfo";
|
|
24
|
+
export * from "./ContextSensitivityInfo";
|
|
25
|
+
export * from "./DecisionEventInfo";
|
|
26
|
+
export * from "./DecisionInfo";
|
|
27
|
+
export * from "./DecisionState";
|
|
28
|
+
export * from "./EpsilonTransition";
|
|
29
|
+
export * from "./ErrorInfo";
|
|
30
|
+
export * from "./InvalidState";
|
|
31
|
+
export * from "./LexerAction";
|
|
32
|
+
export * from "./LexerActionExecutor";
|
|
33
|
+
export * from "./LexerActionType";
|
|
34
|
+
export * from "./LexerATNSimulator";
|
|
35
|
+
export * from "./LexerChannelAction";
|
|
36
|
+
export * from "./LexerCustomAction";
|
|
37
|
+
export * from "./LexerIndexedCustomAction";
|
|
38
|
+
export * from "./LexerModeAction";
|
|
39
|
+
export * from "./LexerMoreAction";
|
|
40
|
+
export * from "./LexerPopModeAction";
|
|
41
|
+
export * from "./LexerPushModeAction";
|
|
42
|
+
export * from "./LexerSkipAction";
|
|
43
|
+
export * from "./LexerTypeAction";
|
|
44
|
+
export * from "./LL1Analyzer";
|
|
45
|
+
export * from "./LookaheadEventInfo";
|
|
46
|
+
export * from "./LoopEndState";
|
|
47
|
+
export * from "./NotSetTransition";
|
|
48
|
+
export * from "./OrderedATNConfigSet";
|
|
49
|
+
export * from "./ParseInfo";
|
|
50
|
+
export * from "./ParserATNSimulator";
|
|
51
|
+
export * from "./PlusBlockStartState";
|
|
52
|
+
export * from "./PlusLoopbackState";
|
|
53
|
+
export * from "./PrecedencePredicateTransition";
|
|
54
|
+
export * from "./PredicateEvalInfo";
|
|
55
|
+
export * from "./PredicateTransition";
|
|
56
|
+
export * from "./PredictionContext";
|
|
57
|
+
export * from "./PredictionContextCache";
|
|
58
|
+
export * from "./PredictionMode";
|
|
59
|
+
export * from "./ProfilingATNSimulator";
|
|
60
|
+
export * from "./RangeTransition";
|
|
61
|
+
export * from "./RuleStartState";
|
|
62
|
+
export * from "./RuleStopState";
|
|
63
|
+
export * from "./RuleTransition";
|
|
64
|
+
export * from "./SemanticContext";
|
|
65
|
+
export * from "./SetTransition";
|
|
66
|
+
export * from "./SimulatorState";
|
|
67
|
+
export * from "./StarBlockStartState";
|
|
68
|
+
export * from "./StarLoopbackState";
|
|
69
|
+
export * from "./StarLoopEntryState";
|
|
70
|
+
export * from "./TokensStartState";
|
|
71
|
+
export * from "./Transition";
|
|
72
|
+
export * from "./TransitionType";
|
|
73
|
+
export * from "./WildcardTransition";
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { LexerActionExecutor } from "../atn/LexerActionExecutor";
|
|
6
|
+
/**
|
|
7
|
+
* Stores information about a {@link DFAState} which is an accept state under
|
|
8
|
+
* some condition. Certain settings, such as
|
|
9
|
+
* {@link ParserATNSimulator#getPredictionMode()}, may be used in addition to
|
|
10
|
+
* this information to determine whether or not a particular state is an accept
|
|
11
|
+
* state.
|
|
12
|
+
*
|
|
13
|
+
* @author Sam Harwell
|
|
14
|
+
*/
|
|
15
|
+
export declare class AcceptStateInfo {
|
|
16
|
+
private readonly _prediction;
|
|
17
|
+
private readonly _lexerActionExecutor?;
|
|
18
|
+
constructor(prediction: number);
|
|
19
|
+
constructor(prediction: number, lexerActionExecutor: LexerActionExecutor | undefined);
|
|
20
|
+
/**
|
|
21
|
+
* Gets the prediction made by this accept state. Note that this value
|
|
22
|
+
* assumes the predicates, if any, in the {@link DFAState} evaluate to
|
|
23
|
+
* `true`. If predicate evaluation is enabled, the final prediction of
|
|
24
|
+
* the accept state will be determined by the result of predicate
|
|
25
|
+
* evaluation.
|
|
26
|
+
*/
|
|
27
|
+
get prediction(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the {@link LexerActionExecutor} which can be used to execute actions
|
|
30
|
+
* and/or commands after the lexer matches a token.
|
|
31
|
+
*/
|
|
32
|
+
get lexerActionExecutor(): LexerActionExecutor | undefined;
|
|
33
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
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 { Array2DHashSet } from "../misc/Array2DHashSet";
|
|
6
|
+
import { ATN } from "../atn/ATN";
|
|
7
|
+
import { ATNState } from "../atn/ATNState";
|
|
8
|
+
import { DecisionState } from "../atn/DecisionState";
|
|
9
|
+
import { DFAState } from "./DFAState";
|
|
10
|
+
import { TokensStartState } from "../atn/TokensStartState";
|
|
11
|
+
import { Vocabulary } from "../Vocabulary";
|
|
12
|
+
export declare class DFA {
|
|
13
|
+
/**
|
|
14
|
+
* A set of all states in the `DFA`.
|
|
15
|
+
*
|
|
16
|
+
* Note that this collection of states holds the DFA states for both SLL and LL prediction. Only the start state
|
|
17
|
+
* needs to be differentiated for these cases, which is tracked by the `s0` and `s0full` fields.
|
|
18
|
+
*/
|
|
19
|
+
readonly states: Array2DHashSet<DFAState>;
|
|
20
|
+
s0: DFAState | undefined;
|
|
21
|
+
s0full: DFAState | undefined;
|
|
22
|
+
readonly decision: number;
|
|
23
|
+
/** From which ATN state did we create this DFA? */
|
|
24
|
+
atnStartState: ATNState;
|
|
25
|
+
/**
|
|
26
|
+
* Note: this field is accessed as `atnStartState.atn` in other targets. The TypeScript target keeps a separate copy
|
|
27
|
+
* to avoid a number of additional null/undefined checks each time the ATN is accessed.
|
|
28
|
+
*/
|
|
29
|
+
atn: ATN;
|
|
30
|
+
private nextStateNumber;
|
|
31
|
+
/**
|
|
32
|
+
* `true` if this DFA is for a precedence decision; otherwise,
|
|
33
|
+
* `false`. This is the backing field for {@link #isPrecedenceDfa}.
|
|
34
|
+
*/
|
|
35
|
+
private precedenceDfa;
|
|
36
|
+
/**
|
|
37
|
+
* Constructs a `DFA` instance associated with a lexer mode.
|
|
38
|
+
*
|
|
39
|
+
* The start state for a `DFA` constructed with this constructor should be a `TokensStartState`, which is the start
|
|
40
|
+
* state for a lexer mode. The prediction made by this DFA determines the lexer rule which matches the current
|
|
41
|
+
* input.
|
|
42
|
+
*
|
|
43
|
+
* @param atnStartState The start state for the mode.
|
|
44
|
+
*/
|
|
45
|
+
constructor(atnStartState: TokensStartState);
|
|
46
|
+
/**
|
|
47
|
+
* Constructs a `DFA` instance associated with a decision.
|
|
48
|
+
*
|
|
49
|
+
* @param atnStartState The decision associated with this DFA.
|
|
50
|
+
* @param decision The decision number.
|
|
51
|
+
*/
|
|
52
|
+
constructor(atnStartState: DecisionState, decision: number);
|
|
53
|
+
/**
|
|
54
|
+
* Gets whether this DFA is a precedence DFA. Precedence DFAs use a special
|
|
55
|
+
* start state {@link #s0} which is not stored in {@link #states}. The
|
|
56
|
+
* {@link DFAState#edges} array for this start state contains outgoing edges
|
|
57
|
+
* supplying individual start states corresponding to specific precedence
|
|
58
|
+
* values.
|
|
59
|
+
*
|
|
60
|
+
* @returns `true` if this is a precedence DFA; otherwise,
|
|
61
|
+
* `false`.
|
|
62
|
+
* @see Parser.precedence
|
|
63
|
+
*/
|
|
64
|
+
get isPrecedenceDfa(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Get the start state for a specific precedence value.
|
|
67
|
+
*
|
|
68
|
+
* @param precedence The current precedence.
|
|
69
|
+
* @returns The start state corresponding to the specified precedence, or
|
|
70
|
+
* `undefined` if no start state exists for the specified precedence.
|
|
71
|
+
*
|
|
72
|
+
* @ if this is not a precedence DFA.
|
|
73
|
+
* @see `isPrecedenceDfa`
|
|
74
|
+
*/
|
|
75
|
+
getPrecedenceStartState(precedence: number, fullContext: boolean): DFAState | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Set the start state for a specific precedence value.
|
|
78
|
+
*
|
|
79
|
+
* @param precedence The current precedence.
|
|
80
|
+
* @param startState The start state corresponding to the specified
|
|
81
|
+
* precedence.
|
|
82
|
+
*
|
|
83
|
+
* @ if this is not a precedence DFA.
|
|
84
|
+
* @see `isPrecedenceDfa`
|
|
85
|
+
*/
|
|
86
|
+
setPrecedenceStartState(precedence: number, fullContext: boolean, startState: DFAState): void;
|
|
87
|
+
get isEmpty(): boolean;
|
|
88
|
+
get isContextSensitive(): boolean;
|
|
89
|
+
addState(state: DFAState): DFAState;
|
|
90
|
+
toString(): string;
|
|
91
|
+
toString(/*@NotNull*/ vocabulary: Vocabulary): string;
|
|
92
|
+
toString(/*@NotNull*/ vocabulary: Vocabulary, ruleNames: string[] | undefined): string;
|
|
93
|
+
toLexerString(): string;
|
|
94
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { ATN } from "../atn/ATN";
|
|
6
|
+
import { DFA } from "./DFA";
|
|
7
|
+
import { DFAState } from "./DFAState";
|
|
8
|
+
import { Recognizer } from "../Recognizer";
|
|
9
|
+
import { Vocabulary } from "../Vocabulary";
|
|
10
|
+
/** A DFA walker that knows how to dump them to serialized strings. */
|
|
11
|
+
export declare class DFASerializer {
|
|
12
|
+
private dfa;
|
|
13
|
+
private vocabulary;
|
|
14
|
+
ruleNames?: string[];
|
|
15
|
+
atn?: ATN;
|
|
16
|
+
constructor(/*@NotNull*/ dfa: DFA, /*@NotNull*/ vocabulary: Vocabulary);
|
|
17
|
+
constructor(/*@NotNull*/ dfa: DFA, /*@Nullable*/ parser: Recognizer<any, any> | undefined);
|
|
18
|
+
constructor(/*@NotNull*/ dfa: DFA, /*@NotNull*/ vocabulary: Vocabulary, /*@Nullable*/ ruleNames: string[] | undefined, /*@Nullable*/ atn: ATN | undefined);
|
|
19
|
+
toString(): string;
|
|
20
|
+
protected getContextLabel(i: number): string;
|
|
21
|
+
protected getEdgeLabel(i: number): string;
|
|
22
|
+
getStateString(s: DFAState): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
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 { AcceptStateInfo } from "./AcceptStateInfo";
|
|
6
|
+
import { ATN } from "../atn/ATN";
|
|
7
|
+
import { ATNConfigSet } from "../atn/ATNConfigSet";
|
|
8
|
+
import { LexerActionExecutor } from "../atn/LexerActionExecutor";
|
|
9
|
+
import { SemanticContext } from "../atn/SemanticContext";
|
|
10
|
+
/** A DFA state represents a set of possible ATN configurations.
|
|
11
|
+
* As Aho, Sethi, Ullman p. 117 says "The DFA uses its state
|
|
12
|
+
* to keep track of all possible states the ATN can be in after
|
|
13
|
+
* reading each input symbol. That is to say, after reading
|
|
14
|
+
* input a1a2..an, the DFA is in a state that represents the
|
|
15
|
+
* subset T of the states of the ATN that are reachable from the
|
|
16
|
+
* ATN's start state along some path labeled a1a2..an."
|
|
17
|
+
* In conventional NFA→DFA conversion, therefore, the subset T
|
|
18
|
+
* would be a bitset representing the set of states the
|
|
19
|
+
* ATN could be in. We need to track the alt predicted by each
|
|
20
|
+
* state as well, however. More importantly, we need to maintain
|
|
21
|
+
* a stack of states, tracking the closure operations as they
|
|
22
|
+
* jump from rule to rule, emulating rule invocations (method calls).
|
|
23
|
+
* I have to add a stack to simulate the proper lookahead sequences for
|
|
24
|
+
* the underlying LL grammar from which the ATN was derived.
|
|
25
|
+
*
|
|
26
|
+
* I use a set of ATNConfig objects not simple states. An ATNConfig
|
|
27
|
+
* is both a state (ala normal conversion) and a RuleContext describing
|
|
28
|
+
* the chain of rules (if any) followed to arrive at that state.
|
|
29
|
+
*
|
|
30
|
+
* A DFA state may have multiple references to a particular state,
|
|
31
|
+
* but with different ATN contexts (with same or different alts)
|
|
32
|
+
* meaning that state was reached via a different set of rule invocations.
|
|
33
|
+
*/
|
|
34
|
+
export declare class DFAState {
|
|
35
|
+
stateNumber: number;
|
|
36
|
+
configs: ATNConfigSet;
|
|
37
|
+
/** `edges.get(symbol)` points to target of symbol.
|
|
38
|
+
*/
|
|
39
|
+
private readonly edges;
|
|
40
|
+
private _acceptStateInfo;
|
|
41
|
+
/** These keys for these edges are the top level element of the global context. */
|
|
42
|
+
private readonly contextEdges;
|
|
43
|
+
/** Symbols in this set require a global context transition before matching an input symbol. */
|
|
44
|
+
private contextSymbols;
|
|
45
|
+
/**
|
|
46
|
+
* This list is computed by {@link ParserATNSimulator#predicateDFAState}.
|
|
47
|
+
*/
|
|
48
|
+
predicates: DFAState.PredPrediction[] | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a new `DFAState`.
|
|
51
|
+
*
|
|
52
|
+
* @param configs The set of ATN configurations defining this state.
|
|
53
|
+
*/
|
|
54
|
+
constructor(configs: ATNConfigSet);
|
|
55
|
+
get isContextSensitive(): boolean;
|
|
56
|
+
isContextSymbol(symbol: number): boolean;
|
|
57
|
+
setContextSymbol(symbol: number): void;
|
|
58
|
+
setContextSensitive(atn: ATN): void;
|
|
59
|
+
get acceptStateInfo(): AcceptStateInfo | undefined;
|
|
60
|
+
set acceptStateInfo(acceptStateInfo: AcceptStateInfo | undefined);
|
|
61
|
+
get isAcceptState(): boolean;
|
|
62
|
+
get prediction(): number;
|
|
63
|
+
get lexerActionExecutor(): LexerActionExecutor | undefined;
|
|
64
|
+
getTarget(symbol: number): DFAState | undefined;
|
|
65
|
+
setTarget(symbol: number, target: DFAState): void;
|
|
66
|
+
getEdgeMap(): Map<number, DFAState>;
|
|
67
|
+
getContextTarget(invokingState: number): DFAState | undefined;
|
|
68
|
+
setContextTarget(invokingState: number, target: DFAState): void;
|
|
69
|
+
getContextEdgeMap(): Map<number, DFAState>;
|
|
70
|
+
hashCode(): number;
|
|
71
|
+
/**
|
|
72
|
+
* Two {@link DFAState} instances are equal if their ATN configuration sets
|
|
73
|
+
* are the same. This method is used to see if a state already exists.
|
|
74
|
+
*
|
|
75
|
+
* Because the number of alternatives and number of ATN configurations are
|
|
76
|
+
* finite, there is a finite number of DFA states that can be processed.
|
|
77
|
+
* This is necessary to show that the algorithm terminates.
|
|
78
|
+
*
|
|
79
|
+
* Cannot test the DFA state numbers here because in
|
|
80
|
+
* {@link ParserATNSimulator#addDFAState} we need to know if any other state
|
|
81
|
+
* exists that has this exact set of ATN configurations. The
|
|
82
|
+
* {@link #stateNumber} is irrelevant.
|
|
83
|
+
*/
|
|
84
|
+
equals(o: any): boolean;
|
|
85
|
+
toString(): string;
|
|
86
|
+
}
|
|
87
|
+
export declare namespace DFAState {
|
|
88
|
+
/** Map a predicate to a predicted alternative. */
|
|
89
|
+
class PredPrediction {
|
|
90
|
+
pred: SemanticContext;
|
|
91
|
+
alt: number;
|
|
92
|
+
constructor(pred: SemanticContext, alt: number);
|
|
93
|
+
toString(): string;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 { DFA } from "./DFA";
|
|
6
|
+
import { DFASerializer } from "./DFASerializer";
|
|
7
|
+
export declare class LexerDFASerializer extends DFASerializer {
|
|
8
|
+
constructor(dfa: DFA);
|
|
9
|
+
protected getEdgeLabel(i: number): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export * from "./AcceptStateInfo";
|
|
6
|
+
export * from "./DFA";
|
|
7
|
+
export * from "./DFASerializer";
|
|
8
|
+
export * from "./DFAState";
|
|
9
|
+
export * from "./LexerDFASerializer";
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
export * from "./ANTLRErrorListener";
|
|
6
|
+
export * from "./ANTLRErrorStrategy";
|
|
7
|
+
export * from "./ANTLRInputStream";
|
|
8
|
+
export * from "./BailErrorStrategy";
|
|
9
|
+
export * from "./BufferedTokenStream";
|
|
10
|
+
export * from "./CharStream";
|
|
11
|
+
export * from "./CharStreams";
|
|
12
|
+
export * from "./CodePointBuffer";
|
|
13
|
+
export * from "./CodePointCharStream";
|
|
14
|
+
export * from "./CommonToken";
|
|
15
|
+
export * from "./CommonTokenFactory";
|
|
16
|
+
export * from "./CommonTokenStream";
|
|
17
|
+
export * from "./ConsoleErrorListener";
|
|
18
|
+
export * from "./DefaultErrorStrategy";
|
|
19
|
+
export * from "./Dependents";
|
|
20
|
+
export * from "./DiagnosticErrorListener";
|
|
21
|
+
export * from "./FailedPredicateException";
|
|
22
|
+
export * from "./InputMismatchException";
|
|
23
|
+
export * from "./InterpreterRuleContext";
|
|
24
|
+
export * from "./IntStream";
|
|
25
|
+
export * from "./Lexer";
|
|
26
|
+
export * from "./LexerInterpreter";
|
|
27
|
+
export * from "./LexerNoViableAltException";
|
|
28
|
+
export * from "./ListTokenSource";
|
|
29
|
+
export * from "./NoViableAltException";
|
|
30
|
+
export * from "./Parser";
|
|
31
|
+
export * from "./ParserErrorListener";
|
|
32
|
+
export * from "./ParserInterpreter";
|
|
33
|
+
export * from "./ParserRuleContext";
|
|
34
|
+
export * from "./ProxyErrorListener";
|
|
35
|
+
export * from "./ProxyParserErrorListener";
|
|
36
|
+
export * from "./RecognitionException";
|
|
37
|
+
export * from "./Recognizer";
|
|
38
|
+
export * from "./RuleContext";
|
|
39
|
+
export * from "./RuleContextWithAltNum";
|
|
40
|
+
export * from "./RuleDependency";
|
|
41
|
+
export * from "./RuleVersion";
|
|
42
|
+
export * from "./Token";
|
|
43
|
+
export * from "./TokenFactory";
|
|
44
|
+
export * from "./TokenSource";
|
|
45
|
+
export * from "./TokenStream";
|
|
46
|
+
export * from "./TokenStreamRewriter";
|
|
47
|
+
export * from "./Vocabulary";
|
|
48
|
+
export * from "./VocabularyImpl";
|
|
49
|
+
export * from "./WritableToken";
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* Validates that an argument is not `null` or `undefined`.
|
|
7
|
+
*
|
|
8
|
+
* @param parameterName The name of the parameter
|
|
9
|
+
* @param value The argument value
|
|
10
|
+
*
|
|
11
|
+
* @throws `TypeError` if `value` is `null` or `undefined`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function notNull(parameterName: string, value: any): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { EqualityComparator } from "./EqualityComparator";
|
|
6
|
+
import { JavaMap } from "./Stubs";
|
|
7
|
+
export declare class Array2DHashMap<K, V> implements JavaMap<K, V> {
|
|
8
|
+
private backingStore;
|
|
9
|
+
constructor(keyComparer: EqualityComparator<K>);
|
|
10
|
+
constructor(map: Array2DHashMap<K, V>);
|
|
11
|
+
clear(): void;
|
|
12
|
+
containsKey(key: K): boolean;
|
|
13
|
+
get(key: K): V | undefined;
|
|
14
|
+
get isEmpty(): boolean;
|
|
15
|
+
put(key: K, value: V): V | undefined;
|
|
16
|
+
putIfAbsent(key: K, value: V): V | undefined;
|
|
17
|
+
get size(): number;
|
|
18
|
+
hashCode(): number;
|
|
19
|
+
equals(o: any): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { EqualityComparator } from "./EqualityComparator";
|
|
6
|
+
import { JavaCollection, JavaSet } from "./Stubs";
|
|
7
|
+
export declare class Array2DHashSet<T extends {
|
|
8
|
+
toString(): string;
|
|
9
|
+
}> implements JavaSet<T> {
|
|
10
|
+
protected comparator: EqualityComparator<T>;
|
|
11
|
+
protected buckets: Array<T[] | undefined>;
|
|
12
|
+
/** How many elements in set */
|
|
13
|
+
protected n: number;
|
|
14
|
+
protected threshold: number;
|
|
15
|
+
constructor(comparator?: EqualityComparator<T>, initialCapacity?: number);
|
|
16
|
+
constructor(set: Array2DHashSet<T>);
|
|
17
|
+
/**
|
|
18
|
+
* Add `o` to set if not there; return existing value if already
|
|
19
|
+
* there. This method performs the same operation as {@link #add} aside from
|
|
20
|
+
* the return value.
|
|
21
|
+
*/
|
|
22
|
+
getOrAdd(o: T): T;
|
|
23
|
+
protected getOrAddImpl(o: T): T;
|
|
24
|
+
get(o: T): T | undefined;
|
|
25
|
+
protected getBucket(o: T): number;
|
|
26
|
+
hashCode(): number;
|
|
27
|
+
equals(o: any): boolean;
|
|
28
|
+
protected expand(): void;
|
|
29
|
+
add(t: T): boolean;
|
|
30
|
+
get size(): number;
|
|
31
|
+
get isEmpty(): boolean;
|
|
32
|
+
contains(o: any): boolean;
|
|
33
|
+
containsFast(obj: T): boolean;
|
|
34
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
35
|
+
toArray(): T[];
|
|
36
|
+
containsAll(collection: JavaCollection<T>): boolean;
|
|
37
|
+
addAll(c: Iterable<T>): boolean;
|
|
38
|
+
clear(): void;
|
|
39
|
+
toString(): string;
|
|
40
|
+
toTableString(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Return `o` as an instance of the element type `T`. If
|
|
43
|
+
* `o` is non-undefined but known to not be an instance of `T`, this
|
|
44
|
+
* method returns `undefined`. The base implementation does not perform any
|
|
45
|
+
* type checks; override this method to provide strong type checks for the
|
|
46
|
+
* {@link #contains} and {@link #remove} methods to ensure the arguments to
|
|
47
|
+
* the {@link EqualityComparator} for the set always have the expected
|
|
48
|
+
* types.
|
|
49
|
+
*
|
|
50
|
+
* @param o the object to try and cast to the element type of the set
|
|
51
|
+
* @returns `o` if it could be an instance of `T`, otherwise
|
|
52
|
+
* `undefined`.
|
|
53
|
+
*/
|
|
54
|
+
protected asElementType(o: any): T;
|
|
55
|
+
/**
|
|
56
|
+
* Return an array of `T[]` with length `capacity`.
|
|
57
|
+
*
|
|
58
|
+
* @param capacity the length of the array to return
|
|
59
|
+
* @returns the newly constructed array
|
|
60
|
+
*/
|
|
61
|
+
protected createBuckets(capacity: number): Array<T[] | undefined>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { EqualityComparator } from "./EqualityComparator";
|
|
6
|
+
import { Equatable } from "./Stubs";
|
|
7
|
+
/**
|
|
8
|
+
* This default implementation of {@link EqualityComparator} uses object equality
|
|
9
|
+
* for comparisons by calling {@link Object#hashCode} and {@link Object#equals}.
|
|
10
|
+
*
|
|
11
|
+
* @author Sam Harwell
|
|
12
|
+
*/
|
|
13
|
+
export declare class ArrayEqualityComparator implements EqualityComparator<Equatable[]> {
|
|
14
|
+
static readonly INSTANCE: ArrayEqualityComparator;
|
|
15
|
+
/**
|
|
16
|
+
* {@inheritDoc}
|
|
17
|
+
*
|
|
18
|
+
* This implementation returns
|
|
19
|
+
* `obj.`{@link Object#hashCode hashCode()}.
|
|
20
|
+
*/
|
|
21
|
+
hashCode(obj: Equatable[]): number;
|
|
22
|
+
/**
|
|
23
|
+
* {@inheritDoc}
|
|
24
|
+
*
|
|
25
|
+
* This implementation relies on object equality. If both objects are
|
|
26
|
+
* `undefined`, this method returns `true`. Otherwise if only
|
|
27
|
+
* `a` is `undefined`, this method returns `false`. Otherwise,
|
|
28
|
+
* this method returns the result of
|
|
29
|
+
* `a.`{@link Object#equals equals}`(b)`.
|
|
30
|
+
*/
|
|
31
|
+
equals(a: Equatable[], b: Equatable[]): boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export declare namespace Arrays {
|
|
6
|
+
/**
|
|
7
|
+
* Searches the specified array of numbers for the specified value using the binary search algorithm. The array must
|
|
8
|
+
* be sorted prior to making this call. If it is not sorted, the results are unspecified. If the array contains
|
|
9
|
+
* multiple elements with the specified value, there is no guarantee which one will be found.
|
|
10
|
+
*
|
|
11
|
+
* @returns index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The
|
|
12
|
+
* insertion point is defined as the point at which the key would be inserted into the array: the index of the first
|
|
13
|
+
* element greater than the key, or array.length if all elements in the array are less than the specified key. Note
|
|
14
|
+
* that this guarantees that the return value will be >= 0 if and only if the key is found.
|
|
15
|
+
*/
|
|
16
|
+
function binarySearch(array: ArrayLike<number>, key: number, fromIndex?: number, toIndex?: number): number;
|
|
17
|
+
function toString<T>(array: Iterable<T>): string;
|
|
18
|
+
}
|