ruby / lrama

Pure Ruby LALR parser generator
190 stars 26 forks source link

Improve `--report` option #449

Closed ydah closed 2 months ago

ydah commented 2 months ago

This PR will improve the --report option as follows:

Before:

Output:
    -H, --header=[FILE]              also produce a header file named FILE
    -d                               also produce a header file
    -r, --report=THINGS              also produce details on the automaton
        --report-file=FILE           also produce details on the automaton output to a file named FILE
: (snip)
Valid Reports:
    states itemsets lookaheads solved counterexamples all rules terms verbose

After:

Output:
    -H, --header=[FILE]              also produce a header file named FILE
    -d                               also produce a header file
    -r, --report=REPO_THINGS         also produce details on the automaton
        --report-file=FILE           also produce details on the automaton output to a file named FILE
: (snip)
REPO_THINGS 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