blob: 97a876d9e35ddb4e37f7941ec89dabcd935d794b [file] [log] [blame]
Jean-Baptiste Queru4b29fe62009-11-12 18:46:23 -08001
2Supported C language subset:
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
15 * Comma operator is supported.
16
17 * Trinary operator (?:) is not supported.
18
19 * Unary operators: '&', '*' (pointer indirection), '-'
20 (negation), '+', '!', '~', '++' and '--'.
21
22 * Pointer indirection ('*') is supported.
23
24 * Square brackets can be used for pointer arithmetic.
25
26 * '=' and <op>= are supported.
27
28 * Function calls are supported with standard Linux calling
29 convention. Function pointers are supported.
30 Functions can be used before being declared.
31
32 - sizeof() is not supported.
33
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.
40 - short is not supported
41 - const is not supported
42 - arrays are not supported
43 - long doubles are not supported
44 - structs are not supported
45
46 - Unknown functions and variables are bound at compile time by calling
47 back to the caller. For the 'acc' command-line tool unknown functions
48 and variables are looked up using dlsym, to allow using many libc
49 functions and variables.
50
51 - Instructions: blocks ('{' '}') are supported as in C. 'if' and
52 'else' can be used for tests. The 'while' and 'for' C constructs
53 are supported for loops. 'break' can be used to exit
54 loops. 'return' is used for the return value of a function.
55
56 - switch / case is not supported.
57 - goto and labels are not supported.
58 - continue is not supported.
59
60 - Identifiers are parsed the same way as C. Local variables are
61 handled, but there is no local name space (not a problem if
62 different names are used for local and global variables).
63
64 - Numbers can be entered in decimal, hexadecimal ('0x' or '0X'
65 prefix), or octal ('0' prefix).
66
67 - Float and double constants are supported.
68
69 - '#define' is supported without function like arguments. No macro
70 recursion is tolerated. Other preprocessor directives are
71 ignored.
72
73 - C Strings and C character constants are supported. All ANSI C
74 character escapes are supported.
75
76 - Both C comments ( /* */ ) and C++ comments ( // ... end-of-line ) are
77 supported.
78
79 - Some syntax errors are reported, others may cause a crash.
80
81 - Memory: the code, data, and symbol sizes are limited to 100KB
82 (it can be changed in the source code).
83