| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 1 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 2 | Supported C language subset: | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 3 |  | 
|  | 4 | - Expressions: | 
|  | 5 |  | 
|  | 6 | * binary operators, by decreasing priority order: '*' '/' '%', | 
|  | 7 | '+' '-', '>>' '<<', '<' '<=' '>' '>=', '==' '!=', '&', | 
|  | 8 | '^', '|', '=', '&&', '||'. | 
|  | 9 |  | 
|  | 10 | * '&&' and '||' have the same semantics as C : left to right | 
|  | 11 | evaluation and early exit. | 
|  | 12 |  | 
|  | 13 | * Parenthesis are supported. | 
|  | 14 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 15 | * Comma operator is supported. | 
|  | 16 |  | 
|  | 17 | * Trinary operator (?:) is not supported. | 
|  | 18 |  | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 19 | * Unary operators: '&', '*' (pointer indirection), '-' | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 20 | (negation), '+', '!', '~', '++' and '--'. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 21 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 22 | * Pointer indirection ('*') is supported. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 23 |  | 
| Jack Palevich | 22f5c6b | 2009-10-27 17:34:45 -0700 | [diff] [blame] | 24 | * Square brackets are supported. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 25 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 26 | * '=' and <op>= are supported. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 27 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 28 | * Function calls are supported with standard Linux calling | 
|  | 29 | convention. Function pointers are supported. | 
|  | 30 | Functions can be used before being declared. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 31 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 32 | - sizeof() is not supported. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 33 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 34 | - Types: | 
|  | 35 | + int, short, char, float, double | 
|  | 36 | + pointers | 
|  | 37 | + variables can be initialized in declarations. | 
|  | 38 | + Only ANSI-style function declarations are supported. | 
|  | 39 | - "..." is not supported. | 
| Jack Palevich | 22f5c6b | 2009-10-27 17:34:45 -0700 | [diff] [blame] | 40 | - short is supported | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 41 | - const is not supported | 
| Jack Palevich | 22f5c6b | 2009-10-27 17:34:45 -0700 | [diff] [blame] | 42 | - signed and unsigned are not supported. | 
|  | 43 | - arrays are supported | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 44 | - long doubles are not supported | 
| Jack Palevich | 22f5c6b | 2009-10-27 17:34:45 -0700 | [diff] [blame] | 45 | - structs and unions are supported | 
| Jack Palevich | ee1f829 | 2009-10-28 16:10:17 -0700 | [diff] [blame] | 46 | - typedef is supported | 
|  | 47 | - explicit storage class specifiers are not supported: register, auto, static, extern | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 48 |  | 
|  | 49 | - Unknown functions and variables are bound at compile time by calling | 
|  | 50 | back to the caller. For the 'acc' command-line tool unknown functions | 
|  | 51 | and variables are looked up using dlsym, to allow using many libc | 
|  | 52 | functions and variables. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 53 |  | 
|  | 54 | - Instructions: blocks ('{' '}') are supported as in C. 'if' and | 
|  | 55 | 'else' can be used for tests. The 'while' and 'for' C constructs | 
|  | 56 | are supported for loops. 'break' can be used to exit | 
|  | 57 | loops. 'return' is used for the return value of a function. | 
|  | 58 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 59 | - switch / case is not supported. | 
|  | 60 | - goto and labels are not supported. | 
|  | 61 | - continue is not supported. | 
|  | 62 |  | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 63 | - Identifiers are parsed the same way as C. Local variables are | 
|  | 64 | handled, but there is no local name space (not a problem if | 
|  | 65 | different names are used for local and global variables). | 
|  | 66 |  | 
|  | 67 | - Numbers can be entered in decimal, hexadecimal ('0x' or '0X' | 
|  | 68 | prefix), or octal ('0' prefix). | 
|  | 69 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 70 | - Float and double constants are supported. | 
|  | 71 |  | 
| Jack Palevich | 22f5c6b | 2009-10-27 17:34:45 -0700 | [diff] [blame] | 72 | - '#define' is supported without function like arguments. | 
|  | 73 | - Macro recursion is allowed. | 
|  | 74 | - Self-referential macros are handled as in gcc. | 
|  | 75 | - '#pragma' is supported. The pragma text is passed to a callback function, | 
|  | 76 | and is used to implement meta-information. | 
|  | 77 | - Other preprocessor directives are ignored. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 78 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 79 | - C Strings and C character constants are supported. All ANSI C | 
|  | 80 | character escapes are supported. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 81 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 82 | - Both C comments ( /* */ ) and C++ comments ( // ... end-of-line ) are | 
|  | 83 | supported. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 84 |  | 
| Jack Palevich | c9b8ffc | 2009-08-03 14:42:57 -0700 | [diff] [blame] | 85 | - Some syntax errors are reported, others may cause a crash. | 
| Frabrice Bellard | a969305 | 2009-05-11 14:50:37 -0700 | [diff] [blame] | 86 |  | 
|  | 87 | - Memory: the code, data, and symbol sizes are limited to 100KB | 
|  | 88 | (it can be changed in the source code). | 
|  | 89 |  |