- Added new SymbolMapper class with a static method which will take a Container and an entity name, resolve the Entity and then generate the hash of the absolute path to said entity and return this as the `symbol name`
TypeChecker
- Set the static field to refer to this instance of the TypeChecker (in the SymbolMapper class)
VariableDeclaration
- Use the `symbolLookup()` method to transform the name
- Added `finalize()` method, this is to be called whenever the emitting is done and a compiler is to be called on the code
DGen
- Implemented a gcc-based finalization method
- Added `emitEntryPoint()` to emit a main() function which is to be called in libc's `_start` symbol
VariableDeclaration
- Added note we may need a symbol table lookup system actually, rather than just a simple `symbolRename`
Compiler
- Call the `finalize()` method on the DGen code emitter
----
Test cases
- Added `simple_variables_only_decs.t` to test code generation
- Added a method which will replace the `.`s in a symbol with underscores
Instruction
- The symbol names need to be valid in C so let's just make it a rule they will only have _'s (underscores) to replace any characters like `.`s
- Pass in the type of the variable being declared to the `VariableDeclaration` instruction
VariableDeclaration
- Emitted code now contains the type of the variable being declared
- Added `getInitQueue()`
- Removed the `beginEmit(initQueue, codeQueue)` method (as this is done for us in compiler.d
CodeEmitter
- Extract init queue as well
This is a queue where all things such as:
- Class static initializations
- Module initializations (maybe)
- Struct static initializations
will go.
Added `addInit()` along `SList initQueue` to support such a queue.
- Whenever a ClassStaticNode is come across it is added to this queue (at the back - so as to maintain allocation order, not that allocation would matter - only initialization (which is already working))
- The VarAssDNode processor on typechecker now adds to the back orf the code queue
- We removed all weird swapping code in typechecker
- Dependency wise, a variable declaration is depended-UPON its variable assignment which in turn a module depends ON.
- In the case of no assignments we simpyl make the module depend on the variable declaration dnode directly
- Added new test case to show this all