summaryrefslogtreecommitdiff
path: root/miniany/REQUIREMENTS
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2021-09-29 20:32:00 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2021-09-29 20:32:00 +0200
commit01ee6d3e1de75a1aa08afd06f4dafe49d099e77e (patch)
treee10eccb9076dfb5b4e7f4a94899496e916288625 /miniany/REQUIREMENTS
parentc2bc809ca97bdebc8c70dd58a1c282c475a88557 (diff)
downloadcompilertests-01ee6d3e1de75a1aa08afd06f4dafe49d099e77e.tar.gz
compilertests-01ee6d3e1de75a1aa08afd06f4dafe49d099e77e.tar.bz2
cc: work on a working if
Diffstat (limited to 'miniany/REQUIREMENTS')
-rw-r--r--miniany/REQUIREMENTS13
1 files changed, 11 insertions, 2 deletions
diff --git a/miniany/REQUIREMENTS b/miniany/REQUIREMENTS
index dd10d7e..cbee3f2 100644
--- a/miniany/REQUIREMENTS
+++ b/miniany/REQUIREMENTS
@@ -38,7 +38,7 @@ not implementing:
- ASTs are basically only useful when you start to optimize,
till then you can use an intermediate format (as C4) does
and a stack machine. They also make the code easier readable.
- For use they fore the introduction of pointers, references and structs.
+ For use they force the introduction of pointers, references and structs.
In expression parsing we see, that const folding already needs
an AST, because we should not emit code when still reading
a constant expression. It also seperates syntactical stuff like '['
@@ -117,5 +117,14 @@ TODO:
Inline assembly in the generated code duplicates code with the putint in libc-freestanding.
- error output is not on stderr, well, are we going to add stdout, stderr now
or do we write errors as sort of assembly comments?
-
+- AST debate:
+ - expressions really require an AST (just the A_ASSIGN itself with its reversed
+ order). IF, WHILE, etc. not, they can be in an AST or be endcoded directly (or if
+ not, what kind of optimizations do we loose?)
+ - the context of a boolean expression can be an if (in this case we would generate
+ direcly the jnXX instruction) and the far less often seen case of assigning it to
+ a variable. Knowing the contest would require an AST.
+ - AST should not be the output of whole programs, scoping is maybe better
+- don't allow non-blocked if/else, just avoid dangling else problems
+