mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
* antlr: Update tree typings * antlr: Add some misc typings. * antlr: Update error types. * antlr: Add some atn types. * antlr: Add some contexts. * antlr: Add some state. * antlr: Add various. * antlr: Add some root level types. * antlr: Complete more types from Parser to dependents. * antlr: Add many atn types. * antlr: Finish atn types. * antlr: Finish DFA types. * antlr: Clean up types. * antlr: add utils tests. * antlr: add dfa tests. * antlr: add atn tests. * antlr: add more atn tests. * antlr: finish atn tests. * antlr: add action tests. * antlr: add context tests. * antlr: finish dfa tests. * antlr: add error tests. * antlr: add misc tests. * antlr: add state tests. * antlr: add transition tests. * antlr: add tree tests. * antlr: add root tests. * antlr: remove relying on lib.dom. * antlr: lexer technically handles null. * antlr4-autosuggest: Update to use new types * antlr: ParserRuleContext child method actually returns a base ParseTree.
54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import ATNSimulator from './atn/ATNSimulator';
|
|
import ConsoleErrorListener from './error/ConsoleErrorListener';
|
|
import ErrorListener from './error/ErrorListener';
|
|
import ProxyErrorListener from './error/ProxyErrorListener';
|
|
import Token from './Token';
|
|
import ParserRuleContext from './context/ParserRuleContext';
|
|
import RecognitionException from './error/RecognitionException';
|
|
|
|
export default class Recognizer {
|
|
checkVersion(toolVersion: number): void;
|
|
|
|
addErrorListener(listener: ErrorListener): void;
|
|
|
|
removeErrorListeners(): void;
|
|
|
|
getLiteralNames(): Array<string | null>;
|
|
|
|
getSymbolicNames(): Array<string | null>;
|
|
|
|
getTokenNames(): Array<string | '<INVALID'>;
|
|
|
|
getTokenTypeMap(): Record<string, number>;
|
|
|
|
/**
|
|
* Get a map from rule names to rule indexes.
|
|
* Used for XPath and tree pattern compilation.
|
|
*/
|
|
getRuleIndexMap(): Record<string, number>;
|
|
|
|
getTokenType(tokenName: string): number;
|
|
|
|
getErrorHeader(e: RecognitionException): string;
|
|
|
|
/**
|
|
* @deprecated This method is not called by the ANTLR 4 Runtime. Specific
|
|
* implementations of {@link ErrorStrategy} may provide a similar feature
|
|
* when necessary. For example, see {@link DefaultErrorStrategy.getTokenErrorDisplay}.
|
|
*/
|
|
getTokenErrorDisplay(t: Token): string;
|
|
|
|
getErrorListenerDispatch(): ProxyErrorListener;
|
|
|
|
/**
|
|
* subclass needs to override these if there are sempreds or actions
|
|
* that the ATN interp needs to execute
|
|
*/
|
|
sempred(localCtx: ParserRuleContext, ruleIndex: number, actionIndex: number): boolean;
|
|
|
|
precpred(localCtx: ParserRuleContext, precedence: number): boolean;
|
|
|
|
set state(arg: number);
|
|
get state(): number;
|
|
}
|