antlr / antlr/antlr4

.interp file is generated even if gencode is 'false'

Open
#2,197 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/antlr/antlr4/blob/4cca8cd68d57f0bfd68800c6527b2e7cecd0928b/tool/src/org/antlr/v4/Tool.java#L400

Should it check gencode first?

I'm having an issue with custom intellij-v4 plugin where I tried to use ANTLR 4.7.1. It is generating .interp files in source directory when I click in grammar file. This happens because Intellij plugin is creating antlr Tool and then calls process() with gencode = false to parse the grammar file. Tool is created with no arguments, so the output directory is empty. Probably assuming that no files will be created if gencode is false.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read tool/src/org/antlr/v4/Tool.java around line 400 and follow process() when gencode is false. Reproduce the no-argument Tool case described for the IntelliJ plugin, then confirm that parsing with code generation disabled leaves no .interp file in the source directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.