Naming Rules
C3 introduces fairly rigid naming rules to reduce ambiguity and make the language easy to parse for tools.
As a basic rule, all identifiers are limited to a-z, A-Z, 0-9 and _
. The initial character can not be a number. Furthermore, all identifiers are limited to 31 character.
Structs, unions, enums and faults
All user defined types must start with A-Z after any optional initial _
and include at least 1 lower case letter. Bar
, _T_i12
and TTi
are all valid names. _1
, bAR
and BAR
are not. For C-compatibility it’s possible to alias the type to a external name using the attribute “extern”.
Variables and parameters
All variables and parameters except for global constant variables must start with a-z after any optional initial _
. ___a
fooBar
and _test_
are all valid variable / parameter names. _
, _Bar
, X
are not.
Global constants
Global constants must start with A-Z after any optional initial _
. _FOO2
, BAR_FOO
, X
are all valid global constants, _
, _bar
, x
are not.
Enum / Fault values
Enum and fault values follow the same naming standard as global constants.
Struct / union members
Struct and union members follow the same naming rules as variables.
Modules
Module names may contain a-z, 0-9 and _
, no upper case characters are allowed.
Functions and macros
Functions and macros must start with a-z after any optional initial _
.