... Wrong assumption: I mean real optimizations like loop unrolling and vectorization. ... And what will you do when you run out of registers because you have...
Hi folks; I've been sitting this one out because I wanted to see what arguments our new poster had and because I was already somewhat ambivalent about the...
I have tried to find some examples of how people have implemented their stack in their virtual machines and unfortunately have not come across many examples...
... Don't take any of this as gospel, I'm just thinking aloud here... 1: are there ever any circumstances when you *don't* know the type/size of all the...
... I'd generally agree with what Graham said: In most traditional languages you'll know what size your types are, so you can just push that many bytes on the...
... Since you said that you were making a "very basic compiler" I incorrectly assumed that a "very basic compiler" wasn't about to target the top 10% of the...
By the way, could you supply a working email address please? I was mailing you to say I'd taken you off moderation so that you could post without delays, when...
... We've been pretty quiet here lately, and our web site suffered some lost files when I had a disc crash without a proper backup, but let me bring you up to...
... Well 4700 lines is not that short. http://www0.us.ioccc.org/2001/bellard.c No it does not use AST :) This is by the same guy who brought us tcc. Laurent...
I have a question regarding AST's and their common construction as binary trees. The binary tree format makes perfect sense to me in expressions. The binary...
... I use a different internal way of handling language constructs and expressions, and that works. But if you ask someone else they will tell you that you...
... One good reason is that sometimes the compiler is processing the output of another tool. That tool can be more simple minded than a real programmer. -Rich...
... Another thing that's very easy is constant folding. You can just do that recursively by asking each node to simplify itself. This allows developers to...
... If your think of a single linked list it is not at all different from a binary tree. Let's assume that statements are right associative. For a sequence of...
Kai Schütz
schuetz.kai@...
Jan 28, 2007 12:32 pm
766
... On Unix, add: #include <string.h> #include <stdlib.h> and then run cc -o tcc bellard.c -ld Looks like it was written some time ago in the days of less...
... or for consistency, this? / \ stmnt1 / \ stmnt2 / \ stmnt3 / \ stmnt4 NIL ... Actually you end up with two data structures, one for expressions and ...
Here is a simple parser and code generator for a subset of the C language. An AST represented as a binary tree is utilized: // parsing functions typedef enum...
... The example I used in a previous message produces the following binary tree: / \ NIL / \ stmt4 / \ stmt3 / \ stmt2 / \ NIL stmt1 This tree is built...
... If you have the time, how would the example I posted be written in LISP? I've always had a fascination with LISP, and was wondering how that would look....
Answering part of my own question, what would parsing code for the following look like: / \ stmt1 / \ stmt2 / \ stmt3 / \ stmt4 EMPTY I think either...
... This is sometimes handled by creating a hole in your <syntax tree, AST, expression tree, whatever> for the rhs, and plugging in the value later, probably...
... I'm not exactly sure what you mean. But, I want to parse the entire program, building an AST, and once it is built for the entire program, generate code...
... Right, that was the first option. What I meant by the other one is that you parse one (simpler) statement at a time, eg "if (cond) then {" is a statement,...
... My compiler (a tiny Pascal subset - but it (the Pascal version) can compile itself :-) ) just generates code on the fly. I want to use an AST (in the C...
Folks, just realized some here may be interested in some more blog postings on my findings about ancilliary areas of writing a compiler/ creating a new...
Hi, I'm wondering how I'd best implement exceptions in my compiler (compiles to x86 machine code for 32-bit, in case that matters). It's kind of hard to...