diff --git a/contributors.txt b/contributors.txt index fe3036767d..652737974b 100644 --- a/contributors.txt +++ b/contributors.txt @@ -305,3 +305,4 @@ YYYY/MM/DD, github id, Full name, email 2021/07/01, marcauberer, Marc Auberer, marc.auberer@chillibits.com 2021/07/14, renzhentaxibaerde, Renzhentaxi Baerde, renzhentaxibaerde@gmail.com 2021/08/02, minjoosur, Minjoo Sur, msur@salesforce.com +2021/08/08, ansiemens, Yi-Hong Lin, ansiemens@gmail.com diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Dart.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Dart.test.stg index 60eeac8be6..0f3e109b4b 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Dart.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Dart.test.stg @@ -1,5 +1,5 @@ writeln(s) ::= <);>> -write(s) ::= <);>> +write(s) ::= <);>> writeList(s) ::= <);>> False() ::= "false" @@ -242,7 +242,7 @@ TokenGetterListener(X) ::= << class LeafListener extends TBaseListener { void exitA(AContext ctx) { if (ctx.childCount==2) - stdout.write("${ctx.INT(0)?.symbol.text} ${ctx.INT(1)?.symbol.text} ${ctx.INTs()}"); + TEST_platformStdoutWrite("${ctx.INT(0)?.symbol.text} ${ctx.INT(1)?.symbol.text} ${ctx.INTs()}"); else print(ctx.ID()?.symbol); } @@ -255,7 +255,7 @@ RuleGetterListener(X) ::= << class LeafListener extends TBaseListener { void exitA(AContext ctx) { if (ctx.childCount==2) { - stdout.write("${ctx.b(0)?.start?.text} ${ctx.b(1)?.start?.text} ${ctx.bs()[0].start?.text}"); + TEST_platformStdoutWrite("${ctx.b(0)?.start?.text} ${ctx.b(1)?.start?.text} ${ctx.bs()[0].start?.text}"); } else print(ctx.b(0)?.start?.text); } @@ -269,7 +269,7 @@ LRListener(X) ::= << class LeafListener extends TBaseListener { void exitE(EContext ctx) { if (ctx.childCount==3) { - stdout.write("${ctx.e(0)?.start?.text} ${ctx.e(1)?.start?.text} ${ctx.es()[0].start?.text}\n"); + print("${ctx.e(0)?.start?.text} ${ctx.e(1)?.start?.text} ${ctx.es()[0].start?.text}"); } else print(ctx.INT()?.symbol.text); } @@ -281,7 +281,7 @@ LRWithLabelsListener(X) ::= << @parser::definitions { class LeafListener extends TBaseListener { void exitCall(CallContext ctx) { - stdout.write("${ctx.e()?.start?.text} ${ctx.eList()}"); + TEST_platformStdoutWrite("${ctx.e()?.start?.text} ${ctx.eList()}"); } void exitInt(IntContext ctx) { print(ctx.INT()?.symbol.text); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java index 1fcce39d53..dd54c2027b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java @@ -19,7 +19,6 @@ import static junit.framework.TestCase.*; import static org.antlr.v4.test.runtime.BaseRuntimeTest.readFile; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; -import static org.junit.Assert.assertArrayEquals; public class BaseDartTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { @@ -147,7 +146,9 @@ protected boolean rawGenerateAndBuildRecognizer(String grammarFileName, final File dartToolDir = new File(getTempDirPath(), ".dart_tool"); if (cacheDartPackages == null) { try { - final Process process = Runtime.getRuntime().exec(new String[]{locatePub(), "get"}, null, getTempTestDir()); + final Process process = + Runtime.getRuntime().exec( + new String[]{locateDart(), "pub", "get"}, null, getTempTestDir()); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); stderrVacuum.start(); Timer timer = new Timer(); @@ -207,8 +208,8 @@ public String execClass(String className, boolean compile) { try { if (compile) { String[] args = new String[]{ - locateDart2Native(), - className + ".dart", "-o", className + locateDart(), + "compile", "exe", className + ".dart", "-o", className }; String cmdLine = Utils.join(args, " "); System.err.println("Compile: " + cmdLine); @@ -314,23 +315,6 @@ private String locateTool(String tool) { throw new RuntimeException("Could not locate " + tool); } - protected String locatePub() { - String propName = getPropertyPrefix() + "-pub"; - String prop = System.getProperty(propName); - - if (prop == null || prop.length() == 0) { - prop = locateTool("pub"); - } - - File file = new File(prop); - - if (!file.exists()) { - throw new RuntimeException("Missing system property:" + propName); - } - - return file.getAbsolutePath(); - } - protected String locateDart() { String propName = getPropertyPrefix() + "-dart"; String prop = System.getProperty(propName); @@ -348,23 +332,6 @@ protected String locateDart() { return file.getAbsolutePath(); } - protected String locateDart2Native() { - String propName = getPropertyPrefix() + "-dart2native"; - String prop = System.getProperty(propName); - - if (prop == null || prop.length() == 0) { - prop = locateTool("dart2native"); - } - - File file = new File(prop); - - if (!file.exists()) { - throw new RuntimeException("Missing system property:" + propName); - } - - return file.getAbsolutePath(); - } - private String locateRuntime() { final ClassLoader loader = Thread.currentThread().getContextClassLoader(); final URL runtimeSrc = loader.getResource("Dart"); diff --git a/runtime/Dart/CHANGELOG.md b/runtime/Dart/CHANGELOG.md index 83a28250fa..1ba1db8d3f 100644 --- a/runtime/Dart/CHANGELOG.md +++ b/runtime/Dart/CHANGELOG.md @@ -2,3 +2,8 @@ ## 4.9.0 * Initial release + +## 4.9.3 + +* Support web platform. + diff --git a/runtime/Dart/lib/antlr4.dart b/runtime/Dart/lib/antlr4.dart index c3890c1cdb..bce2034785 100644 --- a/runtime/Dart/lib/antlr4.dart +++ b/runtime/Dart/lib/antlr4.dart @@ -19,4 +19,10 @@ 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'; \ No newline at end of file +export 'src/prediction_context.dart'; + +import 'src/util/platform_stub.dart' + if (dart.library.io) 'src/util/platform_io.dart'; + +/// Hack to workaround not being able to access stdout in tests. +void TEST_platformStdoutWrite(Object? object) => stdoutWrite(object); diff --git a/runtime/Dart/lib/src/atn/src/atn_simulator.dart b/runtime/Dart/lib/src/atn/src/atn_simulator.dart index 4497d23f60..4c3eb3e607 100644 --- a/runtime/Dart/lib/src/atn/src/atn_simulator.dart +++ b/runtime/Dart/lib/src/atn/src/atn_simulator.dart @@ -62,7 +62,8 @@ abstract class ATNSimulator { if (sharedContextCache == null) return context; final visited = {}; - return PredictionContext.getCachedContext(context, sharedContextCache!, visited); + return PredictionContext.getCachedContext( + context, sharedContextCache!, visited); } } diff --git a/runtime/Dart/lib/src/atn/src/info.dart b/runtime/Dart/lib/src/atn/src/info.dart index a54b303f96..63c9f6c1c4 100644 --- a/runtime/Dart/lib/src/atn/src/info.dart +++ b/runtime/Dart/lib/src/atn/src/info.dart @@ -102,8 +102,6 @@ class DecisionEventInfo { /// /// @since 4.3 class DecisionInfo { - - /// The decision number, which is an index into {@link ATN#decisionToState}. final int decision; diff --git a/runtime/Dart/lib/src/atn/src/lexer_action.dart b/runtime/Dart/lib/src/atn/src/lexer_action.dart index a8630671e4..9d23270bcc 100644 --- a/runtime/Dart/lib/src/atn/src/lexer_action.dart +++ b/runtime/Dart/lib/src/atn/src/lexer_action.dart @@ -13,18 +13,25 @@ import '../../util/murmur_hash.dart'; enum LexerActionType { /// The type of a [LexerChannelAction] action. CHANNEL, + /// The type of a [LexerCustomAction] action. CUSTOM, + /// The type of a [LexerModeAction] action. MODE, + /// The type of a [LexerMoreAction] action. MORE, + /// The type of a [LexerPopModeAction] action. POP_MODE, + /// The type of a [LexerPushModeAction] action. PUSH_MODE, + /// The type of a [LexerSkipAction] action. SKIP, + /// The type of a [LexerTypeAction] action. TYPE, } diff --git a/runtime/Dart/lib/src/error/src/error_listener.dart b/runtime/Dart/lib/src/error/src/error_listener.dart index db459f0aac..36505fb6af 100644 --- a/runtime/Dart/lib/src/error/src/error_listener.dart +++ b/runtime/Dart/lib/src/error/src/error_listener.dart @@ -4,8 +4,6 @@ * can be found in the LICENSE.txt file in the project root. */ -import 'dart:io'; - import '../../atn/atn.dart'; import '../../dfa/dfa.dart'; import '../../parser.dart'; @@ -13,6 +11,10 @@ import '../../recognizer.dart'; import '../../util/bit_set.dart'; import 'errors.dart'; +import '../../util/platform_stub.dart' + if (dart.library.io) '../../util/platform_io.dart' + if (dart.library.html) '../../util/platform_html.dart'; + abstract class ErrorListener { /// Upon syntax error, notify any interested parties. This is not how to /// recover from errors or compute error messages. [ANTLRErrorStrategy] @@ -237,7 +239,7 @@ class ConsoleErrorListener extends BaseErrorListener { /// @override void syntaxError(recognizer, offendingSymbol, line, column, msg, e) { - stderr.writeln('line $line:$column $msg'); + stderrWriteln('line $line:$column $msg'); } } diff --git a/runtime/Dart/lib/src/input_stream.dart b/runtime/Dart/lib/src/input_stream.dart index 8bd9c39471..879915323d 100644 --- a/runtime/Dart/lib/src/input_stream.dart +++ b/runtime/Dart/lib/src/input_stream.dart @@ -6,12 +6,13 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:io'; import 'dart:math'; import 'interval_set.dart'; import 'token.dart'; +import 'util/platform_stub.dart' if (dart.library.io) 'util/platform_io.dart'; + /// A simple stream of symbols whose values are represented as integers. This /// interface provides marked ranges with support for a minimum level /// of buffering necessary to implement arbitrary lookahead during prediction. @@ -248,7 +249,7 @@ class InputStream extends CharStream { } static Future fromPath(String path, {Encoding encoding = utf8}) { - return fromStream(File(path).openRead()); + return fromStream(readStream(path), encoding: encoding); } @override diff --git a/runtime/Dart/lib/src/misc/pair.dart b/runtime/Dart/lib/src/misc/pair.dart index 6d3e0d551b..4993dc289f 100644 --- a/runtime/Dart/lib/src/misc/pair.dart +++ b/runtime/Dart/lib/src/misc/pair.dart @@ -14,7 +14,8 @@ class Pair { @override bool operator ==(other) { - return identical(this, other) || other is Pair && a == other.a && b == other.b; + return identical(this, other) || + other is Pair && a == other.a && b == other.b; } @override diff --git a/runtime/Dart/lib/src/parser.dart b/runtime/Dart/lib/src/parser.dart index 7cc919f952..255bf08acb 100644 --- a/runtime/Dart/lib/src/parser.dart +++ b/runtime/Dart/lib/src/parser.dart @@ -4,8 +4,6 @@ * can be found in the LICENSE.txt file in the project root. */ -import 'dart:io'; - import 'atn/atn.dart'; import 'error/error.dart'; import 'input_stream.dart'; @@ -19,6 +17,10 @@ import 'token_factory.dart'; import 'token_stream.dart'; import 'tree/tree.dart'; +import 'util/platform_stub.dart' + if (dart.library.io) 'util/platform_io.dart' + if (dart.library.html) 'util/platform_html.dart'; + /// This is all the parsing support code essentially; most of it is error recovery stuff. */ abstract class Parser extends Recognizer { /// This field maps from the serialized ATN string to the deserialized [ATN] with @@ -723,7 +725,7 @@ abstract class Parser extends Recognizer { if (dfa.states.isNotEmpty) { if (seenOne) print(''); print('Decision ${dfa.decision}:'); - stdout.write(dfa.toString(vocabulary)); + stdoutWrite(dfa.toString(vocabulary)); seenOne = true; } } diff --git a/runtime/Dart/lib/src/util/bit_operation_util.dart b/runtime/Dart/lib/src/util/bit_operation_util.dart new file mode 100644 index 0000000000..0ac117f5f2 --- /dev/null +++ b/runtime/Dart/lib/src/util/bit_operation_util.dart @@ -0,0 +1,128 @@ +import 'dart:typed_data'; + +int getBitCount(Uint32List value) { + var data = 0; + final size = value.length; + const m1 = 0x5555555555555555; + const m2 = 0x3333333333333333; + const m4 = 0x0F0F0F0F0F0F0F0F; + const m8 = 0x00FF00FF00FF00FF; + const m16 = 0x0000FFFF0000FFFF; + const h01 = 0x0101010101010101; + + var bitCount = 0; + final limit30 = size - size % 30; + + // 64-bit tree merging (merging3) + for (var i = 0; i < limit30; i += 30, data += 30) { + var acc = 0; + for (var j = 0; j < 30; j += 3) { + var count1 = value[data + j]; + var count2 = value[data + j + 1]; + var half1 = value[data + j + 2]; + var half2 = half1; + half1 &= m1; + half2 = (half2 >> 1) & m1; + count1 -= (count1 >> 1) & m1; + count2 -= (count2 >> 1) & m1; + count1 += half1; + count2 += half2; + count1 = (count1 & m2) + ((count1 >> 2) & m2); + count1 += (count2 & m2) + ((count2 >> 2) & m2); + acc += (count1 & m4) + ((count1 >> 4) & m4); + } + + acc = (acc & m8) + ((acc >> 8) & m8); + acc = (acc + (acc >> 16)) & m16; + acc = acc + (acc >> 32); + bitCount += acc; + } + + // count the bits of the remaining bytes (MAX 29*8) using + // "Counting bits set, in parallel" from the "Bit Twiddling Hacks", + // the code uses wikipedia's 64-bit popcount_3() implementation: + // http://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation + for (var i = 0; i < size - limit30; i++) { + var x = value[data + i]; + x = x - ((x >> 1) & m1); + x = (x & m2) + ((x >> 2) & m2); + x = (x + (x >> 4)) & m4; + bitCount += ((x * h01) >> 56); + } + + return bitCount; +} + +final List index64 = [ + 0, + 47, + 1, + 56, + 48, + 27, + 2, + 60, + 57, + 49, + 41, + 37, + 28, + 16, + 3, + 61, + 54, + 58, + 35, + 52, + 50, + 42, + 21, + 44, + 38, + 32, + 29, + 23, + 17, + 11, + 4, + 62, + 46, + 55, + 26, + 59, + 40, + 36, + 15, + 53, + 34, + 51, + 20, + 43, + 31, + 22, + 10, + 45, + 25, + 39, + 14, + 33, + 19, + 30, + 9, + 24, + 13, + 18, + 8, + 12, + 7, + 6, + 5, + 63 +]; + +int BitScanForward(int value) { + if (value == 0) return -1; + + const debruijn64 = 0x03f79d71b4cb0a89; + return index64[(((value ^ (value - 1)) * debruijn64) >> 58) % 64]; +} diff --git a/runtime/Dart/lib/src/util/bit_operation_util_html.dart b/runtime/Dart/lib/src/util/bit_operation_util_html.dart new file mode 100644 index 0000000000..65a501f949 --- /dev/null +++ b/runtime/Dart/lib/src/util/bit_operation_util_html.dart @@ -0,0 +1,56 @@ +import 'dart:typed_data'; + +/// Dart2JS does not support int64; use the alternatives. +/// http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel + +int getBitCount(Uint32List value) { + var bitCount = 0; + for (var v in value) { + v -= ((v >> 1) & 0x55555555); + v = (v & 0x33333333) + ((v >> 2) & 0x33333333); + bitCount += (((v + (v >> 4) & 0xf0f0f0f) * 0x1010101) >> 24); + } + return bitCount; +} + +final List index32 = [ + 0, + 9, + 1, + 10, + 13, + 21, + 2, + 29, + 11, + 14, + 16, + 18, + 22, + 25, + 3, + 30, + 8, + 12, + 20, + 28, + 15, + 17, + 24, + 7, + 19, + 27, + 23, + 6, + 26, + 5, + 4, + 31 +]; + +int BitScanForward(int value) { + if (value == 0) return -1; + + const debruijn32 = 0x07c4acdd; + return index32[((value ^ (value - 1)) * debruijn32) >> 27]; +} diff --git a/runtime/Dart/lib/src/util/bit_set.dart b/runtime/Dart/lib/src/util/bit_set.dart index 1669e3aaff..95ca4203bd 100644 --- a/runtime/Dart/lib/src/util/bit_set.dart +++ b/runtime/Dart/lib/src/util/bit_set.dart @@ -7,6 +7,9 @@ import 'dart:math'; import 'dart:typed_data'; +import 'bit_operation_util.dart' + if (dart.library.html) 'bit_operation_util_html.dart' as util; + class BitSet { static final Uint32List EmptyBits = Uint32List(0); static const BitsPerElement = 8 * 32; @@ -25,133 +28,6 @@ class BitSet { } } - static int getBitCount(Uint32List value) { - var data = 0; - final size = value.length; - const m1 = 0x5555555555555555; - const m2 = 0x3333333333333333; - const m4 = 0x0F0F0F0F0F0F0F0F; - const m8 = 0x00FF00FF00FF00FF; - const m16 = 0x0000FFFF0000FFFF; - const h01 = 0x0101010101010101; - - var bitCount = 0; - final limit30 = size - size % 30; - - // 64-bit tree merging (merging3) - for (var i = 0; i < limit30; i += 30, data += 30) { - var acc = 0; - for (var j = 0; j < 30; j += 3) { - var count1 = value[data + j]; - var count2 = value[data + j + 1]; - var half1 = value[data + j + 2]; - var half2 = half1; - half1 &= m1; - half2 = (half2 >> 1) & m1; - count1 -= (count1 >> 1) & m1; - count2 -= (count2 >> 1) & m1; - count1 += half1; - count2 += half2; - count1 = (count1 & m2) + ((count1 >> 2) & m2); - count1 += (count2 & m2) + ((count2 >> 2) & m2); - acc += (count1 & m4) + ((count1 >> 4) & m4); - } - - acc = (acc & m8) + ((acc >> 8) & m8); - acc = (acc + (acc >> 16)) & m16; - acc = acc + (acc >> 32); - bitCount += acc; - } - - // count the bits of the remaining bytes (MAX 29*8) using - // "Counting bits set, in parallel" from the "Bit Twiddling Hacks", - // the code uses wikipedia's 64-bit popcount_3() implementation: - // http://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation - for (var i = 0; i < size - limit30; i++) { - var x = value[data + i]; - x = x - ((x >> 1) & m1); - x = (x & m2) + ((x >> 2) & m2); - x = (x + (x >> 4)) & m4; - bitCount += ((x * h01) >> 56); - } - - return bitCount; - } - - static final List index64 = [ - 0, - 47, - 1, - 56, - 48, - 27, - 2, - 60, - 57, - 49, - 41, - 37, - 28, - 16, - 3, - 61, - 54, - 58, - 35, - 52, - 50, - 42, - 21, - 44, - 38, - 32, - 29, - 23, - 17, - 11, - 4, - 62, - 46, - 55, - 26, - 59, - 40, - 36, - 15, - 53, - 34, - 51, - 20, - 43, - 31, - 22, - 10, - 45, - 25, - 39, - 14, - 33, - 19, - 30, - 9, - 24, - 13, - 18, - 8, - 12, - 7, - 6, - 5, - 63 - ]; - - static int BitScanForward(int value) { - if (value == 0) return -1; - - const debruijn64 = 0x03f79d71b4cb0a89; - return index64[(((value ^ (value - 1)) * debruijn64) >> 58) % 64]; - } - BitSet clone() { final result = BitSet(); result._data = Uint32List.fromList(_data); @@ -201,7 +77,7 @@ class BitSet { } int get cardinality { - return getBitCount(_data); + return util.getBitCount(_data); } int nextset(int fromIndex) { @@ -215,7 +91,7 @@ class BitSet { var current = _data[i] & ~((1 << (fromIndex % BitsPerElement)) - 1); while (true) { - final bit = BitScanForward(current); + final bit = util.BitScanForward(current); if (bit >= 0) return bit + i * BitsPerElement; i++; diff --git a/runtime/Dart/lib/src/util/platform_html.dart b/runtime/Dart/lib/src/util/platform_html.dart new file mode 100644 index 0000000000..421ed63a12 --- /dev/null +++ b/runtime/Dart/lib/src/util/platform_html.dart @@ -0,0 +1,15 @@ +import 'dart:html'; + +/// Creates a new independent [Stream] for the contents of the file on [path]. +Stream> readStream(String path) => throw UnsupportedError( + 'dart:html does not support read stream from a file'); + +/// Prints a string representation of the object. +void stdoutWrite(Object? object) => throw UnsupportedError( + 'dart:html does not support write without a newline'); + +/// Prints a string representation of the [object] to the error stream. +/// +/// Each call appends an additional newline to the object's string +/// representation. +void stderrWriteln(Object? object) => window.console.error(object); diff --git a/runtime/Dart/lib/src/util/platform_io.dart b/runtime/Dart/lib/src/util/platform_io.dart new file mode 100644 index 0000000000..649073d1ef --- /dev/null +++ b/runtime/Dart/lib/src/util/platform_io.dart @@ -0,0 +1,13 @@ +import 'dart:io'; + +/// Creates a new independent [Stream] for the contents of the file on [path]. +Stream> readStream(String path) => File(path).openRead(); + +/// Prints a string representation of the object. +void stdoutWrite(Object? object) => stdout.write(object); + +/// Prints a string representation of the [object] to the error stream. +/// +/// Each call appends an additional newline to the object's string +/// representation. +void stderrWriteln(Object? object) => stderr.writeln(object); diff --git a/runtime/Dart/lib/src/util/platform_stub.dart b/runtime/Dart/lib/src/util/platform_stub.dart new file mode 100644 index 0000000000..3661faf6cf --- /dev/null +++ b/runtime/Dart/lib/src/util/platform_stub.dart @@ -0,0 +1,14 @@ +/// Creates a new independent [Stream] for the contents of the file on [path]. +Stream> readStream(String path) => + throw UnsupportedError('Cannot read a file stream without dart:io'); + +/// Prints a string representation of the object. +void stdoutWrite(Object? object) => + throw UnsupportedError('Cannot do stdout#write without dart:io'); + +/// Prints a string representation of the [object] to the error stream. +/// +/// Each call appends an additional newline to the object's string +/// representation. +void stderrWriteln(Object? object) => throw UnsupportedError( + 'Cannot do writeln to the error stream without dart:io or dart:html'); diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/Dart/Dart.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/Dart/Dart.stg index 236fd14b18..cfdc9fcf1b 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/Dart/Dart.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/Dart/Dart.stg @@ -46,7 +46,6 @@ ParserFile(file, parser, namedActions, contextSuperClass) ::= << library ; import 'package:antlr4/antlr4.dart'; -import 'dart:io'; part 'Listener.dart'; @@ -59,7 +58,6 @@ part 'BaseVisitor.dart'; part 'Lexer.dart'; import 'package:antlr4/antlr4.dart'; -import 'dart:io'; import 'Listener.dart';