2 * @page scopebuilder Scope builder
4 * @section introduction Introduction
5 * The scope builder builds scope. A scope is a collection of Symbol.
7 * @section implementation Implementation
9 * @subsection rules Rules
10 * - The scope builder can not override a symbol. (weakness is not implemented
12 * - => You can not use the ScopeBuilder two times on the same AST.
14 * @subsection symbols Symbols
15 * What is a symbol ? A data structure which describe 3 things:
16 * - the name of the symbol.
17 * - the type of the symbol.
18 * - the address of the symbol. An address can be:
19 * - a register address
20 * - a memory address. Usually it is scope's prefix + symbol's name.
22 * @subsection global_scope Global scope
23 * This scope is the first scope. It has no parents.
24 * Symbol addresses are prefixed with `@'.
26 * @subsection namespace_scope Namespace scope
27 * This scope is the child of a global scope or a namespace scope.
28 * Symbol addresses are prefixed with the parent prefix plus `.'.
30 * @subsection function_scope Function scope
31 * This scope is the child of a global scope or a namespace scope.
32 * Symbol addresses are prefixed with `@%'.
34 * @subsection strings Strings
35 * When the scope builder meet a StringExp, it should create a internal
36 * constant in a global scope and replace the string with a SymbolExp pointing
37 * to the new constant. The type of the constant is [i8 x size].
39 * @subsection id_exp IdExp
40 * Every IdExp should be resolved and replaced with the corresponding