Commit Graph
100 Commits
Author SHA1 Message Date
cyclane 7f2870e340 feat: generate assembly from main 2025-02-21 23:35:54 +00:00
cyclane 0391b9deba fix: remove logging from Main 2025-02-21 18:51:50 +00:00
cyclane ab28f0950a fix: main outputs to current dir 2025-02-21 18:46:10 +00:00
cyclaneandBarf-Vader 1c6ea16b6e feat: carrot mark + writer
Merge request lab2425_spring/WACC_37!24

Co-authored-by: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com>
2025-02-21 18:35:06 +00:00
cyclane b2da8c2408 ci: use x86 image for tests 2025-02-21 18:30:33 +00:00
cyclane 42ff9c9e79 test: backend tests 2025-02-21 18:19:23 +00:00
cyclane 39c695b1bb feat: output backend files 2025-02-21 18:19:03 +00:00
cyclane 87691902be feat: set wacc target to x86-64 2025-02-21 18:18:44 +00:00
cyclane eb7387b49c chore: update dependencies parsley-cats and os-lib 2025-02-21 18:18:35 +00:00
2a234f6db8 Assembly ir
Merge request lab2425_spring/WACC_37!23

Co-authored-by: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com>
Co-authored-by: Guy C <gc1523@ic.ac.uk>
2025-02-20 19:02:47 +00:00
cyclane bb090ad431 feat: microwacc type checker implementation
Merge request lab2425_spring/WACC_37!22
2025-02-18 17:29:10 +00:00
cyclane 8991024d5d feat: initial microWacc definition
Merge request lab2425_spring/WACC_37!21
2025-02-18 17:27:12 +00:00
cyclane 27cc25cc0d feat: type-checker returns micro wacc 2025-02-17 15:26:32 +00:00
cyclane b7e442b269 refactor: introduce exit-code guard against InternalError 2025-02-14 00:35:57 +00:00
cyclane 756b42dd72 refactor: remove implicit ast from type checker 2025-02-14 00:35:57 +00:00
cyclane bc25f914ad fix: add uid to microWacc Ident 2025-02-14 00:35:48 +00:00
cyclane 6a6aadbbeb fix: add nulliter to micro wacc 2025-02-14 00:21:10 +00:00
cyclane 03999e00ef fix: add support for println in micro wacc 2025-02-14 00:07:43 +00:00
cyclane d6aa83a2ea fix: add support for return types in micro wacc calls 2025-02-13 23:59:44 +00:00
cyclane e23ef8da48 feat: initial microWacc definition 2025-02-13 23:07:38 +00:00
cyclane 2a4c2bc993 refactor: comment non-trivial code in typeChecker.scala
Merge request lab2425_spring/WACC_37!20
2025-02-07 18:45:50 +00:00
cyclane 84932edb69 refactor: change typo in Unweakenable 2025-02-07 18:43:30 +00:00
cyclane 9da2744cb9 refactor: comment non-trivial code in typeChecker.scala 2025-02-07 18:41:16 +00:00
cyclaneandBarf-Vader 585ba6958a feat: reduce appearances of unknown-type, catch illegal function calls
Merge request lab2425_spring/WACC_37!19

