antlr / antlr/antlr4

Java target should not allow any token or rule to match the grammar name

Open
#671 0 comments 0 reactions 0 assignees View on GitHub
comp:tool type:bug
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

Currently, the code generation process does not report an error when an imported token (via the `tokenVocab` option) defines a token which matches the name of the parser grammar. This should be reported as an error for either the Java target specifically, or for the tool in general.

Contributor guide

Open the contributing guide

Research direction

Start by tracing Java-target code generation and how imported tokenVocab definitions are validated against the parser grammar name. Reproduce the case with a minimal grammar and imported token definition, then verify that generation reports an error when either a token or rule matches the grammar name.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.