Skip to content

Commit

Permalink
Fix for #4320--export additional types of the Dart runtime.
Browse files Browse the repository at this point in the history
Signed-off-by: Ken Domino <kenneth.domino@domemtech.com>
  • Loading branch information
kaby76 authored and parrt committed Sep 4, 2023
1 parent ff4cfae commit d02ea0b
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 20 deletions.
18 changes: 11 additions & 7 deletions runtime/Dart/lib/antlr4.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ library antlr4;

export 'src/atn/atn.dart';
export 'src/dfa/dfa.dart';
export 'src/tree/tree.dart';
export 'src/error/error.dart';
export 'src/rule_context.dart';
export 'src/misc/misc.dart';
export 'src/tree/tree.dart';

export 'src/input_stream.dart';
export 'src/token_stream.dart';
export 'src/interval_set.dart';
export 'src/lexer.dart';
export 'src/parser.dart';
export 'src/parser_rule_context.dart';
export 'src/vocabulary.dart';
export 'src/runtime_meta_data.dart';
export 'src/token.dart';
export 'src/prediction_context.dart';
export 'src/recognizer.dart';
export 'src/interval_set.dart';
export 'src/rule_context.dart';
export 'src/runtime_meta_data.dart';
export 'src/token.dart';
export 'src/token_factory.dart';
export 'src/token_source.dart';
export 'src/token_stream.dart';
export 'src/vocabulary.dart';

import 'src/util/platform_stub.dart'
if (dart.library.io) 'src/util/platform_io.dart';
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/atn/src/atn_config_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'dart:math';

import 'package:collection/collection.dart';

import '../../misc/pair.dart';
import '../../misc/misc.dart';
import '../../prediction_context.dart';
import '../../util/bit_set.dart';
import '../../util/utils.dart';
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/atn/src/atn_deserializer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import '../../interval_set.dart';
import '../../misc/pair.dart';
import '../../misc/misc.dart';
import '../../token.dart';
import 'atn.dart';
import 'atn_state.dart';
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import '../../dfa/dfa.dart';
import '../../error/error.dart';
import '../../input_stream.dart';
import '../../interval_set.dart';
import '../../misc/pair.dart';
import '../../misc/misc.dart';
import '../../parser.dart';
import '../../parser_rule_context.dart';
import '../../prediction_context.dart';
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/error/src/error_strategy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:logging/logging.dart';

import '../../atn/atn.dart';
import '../../interval_set.dart';
import '../../misc/pair.dart';
import '../../misc/misc.dart';
import '../../parser.dart';
import '../../parser_rule_context.dart';
import '../../rule_context.dart';
Expand Down
13 changes: 11 additions & 2 deletions runtime/Dart/lib/src/lexer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'atn/atn.dart';
import 'error/error.dart';
import 'input_stream.dart';
import 'interval_set.dart';
import 'misc/pair.dart';
import 'misc/misc.dart';
import 'recognizer.dart';
import 'token.dart';
import 'token_factory.dart';
Expand All @@ -33,7 +33,16 @@ abstract class Lexer extends Recognizer<LexerATNSimulator>
late Pair<TokenSource, CharStream?> _tokenFactorySourcePair;

@override
TokenFactory tokenFactory = CommonTokenFactory.DEFAULT;
TokenFactory get tokenFactory {
return _factory;
}

@override
set tokenFactory(TokenFactory factory) {
_factory = factory;
}

TokenFactory _factory = CommonTokenFactory.DEFAULT;

/// The goal of all lexer rules/methods is to create a token object.
/// this is an instance variable as multiple rules may collaborate to
Expand Down
8 changes: 8 additions & 0 deletions runtime/Dart/lib/src/misc/misc.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2012-2023 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/

export 'src/multi_map.dart';
export 'src/pair.dart';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* can be found in the LICENSE.txt file in the project root.
*/

import '../util/murmur_hash.dart';
import '../../util/murmur_hash.dart';

class Pair<A, B> {
final A a;
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/parser_interpreter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'dart:collection';
import 'atn/atn.dart';
import 'dfa/dfa.dart';
import 'error/error.dart';
import 'misc/pair.dart';
import 'misc/misc.dart';
import 'parser.dart';
import 'parser_rule_context.dart';
import 'token.dart';
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/prediction_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import 'package:collection/collection.dart';

import 'atn/atn.dart';
import 'misc/pair.dart';
import 'misc/misc.dart';
import 'recognizer.dart';
import 'rule_context.dart';
import 'util/murmur_hash.dart';
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/token.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import 'input_stream.dart';
import 'interval_set.dart';
import 'misc/pair.dart';
import 'misc/misc.dart';
import 'token_source.dart';

/// A token has properties: text, type, line, character position in the line
Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/token_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import 'input_stream.dart';
import 'interval_set.dart';
import 'misc/pair.dart';
import 'misc/misc.dart';
import 'token.dart';
import 'token_source.dart';

Expand Down
2 changes: 1 addition & 1 deletion runtime/Dart/lib/src/token_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import 'dart:math';

import 'input_stream.dart';
import 'misc/pair.dart';
import 'misc/misc.dart';
import 'token.dart';
import 'token_factory.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import '../../../error/error.dart';
import '../../../input_stream.dart';
import '../../../lexer.dart';
import '../../../misc/multi_map.dart';
import '../../../misc/misc.dart';
import '../../../parser.dart';
import '../../../parser_interpreter.dart';
import '../../../parser_rule_context.dart';
Expand Down

0 comments on commit d02ea0b

Please sign in to comment.