Commit Graph

107 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire c39bc20d1c VariableDeclaration (WIP)
- Added `emit()` method to fetch name for now and emit a string
2022-12-11 18:40:12 +02:00
Tristan B. Velloza Kildaire d19edef8f4 DGen
- Emit code by calling `emit()` on each Instruction object
2022-12-11 18:13:10 +02:00
Tristan B. Velloza Kildaire 1e2ef795d6 Instruction
- Added `emit()` method to base Instruction class
- Fixed typo in name of `StorageDeclaration` class
- WIP: `VariableDeclaration` emit()
2022-12-11 18:12:46 +02:00
Tristan B. Velloza Kildaire 5a22b184b7 DGen
- Don't write a blank line at the top of the header comment (see `emitHeaderComment()`)
2022-12-11 18:09:56 +02:00
Tristan B. Velloza Kildaire 15617e7ced DGen
- Added note to `emitCodeQueue()` that instructions will need recursive `emit()` methods
2022-12-11 18:08:52 +02:00
Tristan B. Velloza Kildaire f4797b79e2 DGenregs
- This file has been removed

DGen

- Removed unused import for `dgenregs.d`
2022-12-11 18:06:10 +02:00
Tristan B. Velloza Kildaire b8c99329aa DGen
- Added trailing newline to the comment emitted by `emitHeaderComment()`
2022-12-11 18:04:53 +02:00
Tristan B. Velloza Kildaire c91d72d0b9 DGen
- Added some NOTEs for potential TODOs
2022-12-11 18:01:54 +02:00
Tristan B. Velloza Kildaire e6b1de47f1 DGen
- Added docstring to `emitHeaderComment()`
2022-12-11 17:58:33 +02:00
Tristan B. Velloza Kildaire fe7390caa0 DGen
- The module name of the source file is now correctly added to the header comment (see `emitHeaderComment()`)
2022-12-11 17:57:16 +02:00
Tristan B. Velloza Kildaire 1f3bdd3279 DGen
- Added support for an additional string comment to be added to the emitted header comment via the `emitHeaderComment()` method
2022-12-11 17:55:18 +02:00
Tristan B. Velloza Kildaire c37b85b781 DGen
- Emit a header comment to the output C file containing information about the generated code (source file and destination file)
2022-12-11 17:52:36 +02:00
Tristan B. Velloza Kildaire 566a916a5a DCodeEmitter
- Removed old code generation code - starting anew
2022-12-11 17:38:58 +02:00
Tristan B. Velloza Kildaire 99224cbb80 Type checker
- Added `getInitQueue()`
- Removed the `beginEmit(initQueue, codeQueue)` method (as this is done for us in compiler.d

CodeEmitter

- Extract init queue as well
2022-12-11 17:37:27 +02:00
Tristan B. Velloza Kildaire 7e49cf1d0a Added float support
- Added float constant support to the lexer
- Added float support to the typechecker to build the correct Instruction type

Unit tests

- Added unit test for a bad example of a malformed encoded floating point to test out the lexer
2022-08-11 10:26:30 +02:00
Tristan B. Velloza Kildaire 7e9e303a1c Implemented StringLiteral Value-kind-of instruction with string interning 2022-07-26 09:58:25 +02:00
Tristan B. Velloza Kildaire 415538f54a Added StringLiteral instruction 2022-07-25 19:30:07 +02:00
Tristan B. Velloza Kildaire 1e202fe788 Added Unary Oprator Instruction 2022-04-12 10:52:18 +02:00
Tristan B. Velloza Kildaire 1b002382d5 BinaryOperatorExpressions are meant to evaluate to a value, they MUST be ValueInstructions 2022-04-08 00:34:50 +02:00
Tristan B. Velloza Kildaire da9bc742e5 Constrain FuncCallInstr evaluation (for arguyments) to only being value-deriving instructions 2022-02-20 15:36:22 +02:00
Tristan B. Velloza Kildaire 3cac1b496d Fixed addInfo for FuncCallInstr instruction 2022-02-20 15:35:18 +02:00
Tristan B. Velloza Kildaire a84e0dfe20 Some stuff, working on getting function calls working 2022-02-18 14:32:45 +02:00
Tristan B. Velloza Kildaire aa5e82fe09 Added stub funccallinstr add to sotp segmentation fault on funciton calls being processed 2022-02-15 15:04:16 +02:00
Tristan B. Velloza Kildaire 3da50e9eab Got some sort of class allocator node created, now to re-order it by using Context to be able to know when the StaticVariableDeclaration is within class.
This then generates code to allocate space for the class, once done we can be assured the declarations (placed after it now) will be assigning to properly allocated space (paged and maped for example)
2021-11-10 17:15:27 +02:00
Tristan B. Velloza Kildaire cae3cfe88c Updated 2021-11-10 17:01:17 +02:00
Tristan B. Velloza Kildaire 60f490d8e8 Refactored dependency tree generation code (and all related modules) to its own directory 2021-11-09 19:16:51 +02:00
Tristan B. Velloza Kildaire fffcc953ab Refactored Context class 2021-11-09 19:00:23 +02:00
Tristan B. Kildaire 7fe3ea342c Added note on name resolution for correct stack offset mapping 2021-11-09 15:51:08 +02:00
Tristan B. Kildaire 3b36113a5b Added Context 2021-11-09 15:49:59 +02:00
Tristan B. Kildaire 8a8ddcee3a Added notes on ceogeneration 2021-11-09 15:40:35 +02:00
Tristan B. Kildaire b88943d2ed Fixed `pushVariable()` to ACTUALLY add to the stackOffsetMap 2021-11-09 15:40:28 +02:00
Tristan B. Kildaire bef0bced14 Addes some stub functions for writing of variables to the stack (code to generate it) 2021-11-09 15:35:45 +02:00
Tristan B. Kildaire 6c1dac5f2a On variable declaration maintain a mapping of offsets of variables on the stack 2021-11-09 15:30:37 +02:00
Tristan B. Velloza Kildaire fb927eeb17 Yesh 2021-11-06 12:38:13 +02:00
Tristan B. Kildaire 15416aa655 Fixed register generation for Rochard registers on x86_64 2021-11-02 17:24:08 +02:00
Tristan B. Kildaire 4df1aac54c Prevent segmentation faults for now by returning bogus register and bogus emit 2021-11-02 17:16:46 +02:00
Tristan B. Kildaire f75a3cfa5f Added missing register file initialization 2021-11-02 17:14:15 +02:00
Tristan B. Kildaire 90151a2af1 Basic register usage should now be here 2021-11-02 17:13:48 +02:00
Tristan B. Kildaire 94d3128efe Added missing implementation of `getUsableName()` 2021-11-02 17:06:36 +02:00
Tristan B. Kildaire 4dd7e281a2 Renamed method to implement 2021-11-02 17:05:47 +02:00
Tristan B. Kildaire 8bfbb2423c Set to abstract for Register 2021-11-02 17:05:24 +02:00
Tristan B. Kildaire 09233633a0 WIP: Register allocator 2021-11-02 17:03:38 +02:00
Tristan B. Kildaire 0352f96c16 Do not initialize stack variables 2021-11-02 15:29:04 +02:00
Tristan B. Kildaire 536206fdc5 Code emitter can now emit all variable sizes 2021-11-02 15:27:17 +02:00
Tristan B. Kildaire ff9890437d Working code emitter and doing some code gen with it too 2021-11-02 15:13:44 +02:00
Tristan B. Kildaire 2d46eb4458 Removed unused (old) type 2021-11-02 13:58:36 +02:00
Tristan B. Velloza Kildaire 3dba481260 Refactored code emitter sub-system 2021-11-02 10:41:03 +02:00
Tristan B. Velloza Kildaire 9613fcf81d Set the Operator type 2021-10-26 22:03:48 +02:00
Tristan B. Velloza Kildaire 6ac0f5fed7 AddInstr now shows both toString()'s of its LHS Value Instruction and its RHS Value Instruction 2021-10-26 20:58:42 +02:00
Tristan B. Velloza Kildaire 2b29a18328 FetchValueVar now shows information (in its toString) about what variable is being fetched and the length of it to read 2021-10-26 20:44:10 +02:00
Tristan B. Velloza Kildaire 86ee064af5 VariableAssignmentInstr now prints out the nested Instruction for obtaining its value of which will be assigned to the variable it specifies 2021-10-26 20:36:39 +02:00
Tristan B. Velloza Kildaire 569e53f803 This seems to work 2021-10-26 20:32:47 +02:00
Tristan B. Velloza Kildaire 129860fc37 WIP 2021-10-26 17:17:53 +02:00
Tristan B. Kildaire de5502f61d Stub file added for future LLVM code generator 2021-06-01 15:24:23 +02:00
Tristan B. Kildaire 4b13c88c51 DGen works, D code can be generated 2021-06-01 15:24:13 +02:00
Tristan B. Kildaire d8f82e17de Added plumbing for testing D (not final, we shall use LLVM) code generation 2021-06-01 15:18:21 +02:00
Tristan B. Kildaire 274ea767a2 Added plumbing for code generation 2021-06-01 15:18:09 +02:00