All traditional C++ and Java literals are supported by Flavor with the exception of strings. This includes integers, floating-point numbers, and character constants (e.g., a). In addition, Flavor defines a special binary number notation using the prefix 0b. In addition to specifying the actual value, binary literals also convey their length. For example, one can write 0b011 to denote the number 3 represented using 3 bits. For readability, a bitstring can include periods every four digits, e.g., 0b0010.01. Hexadecimal or octal constants used in a context of a bitstring also convey their length in addition to their value. Whenever the length of a bitstring literal is irrelevant, it is treated as a regular integer literal.
Both multi-line (/**/) and single-line (//) comments are allowed. Multi-line comment delimiters cannot be nested.
Variable names follow the C++ and Java conventions (i.e., variable names must start with a letter or an underscore). Several keywords that are used in C++ and Java are considered reserved in Flavor.
Flavor supports the common subset of C++ and Java built-in or fundamental types. This
includes char, int, float, and double
including all appropriate modifiers (short, long, signed,
unsigned). In addition, Flavor defines a new type called bit. This is to
accommodate bitstring variables. In addition, it allows the declaration of new types in
the form of classes (see Classes).
Flavor does not support pointers, references, casts, or C++ operators related to pointers. It also does not support structures or enumerations.