Skip to content

Commit

Permalink
Add new features and modify final fields
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Einhorn <[email protected]>
  • Loading branch information
RobEin committed Jun 23, 2024
1 parent 658b6cf commit 72a760f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions runtime/Dart/lib/src/lexer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import 'util/utils.dart';

abstract class Lexer extends Recognizer<LexerATNSimulator>
implements TokenSource {
static final DEFAULT_MODE = 0;
static final MORE = -2;
static final SKIP = -3;
static const int DEFAULT_MODE = 0;
static const int MORE = -2;
static const int SKIP = -3;

static final DEFAULT_TOKEN_CHANNEL = Token.DEFAULT_CHANNEL;
static final HIDDEN = Token.HIDDEN_CHANNEL;
static final MIN_CHAR_VALUE = 0x0000;
static final MAX_CHAR_VALUE = 0x10FFFF;
static const int DEFAULT_TOKEN_CHANNEL = Token.DEFAULT_CHANNEL;
static const int HIDDEN = Token.HIDDEN_CHANNEL;
static const int MIN_CHAR_VALUE = 0x0000;
static const int MAX_CHAR_VALUE = 0x10FFFF;

CharStream _input;

Expand Down Expand Up @@ -173,6 +173,10 @@ abstract class Lexer extends Recognizer<LexerATNSimulator>
mode_ = m;
}

int getMode() {
return mode_;
}

void pushMode(int m) {
if (LexerATNSimulator.debug) {
log('pushMode $m');
Expand All @@ -188,6 +192,10 @@ abstract class Lexer extends Recognizer<LexerATNSimulator>
return mode_;
}

List<int> get modeStack {
return _modeStack;
}

/// Set the char stream and reset the lexer
@override
set inputStream(CharStream input) {
Expand Down

0 comments on commit 72a760f

Please sign in to comment.