1nescc-ncg(1) General Commands Manual nescc-ncg(1)
2
3
4
6 nescc-ncg - extract constants from nesC files
7
9 nescc-ncg [any nescc option] [tool-specific options]
10 [-o output-file] [-nescc=driver]
11 tool nesC-file filenames-or-constant-names...
12
14 nescc-ncg is a tool to extract constants from nesC files for use with
15 other applications. It is typically used in conjunction with nescc-mig
16 (which generates code to process nesC messages) to extract constants
17 that are used in particular messages (e.g., constants representing var‐
18 ious commands).
19
20 The tool argument specifies what tool should be generated, the nesC-
21 file specifies a nesC file which uses the constants you want to
22 extract. If your constants are all in a single .h file that does not
23 depend on any other files, then you can specify the .h file directly as
24 the msg-format-file. Note that if some of your constants are defined
25 with unique(...) or uniqueCount(...), you must specify your whole
26 application as the nesC-file, or you will not get the correct constant
27 values.
28
29 Each filenames-or-constant-names is either a constant name (if it con‐
30 sists only of letters, numbers and _) or a filename. In the former
31 case, the specified constant will be extracted, in the latter case all
32 constants from the specified C file will be extracted. Only constants
33 declared in C files will be found by nescc-ncg.
34
35 The current tools are java, python and C, which generate java, python
36 and C code that contains the values of the requested constants.
37
39 You can pass any nescc option, as well as
40
41 -o output-file
42 Specify the file in which to output the generated code.
43
44 -nescc=driver
45 Use driver instead of nescc to extract constants. For example,
46 if you specify -nescc=ncc, you can use nescc-ncg to extract con‐
47 stants from TinyOS applications (which are normally compiled
48 with ncc).
49
50 tool-specific options
51 See below.
52
54 This tool generates a java class with the values of the requested con‐
55 stants. These constants will be public final static and have a type
56 chosen from byte, short, char, int, long (the chosen type will be the
57 first one in this list that can hold the constants value - this reduces
58 the need for casts).
59
60 The java tool accepts the following options:
61
62 -java-classname=full-class-name
63 This option is required and specifies the package and name of
64 the generated class. If the full-class-name has no '.', then no
65 package directive is included in the output.
66
67 -java-extends=class-name
68 Specify the class the generated class will extend. The default
69 is Object.
70
72 This tool generates a Python class with the values of the requested
73 constants. These constants will be class (rather than instance) vari‐
74 ables.
75
76 The Python tool accepts the following options:
77
78 -python-classname=full-class-name
79 This option is required and specifies the name of the generated
80 class.
81
82 -python-extends=class-name
83 Specify the class the generated class will extend. The default
84 is is to not inherit.
85
87 This tool generates a C header file with the values of the requested
88 constants (defined as enum constants).
89
90 The C tool accepts the following option:
91
92 -c-prefix=prefix
93 This option specifies a prefix to attach to the generated con‐
94 stants.
95
97 nescc-ncg reports an error if ncc cannot compile nesC-file.
98
100 nescc(1), nescc-mig(1)
101
102
103
104 April 27, 2004 nescc-ncg(1)