Commit Graph

110 Commits

Author SHA1 Message Date
Marvin Kaiser
9f68e6b8d1 Added test for recursive calls 2019-12-17 19:09:09 +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
c8bca94ca8 Added tests that check that klang passes parameters to functions in the same way that gcc does it 2019-12-17 16:48:09 +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
d4dfe27bc0 Added error counting to tests. Tests return ERROR_FAILURE when not all test were successful 2019-12-17 16:13:04 +01:00
Marvin Kaiser
086e9dae76 Added possibility to select pretty printing / evaluating via argument 2019-12-17 15:52:06 +01:00
Marvin Kaiser
59664e73b0 Created testsuite and makefile to run testsuite 2019-12-17 15:13:31 +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
dc7dce48d9 add variable deklaration 2019-12-16 22:40:33 +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
9e5046a20a implement new node types according to the new grammar 2019-12-16 21:45:55 +01:00
629f67b39c make expressions nestable 2019-12-16 21:44:37 +01:00
de7625750e remove obsolete visitor 2019-12-16 21:44:01 +01:00
Marvin Kaiser
ecae26c8a7 Fix: offset calculation for function definitions
Fix: Jumps / Labels in if statement
2019-12-02 17:13:11 +01:00
Marvin Kaiser
b7e6567d69 Fixed main function asm code
Fixed: IntegerValues not passed via rax
Fixed: Some values passed via stack, not via rax
2019-11-26 09:14:44 +01:00
2c2696207f output the generated assembler code 2019-11-26 08:08:06 +01:00
7d17accad5 implement assembler code generation 2019-11-26 08:07:43 +01:00
Marvin Kaiser
37e4db94f2 Implemented GetVars Visitor 2019-11-25 15:29:22 +01:00
5d62ef1d30 start implement a asm code generator visitor 2019-11-25 14:45:52 +01:00
fda65c7d93 implement return statement 2019-11-25 14:45:35 +01:00
07ff7b9f06 Implement return statement node 2019-11-25 14:44:41 +01:00
c5dc08c1e0 add return statement to the grammar 2019-11-25 14:44:14 +01:00
d8985bf070 print SCOL after the program's expression, remove whitespace before the OPAR of the funtion definition 2019-11-18 18:57:25 +01:00
2af9f369cf implement variable assignment 2019-11-18 18:54:24 +01:00
b38369b7a5 implemented variables and function call evaluation 2019-11-18 18:02:10 +01:00
Marvin Kaiser
13caee0667 Added function call and function definition 2019-11-18 16:39:12 +01:00
9385618252 print and evaluate the source code 2019-11-12 12:03:59 +01:00
38d34a7cbc implement else if nesting 2019-11-11 22:27:27 +01:00
ea6bde3305 enforce parantheses around the conditional expression of an if statement 2019-11-11 16:22:43 +01:00
0021e4da60 shortened import statements 2019-11-11 16:20:08 +01:00
d97f84e95f use pretty print visitor 2019-11-11 15:50:37 +01:00
9fa61ed1a4 implement pretty print visitor 2019-11-11 15:50:25 +01:00
af363c729f add method for visiting blocks 2019-11-11 15:50:08 +01:00
b473a627b0 add stub for visiting block statement 2019-11-11 15:49:46 +01:00
d5639db187 actually implement the visitor 2019-11-11 15:49:25 +01:00
67670693e8 explicitly set the type of Blocks to null 2019-11-11 15:46:55 +01:00
6dbc1fe4fb implement visitors for block and braced_block 2019-11-11 11:46:05 +01:00
42ae4c88fb require at least one statement in block 2019-11-11 11:40:17 +01:00
16b8efaa8b delete build artifacts 2019-11-11 11:37:58 +01:00
c26cb6ddf5 add context analysis and custom visitors 2019-11-04 17:35:15 +01:00
Marvin Kaiser
d14a7d7cbd Added basic typing structure 2019-11-04 15:41:32 +01:00
Marvin Kaiser
8ad114107a removed unnecessary comment 2019-10-29 10:33:24 +01:00
Marvin Kaiser
dfefee8a71 removed "then" from if statement 2019-10-29 10:32:17 +01:00