man kc++ (Commandes) - generate C++ code from Kimwitu++ input
NAME
Kimwitu++ - generate C++ code from Kimwitu++ input
SYNOPSIS
kc++_s1 [options] file...
DESCRIPTION
kc++ reads the abstract syntax definition, function definitions, rewrite rules and unparse rules from the files given on the command line, or from the standard input if no file arguments were given. It generates for each file.k input file a pair of file.cc and file.h files that contain the translation of the functions defined in the corresponding file.k.
Additionally the following files are generated: csgiok.{h,cc}, rk.{h,cc} and unpk.{h,cc}, that contain the CSGIO-, the rewrite- and the unparse-functions, respectively, and the k.cc and k.h files that contain the grammar tables and the remaining `default' functions as well as the declaration of the classes for each phylum in the definition of the abstract syntax.
If no command line file arguments are given, the translation of the user-defined functions will be generated in stdin.{h,cc} files.
kc++ does not unnecessarily overwrite a file: if a file would be overwritten with its own (identical) contents, it will not be touched. This makes it easy to write an efficient Makefile.
OPTIONS
GENERAL OPTIONS
- -h, --help
- give a short help message.
- --version
- print the version number of kc++ and exit.
- -q, --quiet
- be quite quiet about warnings etc., give only return status (not implemented).
- -v, --verbose
- print additional status information while processing.
- -p CMD
- filter every input file through CMD. The programm will be called as CMD file.k and must deliver its output to standard output.
OPTIONS FOR FILE GENERATION
- -s, --suffix=EXT
- extension for generated source files (default cc).
- -f, --file-prefix=PREF
- prefix for generated files.
- -c, --no-csgio
- no read/write functions (csgio.{h,cc}) are generated.
- -r, --no-rewrite
- no code for rewrite rules (rk.{h,cc}) is generated.
- -u, --no-unparse
- no code for unparse rules (unpk.{h,cc}) is generated.
- -d, --no-printdot
- no printdot functions for printing dot-files (input for the graphviz package) are generated.
- -t, --no-hashtables
- no code for hastables is generated (works only when both --no-csgio and --no-printdot are specified)
- -b, --yystype[=FILE]
- generates file (default yystype.h) containg YYSTYPE for yacc(1) or bison(1).
- -y, --yxx-union
- generates file yxx_union.h for yacc++.
- -o, --overwrite
- always write generated files even if not changed.
OPTIONS INFLUENCING THE CODE
- -m, --smart-pointer
- generates code for smart pointers (does reference counting).
- -w, --weak-pointer
- generates code for weak pointers (implies --smart-pointer).
- -n, --covariant=C
- use covariant return types; options are yes (use them), no (don't use them, requires explicit casting), or pre (use preprocessor symbol NO_COVARIANT_RETURN to guard the definitions).
- -l, --no-linedirec
- does not emit line directives (`#line'). This is sometimes handy when you need to debug your program.
GENERATED FILES
- k.{h,cc}
- the grammar and default functions
- rk.{h,cc}
- the rewrite view declarations and rewrite functions
- csgiok.{h,cc}
- the CSGIO functions
- unpk.{h,cc}
- the unparse view declarations and unparsing functions
- file.{h,cc}
- translation of user-provided Kimwitu++ functions.
- stdin.{h,cc}
- translation of user-provided Kimwitu++ functions if no command line file arguments were given.
- yystype.h
- (or any other name you specify) the YYSTYPE union.
- yxx_union.h
- the (anonymous?) union (for yacc++, apparently).
DIAGNOSTICS
If an error is encountered in the Kimwitu++ input, an appropriate error message will be written on standard error, code generation will be suppressed and a non-zero exit value will be returned. The error messages should be self-explanatory.
BUGS
The error messages are not always very self-explanatory. Sometimes
kc++ gets confused by parse errors.
The option -p is a hack. Not much checking is done, no fault recovery.
Don't interrupt kc++ when piping, you will regret it.
AUTHOR
- Kimwitu was written by
- Axel Belinfante, University of Twente, the Netherlands.
- Kimwitu++ was written by
- Michael Piefel, Humboldt-Universität zu Berlin, Germany.
REPORTING BUGS
Report bugs to <piefel@informatik.hu-berlin.de>; we'd also like to hear from you when you successfully use Kimwitu++ for your projects.
COPYRIGHT
Copyright © 2001 Michael Piefel, Humboldt-University Berlin
Kimwitu++ comes with no warranty; for details see GPL.
This is free software, and you are welcome to redistribute it under
certain conditions; for details see GPL.