ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
I tried to build a dart package to parse Prisma Orm file. But this problems happens also on your hello grammar file:
// Define a grammar called Hello
grammar Hello;
r : 'hello' ID ; // match keyword hello followed by an identifier
ID : [a-z]+ ; // match lower-case identifiers
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
antlr4 -Dlanguage=Dart Hello.g4 -o lib/hello
Used versions
ANTLR Parser Generator Version 4.13.1
Dart SDK version: 3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "macos_arm64"
The HelloParser.dart file contains a lot of warnings and an some error:
The argument type 'dynamic' can't be assigned to the parameter type 'ParserRuleContext'.
I tried to build a dart package to parse Prisma Orm file. But this problems happens also on your hello grammar file:
Used versions ANTLR Parser Generator Version 4.13.1 Dart SDK version: 3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "macos_arm64"
The HelloParser.dart file contains a lot of warnings and an some error: The argument type 'dynamic' can't be assigned to the parameter type 'ParserRuleContext'.
dynamic _localctx = HelloFileContext(context, state);
this can be fixed by generating:
final _localctx = HelloFileContext(context, state);