Commit Graph

330 Commits

Author SHA1 Message Date
29a63e3771 generate FieldVarAcces back to front instead of front to back 2024-05-12 18:18:14 +02:00
ahmad
7c4ea4b7e2 Implemented the typeCheck in TypedConstructor 2024-05-12 15:54:44 +02:00
ahmad
ede0b38987 Add the list of TypedLocalVariable to TypedMethod and implemented the typeCheck 2024-05-12 15:46:14 +02:00
ahmad
092cbb5af9 Updated the typeCheck of TypedIfElse 2024-05-12 15:45:18 +02:00
ahmad
2322d161e6 Update the typeCheck of TypedBlock 2024-05-12 14:55:03 +02:00
ahmad
3b1161e97a Add recursiveOwnerChain to TypedAssignment 2024-05-12 14:44:17 +02:00
ahmad
8e9ce8caa4 updated the checkType in TypedFieldVarAccess 2024-05-12 14:39:28 +02:00
ahmad
048aff5996 Removed the parameter localvariable in typeCheck 2024-05-12 13:07:39 +02:00
ahmad
827b5551f4 Add TypedLocalVariable and integrate it to Constractur and Methods 2024-05-12 12:45:22 +02:00
ahmad
938e92f679 Removed the TypedField class and use instand of that teh TypedDeclaration 2024-05-12 11:33:15 +02:00
ahmad
a05a4c8744 renamed and refactored 2024-05-12 11:19:31 +02:00
48b41f67f4 remove returnVoid and use return(null) instead 2024-05-12 00:52:56 +02:00
ahmad
5d7f7ef546 Update TypedClass 2024-05-11 21:41:01 +02:00
404Simon
8019e0e9cc Merge remote-tracking branch 'origin/main' 2024-05-11 18:33:34 +02:00
404Simon
4fe433f961 refactor ctx structure 2024-05-11 18:33:06 +02:00
ahmad
d5879e6539 Add typeCheck to newStmt in TypedExpressionHelp 2024-05-11 18:27:55 +02:00
ahmad
ba97c04414 Updated the ClassCanBeTyped 2024-05-11 17:15:14 +02:00
ahmad
6fcf183bc8 Updated the ClassCanBeTyped 2024-05-11 17:07:57 +02:00
ahmad
ecb9abdf6b Add Type to TypedConstructor 2024-05-11 15:16:19 +02:00
ahmad
17601da0a7 Add some TODOS 2024-05-11 15:07:17 +02:00
ahmad
272c25d345 Made the code better to read 2024-05-11 14:37:47 +02:00
ahmad
2448139ba0 Merge remote-tracking branch 'origin/main' 2024-05-11 13:57:11 +02:00
ahmad
17c806c592 Updated the ClasCanBeTyped 2024-05-11 13:54:56 +02:00
ahmad
31d57c8ba9 update the typeCheck of TypedReturn 2024-05-11 13:54:30 +02:00
ahmad
e49691ff29 update the typeCheck of TypedParameter 2024-05-11 13:54:12 +02:00
ahmad
9f4b158237 Put typeCheck to TypedExpressionUtil 2024-05-11 13:53:47 +02:00
ahmad
da4f962281 Update the typeCheck of methods TypedAssignment 2024-05-11 13:53:21 +02:00
ahmad
9e45c65ea3 Update the typeCheck of methods TypedFieldVarAccess 2024-05-11 13:52:55 +02:00
ahmad
5cad5992f2 Added two attributes in TypedClass
and some methods
2024-05-11 13:51:42 +02:00
ahmad
47ecd27fef update TypedBoolLiteral 2024-05-11 11:50:07 +02:00
ahmad
f38670ebd2 put parameter to localvar 2024-05-11 11:49:51 +02:00
ahmad
1b8ed72dff Renamed method name 2024-05-11 11:48:41 +02:00
ahmad
f40318f905 Add Type to TypedBlock 2024-05-11 11:46:26 +02:00
ahmad
34a20668b6 Updated the TypeCheck of TypedAssignement 2024-05-11 11:45:47 +02:00
ahmad
cdbb3ae55f Add parameters to localVar in TypedMethod 2024-05-11 11:45:06 +02:00
ahmad
a8c44dc13b Implemented typeCheck of TypedFieldVarAccess 2024-05-11 11:44:28 +02:00
ahmad
6e2a331a66 Updated TypedField 2024-05-11 11:43:49 +02:00
ahmad
e1a0540a06 Add type to TypedClass 2024-05-11 11:43:27 +02:00
ahmad
c7d756b083 done TODOs for TypedReturn but not all 2024-05-10 19:03:18 +02:00
ahmad
875d0adac4 Added constructor for TypedParameter 2024-05-10 11:11:32 +02:00
ahmad
68b55a4600 Done TODOs for TypedReturn 2024-05-10 11:10:39 +02:00
a911cc10e1 Add empty constructor in parser when none is found 2024-05-10 10:36:23 +02:00
b3fc0c5efd Fix do while 2024-05-10 09:00:47 +02:00
ahmad
e63d7999a2 Done TODOs for TypedDoWhile 2024-05-10 08:33:39 +02:00
ahmad
e9e4f8ccd3 Done TODOs for TypedWhile 2024-05-10 08:31:23 +02:00
ahmad
9b12c843bc correct the condition in TypedBinary 2024-05-10 08:30:30 +02:00
ahmad
a38ea3ad02 added what can be typed 2024-05-09 21:19:58 +02:00
ahmad
5a5b467407 Removed convertToTypedAST methods 2024-05-09 21:14:48 +02:00
ahmad
08658fc8c4 Make the code better to read 2024-05-09 21:11:10 +02:00
ahmad
cb4c637ce4 Change the parameter classes to one class in TypedNode 2024-05-09 19:59:40 +02:00
ahmad
735781a63c renamed the static method 2024-05-09 18:39:44 +02:00
903f9e8d4e Fix ClassCanBeTyped 2024-05-09 17:52:48 +02:00
Ahmad
5f6ca52acb add the override method 2024-05-09 16:17:09 +02:00
Ahmad
054df55da3 handle merge 2024-05-09 16:13:15 +02:00
Ahmad
2b6a5277b5 add a minjava code what can be typed right now 2024-05-09 16:04:51 +02:00
Ahmad
b8f132d9da resolve the error 2024-05-09 16:00:54 +02:00
Ahmad
ba7b23bd34 Implemented typedblock (some statements and expressions) and add some TODOs 2024-05-09 15:59:28 +02:00
Ahmad
f502e58e6e add new class TypedFieldVarAccess and implement required methods of it 2024-05-09 15:56:53 +02:00
Ahmad
a16ee38ce8 update the TypedMethod 2024-05-09 15:56:13 +02:00
Ahmad
85171ce95d add method converToTypedDoWhile to TypedDoWhile class 2024-05-09 15:55:19 +02:00
Ahmad
b5a82f3761 renamed the methods in TypedConstructor and implement the typeCheck of it 2024-05-09 15:54:19 +02:00
Ahmad
8d72f0ff1b correct the implementation of converToTypedAST in typedclass 2024-05-09 15:52:33 +02:00
Ahmad
65dd9152f0 Add a new method to each class in TypedAST package and implement it 2024-05-09 15:51:31 +02:00
Ahmad
37950dee82 Add a help class "TypedExpressionUtil" 2024-05-09 15:45:46 +02:00
Ahmad
f329ad6c59 Added TODOs 2024-05-09 15:43:28 +02:00
404Simon
9246550a3e more codeGen 2024-05-09 13:30:50 +02:00
404Simon
f617061dab Merge remote-tracking branch 'origin/main' 2024-05-09 00:11:20 +02:00
404Simon
60b835d1bb wip localvars 2024-05-09 00:11:04 +02:00
JonathanFleischmann
4d58a4b1f2 wrote tests for ScannerAndParser and more 2024-05-09 00:10:23 +02:00
bbfdbd51dc Ids are gotten explicitly from the IDENTIFIER 2024-05-08 23:57:44 +02:00
dbca4ac327 Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-08 23:54:56 +02:00
379bfe7201 fixed nested IDs showing this. along their name 2024-05-08 23:54:52 +02:00
404Simon
5676fb31de refactor methodcontext 2024-05-08 23:21:09 +02:00
871447b9df Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-08 23:12:17 +02:00
03401434d5 Parser ignores Comments 2024-05-08 23:12:13 +02:00
918acef610 Add Bytecodegenerator for LocalVariable 2024-05-08 22:16:09 +02:00
Ahmad
dea4ba1808 handling merge 2024-05-08 20:54:11 +02:00
Ahmad
b54b2616e0 add initialisation in method 2024-05-08 20:33:58 +02:00
ff04359d25 Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-08 20:33:25 +02:00
a3adb5d62d added returnVoid back in 2024-05-08 20:33:20 +02:00
Ahmad
db646c3399 Implemented the statements in TypedBlock 2024-05-08 20:26:09 +02:00
Ahmad
622a0951f3 Updated the method converToTypedAST 2024-05-08 16:30:52 +02:00
Ahmad
81d1cf6ca8 fix error 2024-05-08 16:06:20 +02:00
Ahmad
bfcbb4dc2d Updated convertToTypedAST of TypedConstructor 2024-05-08 16:05:32 +02:00
Ahmad
cdfb914816 Handling marge 2024-05-08 15:55:17 +02:00
Ahmad
9d35956735 Add initialisition 2024-05-08 15:51:56 +02:00
JonathanFleischmann
4b071ea149 empty class now working 2024-05-08 15:51:25 +02:00
JonathanFleischmann
8c1ae8712e Merge branch 'refs/heads/main' into testsuites 2024-05-08 15:35:08 +02:00
JonathanFleischmann
48e0ebf521 adapted abstract syntax test files to new ast 2024-05-08 15:34:50 +02:00
Ahmad
b0fea68f05 Handling Merge 2024-05-08 15:19:03 +02:00
Ahmad
4a5aba765d Handling Merge 2024-05-08 15:13:38 +02:00
d95ffb4cfc new generators 2024-05-08 15:05:35 +02:00
Ahmad
45f834722b Implementation for testing 2024-05-08 15:05:04 +02:00
4c34a8db44 removed ast.Type in favor of typedast.Type 2024-05-08 15:00:46 +02:00
5d44fc661f removed main method from ast, constructors are always public 2024-05-08 14:53:01 +02:00
300b4a5e9b Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-08 14:27:57 +02:00
0ac708c8ae changes to AST: id is gone, Declaration is one thing, renaming. only one Type 2024-05-08 14:27:51 +02:00
JonathanFleischmann
587d95f546 adapted abstract syntax test files to new ast 2024-05-08 14:10:48 +02:00
0163f5c0b6 fixed compile error 2024-05-08 11:47:56 +02:00
13043a196e merged changes 2024-05-08 11:46:18 +02:00
f816e5c391 left part of an assignement can be a FieldId 2024-05-08 11:44:15 +02:00
Ahmad
6e62b0c21c Handling Merge 2024-05-08 11:30:57 +02:00
Ahmad
a2efa0fa58 fix error 2024-05-08 11:29:43 +02:00
e25aa61834 Merge remote-tracking branch 'origin/main' 2024-05-08 11:29:11 +02:00
8d58ac0a08 Fix numbers in variable names 2024-05-08 11:28:52 +02:00
JonathanFleischmann
f21db82d4c Merge remote-tracking branch 'origin/main' 2024-05-08 11:28:25 +02:00
Ahmad
3ca5a1a6be Handling Merge of Joni 2024-05-08 11:28:06 +02:00
JonathanFleischmann
ce711b3a27 implemented new methods in Compiler 2024-05-08 11:27:54 +02:00
Ahmad
591dee0d48 Deleted TypedId class not required in typedastg 2024-05-08 11:24:34 +02:00
d35aadf36c Add Exception Messages 2024-05-08 11:16:29 +02:00
JonathanFleischmann
388fddd466 Merge branch 'refs/heads/main' into testsuites 2024-05-08 11:12:16 +02:00
JonathanFleischmann
9730455b50 adapted testfiles to new ast and commented code with issues out 2024-05-08 11:11:51 +02:00
7d1b7bc5b0 fixed compilation errors 2024-05-08 11:05:27 +02:00
c3cd7a7015 merged type changes and assign changes 2024-05-08 11:03:26 +02:00
Ahmad
6c1030f888 fixed the error in TypedAssignment 2024-05-08 11:01:44 +02:00
Ahmad
70d933a398 Handling Merge 2024-05-08 10:59:51 +02:00
ea05590c5a solved synthetic shugar of += in parser 2024-05-08 10:52:05 +02:00
Ahmad
201d6e03b9 Added the implementationf of typeCheck in typedAssignment 2024-05-08 10:51:58 +02:00
404Simon
98d899e026 seperate classfile generation from codegen 2024-05-08 10:49:41 +02:00
404Simon
debbea7736 Merge remote-tracking branch 'origin/main' 2024-05-08 10:41:24 +02:00
404Simon
dbbb181ba5 add prerequisites for method block codegen 2024-05-08 10:41:01 +02:00
6f6edbd4b3 generated new Visitor 2024-05-08 10:14:49 +02:00
258819d70f Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-08 10:08:52 +02:00
f97f3a3b3a remove continue 2024-05-08 10:08:29 +02:00
25d539cf49 no programm, forced public in classes and method 2024-05-08 10:08:28 +02:00
404Simon
b61af71076 rename interfaces in typed ast to Typed$(oldName) 2024-05-07 23:41:30 +02:00
404Simon
e915f1817d refactor and alter example 2024-05-07 22:02:47 +02:00
404Simon
a7eedbe98d generate code for fields and constructor (without block tho) 2024-05-07 21:44:13 +02:00
a2fc1686b1 Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-07 20:30:11 +02:00
ee0a465c84 assign has it's own rule 2024-05-07 20:30:03 +02:00
JonathanFleischmann
7d298069cb Merge branch 'refs/heads/main' into testsuites 2024-05-07 20:28:15 +02:00
JonathanFleischmann
509fb6213e fixed small error in abstract Syntax for testfiles 2024-05-07 20:28:00 +02:00
ahmad
32de224ac8 Updated the typedast 2024-05-07 18:52:39 +02:00
JonathanFleischmann
4ef3e6ff11 fixed small error in abstract Syntax for testfiles 2024-05-07 18:22:16 +02:00
JonathanFleischmann
40b17bf2b8 wrote abstract Syntax for testfiles 2024-05-07 18:15:31 +02:00
JonathanFleischmann
272af9690b wrote more Testfiles and created files for abstract syntax 2024-05-07 15:46:30 +02:00
JonathanFleischmann
713a37cc1c wrote more Testfiles and created files for abstract syntax 2024-05-07 15:46:30 +02:00
706e6ee872 changed For to explicitly have an assignement in first and last place 2024-05-07 15:45:46 +02:00
1f0d690043 fix mainmethod potentially empty 2024-05-07 14:51:34 +02:00
f6d546be86 added Object Type with attatched ID to Type and ReturnType 2024-05-07 14:34:52 +02:00
1ff02f86e8 generator formatting 2024-05-07 13:02:52 +02:00
535c712421 minor generator changes 2024-05-07 13:01:28 +02:00
c2ce7ff80f update Generators 2024-05-07 11:32:03 +02:00
ahmad
f87b014584 Added some Implementation of convertToTypedAST 2024-05-05 20:55:49 +02:00
ahmad
cabadd7594 Changed the Name of classes 2024-05-04 17:19:04 +02:00
ahmad
f129277236 Implemented the methods typeCheck for each class in package typedclass 2024-05-04 16:57:27 +02:00
ahmad
48fc1dd7b4 Build the typed ast 2024-05-04 10:49:26 +02:00
404Simon
4646a4d8d1 refactor conversion 2024-05-02 15:47:04 +02:00
404Simon
0aa5976bc1 add bases for conversions 2024-05-02 15:40:25 +02:00
Ahmad
b022244498 Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-02 15:07:14 +02:00
Ahmad
515f91129f Adding Package for typedAST 2024-05-02 15:06:44 +02:00
15efb07f9e fix missing implementations in records 2024-05-02 14:55:11 +02:00
f544d27250 update records 2024-05-02 14:41:30 +02:00
658083d615 update records 2024-05-02 14:39:26 +02:00
73def2733a update records 2024-05-02 14:38:07 +02:00
b1148d5f0c added unary operations to ast 2024-05-02 13:57:09 +02:00
1a73384825 Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-05-02 13:56:28 +02:00
8cc109275a added unary operations to ast 2024-05-02 13:56:20 +02:00
2b10b883a6 wip update records 2024-05-02 13:42:30 +02:00
70ae37d4c9 wip update records 2024-05-02 13:40:34 +02:00
24c3a26136 in order to avoid package stuff, moved intefaces to records 2024-05-02 13:39:01 +02:00
e14af08678 made interfaces sealed 2024-05-02 13:37:18 +02:00
9738fee630 Updated grammar 2024-05-02 13:29:00 +02:00
eea1af45a4 Update grammar 2024-05-02 11:11:23 +02:00
a1cc591220 Update grammar 2024-05-01 12:06:14 +02:00
87766d28c0 Remove unnecessary record 2024-05-01 11:09:55 +02:00
63246b815a Add missing visit functions 2024-05-01 10:49:06 +02:00
12623821f7 Generate Antlr and add Generators 2024-04-30 19:24:49 +02:00
deeea62737 public static void main string args 2024-04-24 22:02:26 +02:00
d9182e369d Fix records and Decaf 2024-04-24 21:56:50 +02:00
9566823ad1 surrounded Charliteral with '' 2024-04-24 18:36:06 +02:00
778611c125 added For 2024-04-24 17:26:42 +02:00
7e8f72d51f added new and charConstant 2024-04-24 17:24:26 +02:00
5bd8c12568 fixed imports on records, added Enums and Interfaces 2024-04-24 16:38:30 +02:00
55a15e8bda Andis ast records 2024-04-24 15:51:54 +02:00
efd6353517 Merge branch 'main' of https://github.com/JonathanFleischmann/CompilerULTIMATE 2024-04-24 15:36:14 +02:00
04f571a678 add Decaf.g4 2024-04-24 15:36:08 +02:00
JonathanFleischmann
65b4993e91
Update and rename test.java to Test.java 2024-04-24 15:35:53 +02:00
JonathanFleischmann
1a0a05a907 wrote testfiles 2024-04-24 15:33:21 +02:00
404Simon
d421652e0a add empty java project 2024-04-24 14:58:17 +02:00