@opra/client 0.10.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.
Files changed (187) hide show
  1. package/package.json +1 -1
  2. package/typings/antlr4ts/ANTLRErrorListener.d.ts +43 -0
  3. package/typings/antlr4ts/ANTLRErrorStrategy.d.ts +109 -0
  4. package/typings/antlr4ts/ANTLRInputStream.d.ts +51 -0
  5. package/typings/antlr4ts/BailErrorStrategy.d.ts +48 -0
  6. package/typings/antlr4ts/BufferedTokenStream.d.ts +143 -0
  7. package/typings/antlr4ts/CharStream.d.ts +26 -0
  8. package/typings/antlr4ts/CharStreams.d.ts +54 -0
  9. package/typings/antlr4ts/CodePointBuffer.d.ts +40 -0
  10. package/typings/antlr4ts/CodePointCharStream.d.ts +45 -0
  11. package/typings/antlr4ts/CommonToken.d.ts +116 -0
  12. package/typings/antlr4ts/CommonTokenFactory.d.ts +53 -0
  13. package/typings/antlr4ts/CommonTokenStream.d.ts +52 -0
  14. package/typings/antlr4ts/ConsoleErrorListener.d.ts +29 -0
  15. package/typings/antlr4ts/Decorators.d.ts +8 -0
  16. package/typings/antlr4ts/DefaultErrorStrategy.d.ts +347 -0
  17. package/typings/antlr4ts/Dependents.d.ts +69 -0
  18. package/typings/antlr4ts/DiagnosticErrorListener.d.ts +60 -0
  19. package/typings/antlr4ts/FailedPredicateException.d.ts +21 -0
  20. package/typings/antlr4ts/InputMismatchException.d.ts +14 -0
  21. package/typings/antlr4ts/IntStream.d.ts +197 -0
  22. package/typings/antlr4ts/InterpreterRuleContext.d.ts +33 -0
  23. package/typings/antlr4ts/Lexer.d.ts +141 -0
  24. package/typings/antlr4ts/LexerInterpreter.d.ts +23 -0
  25. package/typings/antlr4ts/LexerNoViableAltException.d.ts +19 -0
  26. package/typings/antlr4ts/ListTokenSource.d.ts +86 -0
  27. package/typings/antlr4ts/NoViableAltException.d.ts +30 -0
  28. package/typings/antlr4ts/Parser.d.ts +372 -0
  29. package/typings/antlr4ts/ParserErrorListener.d.ts +112 -0
  30. package/typings/antlr4ts/ParserInterpreter.d.ts +151 -0
  31. package/typings/antlr4ts/ParserRuleContext.d.ts +169 -0
  32. package/typings/antlr4ts/ProxyErrorListener.d.ts +20 -0
  33. package/typings/antlr4ts/ProxyParserErrorListener.d.ts +21 -0
  34. package/typings/antlr4ts/RecognitionException.d.ts +87 -0
  35. package/typings/antlr4ts/Recognizer.d.ts +101 -0
  36. package/typings/antlr4ts/RuleContext.d.ts +124 -0
  37. package/typings/antlr4ts/RuleContextWithAltNum.d.ts +22 -0
  38. package/typings/antlr4ts/RuleDependency.d.ts +32 -0
  39. package/typings/antlr4ts/RuleVersion.d.ts +11 -0
  40. package/typings/antlr4ts/Token.d.ts +83 -0
  41. package/typings/antlr4ts/TokenFactory.d.ts +23 -0
  42. package/typings/antlr4ts/TokenSource.d.ts +67 -0
  43. package/typings/antlr4ts/TokenStream.d.ts +145 -0
  44. package/typings/antlr4ts/TokenStreamRewriter.d.ts +216 -0
  45. package/typings/antlr4ts/Vocabulary.d.ts +117 -0
  46. package/typings/antlr4ts/VocabularyImpl.d.ts +47 -0
  47. package/typings/antlr4ts/WritableToken.d.ts +13 -0
  48. package/typings/antlr4ts/atn/ATN.d.ts +123 -0
  49. package/typings/antlr4ts/atn/ATNConfig.d.ts +140 -0
  50. package/typings/antlr4ts/atn/ATNConfigSet.d.ts +113 -0
  51. package/typings/antlr4ts/atn/ATNDeserializationOptions.d.ts +26 -0
  52. package/typings/antlr4ts/atn/ATNDeserializer.d.ts +86 -0
  53. package/typings/antlr4ts/atn/ATNSimulator.d.ts +28 -0
  54. package/typings/antlr4ts/atn/ATNState.d.ts +111 -0
  55. package/typings/antlr4ts/atn/ATNStateType.d.ts +19 -0
  56. package/typings/antlr4ts/atn/ATNType.d.ts +19 -0
  57. package/typings/antlr4ts/atn/AbstractPredicateTransition.d.ts +13 -0
  58. package/typings/antlr4ts/atn/ActionTransition.d.ts +17 -0
  59. package/typings/antlr4ts/atn/AmbiguityInfo.d.ts +60 -0
  60. package/typings/antlr4ts/atn/AtomTransition.d.ts +18 -0
  61. package/typings/antlr4ts/atn/BasicBlockStartState.d.ts +13 -0
  62. package/typings/antlr4ts/atn/BasicState.d.ts +13 -0
  63. package/typings/antlr4ts/atn/BlockEndState.d.ts +12 -0
  64. package/typings/antlr4ts/atn/BlockStartState.d.ts +10 -0
  65. package/typings/antlr4ts/atn/CodePointTransitions.d.ts +27 -0
  66. package/typings/antlr4ts/atn/ConflictInfo.d.ts +35 -0
  67. package/typings/antlr4ts/atn/ContextSensitivityInfo.d.ts +39 -0
  68. package/typings/antlr4ts/atn/DecisionEventInfo.d.ts +54 -0
  69. package/typings/antlr4ts/atn/DecisionInfo.d.ts +201 -0
  70. package/typings/antlr4ts/atn/DecisionState.d.ts +10 -0
  71. package/typings/antlr4ts/atn/EpsilonTransition.d.ts +24 -0
  72. package/typings/antlr4ts/atn/ErrorInfo.d.ts +32 -0
  73. package/typings/antlr4ts/atn/InvalidState.d.ts +13 -0
  74. package/typings/antlr4ts/atn/LL1Analyzer.d.ts +98 -0
  75. package/typings/antlr4ts/atn/LexerATNSimulator.d.ts +153 -0
  76. package/typings/antlr4ts/atn/LexerAction.d.ts +47 -0
  77. package/typings/antlr4ts/atn/LexerActionExecutor.d.ts +104 -0
  78. package/typings/antlr4ts/atn/LexerActionType.d.ts +44 -0
  79. package/typings/antlr4ts/atn/LexerChannelAction.d.ts +48 -0
  80. package/typings/antlr4ts/atn/LexerCustomAction.d.ts +73 -0
  81. package/typings/antlr4ts/atn/LexerIndexedCustomAction.d.ts +74 -0
  82. package/typings/antlr4ts/atn/LexerModeAction.d.ts +48 -0
  83. package/typings/antlr4ts/atn/LexerMoreAction.d.ts +47 -0
  84. package/typings/antlr4ts/atn/LexerPopModeAction.d.ts +47 -0
  85. package/typings/antlr4ts/atn/LexerPushModeAction.d.ts +48 -0
  86. package/typings/antlr4ts/atn/LexerSkipAction.d.ts +47 -0
  87. package/typings/antlr4ts/atn/LexerTypeAction.d.ts +47 -0
  88. package/typings/antlr4ts/atn/LookaheadEventInfo.d.ts +37 -0
  89. package/typings/antlr4ts/atn/LoopEndState.d.ts +11 -0
  90. package/typings/antlr4ts/atn/NotSetTransition.d.ts +14 -0
  91. package/typings/antlr4ts/atn/OrderedATNConfigSet.d.ts +23 -0
  92. package/typings/antlr4ts/atn/ParseInfo.d.ts +79 -0
  93. package/typings/antlr4ts/atn/ParserATNSimulator.d.ts +567 -0
  94. package/typings/antlr4ts/atn/PlusBlockStartState.d.ts +16 -0
  95. package/typings/antlr4ts/atn/PlusLoopbackState.d.ts +12 -0
  96. package/typings/antlr4ts/atn/PrecedencePredicateTransition.d.ts +21 -0
  97. package/typings/antlr4ts/atn/PredicateEvalInfo.d.ts +54 -0
  98. package/typings/antlr4ts/atn/PredicateTransition.d.ts +25 -0
  99. package/typings/antlr4ts/atn/PredictionContext.d.ts +89 -0
  100. package/typings/antlr4ts/atn/PredictionContextCache.d.ts +40 -0
  101. package/typings/antlr4ts/atn/PredictionMode.d.ts +89 -0
  102. package/typings/antlr4ts/atn/ProfilingATNSimulator.d.ts +55 -0
  103. package/typings/antlr4ts/atn/RangeTransition.d.ts +17 -0
  104. package/typings/antlr4ts/atn/RuleStartState.d.ts +13 -0
  105. package/typings/antlr4ts/atn/RuleStopState.d.ts +15 -0
  106. package/typings/antlr4ts/atn/RuleTransition.d.ts +22 -0
  107. package/typings/antlr4ts/atn/SemanticContext.d.ts +143 -0
  108. package/typings/antlr4ts/atn/SetTransition.d.ts +17 -0
  109. package/typings/antlr4ts/atn/SimulatorState.d.ts +17 -0
  110. package/typings/antlr4ts/atn/StarBlockStartState.d.ts +10 -0
  111. package/typings/antlr4ts/atn/StarLoopEntryState.d.ts +37 -0
  112. package/typings/antlr4ts/atn/StarLoopbackState.d.ts +11 -0
  113. package/typings/antlr4ts/atn/TokensStartState.d.ts +10 -0
  114. package/typings/antlr4ts/atn/Transition.d.ts +38 -0
  115. package/typings/antlr4ts/atn/TransitionType.d.ts +16 -0
  116. package/typings/antlr4ts/atn/WildcardTransition.d.ts +13 -0
  117. package/typings/antlr4ts/atn/index.d.ts +73 -0
  118. package/typings/antlr4ts/dfa/AcceptStateInfo.d.ts +33 -0
  119. package/typings/antlr4ts/dfa/DFA.d.ts +94 -0
  120. package/typings/antlr4ts/dfa/DFASerializer.d.ts +23 -0
  121. package/typings/antlr4ts/dfa/DFAState.d.ts +95 -0
  122. package/typings/antlr4ts/dfa/LexerDFASerializer.d.ts +10 -0
  123. package/typings/antlr4ts/dfa/index.d.ts +9 -0
  124. package/typings/antlr4ts/index.d.ts +49 -0
  125. package/typings/antlr4ts/misc/Args.d.ts +13 -0
  126. package/typings/antlr4ts/misc/Array2DHashMap.d.ts +20 -0
  127. package/typings/antlr4ts/misc/Array2DHashSet.d.ts +62 -0
  128. package/typings/antlr4ts/misc/ArrayEqualityComparator.d.ts +32 -0
  129. package/typings/antlr4ts/misc/Arrays.d.ts +18 -0
  130. package/typings/antlr4ts/misc/BitSet.d.ts +268 -0
  131. package/typings/antlr4ts/misc/Character.d.ts +7 -0
  132. package/typings/antlr4ts/misc/DefaultEqualityComparator.d.ts +31 -0
  133. package/typings/antlr4ts/misc/EqualityComparator.d.ts +29 -0
  134. package/typings/antlr4ts/misc/IntSet.d.ts +129 -0
  135. package/typings/antlr4ts/misc/IntegerList.d.ts +69 -0
  136. package/typings/antlr4ts/misc/IntegerStack.d.ts +15 -0
  137. package/typings/antlr4ts/misc/InterpreterDataReader.d.ts +39 -0
  138. package/typings/antlr4ts/misc/Interval.d.ts +57 -0
  139. package/typings/antlr4ts/misc/IntervalSet.d.ts +96 -0
  140. package/typings/antlr4ts/misc/MultiMap.d.ts +9 -0
  141. package/typings/antlr4ts/misc/MurmurHash.d.ts +45 -0
  142. package/typings/antlr4ts/misc/ObjectEqualityComparator.d.ts +32 -0
  143. package/typings/antlr4ts/misc/ParseCancellationException.d.ts +18 -0
  144. package/typings/antlr4ts/misc/Stubs.d.ts +31 -0
  145. package/typings/antlr4ts/misc/UUID.d.ts +13 -0
  146. package/typings/antlr4ts/misc/Utils.d.ts +15 -0
  147. package/typings/antlr4ts/misc/index.d.ts +25 -0
  148. package/typings/antlr4ts/tree/AbstractParseTreeVisitor.d.ts +103 -0
  149. package/typings/antlr4ts/tree/ErrorNode.d.ts +17 -0
  150. package/typings/antlr4ts/tree/ParseTree.d.ts +36 -0
  151. package/typings/antlr4ts/tree/ParseTreeListener.d.ts +26 -0
  152. package/typings/antlr4ts/tree/ParseTreeProperty.d.ts +28 -0
  153. package/typings/antlr4ts/tree/ParseTreeVisitor.d.ts +48 -0
  154. package/typings/antlr4ts/tree/ParseTreeWalker.d.ts +35 -0
  155. package/typings/antlr4ts/tree/RuleNode.d.ts +21 -0
  156. package/typings/antlr4ts/tree/SyntaxTree.d.ts +29 -0
  157. package/typings/antlr4ts/tree/TerminalNode.d.ts +27 -0
  158. package/typings/antlr4ts/tree/Tree.d.ts +36 -0
  159. package/typings/antlr4ts/tree/Trees.d.ts +75 -0
  160. package/typings/antlr4ts/tree/index.d.ts +16 -0
  161. package/typings/antlr4ts/tree/pattern/Chunk.d.ts +17 -0
  162. package/typings/antlr4ts/tree/pattern/ParseTreeMatch.d.ts +124 -0
  163. package/typings/antlr4ts/tree/pattern/ParseTreePattern.d.ts +98 -0
  164. package/typings/antlr4ts/tree/pattern/ParseTreePatternMatcher.d.ts +166 -0
  165. package/typings/antlr4ts/tree/pattern/RuleTagToken.d.ts +122 -0
  166. package/typings/antlr4ts/tree/pattern/TagChunk.d.ts +59 -0
  167. package/typings/antlr4ts/tree/pattern/TextChunk.d.ts +35 -0
  168. package/typings/antlr4ts/tree/pattern/TokenTagToken.d.ts +56 -0
  169. package/typings/antlr4ts/tree/pattern/index.d.ts +9 -0
  170. package/typings/antlr4ts/tree/xpath/XPath.d.ts +66 -0
  171. package/typings/antlr4ts/tree/xpath/XPathElement.d.ts +19 -0
  172. package/typings/antlr4ts/tree/xpath/XPathLexer.d.ts +36 -0
  173. package/typings/antlr4ts/tree/xpath/XPathLexerErrorListener.d.ts +10 -0
  174. package/typings/antlr4ts/tree/xpath/XPathRuleAnywhereElement.d.ts +14 -0
  175. package/typings/antlr4ts/tree/xpath/XPathRuleElement.d.ts +11 -0
  176. package/typings/antlr4ts/tree/xpath/XPathTokenAnywhereElement.d.ts +11 -0
  177. package/typings/antlr4ts/tree/xpath/XPathTokenElement.d.ts +11 -0
  178. package/typings/antlr4ts/tree/xpath/XPathWildcardAnywhereElement.d.ts +10 -0
  179. package/typings/antlr4ts/tree/xpath/XPathWildcardElement.d.ts +10 -0
  180. package/typings/antlr4ts/tree/xpath/index.d.ts +14 -0
  181. package/typings/common/filter/antlr/OpraFilterLexer.d.ts +4 -4
  182. package/typings/common/filter/antlr/OpraFilterParser.d.ts +8 -8
  183. package/typings/common/filter/antlr/OpraFilterVisitor.d.ts +1 -1
  184. package/typings/common/filter/error-listener.d.ts +2 -2
  185. package/typings/common/filter/errors.d.ts +2 -2
  186. package/typings/common/filter/filter-tree-visitor.d.ts +1 -1
  187. package/typings/common/filter/parse.d.ts +1 -1
