CLI reference
The main commands are:
| Command | Purpose |
|---|---|
flexr check SPEC | Parse and diagnose a specification |
flexr diff LEFT RIGHT | Find the shortest change to first rule selection in each lexical state |
flexr generate SPEC -o OUTPUT | Write generated Ruby |
flexr trace SPEC INPUT | Show automaton state, acceptance, and transitions |
flexr new NAME --parser PARSER | Create a calculator project for Racc or Lrama |
flexr --help | Print command and option help |
Use check in CI and treat warnings according to the compatibility policy of your project. trace describes DFA behavior; it is not an input-string logging command.
bundle exec flexr check examples/calculator/lexer.flexr.rbbundle exec flexr generate examples/calculator/lexer.flexr.rb -o tmp/calculator_lexer.rbFor complete options, output formats, and exit status behavior, see the repository’s CLI reference.
Follow the calculator parser tutorial to build a new project.