Tristan B. Velloza Kildaire
263bf5edb7
Bug fixed
...
Should not be parent of, but rather should be the class itself
2021-11-11 10:07:25 +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
c58bf07bb1
WIP: Trying to get literal encoding working (but it is currently broken)
2021-11-10 17:01:12 +02:00
Tristan B. Velloza Kildaire
6ed33a8051
Done with work for today, good refactoring, now to work on class static initoialization.
...
Instance initialization and unique-ness, and same for Functions with their "FunctionData" will come later
2021-11-10 17:00:56 +02:00
Tristan B. Velloza Kildaire
cb6fb5f86f
Removed unused commented blocks of code
2021-11-10 16:45:08 +02:00
Tristan B. Velloza Kildaire
47edb41e17
Seems like generalised generalPass() is working
2021-11-10 16:42:15 +02:00
Tristan B. Velloza Kildaire
3eddf73b7b
Added some stuff
...
FunctionData adding, some generation stuff, but reworking to make a general pass function
2021-11-10 16:17:42 +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. Velloza Kildaire
f0b0f83c45
Added note to be used later
2021-11-09 18:26:50 +02:00
Tristan B. Velloza Kildaire
c9997c60d0
Made public
2021-11-09 18:26:39 +02:00
Tristan B. Velloza Kildaire
beaad7e7f1
Added the thing
2021-11-09 18:26:30 +02:00
Tristan B. Velloza Kildaire
6499abb616
Fixed up all other `getStatements()` for other Container types
2021-11-09 16:54:00 +02:00
Tristan B. Velloza Kildaire
b39fea5e10
Fixed `getStatements()` for Module container type to be stable. Not having it so caused bad affects and re-ordering that should have NOT happened
2021-11-09 16:50:04 +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
de261ec511
Copy Context information from the ParserNode across to the Instruction node (only so far for Module Variable Declaration DNodes' embedded PNode
2021-11-09 15:50:04 +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
3d79531978
Removed emitter code from data.d
2021-11-02 10:38:09 +02:00
Tristan B. Kildaire
ad5e26602f
Removed unused method
2021-11-02 09:43:02 +02:00
Tristan B. Kildaire
7a78a4e5b1
Removed old cruft
2021-11-02 09:42:50 +02:00
Tristan B. Kildaire
12087b8fdf
Removed old VTReeNode commented-out code
2021-11-02 09:42:21 +02:00
Tristan B. Kildaire
60b97f90aa
Removed unused commented code
2021-11-02 09:41:30 +02:00
Tristan B. Kildaire
9987c46497
Re-enabled a unit test for the type checker
2021-11-02 09:36:15 +02:00
Tristan B. Kildaire
1731ae3299
Re-enabled a unit test for the type checker
2021-11-02 09:35:48 +02:00
Tristan B. Kildaire
c8ccc71244
Re-enabled a unit test for the type checker
2021-11-02 09:35:27 +02:00
Tristan B. Kildaire
bbd34a951a
Re-enabled unit test for type checker
2021-11-02 09:34:57 +02:00
Tristan B. Kildaire
36f073fbff
Re-enabled two unit tests for the type checker
2021-11-02 09:34:40 +02:00
Tristan B. Kildaire
71be300582
Disabled a lot of old typechecking code that we either don't need or I am not working with right now
2021-11-02 09:32:52 +02:00
Tristan B. Velloza Kildaire
cf03601eec
Removed unused field
2021-11-01 18:28:19 +02:00
Tristan B. Velloza Kildaire
8fed8fa4fb
Removed unused methods for Statement
2021-11-01 18:25:53 +02:00
Tristan B. Velloza Kildaire
396ccdbc60
Moved token I/O statements toghether
2021-11-01 18:25:43 +02:00
Tristan B. Velloza Kildaire
0081277fb1
Cleaned up typechecking (codegen)
2021-10-27 21:12:00 +02:00
Tristan B. Velloza Kildaire
bbf174b757
Added weighting such that `getStatements()` can be ordered more easily. Many weights are still missing but the things I am testing with now are atleast here.
...
Added check for standalone variable assignments to error (crash) the compiler when the variable has not yet been declared.
I still need to clean up the codegen and add back in typechecking, the thing has become weird with many weird function calls, but I can do it in one function call to be honest (and that makes most sense)
Standalone variable assignments are now in the dependency tree and therefore make it into the typechecking/codegen phase (of which code to handle them has also been added)
2021-10-27 20:57:30 +02:00
Tristan B. Velloza Kildaire
47375cbec4
Beginning to work on weighting system
2021-10-27 15:52:43 +02:00
Tristan B. Velloza Kildaire
0bceb16373
Added toString for VariableAssignment
2021-10-27 15:33:24 +02:00
Tristan B. Velloza Kildaire
a14f2a682d
Added `getCodeQueue()` which will be used when code generation is complete (after typechecking) and we can then emit code from it
2021-10-27 09:51:13 +02:00
Tristan B. Velloza Kildaire
7ffbd6f50e
Corrected instruction counter for printCodeQueue()
2021-10-27 09:25:11 +02:00
Tristan B. Velloza Kildaire
9613fcf81d
Set the Operator type
2021-10-26 22:03:48 +02:00
Tristan B. Velloza Kildaire
975acc05a2
Added the following new SymbolTypes
...
SymbolType.ADD, SymbolType.MINUS, SymbolType.DIVIDE, SymbolType.STAR
2021-10-26 21:35:39 +02:00
Tristan B. Velloza Kildaire
fcfde58b98
Fixed order of execution for AddInstr construction
2021-10-26 21:15:26 +02:00
Tristan B. Velloza Kildaire
5b70175de4
Added note TODO
2021-10-26 21:04:47 +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. Velloza Kildaire
b9adbc6663
Yo, so I think I got this down
2021-10-25 22:31:07 +02:00
Tristan B. Velloza Kildaire
8bf3270de7
NumberLiteral now has its own custom toString
2021-10-25 20:49:58 +02:00
Tristan B. Velloza Kildaire
a58c90d6cb
Added some ideas for typechecking the action-list and then furthermore emitting code from it
2021-10-25 17:03:36 +02:00
Tristan B. Velloza Kildaire
ceac4f0eaa
Print out action-list items in initialization order
2021-10-25 16:55:43 +02:00
Tristan B. Velloza Kildaire
8833a14da9
Generate linearized action-list for code generation (and type-checking)
2021-10-25 16:54:06 +02:00
Tristan B. Velloza Kildaire
d4ec91dc94
Added TODO to make the graph acyclic and THEN print it
2021-08-15 22:33:22 +02:00
Tristan B. Velloza Kildaire
0cd1812fa6
Removed comment
2021-08-15 22:23:31 +02:00
Tristan B. Velloza Kildaire
6e7bb365ed
The generation of the tree is now called externally along with printing of the acyclic tree
2021-08-15 22:23:17 +02:00
Tristan B. Kildaire
6ceff9e54a
Removed comment as it no longer applies (I have a working method for what I want to do already, just using visitations :))
2021-08-12 15:45:42 +02:00
Tristan B. Kildaire
19119bbff6
Removed uneeded variables
2021-08-12 15:42:39 +02:00
Tristan B. Kildaire
2606764f84
Updated ExpressionDNode (dependency node) to use the Expression's toString to make indicating the TYPE of Expressionit contains
2021-08-12 15:42:22 +02:00
Tristan B. Kildaire
67b9fd1504
Added override for VariableExpression's toString method
2021-08-12 15:41:56 +02:00
Tristan B. Kildaire
b264ad2371
Fixed cast, which caused segfault later
2021-08-12 15:26:26 +02:00
Tristan B. Kildaire
0cfcf2a5e6
Pretty sure that needs to be there
2021-08-12 15:21:59 +02:00
Tristan B. Kildaire
51b62fe89f
Made error message specific such that whena variable is refercned that EXISTS but has not yet been declared and we can tell the clear difference between that and an entity completely not existing in the program (regardless of declaration order)
2021-08-12 15:18:52 +02:00
Tristan B. Kildaire
4d03416383
Updated error message on reference to variable that is yet to be declared
2021-08-12 15:17:42 +02:00
Tristan B. Kildaire
dbf4667516
Removed comment
...
Added dependency addition
2021-08-12 15:13:36 +02:00
Tristan B. Kildaire
eeba21edd9
Added note, I may want to move this
2021-08-12 15:12:26 +02:00
Tristan B. Kildaire
5a805b699b
Hit a bit of a roadblock
2021-08-12 15:03:56 +02:00
Tristan B. Kildaire
1596bedc35
Bruh
2021-08-12 14:19:53 +02:00
Tristan B. Kildaire
b1219c20d5
Working on variable declarations (simple) dependency generation (with assignments)
2021-08-12 14:16:32 +02:00
Tristan B. Velloza Kildaire
c60e83832e
All for today
2021-08-11 23:33:53 +02:00
Tristan B. Kildaire
c721ca1d65
All for now, will clarify and think on it a little more later
2021-08-11 18:46:25 +02:00
Tristan B. Kildaire
8da430475b
Will work on this a bit later, probably the weekend
2021-08-11 18:44:32 +02:00
Tristan B. Kildaire
59d325d691
WIP: Will work on more later, I know what must be done
2021-08-11 18:27:34 +02:00
Tristan B. Kildaire
8fc53fb837
Added mechanism that can be used in the future to indicate, given the Context, whether one can resolve upwards or only within (and hence down too)
2021-08-11 18:24:18 +02:00
Tristan B. Kildaire
ab70e5ea3a
WIP: Working on accessor dependeny generation for `new A().thing.thing`
2021-08-11 18:19:28 +02:00
Tristan B. Kildaire
ff5f39c752
WIP
2021-08-11 17:33:16 +02:00
Tristan B. Velloza Kildaire
06dbf479ff
Use ExpressionNode for now (get more specific later)
2021-06-15 18:06:55 +02:00
Tristan B. Velloza Kildaire
9c445f2a52
Disabled uneeded code
2021-06-15 16:23:53 +02:00
Tristan B. Velloza Kildaire
193c2b285a
WIP:Object initialization
2021-06-15 15:45:31 +02:00
Tristan B. Velloza Kildaire
f76b228114
Implemented use of Object initilization node
2021-06-15 15:35:20 +02:00
Tristan B. Velloza Kildaire
3c6270be04
Added Object initilization node
2021-06-15 15:35:12 +02:00
Tristan B. Velloza Kildaire
255f96511e
WIP: Object initialization
2021-06-15 15:25:11 +02:00
Tristan B. Velloza Kildaire
d6f15e2b86
Switched to using more specific DNodes for Variables
2021-06-15 15:04:15 +02:00
Tristan B. Velloza Kildaire
12b0a99d47
Added markings to show static
2021-06-15 15:04:05 +02:00
Tristan B. Velloza Kildaire
548867fcb1
Added generic pooler using templating
2021-06-15 14:56:40 +02:00
Tristan B. Velloza Kildaire
ba650f1ab7
Added ExpressionDNode
2021-06-15 14:48:44 +02:00
Tristan B. Velloza Kildaire
c957845c66
Made `new` expression support more explicit to return a `NewExpression` with an embedded FunctionCall rather than a FunctionCall alone
2021-06-15 14:27:32 +02:00
Tristan B. Velloza Kildaire
8799ab9b85
FOund a parsing error that must be fixed to allow `new A().x`
2021-06-15 13:29:04 +02:00
Tristan B. Velloza Kildaire
8079167fa5
Going to refactor into this
2021-06-15 13:12:27 +02:00
Tristan B. Velloza Kildaire
a2445607ba
Reordered visitation marking of variable
2021-06-15 13:07:11 +02:00
Tristan B. Velloza Kildaire
758614b7fc
Added Module Variable Delcration code
2021-06-15 13:05:26 +02:00
Tristan B. Velloza Kildaire
3548f1d5bb
Removed undeeded prints
2021-06-15 12:54:05 +02:00
Tristan B. Velloza Kildaire
390a573b47
Use special ModuleVariableDeclaration DNode
2021-06-15 12:53:39 +02:00
Tristan B. Velloza Kildaire
e8dfb61ab9
WIP: VariableNode base class
2021-06-15 12:44:43 +02:00
Tristan B. Velloza Kildaire
756b648420
Fixed segmentation fault
2021-06-15 12:44:37 +02:00
Tristan B. Velloza Kildaire
075c175d3e
Implemented `getName()` temporarily to make tree print-out work
2021-06-15 11:25:04 +02:00
Tristan B. Velloza Kildaire
998a2dd577
Refactored into directory for class-related types
2021-06-15 11:23:22 +02:00
Tristan B. Velloza Kildaire
b807718fad
Make fields protected
2021-06-15 11:23:08 +02:00
Tristan B. Velloza Kildaire
350ff14586
WIP: Expression dependencies
2021-06-15 11:15:08 +02:00
Tristan B. Velloza Kildaire
2b2f119fdc
Support for previous commit
2021-06-15 11:10:58 +02:00
Tristan B. Velloza Kildaire
8b1e1c1db5
Associate variable's and their assignment statements bidirectionally
2021-06-15 11:10:50 +02:00
Tristan B. Velloza Kildaire
750ec6605c
WIP: Expression dependency generation
2021-06-15 10:51:40 +02:00
Tristan B. Velloza Kildaire
8e2f7032ad
Added getters and setters for left-hand and right-hand expressions of BinaryOperatorExpression
2021-06-15 10:49:19 +02:00
Tristan B. Velloza Kildaire
c6d0d762e8
Store the left-hand and right-hand expressions for BinaryOperatorExpression
2021-06-15 10:48:01 +02:00
Tristan B. Kildaire
c8ae0e7ae4
Back to where we were last night now
2021-06-09 21:14:48 +02:00
Tristan B. Kildaire
f22df86e39
Damn I spent time making ascii art
2021-06-09 20:47:52 +02:00
Tristan B. Kildaire
54a1b8f247
Introduce new marking, `completed`, means that it has visited during psot-processing
2021-06-09 20:35:17 +02:00
Tristan B. Kildaire
687cf6c92c
Fixed visitation loop detection algorithmn
2021-06-09 20:19:26 +02:00
Tristan B. Kildaire
1b5c783b75
If the class has not been visited then set it as such and return immediately
2021-06-09 20:10:47 +02:00
Tristan B. Kildaire
01684f785e
Use `getType()` instead for resolving types
2021-06-09 20:07:39 +02:00
Tristan B. Kildaire
2ebf2c13cf
Use `getType` instead
2021-06-09 20:07:23 +02:00
Tristan B. Kildaire
7cdd7bc57f
Make variable declarations at the module-level that use class-types depend on their static initialization
2021-06-09 19:54:22 +02:00
Tristan B. Kildaire
3ba469c481
Re-enabled printing of dependency tree
2021-06-09 19:53:04 +02:00
Tristan B. Kildaire
8cdd414dab
Only initialize the parent Container if it is of type Clazz
2021-06-09 19:52:32 +02:00
Tristan B. Kildaire
392fae8088
Debugging segmentation fault now
2021-06-09 19:51:39 +02:00
Tristan B. Kildaire
653495b324
Disabled code generation (for now)
2021-06-09 19:49:49 +02:00
Tristan B. Kildaire
de6687de24
New direction
...
We need to do what we did with data structures for parsing for type checking (dependency checking).
We have pooling sorted now, but we must actually create our own initializer sub-types from DNode (non static vs static class init for example)
2021-06-09 19:45:57 +02:00
Tristan B. Kildaire
695354d4b6
Trashed old code
2021-06-09 18:22:07 +02:00
Tristan B. Kildaire
cbaca17d96
I want to rework the whole thing
2021-06-09 18:20:50 +02:00
Tristan B. Kildaire
6d19bd9b44
TODO added
2021-06-09 17:44:21 +02:00
Tristan B. Kildaire
48c7e9c681
Trying to reduce duplicate code for variable declaration checking
2021-06-09 13:08:55 +02:00
Tristan B. Kildaire
fb5de13895
Fixed bug whereby the semicolon after a `discard`'s expression was not expected and neither consumed
2021-06-09 12:57:43 +02:00
Tristan B. Kildaire
dc162e7b03
Added support for discard statement
2021-06-09 12:55:59 +02:00
Tristan B. Kildaire
55b256565c
Added support for `new` operator in expression parsing (not yet as a statement)
2021-06-09 12:44:26 +02:00
Tristan B. Kildaire
c24b19bc0a
Added `new` keyword
2021-06-09 12:43:59 +02:00
Tristan B. Velloza Kildaire
5e20c97d1a
Fixed bug whereby the Module (top-level and base case (should be, is NOW)) was checked for a container (which would always be null), don't do this for Module's
...
We START at Modules
2021-06-09 12:28:38 +02:00
Tristan B. Velloza Kildaire
8c3a92ac4c
Bug found and fixed, introduces bug globally now but that is an easy fix.
2021-06-09 12:24:19 +02:00
Tristan B. Velloza Kildaire
8473b2e836
Formatted
2021-06-09 11:23:56 +02:00
Tristan B. Velloza Kildaire
51b113f734
Remove uneeded check (unit tests pass)
2021-06-08 13:26:19 +02:00
Tristan B. Velloza Kildaire
52e904495e
WIP: BIg to fix with Module
2021-06-08 13:20:50 +02:00
Tristan B. Velloza Kildaire
9b2468144b
Ensure they are variables
...
Added variable to myClass1.myClass1_1 as `entity` and code to the unit test to test it
2021-06-08 13:03:46 +02:00
Tristan B. Velloza Kildaire
8feb055c86
Cleaned up
2021-06-08 13:00:21 +02:00
Tristan B. Velloza Kildaire
1e46615f81
Vice-versa of the above should not be true (unit test passes)
2021-06-08 12:58:36 +02:00
Tristan B. Velloza Kildaire
ebc99584dd
Fixed incorrect variable type being used
2021-06-08 12:57:58 +02:00
Tristan B. Velloza Kildaire
dfe9d8e553
Ensure the inner and outer variables exist in the correct classes
2021-06-08 12:57:32 +02:00
Tristan B. Velloza Kildaire
b51414eb02
Ensure name resolution is working (unit test passed)
2021-06-08 12:54:29 +02:00
Tristan B. Velloza Kildaire
92a11bf605
Assure that they are classes
2021-06-08 12:52:27 +02:00
Tristan B. Velloza Kildaire
a7922879cb
Test that the entities exist
2021-06-08 12:51:23 +02:00
Tristan B. Velloza Kildaire
6f9d4da5ae
Added more to unit test
2021-06-08 12:49:25 +02:00
Tristan B. Kildaire
df9866eeeb
WIP: Adding unit test to test naming resolution
2021-06-08 11:07:30 +02:00
Tristan B. Kildaire
a39ee62915
Disabled unit test
2021-06-08 10:53:53 +02:00
Tristan B. Kildaire
55ccf00e29
Disabl typechecking unit tests for now
...
Need to simplify code base a lot
2021-06-08 10:52:22 +02:00
Tristan B. Velloza Kildaire
7fa9f9ff87
Throw syntax error when expect(SymbolType, Token) is called
2021-06-08 10:45:32 +02:00
Tristan B. Velloza Kildaire
18f34b5e99
Fixed missing imports
2021-06-08 10:45:14 +02:00
Tristan B. Velloza Kildaire
ed818120b5
ParserException now takes in an instance of Parser
2021-06-08 10:38:46 +02:00
Tristan B. Velloza Kildaire
e659bf3e4f
Added SyntaxError
2021-06-08 10:37:43 +02:00
Tristan B. Velloza Kildaire
91a422f2fe
Added ParserException
2021-06-08 10:37:38 +02:00
Tristan B. Kildaire
8028fc1d7b
WIP: Make the compiler more like a library
2021-06-08 10:30:15 +02:00
Tristan B. Kildaire
5c566644c3
Mark all module-level defined Entities as static
2021-06-07 17:08:21 +02:00
Tristan B. Kildaire
0c4b3a7008
Classes may now not contain if statements etc
2021-06-07 17:01:55 +02:00
Tristan B. Kildaire
7663f4fd5b
Before
2021-06-07 16:55:48 +02:00
Tristan B. Kildaire
6b5d157d41
It's about time we actually mark things as static correctly now
2021-06-07 16:54:06 +02:00
Tristan B. Kildaire
6270d295b9
Undo SingletonExpression
2021-06-07 16:47:57 +02:00
Tristan B. Kildaire
f6d613f0fc
Make tese SingletonExpression
2021-06-07 16:46:41 +02:00
Tristan B. Kildaire
8f26a414b4
Added missing getters
2021-06-07 16:32:23 +02:00
Tristan B. Kildaire
fa603bf745
Initialize basic-typed variables at module level
2021-06-07 16:32:12 +02:00
Tristan B. Kildaire
752cc02ed2
Grouping mechanism added
2021-06-07 16:26:36 +02:00
Tristan B. Kildaire
40982684b3
Need to add grouping of things that must generate toghether
2021-06-07 16:01:39 +02:00
Tristan B. Kildaire
b4aa08808f
Test code gen
2021-06-07 15:56:43 +02:00
Tristan B. Kildaire
cdfa576d04
Works I think
2021-06-07 14:58:24 +02:00
Tristan B. Kildaire
8da6d94212
I wonder if that worked
2021-06-07 14:27:36 +02:00
Tristan B. Kildaire
00920ad43b
Added quick fix for gotcha
2021-06-07 14:00:06 +02:00
Tristan B. Kildaire
7e05c1cbdb
Prevent non-static classes from being used as a type in static initialization
2021-06-07 13:59:12 +02:00
Tristan B. Kildaire
2ac0e18aac
Statically initialize static classes that are members of the current class being statically initialized
2021-06-07 13:54:17 +02:00
Tristan B. Kildaire
d9566698d2
Pool the Module and make it depend on variables
2021-06-07 13:48:14 +02:00
Tristan B. Kildaire
547f25b835
Nvm
2021-06-07 13:29:15 +02:00
Tristan B. Kildaire
ea2f27d0b8
This is pretty aids not gonna lie
2021-06-07 13:25:42 +02:00
Tristan B. Kildaire
eac31532c7
If a Variable declaration has a non-basic type that is a Class-type then that class should have its static initialization run (we should make sure it is reachable however)
2021-06-07 11:17:48 +02:00
Tristan B. Kildaire
b07eecd5a2
Recursively print dependencies of the Module after running the dependency generator
2021-06-07 11:14:38 +02:00
Tristan B. Kildaire
edb11df247
Added method to print dependencies of the given Container
2021-06-07 11:14:22 +02:00
Tristan B. Kildaire
1aa3aabc44
Tired
2021-06-06 23:29:16 +02:00
Tristan B. Kildaire
d42779c3cc
WIP: Dependency
2021-06-06 23:10:16 +02:00
Tristan B. Kildaire
28bbd68857
Added dependency mechanism to Entity
2021-06-06 23:10:15 +02:00
Tristan B. Kildaire
88a6346993
Before revamp
2021-06-06 22:48:04 +02:00
Tristan B. Kildaire
dc01256e60
Fuck this is complicated (1/2)
...
Going to need proper tree and also usign static now in a way that is legal but want it to be illegal to test for loops
2021-06-06 22:45:49 +02:00
Tristan B. Kildaire
a604f4ca27
Return immediatelly if the class has been statically initialized already
2021-06-06 21:43:42 +02:00
Tristan B. Kildaire
5f30ba1ac9
Don't init the class already being initted
2021-06-06 21:34:23 +02:00
Tristan B. Kildaire
a30b544d67
Made initial state default to virtual (non-static) as intended
2021-06-06 20:06:27 +02:00
Tristan B. Kildaire
9609e11303
Process the class itself then too, because if it must be initted as it is referenced by a variable's type then we must do the initializtions (static) of said class first and then that variable is satisfied (it doesn't matter too much without an assignment expresison but would with it hence we definately want this.
2021-06-06 19:10:26 +02:00
Tristan B. Kildaire
4f0d601a0e
Added more tests
...
Added print out for case where parent of class type being referenced is not at module-level hence static-ness cannot be guaranteed and we will need to process this (possibly recursively)
2021-06-06 19:04:26 +02:00
Tristan B. Kildaire
343564f287
All entities must be dependent on themselves (reason: see last commit)
2021-06-06 18:46:21 +02:00
Tristan B. Kildaire
15bce32ef6
WIP: Everything should be dependent on itself, just so we can build a tree afterwards else things like `int j;` at module-level will not be remembered
2021-06-06 18:44:47 +02:00
Tristan B. Kildaire
bf6a724783
Added intermediary type to differentiate between user-defined types, Class, Struct and built-in types like Number and Void
2021-06-06 18:42:23 +02:00
Tristan B. Kildaire
4aeca83d90
Variables declared at module-level with types that are class types must set a dependency on said class running its static initializer
2021-06-06 18:38:07 +02:00
Tristan B. Kildaire
b2eca50f5f
Print out ndependencies after generating the list
2021-06-06 18:37:34 +02:00
Tristan B. Kildaire
3294076faa
If a variable declaration occurs at the module level an it is of a type that is non-basic then it is only a class-type and it must be statically initialized
...
(An actual check as to whether the type idk
2021-06-06 18:33:33 +02:00
Tristan B. Kildaire
8e2807c24a
WIP: Module-level type checking
2021-06-06 18:13:12 +02:00
Tristan B. Kildaire
bffcaa0898
Updated TODO
...
Removed static marking of Module-level class and struct definitions
2021-06-06 18:05:19 +02:00
Tristan B. Kildaire
3a9a43b258
Make all structs and classes at the Module level static
2021-06-06 17:59:46 +02:00
Tristan B. Kildaire
420ec5060d
TODO: Restarting dependency stuff
2021-06-06 17:56:31 +02:00
Tristan B. Kildaire
7e8e4d6f56
Disabled visitation code for now
2021-06-06 17:33:14 +02:00
Tristan B. Kildaire
ea411066aa
Grouped dependency code toghether
2021-06-06 17:15:48 +02:00
Tristan B. Kildaire
bf226a16c7
Switched around
2021-06-06 17:14:24 +02:00
Tristan B. Kildaire
0596611295
Reliance list was keyed incorrecttly
2021-06-06 17:13:32 +02:00
Tristan B. Kildaire
4c538a95f5
Dependency list construction works
2021-06-06 17:08:55 +02:00
Tristan B. Kildaire
3501910f32
WIP: Dependancy "tree" construction
...
Added collection of all static members per each class in a container
2021-06-06 16:52:47 +02:00
Tristan B. Kildaire
3f9375c6ed
Added support for `static` (complete support) within structs
...
Updated test case to test this
2021-06-06 15:51:06 +02:00
Tristan B. Kildaire
1ddd7f102b
Support for `static` without preceding accessor, has been added
2021-06-06 15:43:01 +02:00
Tristan B. Kildaire
f0dae29533
Added support for `static` keyword when preceded by an accessor
2021-06-06 15:33:20 +02:00
Tristan B. Velloza Kildaire
948238d4e9
Added InitScope, for STATIC
2021-06-04 21:28:30 +02:00
Tristan B. Velloza Kildaire
c8490bfe36
WIP
2021-06-04 14:52:22 +02:00
Tristan B. Velloza Kildaire
0bf4a7f658
WIP: Adding static support
2021-06-04 14:47:39 +02:00
Tristan B. Velloza Kildaire
1974428772
Found my bug
2021-06-04 13:42:26 +02:00
Tristan B. Velloza Kildaire
440154b228
Visitation by UFOs, damn
2021-06-04 13:39:11 +02:00
Tristan B. Velloza Kildaire
f024bedaaa
WIP: Need to add support for the `new` keyword
2021-06-04 12:04:58 +02:00
Tristan B. Velloza Kildaire
440addf664
Merge branch 'develop' into codegen
2021-06-04 11:58:56 +02:00
Tristan B. Velloza Kildaire
9cf1a181a2
TIme for expression checking
2021-06-04 11:57:25 +02:00
Tristan B. Velloza Kildaire
e5873fecb3
Idea: Added visitation, we don't need marking tbh , we checking visitaion, marking is implcii in that if there is an error, we exit compiation rpocess, else we continue (which implies marked i.e. the type checking succeeded)
2021-06-04 11:55:22 +02:00
Tristan B. Velloza Kildaire
6c0a0ec69e
Idea: /* TODO: Got it, we NEED a dependency tree, to know chihs is being processed previosuly */
2021-06-04 11:44:51 +02:00
Tristan B. Velloza Kildaire
3051d6b66f
Added marking capability to Statement
2021-06-04 11:36:58 +02:00
Tristan B. Velloza Kildaire
09bb089998
WIP: Found problem for ongoing recursion, we need a stopping case - we need to mark things
2021-06-04 11:34:18 +02:00
Tristan B. Velloza Kildaire
cfd81a6b45
Don't check the type (in class case) when the conatiner we are in is a class AND is the same class as that of the type of the typed entity being checked
2021-06-04 11:31:44 +02:00
Tristan B. Velloza Kildaire
6089598afe
WIP
2021-06-04 11:27:56 +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
Tristan B. Kildaire
d34dd5b689
Now properly generates a Struct object
2021-06-01 10:00:21 +02:00
Tristan B. Kildaire
814b29984c
Refactored comment
2021-05-31 22:36:11 +02:00
Tristan B. Kildaire
d1bd2fab2c
Added TODO
2021-05-31 18:16:35 +02:00
Tristan B. Kildaire
13645f6b6b
Append Statement objects to build up struct's body
2021-05-31 18:14:15 +02:00
Tristan B. Kildaire
cf66e8255d
Fixed termination of struct parse loop
2021-05-31 18:06:09 +02:00
Tristan B. Kildaire
b07c2fb2b5
Ensure that only assignment-less variable declarations and funciton definitions are present in the struct's body
2021-05-31 18:01:06 +02:00
Tristan B. Kildaire
6a18315f78
Re-enable chekc for item we are left on (exit if semi-colon)
...
Actually NO
2021-05-31 17:53:24 +02:00
Tristan B. Kildaire
46c135042b
Struct parsing basic parsing completed, just simply call `parseAccessor()`
2021-05-31 17:52:15 +02:00
Tristan B. Kildaire
8c7c4d038c
WIP: Actual struct support
...
Added TODO
2021-05-31 17:51:16 +02:00
Tristan B. Kildaire
fd05ab1ef8
Fixed bug with `parseStruct`, now it doesn't return null
2021-05-04 19:18:30 +02:00
Tristan B. Kildaire
04c902a2c7
Added struct parsing support parseAccessor
2021-05-04 19:17:33 +02:00
Tristan B. Kildaire
5cee963957
Added struct parsing support to `parse` (for top-evel parsing)
2021-05-04 19:13:20 +02:00
Tristan B. Kildaire
931d136d74
Consume the closing curly brace in parseStruct
2021-05-04 19:11:25 +02:00
Tristan B. Kildaire
688fc34969
Added Struct parsing support to paarseBody
...
Added a test to test it (in basic1.t)
2021-05-04 19:10:59 +02:00
Tristan B. Kildaire
ef3891530a
Added SymbolType.STRUCT enum
...
Added support for SymbolType.STRUCT to getSymbolType
2021-05-04 19:08:55 +02:00
Tristan B. Kildaire
8661d2e264
Basic struct parsing added (not done and also not being called anywhere yet)
...
Updated unit test basic1.t to include a struct in it
2021-05-04 19:07:04 +02:00