Co-authored-by: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com>
2025-02-07 18:14:33 +00:00
cyclane 5ea3ca5a03 fix: display function type on incorrect number of args 2025-02-07 18:09:18 +00:00
cyclane 4d25d7a730 fix: make int binary operators and char binary operators errors consistent 2025-02-07 18:02:31 +00:00
cyclane 8a7b37e05f fix: check both sides are unknown for assign error message 2025-02-07 17:32:24 +00:00
cyclane b5e72660b7 fix: make free error message more clear 2025-02-07 17:19:16 +00:00
cyclane e87e61b152 feat: explicitly disallow non-assigned direct function calls 2025-02-07 17:16:23 +00:00
cyclane 4631f4370e Revert "fix: catch function call without keyword with parenscheck"
This reverts commit 4bf63454f4.
2025-02-07 17:13:06 +00:00
cyclane 4738207523 refactor: make missing return type message more precise 2025-02-07 16:22:00 +00:00
cyclane d32855cc29 feat: detect pointer operators 2025-02-07 15:42:38 +00:00
cyclane 959c556eae fix: use verifiedExplain for missing return type check 2025-02-07 15:39:50 +00:00
cyclane 0955f19a81 feat: detect function declarations mid-body 2025-02-07 15:39:04 +00:00
cyclane af909b1492 refactor: remove offset property from position
Merge request lab2425_spring/WACC_37!16
2025-02-07 15:07:45 +00:00
cyclane ba5445a4c5 feat: improve semantic errors
Merge request lab2425_spring/WACC_37!15
2025-02-07 15:07:35 +00:00
cyclane 1f2adf4b82 refactor: remove offset property from position 2025-02-07 14:51:05 +00:00
cyclane ba1b7d67c7 fix: return proper type in non-array index error (instead of ?) 2025-02-07 14:32:15 +00:00
cyclane 88ddca2b98 feat: do not include ? type in error messages 2025-02-07 14:24:16 +00:00
cyclane 3430299847 feat: include operator name in type errors 2025-02-07 14:22:36 +00:00
cyclane 319fa606d9 fix: foldLeft when type checking, rather than foldRight which is unintuitive 2025-02-07 14:16:50 +00:00
cyclane 68e4762b37 feat: show expected and got types for TypeMismatch 2025-02-07 14:16:20 +00:00
cyclane c547a2a37f refactor: make functions non-semantic types
Merge request lab2425_spring/WACC_37!13
2025-02-07 14:12:58 +00:00
cyclane 4e10fb3fda refactor: fail on ? snd or fst type-check result 2025-02-07 13:54:35 +00:00
cyclane f143f685c4 refactor: make functions non-semantic types 2025-02-07 13:54:35 +00:00
cyclaneandJonny a635370522 feat: full type checker without user-friendly error messages
Merge request lab2425_spring/WACC_37!11

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-07 08:20:42 +00:00
cyclane 316500484a Merge branch 'master' into type-checker 2025-02-07 00:24:06 +00:00
cyclane bc5f28ab52 fix: disallow unknown type assignments and reads 2025-02-07 00:23:41 +00:00
cyclane 277d2f66af fix: check function calls have correct number of args 2025-02-07 00:09:10 +00:00
cyclane e57c89beec fix: extract retType from KnownType.Func when type-checking function bodies 2025-02-06 23:59:13 +00:00
cyclaneandjt2622 f6e734937f feat: implement satisfies function in type checker
Co-Authored-By: jt2622
2025-02-06 21:04:27 +00:00
4dc07c249a refactor: implemented labelAndExplain(), combining label and explain, and...
Merge request lab2425_spring/WACC_37!9

