From 0232d595b9372fa03e38da90bc62e48567dea594 Mon Sep 17 00:00:00 2001 From: Francisco Rodriguez Elorza Date: Fri, 15 Nov 2024 13:44:23 -0800 Subject: [PATCH] fix(JS: ErrorListener types) Signed-off-by: Francisco Rodriguez Elorza --- .../antlr4/error/DiagnosticErrorListener.d.ts | 9 +++++- .../src/antlr4/error/ErrorListener.d.ts | 13 ++++++-- .../JavaScript/src/antlr4/misc/BitSet.d.ts | 30 +++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 runtime/JavaScript/src/antlr4/misc/BitSet.d.ts diff --git a/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.d.ts b/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.d.ts index b88fe66844..2e27858687 100644 --- a/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.d.ts +++ b/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.d.ts @@ -1,9 +1,16 @@ +import {ATNConfigSet} from "../atn"; +import {BitSet} from "../misc/BitSet"; +import {DFA} from "../dfa"; import {ErrorListener} from "./ErrorListener"; import {Recognizer} from "../Recognizer"; import {RecognitionException} from "./RecognitionException"; export declare class DiagnosticErrorListener implements ErrorListener { + reportAmbiguity(recognizer: Recognizer, dfa: DFA, startIndex: number, stopIndex: number, exact: boolean, ambigAlts: BitSet, configs: ATNConfigSet): void; + + reportAttemptingFullContext(recognizer: Recognizer, dfa: DFA, startIndex: number, stopIndex: number, conflictingAlts: BitSet, configs: ATNConfigSet): void; + + reportContextSensitivity(recognizer: Recognizer, dfa: DFA, startIndex: number, stopIndex: number, prediction: number, configs: ATNConfigSet): void; syntaxError(recognizer: Recognizer, offendingSymbol: TSymbol, line: number, column: number, msg: string, e: RecognitionException | undefined): void; - } diff --git a/runtime/JavaScript/src/antlr4/error/ErrorListener.d.ts b/runtime/JavaScript/src/antlr4/error/ErrorListener.d.ts index 4b61236410..e3882711c9 100644 --- a/runtime/JavaScript/src/antlr4/error/ErrorListener.d.ts +++ b/runtime/JavaScript/src/antlr4/error/ErrorListener.d.ts @@ -1,6 +1,15 @@ -import {Recognizer} from "../Recognizer"; -import {RecognitionException} from "./RecognitionException"; +import { ATNConfigSet } from "../atn"; +import { BitSet } from '../misc/BitSet'; +import { DFA } from "../dfa"; +import { Recognizer } from "../Recognizer"; +import { RecognitionException } from "./RecognitionException"; export declare class ErrorListener { + reportAmbiguity(recognizer: Recognizer, dfa: DFA, startIndex: number, stopIndex: number, exact: boolean, ambigAlts: BitSet, configs: ATNConfigSet): void; + + reportAttemptingFullContext(recognizer: Recognizer, dfa: DFA, startIndex: number, stopIndex: number, conflictingAlts: BitSet, configs: ATNConfigSet): void; + + reportContextSensitivity(recognizer: Recognizer, dfa: DFA, startIndex: number, stopIndex: number, prediction: number, configs: ATNConfigSet): void; + syntaxError(recognizer: Recognizer, offendingSymbol: TSymbol, line: number, column: number, msg: string, e: RecognitionException | undefined): void; } diff --git a/runtime/JavaScript/src/antlr4/misc/BitSet.d.ts b/runtime/JavaScript/src/antlr4/misc/BitSet.d.ts new file mode 100644 index 0000000000..9c3cca88ef --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/BitSet.d.ts @@ -0,0 +1,30 @@ +export declare class BitSet { + private data: Uint32Array; + readonly length: number; + + constructor(); + + set(index: number): void; + + get(index: number): number; + + clear(index: number): void; + + or(set: BitSet): void; + + values(): Array; + + minValue(): number; + + hashCode(): number; + + equals(): boolean; + + toString(): string; + + _resize(index: number): void; + + static _checkIndex(index: number): void; + + static _bitCount(l: number): number; +}