Skip to content

Commit

Permalink
fix(JS: ErrorListener types)
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Rodriguez Elorza <francisco.rodriguez.elorza@oracle.com>
  • Loading branch information
Francisco Rodriguez Elorza committed Nov 15, 2024
1 parent 75befab commit 0232d59
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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<TSymbol> implements ErrorListener<TSymbol> {
reportAmbiguity(recognizer: Recognizer<TSymbol>, dfa: DFA, startIndex: number, stopIndex: number, exact: boolean, ambigAlts: BitSet, configs: ATNConfigSet): void;

reportAttemptingFullContext(recognizer: Recognizer<TSymbol>, dfa: DFA, startIndex: number, stopIndex: number, conflictingAlts: BitSet, configs: ATNConfigSet): void;

reportContextSensitivity(recognizer: Recognizer<TSymbol>, dfa: DFA, startIndex: number, stopIndex: number, prediction: number, configs: ATNConfigSet): void;

syntaxError(recognizer: Recognizer<TSymbol>, offendingSymbol: TSymbol, line: number, column: number, msg: string, e: RecognitionException | undefined): void;

}
13 changes: 11 additions & 2 deletions runtime/JavaScript/src/antlr4/error/ErrorListener.d.ts
Original file line number Diff line number Diff line change
@@ -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<TSymbol> {
reportAmbiguity(recognizer: Recognizer<TSymbol>, dfa: DFA, startIndex: number, stopIndex: number, exact: boolean, ambigAlts: BitSet, configs: ATNConfigSet): void;

reportAttemptingFullContext(recognizer: Recognizer<TSymbol>, dfa: DFA, startIndex: number, stopIndex: number, conflictingAlts: BitSet, configs: ATNConfigSet): void;

reportContextSensitivity(recognizer: Recognizer<TSymbol>, dfa: DFA, startIndex: number, stopIndex: number, prediction: number, configs: ATNConfigSet): void;

syntaxError(recognizer: Recognizer<TSymbol>, offendingSymbol: TSymbol, line: number, column: number, msg: string, e: RecognitionException | undefined): void;
}
30 changes: 30 additions & 0 deletions runtime/JavaScript/src/antlr4/misc/BitSet.d.ts
Original file line number Diff line number Diff line change
@@ -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<number>;

minValue(): number;

hashCode(): number;

equals(): boolean;

toString(): string;

_resize(index: number): void;

static _checkIndex(index: number): void;

static _bitCount(l: number): number;
}

0 comments on commit 0232d59

Please sign in to comment.