cmm 0.26, 27 August 2003. Main parameters: -s Input cmm file should be preprocessed. Requires that the dispatch.cpp file (included in the cmm distribution) is linked into the final executable. Other parameters: -! Run using system(). -autoblocks Insert `{' and `}' to match indentation. -block Inserts at start of all blocks -caller-dispatch enable caller dispatch (not implemented yet -checkindent Checks indentation of lines containing '{' and '}'. -detailedparse Parse class/function bodies. -embeddedfns Support embedded functions, and convert to legal C++. -errorlevel xyz Sets how verbose error messages are after a parse failure x, y and z are each `0' or `1': x: showstartpos y: show all positions z: show failed terminals Default is 001 -exceptions-exit Converts try..catch to exit(1). -exceptions-fudge Converts try..throw.. catch, to use Throw(), catch_t() and Catch2() functions -h|-help|--h|--help Show this help. -k Wait for keypress before exiting. -lexer-verbose Verbose lexer output -newdeclsyntax Support new declaration syntax, such as: foo: ( argv: []->char) int; -no-exceptions Generated code never throws exceptions. Calls exit(1) instead. -no-hash-line Ommit #line directives in generated source. -parse Parses , outputs parse- -tree if verbose. -parsefile Parses , outputs parse- -tree if verbose. -pre Inserts at start of output -profile
Generates profiling code. (Not for general useage) -profil Generates profiling stats using profil(1) -shownumnodes Prints out nuber of parser nodes created so far - e.g. you will probably want to put this flag after -s . -small-ints Add virtual function to every polymorphic class, which returns a unique int for that class -v|verbose Verbose. -no-c++ lexer_t ignores C++ keywords -serialise Generate serialisation code (experimental) Special names Declaring the following names in cmm code gives control of cmm parser's as it parses the code: cmm_pragma_autoblocks_on cmm_pragma_autoblocks_off cmm_pragma_detailedparse_on cmm_pragma_detailedparse_off cmm_pragma_newdeclsyntax_on cmm_pragma_newdeclsyntax_off cmm_pragma_embeddedfns_on cmm_pragma_embeddedfns_off cmm_pragma_lexer_verbose_on cmm_pragma_lexer_verbose_off E.g. int cmm_pragma_embeddedfns_on() Old usage: -c Reads in cmm source, and translates into c++ source. Also generates a cmminfo file for use by `cmm -l'. This contain information about all multimethod implementations that were found in , and also the filename . if_t is empty (i.e. ""), no cmminfo file is generated. -l {} Reads in cmminfo file(s) created previously by `cmm -c ...' command(s). Appends C++ source code to some of the c++ files generated by these command(s). Dispatch code customisation: In the following,
means a complete #include line. For example, to make the dispatch code use a custom replacement for std::map, called MyMap, defined in the header file "MyMap.h", do: cmm -map "#include \"MyMap.h\"" MyMap -l ... -array
Override use of and std::vector in code generated by cmm -l. Replacement should match template< class T, int N>, where N is fixed size. -map
Override use of and std::map in code generated by cmm -l. For more information, see: http://www.op59.net/cmm/