antlr / antlr/antlr4

Use of "expressions" in a parser grammar for Dart target causes compiler errors

Open
#3,203 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

This seems like an Antlr4 4.9.2 bug with Dart code generation. When I use "expressions" in grammars-v4/sql/plsql/PlSqlParser.g4, the generated code from Dart contains two methods for "expressions()" with different return values. I can work around the problem by renaming "expressions" to "expressions_" in the grammar.

Contributor guide

Open the contributing guide

Research direction

Start with grammars-v4/sql/plsql/PlSqlParser.g4 and the Dart output generated by ANTLR 4.9.2; inspect why two expressions() methods with different return values are emitted. Reproduce the compiler error with the Dart target, then confirm the generated parser has no conflicting methods while preserving the grammar's behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.