antlr / antlr/antlr4

Antlr 4.7 doesn't honor the -o <out_dir> option when generating Python3 parser code.

Open
#2,180 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

I have the following directory structure

grammar/ -- contains language.g4
lib/python/ -- location where the generated .py files are expected.

when executing antlr4 from within lib/python like so:

antlr4 -Dlanguage=Python3 -visitor -listener -o . ../../grammar/language.g4

the files get generated in the grammar directory.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown antlr4 command, using grammar/language.g4 and the lib/python output location. Start by tracing the command-line handling of -o for the Python3 target. Done means the generated .py files are written under lib/python rather than grammar/.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, python
Domain
cli, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.