I thought y'all might be interested in this. Fabrice Bellard has released an unobfuscated version of his obfuscated Tiny-C compiler (OTCC). In only 930 lines...
... Very interesting. Thanks for the link. ===== Rick Clark http://home.grandecom.net/~rickclark58/ __________________________________ Do you Yahoo!? Y!...
I found another 'intro to compilers' type book online. Caveat - the code generation section is extremely brief, which is a shame because that's the most...
http://not.meko.dk/Hacks/Alvilda/The%20Alvilda%20Optimizing%20Compiler.html I found this page a couple of years ago but there was no source. The author has now...
Hello, group I wrote a compiler for a small subset of C the other day. It can deal with things like shortcut operators, coercing the result of a logical...
Hi, I have to implement a lexical analyzer for the C language...I however am running into some problems.. ;-< Firstly It is whether i should have a TOKEN for...
... Personal opinion (e.g., I can't prove it either way): I prefer the former - unique tokens. It seems simplest to me, but I've never written a full c...
... Are you saying that an ad hoc scanner *isn't* a DFA? :-) ... Another potential problem is how to interpret, say, +++. Does a+++b mean (a++)+b or a+(++b)? ...
Rainer Thonnes
rainer@...
Sep 13, 2004 2:55 pm
338
... It is certainly possible that I don't know a DFA from a NFA from FSA. I got them confused in college, and I still do now. I was under the impression that...
... DFAs and NFAs are both FSAs (OK, I know it's incorrect to use an 's' to denote plurals here, as the word is "automata"). The D and N stand for...
Rainer Thonnes
rainer@...
Sep 17, 2004 12:24 pm
340
... I have written a translator for my AtomVM that uses a basic/c like syntax. It is quite "ad-hoc", almost simplistic in fact, yet seems to work very well, it...
... I have for some years had an inkling that it might be possible to use a single state machine for both grammar and tokenisation. We've talked before about...
... Does this recursive expression evaluator deal with precedence of operators? In other words, does it evaluate A+B*C as A+(B*C) or as (A+B)*C? If the...
Rainer Thonnes
rainer@...
Sep 18, 2004 11:15 am
343
... Yes, it uses the standard operator precedence found in most languages. Parenthesis are also supported. ===== Rick Clark ...
... Rick, if you're interested in making this a little more mainstream: Most other C-like languages that have something like this use "$" instead. This will...
... First of all, I'd like to say "hi". I just stumbled onto this list. I read some of the previous posts and it looks as if you have been discussing some...
I'm in the process of developing a stack machine runtime environment and have a few implementation questions. First, is there any recommended layout design for...
Chris Cranford
chris.cranford@...
Sep 19, 2004 2:21 pm
347
Hi Chris, I have a couple of questions and observations. See below. ... Do you really want to differentiate addresses? By that I mean: Do you want things in...
Hi Richard, ... others ... They don't have to be. The goal however is to make the code generation process easy and to keep the address calculations easy when...
Chris Cranford
chris.cranford@...
Sep 20, 2004 12:04 am
349
Hi Chris, (Comments below) ... [snip] ... I would have: PC - point to the current instruction. SP - point to the bottom of the stack. HP - point to the next...
... Thanks, this makes things clearer. ... Me too. I've become good enough with YACC and COCO/R that I can do what I need to, but when whatever it is I'm...
... Please don't take this the wrong way. The following is only my simple opinion. And be sure and take it for what it cost you (nothing!) I strongly dislike...
... I don't have nearly as much compiler experience as you, but in my dabblings, I've always been enamored with the tools (for the very reason you state...
... I've used the latter. When I load a binary, the header tells me how much is code, how much is static data, and how much non-static data is needed. So,...
... Hey Ed, ... Never. I always appreciate your input. Since I don't know what I am doing anyway :), any input is helpful. ... I am of a different view on...
Can someone here show me how you declared your stack? I totally forgot to think about the concept of different data types that play an important role in...
Chris Cranford
chris.cranford@...
Sep 20, 2004 9:22 pm
356
Hi Ed, (Comments below) ... I'm enamored as well. That's why I'm writing my own tools. ... Sorry for the confusion. My grammars do support [] and ? for one or...
... This one just has integers and reals. It is from a toy language I was playing with, trying to see how I could use both integers and reals: typedef union {...
... Ah, so you basically allocate an array of Stack objects populating each object according to the type of data being pushed. I suppose that is one way and...