Hello, I did a little bit of work on a simple CSE demo last night. All that's left to do is the actual CSE/code generation ;) Right now I've got the grammar ...
Hello, I've attached a yacc grammar for a simple expression parser which emits code with CSE. It builds a DAG using n-ary trees (with pointers, not the cell...
... I would like to take this moment to introduce myself (to those who were not part of dynarec.com's mailing list - or those that missed the three posts I...
... description on ... along ... I run another list for a historical project to recover lost software written in the early days of my old University,...
Sorry for the late reply, I wanted to compile and try your code first. Input: a = 3; b = a; c = d = e = 2 * 3; 1 + 2 * 3 / a; Code: a = 3 b = a T0 = 2 * 3 e =...
... Not only that, but it should also work in those situations where a variable is modified: a = c * d; b = c * d; c = 2; e = c * d; c*d is only a common...
... I'm writing a simple C compiler (a subset of the language, actually.) Currently, the lexer is pretty much complete and I'm now working on the yacc grammar....
... Grrr. Yahoo stores it properly and it even looks OK when you look at it in the moderators window or the preview window, but when you read it in the group...
... Yeah, and I just realized that my alternate example also relies on spacing ;) I'll try to stick to a LISP-like form when posting this kind of stuff to make...
... were ... three ... So what choices have you already made, Evan? Have you decided which language you're going to compile? How much of it to implement?...
... Yeah - maybe I forgot to mention a few things. ... I am currently thinking a small subset of C at this stage. I am going to scrap what I started (absolute...
... How does Imp77 compare to C? C as a language doesn't actually define any I/O constructs and can be viewed as a language which does nothing more than...
... If you know some other processor architecture well, perhaps you could generate code for it? X86 is definitely the most useful if you're running an X86...
... .NET and the java bytecode would both give you portability, though going to a real machine might be more fun, in the sense that you get real-machine...
Hi, My name is Marcelo, I'm from Brazil, and I'm currently working on 2 projects: one of them is a game, the other one is a compiler. I'd like to know where I...
I'll move this over here... ... I kind of slipped that under the door but I'd been meaning to talk to you about this anyway... It occurred to me, after playing...
... Well, it's roughly at the same level; it would be just as easy to convert from C to Imp as from Imp to C; it's a closer mapping than say Pascal to C. ... ...
... Welcome Marcelo! That's a perfectly on-topic question, although personally I can't recommend any specific document on parsing as being definitely worth a...
... I didn't actually explain how to do this the 'non-naive' way... It's pretty simple actually; there are two obvious ways - they're equivalent I guess: ...
In Bart's code to do CSE, we haven't yet considered the ramifications of calling functions with side-effects (actually not just functions - memory-mapped...
... I'll have to ask this question: How much do you want to learn? Do you want to spend time writing parsers that won't be used in your project (for practice...
Hello, I've added constant folding to the CSE demo as well as source reordering (which reorders the sources to + and * operators according to a fixed set of...
... It does sound interesting, but I'd like to forge on with my normal compiler because I'd really like to get something working that can generate machine ...
... addition. It ... it ... down the tree. ... redundant ... output ... Whoa there! Doing anything "multiple times until nothing can be done further" in...
... No, that's not what I meant. Constant folding is performed in one walk of the tree. static void FoldConstants(DAG **pnode) { DAG *new, *node; int i,...
... Actually, if I assigned temporary variables to nodes as they were generated (MakeNode()), I could do the reordering automatically based on only a few ...
... out, but ... generated ... only a few ... with higher ... higher temp. var ... Yep, that's what I wasted 200 lines trying to say :-) Here's another one: ...
... generated ... only a few ... higher temp. var By assigning a temp you're effectively just numbering the node. The temp doesn't have to actually be used as...
... What happens when something is reassigned and what was once a common sub-expression no longer can be considered one? Would you have to take a new node from...