Command Line Options

This page describes the options for the command line tool himecc.

Options

Option Description
-h, --help Display a help screen with the description of the options.
-o:assembly Compile the generated parser code in an assembly. In addition to the sources for the lexer and parser, the tool will compile them and create an assembly in the form of a .dll.
-o:nosources Only generate the assembly, do not keep the sources. This option implicitely implies the previous one. The tool will only produce an assembly an not the sources.
-g Select the top grammar to compile if more than one are given. It is possible to define multiple grammar in the same file, or to give multiple files to the tool. This option is to be followed by the name of the grammar that will act as the top one to be compiled.
-p Set the path for the outputs, default is the current directory. See below for examples.
-m:rnglr Use the RNGLR parsing algorithm, default is LALR. This option is used to generate a parser that will use the RNGLR algorithm (generalized parsing). If the option is not set, the tool generate a LALR parser instead.
-n Namespace for the generated code, default is the grammar's name.
-a:public Public modifier for the generated code, default is internal. By default the generated code is applied the internal access modifier. Use this option to force the use of the public access modifier. This is useful when directly generating a compiled assembly.
-l Output the log as a MHTML file.
-d Output the documentation for the compiled grammar.

Examples

With no option set, the tool compile the first grammar it found in the given input,
  • it will only generate the source code (and binary resources) of the lexer and parser
  • it will output the files in the current directory with the name of the grammar as a prefix
  • it will generate a LALR parser
  • the namespace for the generated code will be the name of the grammar
  • the access modifier for the generated code will be internal
  • the compilation log will not be saved (but displayed on the console)
  • the grammar's documentation will not be generated

To output only an assembly:
himecc MyGram.gram -o:nosources

To output both the sources and the compiled assembly:
himecc MyGram.gram -o:assembly

It is possible to give multiple file to the tool, in which cas the top grammar to compile should be selected:
himecc MyGram1.gram MyGram2.gram -g MyGram2

To prefix the outputs:
himecc MyGram.gram -p XXX

And put them in the YYY directory:
himecc MyGram.gram -p YYY\XXX

If the path contains spaces:
himecc MyGram.gram -p "a hole\gen_"

To select the RNGLR algorithm:
himecc MyGram.gram -m:rnglr

To specify a namespace for the generated code:
himecc MyGram.gram -n MyApp.Generated

To switch the generated code access modifiers to public in an assembly:
himecc MyGram.gram -a:public -o:nosources

Last edited May 14, 2013 at 2:00 PM by lwouters, version 1

Comments

No comments yet.