@@ -0,0 +1,25 @@
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
+ /** TODO: this is old comment:
10
+ * A tree of semantic predicates from the grammar AST if label==SEMPRED.
11
+ * In the ATN, labels will always be exactly one predicate, but the DFA
12
+ * may have to combine a bunch of them as it collects predicates from
13
+ * multiple ATN configurations into a single DFA state.
14
+ */
15
+ export declare class PredicateTransition extends AbstractPredicateTransition {
16
+ ruleIndex: number;
17
+ predIndex: number;
18
+ isCtxDependent: boolean;
19
+ constructor(target: ATNState, ruleIndex: number, predIndex: number, isCtxDependent: boolean);
20
+ get serializationType(): TransitionType;
21
+ get isEpsilon(): boolean;
22
+ matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
23
+ get predicate(): SemanticContext.Predicate;
24
+ toString(): string;
25
+ }
@@ -0,0 +1,89 @@
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 { Array2DHashMap } from "../misc/Array2DHashMap";
6
+ import { ATN } from "./ATN";
7
+ import { EqualityComparator } from "../misc/EqualityComparator";
8
+ import { Equatable } from "../misc/Stubs";
9
+ import { PredictionContextCache } from "./PredictionContextCache";
10
+ import { Recognizer } from "../Recognizer";
11
+ import { RuleContext } from "../RuleContext";
12
+ export declare abstract class PredictionContext implements Equatable {
13
+ /**
14
+ * Stores the computed hash code of this {@link PredictionContext}. The hash
15
+ * code is computed in parts to match the following reference algorithm.
16
+ *
17
+ * ```
18
+ * private int referenceHashCode() {
19
+ * int hash = {@link MurmurHash#initialize MurmurHash.initialize}({@link #INITIAL_HASH});
20
+ *
21
+ * for (int i = 0; i < this.size; i++) {
22
+ * hash = {@link MurmurHash#update MurmurHash.update}(hash, {@link #getParent getParent}(i));
23
+ * }
24
+ *
25
+ * for (int i = 0; i < this.size; i++) {
26
+ * hash = {@link MurmurHash#update MurmurHash.update}(hash, {@link #getReturnState getReturnState}(i));
27
+ * }
28
+ *
29
+ * hash = {@link MurmurHash#finish MurmurHash.finish}(hash, 2 * this.size);
30
+ * return hash;
31
+ * }
32
+ * ```
33
+ */
34
+ private readonly cachedHashCode;
35
+ constructor(cachedHashCode: number);
36
+ protected static calculateEmptyHashCode(): number;
37
+ protected static calculateSingleHashCode(parent: PredictionContext, returnState: number): number;
38
+ protected static calculateHashCode(parents: PredictionContext[], returnStates: number[]): number;
39
+ abstract readonly size: number;
40
+ abstract getReturnState(index: number): number;
41
+ abstract findReturnState(returnState: number): number;
42
+ abstract getParent(index: number): PredictionContext;
43
+ protected abstract addEmptyContext(): PredictionContext;
44
+ protected abstract removeEmptyContext(): PredictionContext;
45
+ static fromRuleContext(atn: ATN, outerContext: RuleContext, fullContext?: boolean): PredictionContext;
46
+ private static addEmptyContext;
47
+ private static removeEmptyContext;
48
+ static join(context0: PredictionContext, context1: PredictionContext, contextCache?: PredictionContextCache): PredictionContext;
49
+ static isEmptyLocal(context: PredictionContext): boolean;
50
+ static getCachedContext(context: PredictionContext, contextCache: Array2DHashMap<PredictionContext, PredictionContext>, visited: PredictionContext.IdentityHashMap): PredictionContext;
51
+ appendSingleContext(returnContext: number, contextCache: PredictionContextCache): PredictionContext;
52
+ abstract appendContext(suffix: PredictionContext, contextCache: PredictionContextCache): PredictionContext;
53
+ getChild(returnState: number): PredictionContext;
54
+ abstract readonly isEmpty: boolean;
55
+ abstract readonly hasEmpty: boolean;
56
+ hashCode(): number;
57
+ abstract equals(o: any): boolean;
58
+ toStrings(recognizer: Recognizer<any, any> | undefined, currentState: number, stop?: PredictionContext): string[];
59
+ }
60
+ export declare class SingletonPredictionContext extends PredictionContext {
61
+ parent: PredictionContext;
62
+ returnState: number;
63
+ constructor(parent: PredictionContext, returnState: number);
64
+ getParent(index: number): PredictionContext;
65
+ getReturnState(index: number): number;
66
+ findReturnState(returnState: number): number;
67
+ get size(): number;
68
+ get isEmpty(): boolean;
69
+ get hasEmpty(): boolean;
70
+ appendContext(suffix: PredictionContext, contextCache: PredictionContextCache): PredictionContext;
71
+ protected addEmptyContext(): PredictionContext;
72
+ protected removeEmptyContext(): PredictionContext;
73
+ equals(o: any): boolean;
74
+ }
75
+ export declare namespace PredictionContext {
76
+ const EMPTY_LOCAL: PredictionContext;
77
+ const EMPTY_FULL: PredictionContext;
78
+ const EMPTY_LOCAL_STATE_KEY: number;
79
+ const EMPTY_FULL_STATE_KEY: number;
80
+ class IdentityHashMap extends Array2DHashMap<PredictionContext, PredictionContext> {
81
+ constructor();
82
+ }
83
+ class IdentityEqualityComparator implements EqualityComparator<PredictionContext> {
84
+ static readonly INSTANCE: IdentityEqualityComparator;
85
+ private IdentityEqualityComparator;
86
+ hashCode(obj: PredictionContext): number;
87
+ equals(a: PredictionContext, b: PredictionContext): boolean;
88
+ }
89
+ }
@@ -0,0 +1,40 @@
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 { PredictionContext } from "./PredictionContext";
6
+ /** Used to cache {@link PredictionContext} objects. Its used for the shared
7
+ * context cash associated with contexts in DFA states. This cache
8
+ * can be used for both lexers and parsers.
9
+ *
10
+ * @author Sam Harwell
11
+ */
12
+ export declare class PredictionContextCache {
13
+ static UNCACHED: PredictionContextCache;
14
+ private contexts;
15
+ private childContexts;
16
+ private joinContexts;
17
+ private enableCache;
18
+ constructor(enableCache?: boolean);
19
+ getAsCached(context: PredictionContext): PredictionContext;
20
+ getChild(context: PredictionContext, invokingState: number): PredictionContext;
21
+ join(x: PredictionContext, y: PredictionContext): PredictionContext;
22
+ }
23
+ export declare namespace PredictionContextCache {
24
+ class PredictionContextAndInt {
25
+ private obj;
26
+ private value;
27
+ constructor(obj: PredictionContext, value: number);
28
+ equals(obj: any): boolean;
29
+ hashCode(): number;
30
+ }
31
+ class IdentityCommutativePredictionContextOperands {
32
+ private _x;
33
+ private _y;
34
+ constructor(x: PredictionContext, y: PredictionContext);
35
+ get x(): PredictionContext;
36
+ get y(): PredictionContext;
37
+ equals(o: any): boolean;
38
+ hashCode(): number;
39
+ }
40
+ }
@@ -0,0 +1,89 @@
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 { ATNConfigSet } from "./ATNConfigSet";
6
+ /**
7
+ * This enumeration defines the prediction modes available in ANTLR 4 along with
8
+ * utility methods for analyzing configuration sets for conflicts and/or
9
+ * ambiguities.
10
+ */
11
+ export declare enum PredictionMode {
12
+ /**
13
+ * The SLL(*) prediction mode. This prediction mode ignores the current
14
+ * parser context when making predictions. This is the fastest prediction
15
+ * mode, and provides correct results for many grammars. This prediction
16
+ * mode is more powerful than the prediction mode provided by ANTLR 3, but
17
+ * may result in syntax errors for grammar and input combinations which are
18
+ * not SLL.
19
+ *
20
+ * When using this prediction mode, the parser will either return a correct
21
+ * parse tree (i.e. the same parse tree that would be returned with the
22
+ * {@link #LL} prediction mode), or it will report a syntax error. If a
23
+ * syntax error is encountered when using the {@link #SLL} prediction mode,
24
+ * it may be due to either an actual syntax error in the input or indicate
25
+ * that the particular combination of grammar and input requires the more
26
+ * powerful {@link #LL} prediction abilities to complete successfully.
27
+ *
28
+ * This prediction mode does not provide any guarantees for prediction
29
+ * behavior for syntactically-incorrect inputs.
30
+ */
31
+ SLL = 0,
32
+ /**
33
+ * The LL(*) prediction mode. This prediction mode allows the current parser
34
+ * context to be used for resolving SLL conflicts that occur during
35
+ * prediction. This is the fastest prediction mode that guarantees correct
36
+ * parse results for all combinations of grammars with syntactically correct
37
+ * inputs.
38
+ *
39
+ * When using this prediction mode, the parser will make correct decisions
40
+ * for all syntactically-correct grammar and input combinations. However, in
41
+ * cases where the grammar is truly ambiguous this prediction mode might not
42
+ * report a precise answer for *exactly which* alternatives are
43
+ * ambiguous.
44
+ *
45
+ * This prediction mode does not provide any guarantees for prediction
46
+ * behavior for syntactically-incorrect inputs.
47
+ */
48
+ LL = 1,
49
+ /**
50
+ * The LL(*) prediction mode with exact ambiguity detection. In addition to
51
+ * the correctness guarantees provided by the {@link #LL} prediction mode,
52
+ * this prediction mode instructs the prediction algorithm to determine the
53
+ * complete and exact set of ambiguous alternatives for every ambiguous
54
+ * decision encountered while parsing.
55
+ *
56
+ * This prediction mode may be used for diagnosing ambiguities during
57
+ * grammar development. Due to the performance overhead of calculating sets
58
+ * of ambiguous alternatives, this prediction mode should be avoided when
59
+ * the exact results are not necessary.
60
+ *
61
+ * This prediction mode does not provide any guarantees for prediction
62
+ * behavior for syntactically-incorrect inputs.
63
+ */
64
+ LL_EXACT_AMBIG_DETECTION = 2
65
+ }
66
+ export declare namespace PredictionMode {
67
+ /**
68
+ * Checks if any configuration in `configs` is in a
69
+ * {@link RuleStopState}. Configurations meeting this condition have reached
70
+ * the end of the decision rule (local context) or end of start rule (full
71
+ * context).
72
+ *
73
+ * @param configs the configuration set to test
74
+ * @returns `true` if any configuration in `configs` is in a
75
+ * {@link RuleStopState}, otherwise `false`
76
+ */
77
+ function hasConfigInRuleStopState(configs: ATNConfigSet): boolean;
78
+ /**
79
+ * Checks if all configurations in `configs` are in a
80
+ * {@link RuleStopState}. Configurations meeting this condition have reached
81
+ * the end of the decision rule (local context) or end of start rule (full
82
+ * context).
83
+ *
84
+ * @param configs the configuration set to test
85
+ * @returns `true` if all configurations in `configs` are in a
86
+ * {@link RuleStopState}, otherwise `false`
87
+ */
88
+ function allConfigsInRuleStopStates(/*@NotNull*/ configs: ATNConfigSet): boolean;
89
+ }
@@ -0,0 +1,55 @@
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 { ATNConfigSet } from "./ATNConfigSet";
6
+ import { BitSet } from "../misc/BitSet";
7
+ import { DecisionInfo } from "./DecisionInfo";
8
+ import { DFA } from "../dfa/DFA";
9
+ import { DFAState } from "../dfa/DFAState";
10
+ import { Parser } from "../Parser";
11
+ import { ParserATNSimulator } from "./ParserATNSimulator";
12
+ import { ParserRuleContext } from "../ParserRuleContext";
13
+ import { PredictionContextCache } from "./PredictionContextCache";
14
+ import { SemanticContext } from "./SemanticContext";
15
+ import { SimulatorState } from "./SimulatorState";
16
+ import { TokenStream } from "../TokenStream";
17
+ /**
18
+ * @since 4.3
19
+ */
20
+ export declare class ProfilingATNSimulator extends ParserATNSimulator {
21
+ protected decisions: DecisionInfo[];
22
+ protected numDecisions: number;
23
+ protected _input: TokenStream | undefined;
24
+ protected _startIndex: number;
25
+ protected _sllStopIndex: number;
26
+ protected _llStopIndex: number;
27
+ protected currentDecision: number;
28
+ protected currentState: SimulatorState | undefined;
29
+ /** At the point of LL failover, we record how SLL would resolve the conflict so that
30
+ * we can determine whether or not a decision / input pair is context-sensitive.
31
+ * If LL gives a different result than SLL's predicted alternative, we have a
32
+ * context sensitivity for sure. The converse is not necessarily true, however.
33
+ * It's possible that after conflict resolution chooses minimum alternatives,
34
+ * SLL could get the same answer as LL. Regardless of whether or not the result indicates
35
+ * an ambiguity, it is not treated as a context sensitivity because LL prediction
36
+ * was not required in order to produce a correct prediction for this decision and input sequence.
37
+ * It may in fact still be a context sensitivity but we don't know by looking at the
38
+ * minimum alternatives for the current input.
39
+ */
40
+ protected conflictingAltResolvedBySLL: number;
41
+ constructor(parser: Parser);
42
+ adaptivePredict(/*@NotNull*/ input: TokenStream, decision: number, outerContext: ParserRuleContext | undefined): number;
43
+ adaptivePredict(/*@NotNull*/ input: TokenStream, decision: number, outerContext: ParserRuleContext | undefined, useContext: boolean): number;
44
+ protected getStartState(dfa: DFA, input: TokenStream, outerContext: ParserRuleContext, useContext: boolean): SimulatorState | undefined;
45
+ protected computeStartState(dfa: DFA, globalContext: ParserRuleContext, useContext: boolean): SimulatorState;
46
+ protected computeReachSet(dfa: DFA, previous: SimulatorState, t: number, contextCache: PredictionContextCache): SimulatorState | undefined;
47
+ protected getExistingTargetState(previousD: DFAState, t: number): DFAState | undefined;
48
+ protected computeTargetState(dfa: DFA, s: DFAState, remainingGlobalContext: ParserRuleContext, t: number, useContext: boolean, contextCache: PredictionContextCache): [DFAState, ParserRuleContext | undefined];
49
+ protected evalSemanticContextImpl(pred: SemanticContext, parserCallStack: ParserRuleContext, alt: number): boolean;
50
+ protected reportContextSensitivity(dfa: DFA, prediction: number, acceptState: SimulatorState, startIndex: number, stopIndex: number): void;
51
+ protected reportAttemptingFullContext(dfa: DFA, conflictingAlts: BitSet, conflictState: SimulatorState, startIndex: number, stopIndex: number): void;
52
+ protected reportAmbiguity(dfa: DFA, D: DFAState, startIndex: number, stopIndex: number, exact: boolean, ambigAlts: BitSet, configs: ATNConfigSet): void;
53
+ getDecisionInfo(): DecisionInfo[];
54
+ getCurrentState(): SimulatorState | undefined;
55
+ }
@@ -0,0 +1,17 @@
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 { Transition } from "./Transition";
8
+ import { TransitionType } from "./TransitionType";
9
+ export declare class RangeTransition extends Transition {
10
+ from: number;
11
+ to: number;
12
+ constructor(target: ATNState, from: number, to: number);
13
+ get serializationType(): TransitionType;
14
+ get label(): IntervalSet;
15
+ matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
16
+ toString(): string;
17
+ }
@@ -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 { ATNStateType } from "./ATNStateType";
7
+ import { RuleStopState } from "./RuleStopState";
8
+ export declare class RuleStartState extends ATNState {
9
+ stopState: RuleStopState;
10
+ isPrecedenceRule: boolean;
11
+ leftFactored: boolean;
12
+ get stateType(): ATNStateType;
13
+ }
@@ -0,0 +1,15 @@
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 { ATNStateType } from "./ATNStateType";
7
+ /** The last node in the ATN for a rule, unless that rule is the start symbol.
8
+ * In that case, there is one transition to EOF. Later, we might encode
9
+ * references to all calls to this rule to compute FOLLOW sets for
10
+ * error handling.
11
+ */
12
+ export declare class RuleStopState extends ATNState {
13
+ get nonStopStateNumber(): number;
14
+ get stateType(): ATNStateType;
15
+ }
@@ -0,0 +1,22 @@
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 { RuleStartState } from "./RuleStartState";
7
+ import { Transition } from "./Transition";
8
+ import { TransitionType } from "./TransitionType";
9
+ /** */
10
+ export declare class RuleTransition extends Transition {
11
+ /** Ptr to the rule definition object for this rule ref */
12
+ ruleIndex: number;
13
+ precedence: number;
14
+ /** What node to begin computations following ref to rule */
15
+ followState: ATNState;
16
+ tailCall: boolean;
17
+ optimizedTailCall: boolean;
18
+ constructor(ruleStart: RuleStartState, ruleIndex: number, precedence: number, followState: ATNState);
19
+ get serializationType(): TransitionType;
20
+ get isEpsilon(): boolean;
21
+ matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
22
+ }
@@ -0,0 +1,143 @@
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 { Comparable } from "../misc/Stubs";
6
+ import { Equatable } from "../misc/Stubs";
7
+ import { Recognizer } from "../Recognizer";
8
+ import { RuleContext } from "../RuleContext";
9
+ /** A tree structure used to record the semantic context in which
10
+ * an ATN configuration is valid. It's either a single predicate,
11
+ * a conjunction `p1&&p2`, or a sum of products `p1||p2`.
12
+ *
13
+ * I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of
14
+ * {@link SemanticContext} within the scope of this outer class.
15
+ */
16
+ export declare abstract class SemanticContext implements Equatable {
17
+ private static _NONE;
18
+ /**
19
+ * The default {@link SemanticContext}, which is semantically equivalent to
20
+ * a predicate of the form `{true}?`.
21
+ */
22
+ static get NONE(): SemanticContext;
23
+ /**
24
+ * For context independent predicates, we evaluate them without a local
25
+ * context (i.e., unedfined context). That way, we can evaluate them without
26
+ * having to create proper rule-specific context during prediction (as
27
+ * opposed to the parser, which creates them naturally). In a practical
28
+ * sense, this avoids a cast exception from RuleContext to myruleContext.
29
+ *
30
+ * For context dependent predicates, we must pass in a local context so that
31
+ * references such as $arg evaluate properly as _localctx.arg. We only
32
+ * capture context dependent predicates in the context in which we begin
33
+ * prediction, so we passed in the outer context here in case of context
34
+ * dependent predicate evaluation.
35
+ */
36
+ abstract eval<T>(parser: Recognizer<T, any>, parserCallStack: RuleContext): boolean;
37
+ /**
38
+ * Evaluate the precedence predicates for the context and reduce the result.
39
+ *
40
+ * @param parser The parser instance.
41
+ * @param parserCallStack
42
+ * @returns The simplified semantic context after precedence predicates are
43
+ * evaluated, which will be one of the following values.
44
+ *
45
+ * * {@link #NONE}: if the predicate simplifies to `true` after
46
+ * precedence predicates are evaluated.
47
+ * * `undefined`: if the predicate simplifies to `false` after
48
+ * precedence predicates are evaluated.
49
+ * * `this`: if the semantic context is not changed as a result of
50
+ * precedence predicate evaluation.
51
+ * * A non-`undefined` {@link SemanticContext}: the new simplified
52
+ * semantic context after precedence predicates are evaluated.
53
+ */
54
+ evalPrecedence(parser: Recognizer<any, any>, parserCallStack: RuleContext): SemanticContext | undefined;
55
+ abstract hashCode(): number;
56
+ abstract equals(obj: any): boolean;
57
+ static and(a: SemanticContext | undefined, b: SemanticContext): SemanticContext;
58
+ /**
59
+ *
60
+ * @see ParserATNSimulator#getPredsForAmbigAlts
61
+ */
62
+ static or(a: SemanticContext | undefined, b: SemanticContext): SemanticContext;
63
+ }
64
+ export declare namespace SemanticContext {
65
+ class Predicate extends SemanticContext {
66
+ ruleIndex: number;
67
+ predIndex: number;
68
+ isCtxDependent: boolean;
69
+ constructor();
70
+ constructor(ruleIndex: number, predIndex: number, isCtxDependent: boolean);
71
+ eval<T>(parser: Recognizer<T, any>, parserCallStack: RuleContext): boolean;
72
+ hashCode(): number;
73
+ equals(obj: any): boolean;
74
+ toString(): string;
75
+ }
76
+ class PrecedencePredicate extends SemanticContext implements Comparable<PrecedencePredicate> {
77
+ precedence: number;
78
+ constructor(precedence: number);
79
+ eval<T>(parser: Recognizer<T, any>, parserCallStack: RuleContext): boolean;
80
+ evalPrecedence(parser: Recognizer<any, any>, parserCallStack: RuleContext): SemanticContext | undefined;
81
+ compareTo(o: PrecedencePredicate): number;
82
+ hashCode(): number;
83
+ equals(obj: any): boolean;
84
+ toString(): string;
85
+ }
86
+ /**
87
+ * This is the base class for semantic context "operators", which operate on
88
+ * a collection of semantic context "operands".
89
+ *
90
+ * @since 4.3
91
+ */
92
+ abstract class Operator extends SemanticContext {
93
+ /**
94
+ * Gets the operands for the semantic context operator.
95
+ *
96
+ * @returns a collection of {@link SemanticContext} operands for the
97
+ * operator.
98
+ *
99
+ * @since 4.3
100
+ */
101
+ abstract readonly operands: Iterable<SemanticContext>;
102
+ }
103
+ /**
104
+ * A semantic context which is true whenever none of the contained contexts
105
+ * is false.
106
+ */
107
+ class AND extends Operator {
108
+ opnds: SemanticContext[];
109
+ constructor(a: SemanticContext, b: SemanticContext);
110
+ get operands(): Iterable<SemanticContext>;
111
+ equals(obj: any): boolean;
112
+ hashCode(): number;
113
+ /**
114
+ * {@inheritDoc}
115
+ *
116
+ * The evaluation of predicates by this context is short-circuiting, but
117
+ * unordered.
118
+ */
119
+ eval<T>(parser: Recognizer<T, any>, parserCallStack: RuleContext): boolean;
120
+ evalPrecedence(parser: Recognizer<any, any>, parserCallStack: RuleContext): SemanticContext | undefined;
121
+ toString(): string;
122
+ }
123
+ /**
124
+ * A semantic context which is true whenever at least one of the contained
125
+ * contexts is true.
126
+ */
127
+ class OR extends Operator {
128
+ opnds: SemanticContext[];
129
+ constructor(a: SemanticContext, b: SemanticContext);
130
+ get operands(): Iterable<SemanticContext>;
131
+ equals(obj: any): boolean;
132
+ hashCode(): number;
133
+ /**
134
+ * {@inheritDoc}
135
+ *
136
+ * The evaluation of predicates by this context is short-circuiting, but
137
+ * unordered.
138
+ */
139
+ eval<T>(parser: Recognizer<T, any>, parserCallStack: RuleContext): boolean;
140
+ evalPrecedence(parser: Recognizer<any, any>, parserCallStack: RuleContext): SemanticContext | undefined;
141
+ toString(): string;
142
+ }
143
+ }
@@ -0,0 +1,17 @@
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 { Transition } from "./Transition";
8
+ import { TransitionType } from "./TransitionType";
9
+ /** A transition containing a set of values. */
10
+ export declare class SetTransition extends Transition {
11
+ set: IntervalSet;
12
+ constructor(target: ATNState, set: IntervalSet);
13
+ get serializationType(): TransitionType;
14
+ get label(): IntervalSet;
15
+ matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean;
16
+ toString(): string;
17
+ }
@@ -0,0 +1,17 @@
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 { DFAState } from "../dfa/DFAState";
6
+ import { ParserRuleContext } from "../ParserRuleContext";
7
+ /**
8
+ *
9
+ * @author Sam Harwell
10
+ */
11
+ export declare class SimulatorState {
12
+ outerContext: ParserRuleContext;
13
+ s0: DFAState;
14
+ useContext: boolean;
15
+ remainingOuterContext: ParserRuleContext | undefined;
16
+ constructor(outerContext: ParserRuleContext, s0: DFAState, useContext: boolean, remainingOuterContext: ParserRuleContext | undefined);
17
+ }
@@ -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 { ATNStateType } from "./ATNStateType";
6
+ import { BlockStartState } from "./BlockStartState";
7
+ /** The block that begins a closure loop. */
8
+ export declare class StarBlockStartState extends BlockStartState {
9
+ get stateType(): ATNStateType;
10
+ }
@@ -0,0 +1,37 @@
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 { BitSet } from "../misc/BitSet";
7
+ import { DecisionState } from "./DecisionState";
8
+ import { StarLoopbackState } from "./StarLoopbackState";
9
+ export declare class StarLoopEntryState extends DecisionState {
10
+ loopBackState: StarLoopbackState;
11
+ /**
12
+ * Indicates whether this state can benefit from a precedence DFA during SLL
13
+ * decision making.
14
+ *
15
+ * This is a computed property that is calculated during ATN deserialization
16
+ * and stored for use in {@link ParserATNSimulator} and
17
+ * {@link ParserInterpreter}.
18
+ *
19
+ * @see `DFA.isPrecedenceDfa`
20
+ */
21
+ precedenceRuleDecision: boolean;
22
+ /**
23
+ * For precedence decisions, this set marks states *S* which have all
24
+ * of the following characteristics:
25
+ *
26
+ * * One or more invocation sites of the current rule returns to
27
+ * *S*.
28
+ * * The closure from *S* includes the current decision without
29
+ * passing through any rule invocations or stepping out of the current
30
+ * rule.
31
+ *
32
+ * This field is not used when {@link #precedenceRuleDecision} is
33
+ * `false`.
34
+ */
35
+ precedenceLoopbackStates: BitSet;
36
+ get stateType(): ATNStateType;
37
+ }
@@ -0,0 +1,11 @@
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 { ATNStateType } from "./ATNStateType";
7
+ import { StarLoopEntryState } from "./StarLoopEntryState";
8
+ export declare class StarLoopbackState extends ATNState {
9
+ get loopEntryState(): StarLoopEntryState;
10
+ get stateType(): ATNStateType;
11
+ }
@@ -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 { ATNStateType } from "./ATNStateType";
6
+ import { DecisionState } from "./DecisionState";
7
+ /** The Tokens rule start state linking to each lexer rule start state */
8
+ export declare class TokensStartState extends DecisionState {
9
+ get stateType(): ATNStateType;
10
+ }