Commit Graph

327 Commits (1ddd7f102bb50eb4ffe24f81b6b35f66ab96584a)

Author SHA1 Message Date
Tristan B. Kildaire 74fb188d82 Now all containers set their children Statements to be parented to them (container a reference to them) 2021-03-29 22:20:47 +02:00
Tristan B. Kildaire afcf1609b6 Added `parenTo(Statement)` to `Statement` which will allow us to link stuff toghether in containers 2021-03-29 21:48:59 +02:00
Tristan B. Kildaire adc9457a0f WIP: Name resoltuion 2021-03-29 21:47:30 +02:00
Tristan B. Kildaire 0433bccc00 Duplicate variable detection works 2021-03-29 21:26:16 +02:00
Tristan B. Kildaire 9c829302a5 WIP 2021-03-29 21:06:37 +02:00
Tristan B. Kildaire 2cf88b01be WIP: Might need to attach parnt to have linked list linked stuff up, for scope and stuff 2021-03-29 21:06:30 +02:00
Tristan B. V. Kildaire 6edd787588 Fixed `getAllOf` 2021-03-29 19:13:39 +02:00
Tristan B. V. Kildaire 38ef3a49c1 Added support for unary operators
Currently any math operator is allowed in unary form, of course this must be changed

Updated test cases to test this
2021-03-29 17:31:17 +02:00
Tristan B. V. Kildaire 50e84ec06e Fixed bug for `()` parsing 2021-03-29 14:48:47 +02:00
Tristan B. V. Kildaire fc6b28fcca WIP: Expression parsing and data strucure generation 2021-03-29 14:35:52 +02:00
Tristan B. V. Kildaire 61aaa84daf Fixed parsing of dot-path identifiers
Updated test case
2021-03-29 13:48:32 +02:00
Tristan B. V. Kildaire e469cc3ec3 Added functions to lexer to aid in dot-identifier parsing
Made isPathIdentifier public

Updated test case
2021-03-29 13:44:09 +02:00
Tristan B. V. Kildaire e003a9879f Removd testing stuff 2021-03-29 13:34:30 +02:00
Tristan B. V. Kildaire 1883a91e86 Fixed unit tests 2021-03-28 22:41:04 +02:00
Tristan B. V. Kildaire 66ca7e5e5b Updated test case 2021-03-28 22:40:35 +02:00
Tristan B. V. Kildaire 7296bea22a Updated test case 2021-03-28 22:37:35 +02:00
Tristan B. V. Kildaire e8915d7525 Fixed bug for name checking for function parameters 2021-03-28 22:32:44 +02:00
Tristan B. V. Kildaire 165d08f411 Removed debug panic 2021-03-28 22:29:52 +02:00
Tristan B. V. Kildaire c53397fa0d Fixed class name check in class definition 2021-03-28 22:29:33 +02:00
Tristan B. V. Kildaire 6a19e1c430 Fixed bug that made identifier checks not work 2021-03-28 22:27:09 +02:00
Tristan B. V. Kildaire b465d7e5b7 Fixed function calls 2021-03-28 22:05:58 +02:00
Tristan B. V. Kildaire 733bf117c0 Using `parseName` now for whenever a name appears, this is for function calls (not in expressions), typed declarations
We are not gonna do f(x)*f(g); Like no, only a function per statement. So we need not implement expression statements.

Name parsing is done seperately for parseExpression

Also added null check for Function.getVariables, as function calls don't yet get added and add 0 ptrs
2021-03-28 21:54:38 +02:00
Tristan B. V. Kildaire 467bdb6ff9 Added two functions which will be used for checking if we get an identifier that ia valid for being a path identifier and also one for normal identifiers. 2021-03-28 20:11:54 +02:00
Tristan B. V. Kildaire f92277e9e6 Removed IDENTIFIER 2021-03-28 20:07:44 +02:00
Tristan B. V. Kildaire 64d4a5a001 Updated parser test cases to fail on lexeing failure 2021-03-28 20:04:27 +02:00
Tristan B. V. Kildaire 40322e79f4 Fixed comment 2021-03-28 19:59:54 +02:00
Tristan B. V. Kildaire 20c9270739 Fixed bug in `isPathIdentifier` 2021-03-28 19:59:23 +02:00
Tristan B. V. Kildaire 25bfdfc24e Moved `isCharacterNumber` to utils.d 2021-03-28 19:49:37 +02:00
Tristan B. V. Kildaire 9c72756336 Added support for lexing `a.a`
Moved `isAlpha` to utils.d

Return false on lexing failures, true otherwise

Abort compilation and lexing failures
2021-03-28 19:48:07 +02:00
Tristan B. V. Kildaire 1abbf31f56 WIP: Support for `x.x.x` ideas 2021-03-28 12:11:13 +02:00
Tristan B. V. Kildaire 1af072de8c Added some more things 2021-03-27 15:27:14 +02:00
Tristan B. Kildaire 5761a454a8 Added name resolver
Sub-typed Clazz to Container

Updated test case
2021-03-24 23:19:40 +02:00
Tristan B. Kildaire 31fe91d947 Added statement from parseAccessor call 2021-03-24 23:17:58 +02:00
Tristan B. Kildaire e663a0792b In `parseBody()` after calling `parseClass` add the statement generated 2021-03-24 21:50:06 +02:00
Tristan B. Kildaire 4b9ca7588f TypedEntity now houses `type` field for use by Function as returnType and for use by Variable for `type` 2021-03-23 21:46:27 +02:00
Tristan B. Kildaire 5c8e30f1f5 Run type checker system
WIP: Resolution of names

Reworked type hierachy for Enity in relation to Function, Variable and Class

Updated test case
2021-03-23 21:35:13 +02:00
Tristan B. Kildaire 69afebbe04 Add parameters to function 2021-03-22 11:18:56 +02:00
Tristan B. V. Kildaire c02791d748 Return Entity with correct AccessorType set 2021-03-21 22:51:42 +02:00
Tristan B. V. Kildaire 293399722c WIP Accessor types 2021-03-21 22:26:48 +02:00
Tristan B. V. Kildaire f4550a77fc Return Statement from `parseAccessor()` 2021-03-21 22:01:54 +02:00
Tristan B. V. Kildaire b04060af80 Added getAllOf(Type) function 2021-03-21 22:01:38 +02:00
Tristan B. V. Kildaire f1d1f7d610 Wrong input type fixed in TypeChecker, now all functions, globals and class definitions can br printed out 2021-03-21 22:01:28 +02:00
Tristan B. V. Kildaire 779a76acb6 Implemented `getGlobals()` for Program which will return all Variable objects representing variables defined globally 2021-03-21 21:44:22 +02:00
Tristan B. V. Kildaire 87f7f458c8 Call type checker 2021-03-21 21:43:05 +02:00
Tristan B. V. Kildaire 3165f46416 Added type checker 2021-03-21 21:43:01 +02:00
Tristan B. V. Kildaire db4dd757eb Null was there because of bug, that should never happen though so I want to unmask any future bugs. 2021-03-21 21:42:53 +02:00
Tristan B. V. Kildaire a979d560c3 WIP: Symbol table additions 2021-03-21 17:57:56 +02:00
Tristan B. Kildaire 855be6f8f0 We will rather return Variable and modify in `parseAccessor`. And if not then we set to default 2021-03-21 15:56:51 +02:00
Tristan B. V. Kildaire bc2f92a9f0 Fixed unit tests 2021-03-21 14:27:31 +02:00
Tristan B. V. Kildaire 91e326d517 Added some temporary (going to change them later) unit tests for the parser 2021-03-21 14:23:18 +02:00