antlr4ng
Version:
Alternative JavaScript/TypeScript runtime for ANTLR4
49 lines (48 loc) • 2.19 kB
TypeScript
import { ATNSimulator } from "./atn/ATNSimulator.js";
import { ParseInfo } from "./atn/ParseInfo.js";
import { Vocabulary } from "./Vocabulary.js";
import { ANTLRErrorListener } from "./ANTLRErrorListener.js";
import { RecognitionException } from "./RecognitionException.js";
import { ATN } from "./atn/ATN.js";
import { ParserRuleContext } from "./ParserRuleContext.js";
import { IntStream } from "./IntStream.js";
export declare abstract class Recognizer<ATNInterpreter extends ATNSimulator> {
static readonly EOF = -1;
private static tokenTypeMapCache;
private static ruleIndexMapCache;
interpreter: ATNInterpreter;
private listeners;
private stateNumber;
checkVersion(toolVersion: string): void;
addErrorListener(listener: ANTLRErrorListener): void;
removeErrorListeners(): void;
removeErrorListener(listener: ANTLRErrorListener): void;
getErrorListeners(): ANTLRErrorListener[];
getTokenTypeMap(): Map<string, number>;
/**
* Get a map from rule names to rule indexes.
* Used for XPath and tree pattern compilation.
*/
getRuleIndexMap(): Map<string, number>;
getTokenType(tokenName: string): number;
/** What is the error header, normally line/character position information? */
getErrorHeader(e: RecognitionException): string;
get errorListenerDispatch(): ANTLRErrorListener;
/**
* subclass needs to override these if there are semantic predicates or actions
* that the ATN interp needs to execute
*/
sempred(_localctx: ParserRuleContext | null, _ruleIndex: number, _actionIndex: number): boolean;
precpred(_localctx: ParserRuleContext | null, _precedence: number): boolean;
action(_localctx: ParserRuleContext | null, _ruleIndex: number, _actionIndex: number): void;
get atn(): ATN;
get state(): number;
set state(state: number);
getParseInfo(): ParseInfo | undefined;
abstract get serializedATN(): number[];
abstract get grammarFileName(): string;
abstract get ruleNames(): string[];
abstract get vocabulary(): Vocabulary;
abstract get inputStream(): IntStream | null;
abstract set inputStream(input: IntStream | null);
}