Skip to content

Improve documentation of the Agda backend on the command line #520

@MatthewDaggitt

Description

@MatthewDaggitt

Current running bnfc --help gives the output below, but it doesn't any reference to the Agda backend. Experimentally at least the -p option seems to work for Agda.

Target languages
    --java          Output Java code [default: for use with JLex and CUP]
    --haskell       Output Haskell code for use with Alex and Happy (default)
    --haskell-gadt  Output Haskell code which uses GADTs
    --latex         Output LaTeX code to generate a PDF description of the language
    --c             Output C code for use with FLex and Bison
    --cpp           Output C++ code for use with FLex and Bison
    --cpp-nostl     Output C++ code (without STL) for use with FLex and Bison
    --csharp        Output C# code for use with GPLEX and GPPG
    --ocaml         Output OCaml code for use with ocamllex and ocamlyacc
    --profile       Output Haskell code for rules with permutation profiles
    --pygments      Output a Python lexer for Pygments

Special options for the Haskell backend
  -p <namespace>                  Prepend <namespace> to the package/module name
  -d                              Put Haskell code in modules Lang.* instead of Lang*
                  --alex1         Use Alex 1.1 as Haskell lexer tool
                  --alex2         Use Alex 2 as Haskell lexer tool
                  --alex3         Use Alex 3 as Haskell lexer tool (default)
                  --sharestrings  Use string sharing in Alex 2 lexer
                  --bytestrings   Use byte string in Alex 2 lexer
                  --glr           Output Happy GLR parser
                  --ghc           Use ghc-specific language extensions
                  --functor       Make the AST a functor and use it to store the position of the nodes
                  --xml           Also generate a DTD and an XML printer
                  --xmlt          DTD and an XML printer, another encoding
                  --cnf           Use the CNF parser instead of happy
                  --agda          Also generate Agda bindings for the abstract syntax

Special options for the Java backend
  -l                        Add and set line_number field for all syntax classes
                            Java requires cup 0.11b-2014-06-11 or greater
  -p <namespace>            Prepend <namespace> to the package/module name
                  --jlex    Lex with JLex, parse with CUP (default)
                  --jflex   Lex with JFlex, parse with CUP
                  --antlr4  Lex and parse with antlr4

Special options for the C backend
  -l    Add and set line_number field for all syntax classes
        Java requires cup 0.11b-2014-06-11 or greater

Special options for the C++ backend
  -l                Add and set line_number field for all syntax classes
                    Java requires cup 0.11b-2014-06-11 or greater
  -p <namespace>    Prepend <namespace> to the package/module name

Special options for the C# backend
  -p <namespace>         Prepend <namespace> to the package/module name
                  --vs   Generate Visual Studio solution/project files
                  --wcf  Add support for Windows Communication Foundation,
                          by marking abstract syntax classes as DataContracts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions