Skip to content

Commit

Permalink
remove setMode method
Browse files Browse the repository at this point in the history
  • Loading branch information
RobEin committed Mar 17, 2024
1 parent 69cfd8e commit 996eb6b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion runtime/JavaScript/src/antlr4/Lexer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export declare class Lexer extends Recognizer<number> {
nextToken(): Token;
skip(): void;
more(): void;
more(m: number): void;
mode(m: number): void;
getMode(): number;
getModeStack(): number[];
pushMode(m: number): void;
popMode(): number;
emitToken(token: Token): void;
Expand Down
8 changes: 8 additions & 0 deletions runtime/JavaScript/src/antlr4/Lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ export default class Lexer extends Recognizer {
this._mode = m;
}

getMode() {
return this._mode;
}

getModeStack() {
return this._modeStack;
}

pushMode(m) {
if (this._interp.debug) {
console.log("pushMode " + m);
Expand Down
3 changes: 3 additions & 0 deletions runtime/JavaScript/src/antlr4/Recognizer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ export declare class Recognizer<TSymbol> {

removeErrorListeners(): void;
addErrorListener(listener: ErrorListener<TSymbol>): void;
getErrorListenerDispatch(): ErrorListener<TSymbol>;
getLiteralNames(): string[] | [];
getSymbolicNames(): string[] | [];
}
6 changes: 4 additions & 2 deletions runtime/JavaScript/src/antlr4/Token.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {CharStream} from "./CharStream";
import { TokenSource } from "./TokenSource";
import { CharStream } from "./CharStream";

export declare class Token {

static INVALID_TYPE: number;
static EOF: number;

static DEFAULT_CHANNEL: number;
static HIDDEN_CHANNEL: number;

Expand All @@ -18,5 +19,6 @@ export declare class Token {

clone(): Token;
cloneWithType(type: number): Token;
getTokenSource(): TokenSource;
getInputStream(): CharStream;
}

0 comments on commit 996eb6b

Please sign in to comment.