This is an implementation of the C99 programming language as a base language for MPS.
You can use this language if you want to generate C code with the MPS language workbench.
The ISO/IEC 9899:1999 standard is implemented in large parts. There are some discrepancies, though, which we introduced in order to keep the MPS model simple. In the following, if a feature is "not supported" this means that you can not generate C code which uses this feature. In general, all features which are not supported are not
Trigraph sequences are not supported.
Universal character names in identifiers are not supported.
For simplicity, the zero constant is a concept on it's own. The standard defines, that 0 is an octal constant, though.
The hexadecimal prefix 0X
is not supported (but 0x
is).
The exponent prefix E
is not supported (but e
is).
The hexadecimal prefix 0X
is not supported (but 0x
is).
Concatenation of string literal tokens is not supported.
Digraphs are not supported.
In C99 comments are no language tokens and thus not part of the language grammar. For a meta-model driven sytem like MPS this is a problem. In order to support at least some comments we did the following:
- Block comments are not supported
- Line comments can be placed on file scope between external declarations
- Line comments can be placed within compount statements between other statements
- All other line comments are not supported
A trailing comma at the end of an enumerator list is not supported.
A trailing comma at the end of an initializer list is not supported.
The static
keyword after a qualifier list inside the square brackets of an array declaration is not supported (it's only supported before a qualifier list).
Function declarators with empty parantheses (not prototype-format parameter type declarators) are not supported. (See 6.11.6)
Function definitions with separate parameter identifier and declaration lists (not prototype-format parameter type and identifier declarators) are not supported. (See 6.11.7)
Most implementation defined properties play no role in this implementation, because there is no compile and no execution time. Instead, theses properties are finally inherited from the tool chain which is used to process the generated files. Some properties, though, are already restricted by this implementation.
The source character set of this implementation contains all valid characters of the Java programming language, given MPS supports the creation of the character. Note, that the usage of characters which are not in the basic character set of the C99 language only makes sense if this character is in the extended character set of the underlying C99 toolchain.