Skip to content

Fix typo and clarify input file argument in Interpreter help message#4946

Open
Nokhrin wants to merge 1 commit into
antlr:devfrom
Nokhrin:fix/interpreter-help-typo
Open

Fix typo and clarify input file argument in Interpreter help message#4946
Nokhrin wants to merge 1 commit into
antlr:devfrom
Nokhrin:fix/interpreter-help-typo

Conversation

@Nokhrin

@Nokhrin Nokhrin commented Jun 12, 2026

Copy link
Copy Markdown

Problem

The help message for org.antlr.v4.gui.Interpreter (invoked via antlr4-parse or directly via java -cp) contains a typo in the class name (Intrepreter) and uses the abstract term input-filename(s), which can be confusing for users trying to understand what kind of files the tool expects.

Additionally, the fallback message uses the word "rig", which is ambiguous in this context.

Solution

This PR updates the help message printed to stderr when the tool is invoked with insufficient arguments:

  1. Fixes the typo: IntrepreterInterpreter.
  2. Replaces input-filename(s) with source-code-file(s) to explicitly indicate that the tool expects plain text source code files in the target language.
  3. Updates the stdin fallback message to use the new terminology and replaces "rig" with "the tool".

Before

java org.antlr.v4.gui.Intrepreter [X.g4|XParser.g4 XLexer.g4] startRuleName
  [-tokens] [-tree] [-gui] [-encoding encodingname]
  [-trace] [-profile filename.csv] [input-filename(s)]
Omitting input-filename makes rig read from stdin.

After

java org.antlr.v4.gui.Interpreter [X.g4|XParser.g4 XLexer.g4] startRuleName
  [-tokens] [-tree] [-gui] [-encoding encodingname]
  [-trace] [-profile filename.csv] [source-code-file(s)]
Omitting source-code-file makes the tool read from stdin.

Verification

Run the interpreter with insufficient arguments to trigger the help message:

java -cp ~/projects/antlr4/tool/target/antlr4-4.13.3-SNAPSHOT-complete.jar org.antlr.v4.gui.Interpreter
# or
antlr4-parse

The output should match the "After" block above.

- Fix typo in class name: 'Intrepreter' -> 'Interpreter'
- Replace abstract 'input-filename(s)' with 'source-code-file(s)' to
  clarify that the tool expects plain text source code files, not
  compiled binaries.
- Update the stdin fallback message to use the new terminology and
  replace the ambiguous word 'rig' with 'the tool'.

Signed-off-by: Aleksandr Nokhrin <a.v.nokhrin@yandex.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant