Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust the output of the trace help command #456

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

ydah
Copy link
Collaborator

@ydah ydah commented Jul 1, 2024

This PR adjusts the output of the trace help command.

Before

❯ exe/lrama -h
Lrama is LALR (1) parser generator written by Ruby.

Usage: lrama [options] FILE

STDIN mode:
lrama [options] - FILE               read grammar from STDIN

Tuning the Parser:
    -S, --skeleton=FILE              specify the skeleton to use
    -t                               reserved, do nothing
        --debug                      display debugging outputs of internal parser

Output:
    -H, --header=[FILE]              also produce a header file named FILE
    -d                               also produce a header file
    -r, --report=REPORTS             also produce details on the automaton
        --report-file=FILE           also produce details on the automaton output to a file named FILE
    -o, --output=FILE                leave output to FILE
        --trace=THINGS               also output trace logs at runtime
    -v                               reserved, do nothing

Diagnostics:
    -W, --warnings                   report the warnings

Error Recovery:
    -e                               enable error recovery

Other options:
    -V, --version                    output version information and exit
    -h, --help                       display this help and exit

REPORTS is a list of comma-separated words that can include:
    states                           describe the states
    itemsets                         complete the core item sets with their closure
    lookaheads                       explicitly associate lookahead tokens to items
    solved                           describe shift/reduce conflicts solving
    counterexamples, cex             generate conflict counterexamples
    rules                            list unused rules
    terms                            list unused terminals
    verbose                          report detailed internal state and analysis results
    all                              include all the above reports
    none                             disable all reports

Valid Traces:
    none locations scan parse automaton bitsets closure grammar rules actions resource sets muscles tools m4-early m4 skeleton time ielr cex all

After

❯ exe/lrama -h
Lrama is LALR (1) parser generator written by Ruby.

Usage: lrama [options] FILE

STDIN mode:
lrama [options] - FILE               read grammar from STDIN

Tuning the Parser:
    -S, --skeleton=FILE              specify the skeleton to use
    -t                               reserved, do nothing
        --debug                      display debugging outputs of internal parser

Output:
    -H, --header=[FILE]              also produce a header file named FILE
    -d                               also produce a header file
    -r, --report=REPORTS             also produce details on the automaton
        --report-file=FILE           also produce details on the automaton output to a file named FILE
    -o, --output=FILE                leave output to FILE
        --trace=TRACES               also output trace logs at runtime
    -v                               reserved, do nothing

Diagnostics:
    -W, --warnings                   report the warnings

Error Recovery:
    -e                               enable error recovery

Other options:
    -V, --version                    output version information and exit
    -h, --help                       display this help and exit

REPORTS is a list of comma-separated words that can include:
    states                           describe the states
    itemsets                         complete the core item sets with their closure
    lookaheads                       explicitly associate lookahead tokens to items
    solved                           describe shift/reduce conflicts solving
    counterexamples, cex             generate conflict counterexamples
    rules                            list unused rules
    terms                            list unused terminals
    verbose                          report detailed internal state and analysis results
    all                              include all the above reports
    none                             disable all reports

TRACES is a list of comma-separated words that can include:
    automaton                        display states
    closure                          display states
    rules                            display grammar rules
    actions                          display grammar rules with actions
    time                             display generation time
    all                              include all the above traces
    none                             disable all traces

@ydah ydah merged commit fd28ccc into ruby:master Jul 2, 2024
16 checks passed
@ydah ydah deleted the adjust-trace-command branch July 2, 2024 05:53
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.

2 participants