[doc] updated the scope builder documentation
[ozulis.git] / src / ozulis / visitors / scope-builder.doch
blob7d99fbe6d10189732263198e9be02927d9dd738e
1 /**
2  * @page scopebuilder Scope builder
3  *
4  * @section introduction Introduction
5  * The scope builder builds scope. A scope is a collection of Symbol.
6  *
7  * @section implementation Implementation
8  *
9  * @subsection rules Rules
10  * - The scope builder can not override a symbol. (weakness is not implemented
11  * at the moment).
12  *  - => You can not use the ScopeBuilder two times on the same AST.
13  *
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.
21  *
22  * @subsection global_scope Global scope
23  * This scope is the first scope. It has no parents.
24  * Symbol addresses are prefixed with `@'.
25  *
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 `.'.
29  *
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 `@%'.
33  *
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].
38  *
39  * @subsection id_exp IdExp
40  * Every IdExp should be resolved and replaced with the corresponding
41  * SymbolExp.
42  */