DYPGEN(1)

NAME
dypgen - The Objective Caml parser generator

SYNOPSIS
dypgen [ options ] filename.dyp

SYNOPSIS
dypgen.opt [ options ] filename.dyp

SYNOPSIS
dyp2gram filename.dyp

DESCRIPTION
The dypgen(1) command produces a parser from a context-free grammar specification with attached semantic actions, in the style of yacc(1). Assuming the input file is grammar.dyp, running dypgen produces Caml code for a parser in the file grammar.ml, and its interface in file grammar.mli. The generated module defines one parsing function per entry point in the grammar. These functions have the same names as the entry points. The lexer (lexical analyzer) can be generated by dypgen or by a third party generator such as ocamllex(1) If an external lexer generator is used, then parsing functions take as arguments a lexical analyzer (a function from lexer buffers to tokens) and a lexer buffer. If dypgen is used to generate the lexer then parsing functions only take a lexer buffer as argument. They return the semantic attribute of the corresponding entry point. Lexer buffers are an abstract data type implemented in the library module Dyp. Tokens are values from the concrete type token, defined in the interface file grammar.mli produced by dypgen(1). dypgen.opt(1) is the same as .BR dypgen (1) but compiled to native code instead of bytecode. dyp2gram(1) is is a pearl script producing a readable text documentation of your grammar from a grammar.dyp file.

OPTIONS
The dypgen(1) command recognizes the following options:

--merge-warning prefix
     activates merge warning: the generated parser will emit a warning on the standard output each time a merge happens

--pv-obj
    the type constructor obj is made as a sum of polymorphic variants instead of a sum of constructors. This is useful when the maximum number of constructors allowed is reached.

--pv-token
    the type token is made as a sum of polymorphic variants instead of a sum of constructors. This is useful when the maximum number of constructors allowed is reached.

--noemit-token-type
    the type token is not emitted in the mli or ml files, it must be provided by the user instead.

--no-pp
    the value pp is not stated in the mli file.

--no-obj-type
    the type obj_type is not stated in the mli file.

--no-undef-nt
    prevents the exception Undefined_nt from being raised.

--ocamlc options
    dypgen uses these options when calling ocamlc -i.

--command command
    dypgen uses this command instead of calling ocamlc -i.

--no-mli
    dypgen does not generate the .mli file.

--use-rule-order
    dypgen uses rule order to decide which rule to reduce in case of reduce/reduce conflict, it is overriden by the variable dypgen_use_rule_order.

--use-all-actions
    the parser will execute all the user actions bound to a rule instead of just the first that does not raise Giveup.

--cpp dypgen
    calls the C preprocessor cpp on the input file before processing it.

--cpp-options options
    dypgen calls the C preprocessor cpp with options "options" on the input file before processing it.

--version
    gives the version of dypgen and exit.

-help
    Display this list of options

--help
    Display this list of options

SEE ALSO
ocamllex(1).
dypgen User's Manual