Co-authored-by: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com>
Co-authored-by: Guy C <gc1523@ic.ac.uk>
2025-02-06 20:30:20 +00:00
cyclaneandjt2622 6548d895d5 feat: type checker without satisfies implemented
Co-Authored-By: jt2622
2025-02-06 20:26:15 +00:00
cyclane 0e2d1af878 refactor: add comments to renamer 2025-02-06 19:55:52 +00:00
cyclane 74f62ea933 fix: fix merge breaks, add function names to scope before renaming bodies 2025-02-06 19:55:52 +00:00
cyclane ae9625b586 fix: use apply() instead of get() for Maps 2025-02-06 19:55:52 +00:00
cyclane 30cf42ee3a fix: separate variable and function in scope 2025-02-06 19:55:52 +00:00
cyclane 3fbb90322f feat: renamer maybe maybe maybe maybe 2025-02-06 19:55:52 +00:00
cyclane e9ed197782 fix: remove unused applyCon from AST 2025-02-06 19:55:52 +00:00
cyclane 6d1c0b7a87 fix: make parser use only parsley parser bridge apply 2025-02-06 19:55:52 +00:00
cyclane 1486296b40 refactor: add position tracking to AST, UnaryOp, BinaryOp 2025-02-06 19:54:16 +00:00
cyclane 2fb520d891 feat: scope checker and renamer
Merge request lab2425_spring/WACC_37!8
2025-02-06 17:02:31 +00:00
cyclane 5210a55d9e refactor: add comments to renamer 2025-02-05 22:03:26 +00:00
cyclane 0f18bca7fd fix: fix merge breaks, add function names to scope before renaming bodies 2025-02-05 20:41:49 +00:00
cyclane 6027bea95e fix: use apply() instead of get() for Maps 2025-02-05 18:12:26 +00:00
cyclane 8c5b85b8c2 fix: separate variable and function in scope 2025-02-05 18:12:26 +00:00
cyclane 06c8a069fb feat: renamer maybe maybe maybe maybe 2025-02-05 18:12:25 +00:00
cyclane 539403fd36 fix: remove unused applyCon from AST 2025-02-05 04:49:05 +00:00
cyclane 5fffd01a6f fix: make parser use only parsley parser bridge apply 2025-02-05 04:47:43 +00:00
cyclane f3a59460ef refactor: add position tracking to AST, UnaryOp, BinaryOp 2025-02-05 02:12:16 +00:00
cyclane 3aae08ffd4 feat: implement CLI for parser 2025-02-02 13:48:54 +00:00
cyclaneandJonny d4b410bca9 feat: implement parser
Merge request lab2425_spring/WACC_37!6

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-02 13:45:25 +00:00
cyclane 1bb4939fcd Merge branch 'master' into parser 2025-02-02 13:41:12 +00:00
cyclaneandJonny feac5efb6a feat: implement abstract syntax tree
Merge request lab2425_spring/WACC_37!4

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-02 13:37:48 +00:00
cyclaneandJonny 41d541050f feat: implement lexer
Merge request lab2425_spring/WACC_37!5

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-02 13:37:36 +00:00
cyclane da4b398bf0 fix: do not allow negation of a positive int literal 2025-02-02 13:30:33 +00:00
cyclane 2588c8287d fix: change lhs of Assign to lvalue 2025-02-02 00:33:16 +00:00
cyclane 03fdbe01d9 fix: put functions "(" within atomic 2025-02-02 00:30:18 +00:00
cyclane b5a1f2565f Revert "fix: add function must return on all paths check"
This reverts commit a71045867a.
2025-02-02 00:27:04 +00:00
cyclane cb9796fa87 feat: show exact statement which must be returning at the end of a function 2025-02-02 00:00:09 +00:00
cyclane a71045867a fix: add function must return on all paths check 2025-02-01 21:22:48 +00:00
cyclane 0db7a30af0 refactor: remove excessive atomics 2025-02-01 21:05:42 +00:00
cyclane a110225c49 Merge branch 'ast' into parser 2025-02-01 20:56:03 +00:00
cyclane 993acddad3 Merge branch 'master' into lexer 2025-02-01 20:55:22 +00:00
cyclane 1d78072c22 feat: use NoneEmptyList from cats to enfroce non-empty statements 2025-02-01 20:39:56 +00:00
cyclane 1643628c60 Merge branch 'master' into ast 2025-02-01 20:37:29 +00:00
cyclane 7320052939 refactor: increase max line length to 100 2025-02-01 20:33:27 +00:00
cyclane f5f6628c89 fix: extract <ident> from <array-elem> 2025-02-01 20:29:04 +00:00
cyclane 5361373c01 refactor: non-recursive statements and array types 2025-02-01 18:10:25 +00:00
cyclane c5b02a00aa feat: initial parser implementation 2025-02-01 17:17:54 +00:00
cyclane cfad2f08f4 refactor: non-recursive statements and array types 2025-02-01 17:15:14 +00:00
cyclane 70aa58b879 fix: disallow exponents, export identifier from lexer 2025-02-01 03:42:02 +00:00
cyclane 4754858094 refactor: allow binPack Strings 2025-02-01 03:42:02 +00:00
cyclane 302fecc91b refactor: remove boilerplate parser 2025-02-01 03:42:02 +00:00
cyclane 4f02d7f2b0 fix: disallow exponents, export identifier from lexer 2025-02-01 02:21:45 +00:00
cyclane bf310b633a refactor: allow binPack Strings 2025-02-01 02:21:31 +00:00
cyclane 24b83c8448 refactor: remove boilerplate parser 2025-02-01 00:58:29 +00:00
cyclane cc97118e76 fix: add explicit Block statement (required for scoping) 2025-01-31 22:03:54 +00:00
cyclane af919742a0 fix: fully fix binary operators associativity 2025-01-31 20:39:45 +00:00
cyclane 292551aca0 refactor: format AST to follow BNF order 2025-01-31 20:01:44 +00:00