make_dparser ‐ D Parser Generator
make_dparser is a scannerless GLR parser generator based on the Tomita
algorithm. It is self-hosted and very easy to use. Grammars are written in a
natural style of EBNF and regular expressions and support both speculative and
- Toggle longest match lexical ambiguity resolution. When ON the scanner
only recognizing the longest matching tokens in a given state. This
provides an easy way to build grammars for languages which use longest
match lexical ambiguity resolution (e.g. ANSI-C, C++). (OFF by
- Toggle building of a tokenizer for START. When ON, instead of generating a
unique scanner for each state (i.e. a 'scannerless' parser), generate a
single scanner (tokenizer) for the entire grammar. This provides an easy
way to build grammars for languages which assume a tokenizer (e.g. ANSI
C). (OFF by default)
- -H -1/0/1
- Write header, 0 : no, 1 : yes, -1 : only if not empty.
- -t 0/1
- Token type, 0 : #define, 1 : enum.
- Toggle computing whitespace states. If 'whitespace' is defined in the
grammar, then use it as a subparser to consume whitespace. (ON by
- Toggle computing states for all non-terminals. Ensures that there is a
unique state for each non-terminal so that a subparsers can be invoked for
that non-terminal. (OFF by default)
- -i tag
- Tag for grammar data structures so that multiple sets of tables can be
included in one file/application. (defaults to 'gram')
- -b blocks
- Number of blocks to which scanner tables are broken up into. Larger
numbers permit more sharing with more overhead. 4 seems to be optimal for
most grammars. (defaults to 4) files.
- Toggle setting of operator priority from rules. Setting of operator
priorities on operator tokens can increase the size of the tables but can
permit unnecessary parse stacks to be pruned earlier. (OFF by
- Toggle use of right recursion for EBNF productions. Do not change this
unless you really know what you are doing. (OFF by default)
- Toggle writing of line numbers. Used to debug the parsing table generator
itself. (ON by default)
- Set the extension of the generated code file. For C++ programs (for
example) the extension can be set to .cpp with the option
"-Xcpp". ("-Xc" by default)
- Increase verbosity.
- Replace all actions in the grammar with actions printing productions, 1 :
during the speculative parsing process (<-), 2 : when reduction is part
of any legal final parse (<=), 3 : both, 4 : remove all actions from
the grammar. Print the changed grammar to stdout. Useful for debugging or
prototyping new, experimental grammars.
- Increase debugging.
- Display help.
All the options are available through environment variables with the names:
D_MAKE_PARSER_HEADER, D_MAKE_PARSER_TOKEN, D_MAKE_PARSER_GRAMMAR_IDENT,
The features are covered in the documentation. See the README file.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the COPYRIGHT for more details.
D Parser Home Page: http://dparser.sourceforge.net/
The BSD General Public License.
John Plevyak. Use <jplevyak at users.sourceforge.net> to contact.