Commit Graph

134 Commits

Author SHA1 Message Date
f3c5bac860 check whether the types of the operants of an equality expression can combine instead of enforcing them to both be integers 2020-02-03 23:45:52 +01:00
e8f80eb2f9 make file pretty 2020-02-03 22:59:17 +01:00
018ce8712a add error message prefix to type missmatch errors, staticly assign bool type to boolean expressions 2020-02-03 22:56:40 +01:00
6f0a3754bd check whether the body of a function guarantees a return value and throw an exception if not 2020-02-03 22:36:24 +01:00
7c56f401ac add error prefix to the runtime exception message 2020-02-03 22:28:37 +01:00
02fb7b7cc2 unify error message appearance 2020-02-03 22:28:21 +01:00
3a89ab2231 remove error handling, since these kinds of errors are caught by our context analysis 2020-02-03 22:24:27 +01:00
3e8a904cb8 catch error to abort further processing 2020-02-03 22:21:30 +01:00
cb0d63a71c save the line and column of the corresponding token, generate an error prefix for every thrown error 2020-02-03 22:20:59 +01:00
12c1f75602 add fields to save the line and column in which the token corresponding to the node was found 2020-02-03 22:20:25 +01:00
33cbae0eeb implement method to generate an error prefix that mentions the line and column the error occured in 2020-02-03 22:19:36 +01:00
Dennis Kaiser
5ed294965c Merge branch '22-operatorenprazedenz' into 'master'
Resolve "Operatorenpräzedenz"

Closes #22

See merge request mkais001/klang!8
2020-02-03 22:10:42 +01:00
Marvin Kaiser
69f44a2867 Added possibility to pass filenames for input / output 2020-02-03 17:16:27 +01:00
Marvin Kaiser
34253a70ba Implement operator precedence with and without parenthesis 2020-02-03 16:35:29 +01:00
3fb30ebd7e print statement never has a type 2020-01-27 17:02:21 +01:00
fa8904e0f5 fix type annotation for comparison expressions 2020-01-27 16:57:09 +01:00
Marvin Kaiser
86468ea740 Fix correct type name access 2020-01-27 16:47:16 +01:00
Marvin Kaiser
b1be18f367 Fix function type addition for if statement 2020-01-27 16:47:00 +01:00
Marvin Kaiser
db7331911a Added functionality to analyze AST for all defined functions 2020-01-27 16:04:38 +01:00
0aed4ee893 my initial short for typechecking, still very unifinished tho 2020-01-21 00:21:54 +01:00
295bcaec8a implement visitors for boolean expressions 2020-01-20 19:32:50 +01:00
722a9babcb remove unused import 2020-01-20 19:32:16 +01:00
Marvin Kaiser
d27df13ec1 added boolean operators 2020-01-20 16:01:25 +01:00
1186bb4550 add bool literal 2020-01-20 15:26:55 +01:00
Marvin Kaiser
34d0e1bb0e Added cli argument to either generate main method or not 2020-01-14 18:37:34 +01:00
Marvin Kaiser
be43cc9a77 implement for loops 2020-01-14 11:04:31 +01:00
Marvin Kaiser
1980e1ba8c Move the SCOL for var_assigns and var_decl to the statement rule 2020-01-14 10:39:46 +01:00
Marvin Kaiser
f6818b6983 fix syntax issues 2020-01-14 10:23:12 +01:00
Marvin Kaiser
586c2bb5d9 renamed whileLoop to WhileLoop 2020-01-14 08:50:45 +01:00
Marvin Kaiser
5eb0679bf3 Renamed doWhileLoop to DoWhileLoop 2020-01-14 08:48:51 +01:00
Marvin Kaiser
e52ad061f9 Implemented do while loops 2020-01-13 16:43:38 +01:00
Marvin Kaiser
bd4ae1d605 Added while loop 2020-01-13 16:08:44 +01:00
Marvin Kaiser
079cdf4969 Implemented != expression 2019-12-20 09:09:01 +01:00
Marvin Kaiser
a79b7c9362 Implemented boolean expressions 2019-12-20 09:01:03 +01:00
Marvin Kaiser
f341401ccc Implemented pretty printing and evaluating of boolean expressions 2019-12-20 08:42:20 +01:00
Marvin Kaiser
00145848da Added classes for boolean expressions 2019-12-20 08:41:05 +01:00
d1f8a18bef add missing visit of lhs in a modulo expresion 2019-12-19 14:47:26 +01:00
Marvin Kaiser
3f2987074d Fix: Variable Declaration with initialization not correctly pretty printed 2019-12-18 10:37:05 +01:00
Marvin Kaiser
08f486203b Fix: Arguments that don't fit into registeres are passed in the incorrect order 2019-12-17 17:22:44 +01:00
Marvin Kaiser
5745062704 Fix: Subtraction tests not working. Was: incorrect order of expression evaluation 2019-12-17 16:53:20 +01:00
Marvin Kaiser
d3847682d6 Fix: Offset calculation for stack parameters 2019-12-17 16:45:54 +01:00
Marvin Kaiser
e71ccf1cdc Fix: Additional parameters not pushed onto stack 2019-12-17 16:45:32 +01:00
Marvin Kaiser
086e9dae76 Added possibility to select pretty printing / evaluating via argument 2019-12-17 15:52:06 +01:00
Marvin Kaiser
aaf1c3195d if statement asm generation now omits else labels if no else was defined 2019-12-17 15:12:36 +01:00
Marvin Kaiser
bf50587cdb Comment out syso's that print something that's not assembly code 2019-12-17 15:10:37 +01:00
1c686fb0ea Implement variable declaration 2019-12-16 22:41:58 +01:00
ee19cb9a00 create VariableDeclaration nodes and check if a variable is redeclared or undefined 2019-12-16 22:41:45 +01:00
b9b36f7ba1 Add new node for the variable declaration 2019-12-16 22:41:12 +01:00
63c5f70358 add new node types to the visitors 2019-12-16 21:46:43 +01:00
e1eb64f576 use new node types, implement new visitors 2019-12-16 21:46:18 +01:00