nescc-ncg(1) | General Commands Manual | nescc-ncg(1) |
nescc-ncg - extract constants from nesC files
nescc-ncg [any nescc option] [tool-specific options]
[-o output-file] [-nescc=driver]
tool nesC-file filenames-or-constant-names...
nescc-ncg is a tool to extract constants from nesC files for use with other applications. It is typically used in conjunction with nescc-mig (which generates code to process nesC messages) to extract constants that are used in particular messages (e.g., constants representing various commands).
The tool argument specifies what tool should be generated, the nesC-file specifies a nesC file which uses the constants you want to extract. If your constants are all in a single .h file that does not depend on any other files, then you can specify the .h file directly as the msg-format-file. Note that if some of your constants are defined with unique(...) or uniqueCount(...), you must specify your whole application as the nesC-file, or you will not get the correct constant values.
Each filenames-or-constant-names is either a constant name (if it consists only of letters, numbers and _) or a filename. In the former case, the specified constant will be extracted, in the latter case all constants from the specified C file will be extracted. Only constants declared in C files will be found by nescc-ncg.
The current tools are java, python and C, which generate java, python and C code that contains the values of the requested constants.
You can pass any nescc option, as well as
This tool generates a java class with the values of the requested constants. These constants will be public final static and have a type chosen from byte, short, char, int, long (the chosen type will be the first one in this list that can hold the constants value - this reduces the need for casts).
The java tool accepts the following options:
This tool generates a Python class with the values of the requested constants. These constants will be class (rather than instance) variables.
The Python tool accepts the following options:
This tool generates a C header file with the values of the requested constants (defined as enum constants).
The C tool accepts the following option:
nescc-ncg reports an error if ncc cannot compile nesC-file.
April 27, 2004 |