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...
333
Graham Toal
graham_toal
Aug 6, 2004 3:17 am
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...
334
Mauro Persano
mauro_persano
Aug 6, 2004 8:35 pm
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...
335
Piyush Narang
dinosaurclub
Sep 12, 2004 1:58 pm
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...
336
ed_davis2
Sep 13, 2004 2:19 pm
... 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...
337
Rainer Thonnes
rainer@...
Sep 13, 2004 2:55 pm
... 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)? ...
338
ed_davis2
Sep 13, 2004 9:27 pm
... 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...
339
Rainer Thonnes
rainer@...
Sep 17, 2004 12:24 pm
... 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...
340
Rick Clark
rickclark58
Sep 17, 2004 1:23 pm
... 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...
341
Graham Toal
graham_toal
Sep 18, 2004 1:26 am
... 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...
342
Rainer Thonnes
rainer@...
Sep 18, 2004 11:15 am
... 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...
343
Rick Clark
rickclark58
Sep 18, 2004 8:21 pm
... Yes, it uses the standard operator precedence found in most languages. Parenthesis are also supported. ===== Rick Clark ...
344
M. Uli Kusterer
witness_of_t...
Sep 18, 2004 9:50 pm
... 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...
345
pennington6809
Sep 19, 2004 2:01 pm
... 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...
346
Chris Cranford
chris.cranford@...
Sep 19, 2004 2:21 pm
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...
347
Richard Pennington
pennington6809
Sep 19, 2004 3:14 pm
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...
348
Chris Cranford
chris.cranford@...
Sep 20, 2004 12:04 am
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...
349
Richard Pennington
pennington6809
Sep 20, 2004 1:05 am
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...
350
ed_davis2
Sep 20, 2004 3:52 pm
... 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...
351
ed_davis2
Sep 20, 2004 4:10 pm
... 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...
352
ed_davis2
Sep 20, 2004 4:32 pm
... 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...
353
ed_davis2
Sep 20, 2004 4:48 pm
... 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,...
354
Rick Clark
rickclark58
Sep 20, 2004 5:12 pm
... 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...
355
Chris Cranford
chris.cranford@...
Sep 20, 2004 9:22 pm
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...
356
Richard Pennington
pennington6809
Sep 20, 2004 10:00 pm
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...
357
ed_davis2
Sep 21, 2004 12:42 am
... 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 {...
358
Chris Cranford
chris.cranford@...
Sep 21, 2004 1:38 am
... 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...
359
Richard Pennington
pennington6809
Sep 21, 2004 2:37 am
... We could get very basic and act like a real processor. The instruction opcode would indicate the type of operand (s). unsigned char memory[SIZE]; unsigned...
360
Chris Cranford
chris.cranford@...
Sep 21, 2004 10:37 am
Rich - I think that is what the program I referenced earlier is doing. Again the example code I posted was: DSP 4 // SP=SP-4 PUSH1 2 // Push a 1 byte...
361
Richard Pennington
pennington6809
Sep 21, 2004 11:35 am
... Hi Chris, Hmm... I think you should use the same endianess on the stack as you do for other areas. Otherwise you'll have al sorts of headaches. Could you...