Here we put the non-programming choices we made
- variables can be only constitued of letters,
_
and numbers - for the moment we can do multiple affectations
- we choose to change the memory_offset and the tmp_index before the actions
- the char have size 4
- Data type char
- Data type int
- Variables
- Integer constants
- Basic arithmetic operations: +,-, *
- Division and modulo (in IR)
- Bit-by-bit logical operations: |, &,ˆ
- Comparison operations: ==, !=, <, >
- Unary operations: ! and - and ~ (bonus)
- Declaration of variables anywhere
- Assignment (which, in C, also returns a value)
- Possibility of initializing a variable when declaring it
- Use of standard putchar and getchar functions for I/O
- Define functions with parameters, and int, char or void return type : James
- Check consistency of function calls and parameters (reserved names)
- Block structure using { and }
- Support for variable scopes and shadowing
- If, else, while control structures
- Support for return expression anywhere
- Check that a variable used in an expression has been declared
- Check that a variable is not declared more than once
- Check that a declared variable is used at least once: I don't think this has been implemented ~James
- Retargeting to multiple architectures: x86, MSP430, ARM
- Double support with all implicit conversions
- Simple constant propagation
- Propagation of constant variables (with data-flow analysis)
- Arrays (one-dimensional)
- Pointers
- Break and continue : Mathieu
- Char data type width support (8-bit integer)
- Character strings represented by char arrays
- Switch...case : Bachir
- Lazy operators ||, &&
- Assignment operators +=, -= etc., increment ++ and decrement --
- Data type void
- Data type pointer address
- see example of c.g4