diff options
| author | Jack Palevich <jackpal@google.com> | 2009-08-03 14:42:57 -0700 |
|---|---|---|
| committer | Jack Palevich <jackpal@google.com> | 2009-08-03 14:42:57 -0700 |
| commit | c9b8ffc3897952deef9e23949ce42fdc09f14a24 (patch) | |
| tree | 70da23dead593f87a31390df47b8ddbee8d39ebd /libacc/FEATURES | |
| parent | 029c7f81a9a445b57a9f6b791a32eebc7b581e2a (diff) | |
| download | system_core-c9b8ffc3897952deef9e23949ce42fdc09f14a24.tar.gz system_core-c9b8ffc3897952deef9e23949ce42fdc09f14a24.tar.bz2 system_core-c9b8ffc3897952deef9e23949ce42fdc09f14a24.zip | |
Add support for "short" data type.
Diffstat (limited to 'libacc/FEATURES')
| -rw-r--r-- | libacc/FEATURES | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/libacc/FEATURES b/libacc/FEATURES index 1a444150..97a876d9 100644 --- a/libacc/FEATURES +++ b/libacc/FEATURES @@ -1,6 +1,5 @@ -Supported C language subset (read joint example 'otccex.c' to have - an introduction to OTCC dialect): +Supported C language subset: - Expressions: @@ -13,35 +12,51 @@ Supported C language subset (read joint example 'otccex.c' to have * Parenthesis are supported. + * Comma operator is supported. + + * Trinary operator (?:) is not supported. + * Unary operators: '&', '*' (pointer indirection), '-' - (negation), '+', '!', '~', post fixed '++' and '--'. + (negation), '+', '!', '~', '++' and '--'. + + * Pointer indirection ('*') is supported. - * Pointer indirection ('*') only works with explicit cast to - 'char *', 'int *' or 'int (*)()' (function pointer). + * Square brackets can be used for pointer arithmetic. - * '++', '--', and unary '&' can only be used with variable - lvalue (left value). + * '=' and <op>= are supported. - * '=' can only be used with variable or '*' (pointer - indirection) lvalue. + * Function calls are supported with standard Linux calling + convention. Function pointers are supported. + Functions can be used before being declared. - * Function calls are supported with standard i386 calling - convention. Function pointers are supported with explicit - cast. Functions can be used before being declared. + - sizeof() is not supported. - - Types: only signed integer ('int') variables and functions can - be declared. Variables cannot be initialized in - declarations. Only old K&R function declarations are parsed - (implicit integer return value and no types on arguments). + - Types: + + int, short, char, float, double + + pointers + + variables can be initialized in declarations. + + Only ANSI-style function declarations are supported. + - "..." is not supported. + - short is not supported + - const is not supported + - arrays are not supported + - long doubles are not supported + - structs are not supported - - Any function or variable from the libc can be used because OTCC - uses the libc dynamic linker to resolve undefined symbols. + - Unknown functions and variables are bound at compile time by calling + back to the caller. For the 'acc' command-line tool unknown functions + and variables are looked up using dlsym, to allow using many libc + functions and variables. - Instructions: blocks ('{' '}') are supported as in C. 'if' and 'else' can be used for tests. The 'while' and 'for' C constructs are supported for loops. 'break' can be used to exit loops. 'return' is used for the return value of a function. + - switch / case is not supported. + - goto and labels are not supported. + - continue is not supported. + - Identifiers are parsed the same way as C. Local variables are handled, but there is no local name space (not a problem if different names are used for local and global variables). @@ -49,16 +64,19 @@ Supported C language subset (read joint example 'otccex.c' to have - Numbers can be entered in decimal, hexadecimal ('0x' or '0X' prefix), or octal ('0' prefix). + - Float and double constants are supported. + - '#define' is supported without function like arguments. No macro recursion is tolerated. Other preprocessor directives are ignored. - - C Strings and C character constants are supported. Only '\n', - '\"', '\'' and '\\' escapes are recognized. + - C Strings and C character constants are supported. All ANSI C + character escapes are supported. - - Both C comments ( /* */ ) and C++ comments ( // ... end-of-line ) can be used. + - Both C comments ( /* */ ) and C++ comments ( // ... end-of-line ) are + supported. - - No error is displayed if an incorrect program is given. + - Some syntax errors are reported, others may cause a crash. - Memory: the code, data, and symbol sizes are limited to 100KB (it can be changed in the source code). |
