Search the web
Sign In
New User? Sign Up
compilers101 · Compilers 101
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Messages 1036 - 1065 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
1036
Hey tim, have you seen this? http://people.cs.uchicago.edu/~varmaa/mini_c/ Seems quite cleanly written. You might be able to pick up some useful ideas from...
Graham Toal
graham_toal
Offline Send Email
May 3, 2008
3:56 am
1037
No I hadn't seen that, I'll have a look at it, though I'm not sure how much I'm going to get from it at this stage since it uses a lexer and parser generator. ...
Tim Wakeham
deltacentauri
Offline Send Email
May 3, 2008
10:06 am
1038
... Or possibly bite you in the AST :-) We haven't really talked about your internal data structure yet. Getting that right will be key to code generation...
Graham Toal
graham_toal
Offline Send Email
May 3, 2008
11:19 am
1039
... Ok well let's talk :) I've got a node based system which I'm reusing from the old code, but I'm refactoring it as I use the nodes in the new parser. ... ...
Tim Wakeham
deltacentauri
Offline Send Email
May 3, 2008
4:02 pm
1040
... It's *not* a string... It's a single-character integer constant. Treat it exactly the same as IF a < 65 I guess python doesn't have that construct, but...
Graham Toal
graham_toal
Offline Send Email
May 3, 2008
5:03 pm
1041
... (I'm back.) I had a quick look at your AST code and although it's regular and consistent, I'm wondering if it's *too* clean, ie by being encapsulated in...
Graham Toal
graham_toal
Offline Send Email
May 3, 2008
7:31 pm
1042
... (ie ... jump ... along. And what I used to do too - my last 'toy' compiler was a top-level loop that parsed a simple statement at a time, and kept track of...
Graham Toal
graham_toal
Offline Send Email
May 3, 2008
8:02 pm
1043
... Python objects a super flexible, any attribute can be accessed from the outside since Python doesn't really have a notion of private members. The code...
Tim Wakeham
deltacentauri
Offline Send Email
May 4, 2008
2:51 am
1044
... Why are semicolons providing you with such issue? Oh wait do you mean semicolons in the input stream, or outputting them in the right places in the C...
Tim Wakeham
deltacentauri
Offline Send Email
May 4, 2008
2:57 am
1045
... Well, when you have a node that was built like MkNode(IFTHENELSE, cond1, statement1, MkNode(IFTHENELSE, cond2, statement2, statement3)) a simple walk of...
Graham Toal
graham_toal
Offline Send Email
May 4, 2008
3:42 am
1046
... No it isn't/doesn't. The semicolons aren't statement separators, they're statement terminators, so they "belong to" the subordinate statements. Therefore...
Rainer Thonnes
rainer@...
Send Email
May 4, 2008
8:55 am
1047
... All I can say is try it yourself! Unless you do the peepholing/post-processing trick, there is no simple rule that puts them in the right places - I tried...
Graham Toal
graham_toal
Offline Send Email
May 4, 2008
2:32 pm
1048
... Is this real C code? I never knew C had gotos/labels...and do you really need the ; after a label? Wait I didn't know C had do statement either, kinda...
Tim Wakeham
deltacentauri
Offline Send Email
May 4, 2008
3:01 pm
1049
... It's mostly genuine C although there are bits that aren'ty finished. The semi-colon may or may not be optional depending on whether there are "if"s...
Graham Toal
graham_toal
Offline Send Email
May 4, 2008
6:27 pm
1050
... One day perhaps.. ... Yes there is. OK, that's easy to say not having tried it myself, but I can't really see any difficulty at all. The simple rule is...
Rainer Thonnes
rainer@...
Send Email
May 4, 2008
10:39 pm
1051
Rainer, could you have a look at this and see if you can see any obvious problems in the translation? ...
Graham Toal
graham_toal
Offline Send Email
May 5, 2008
1:01 am
1052
... rainer.c.txt ... It was in, but wrongly. I was bracketing on the wrong comparison, and the problem was caused by non-binary-ops all having a default...
Graham Toal
graham_toal
Offline Send Email
May 5, 2008
1:29 am
1053
... Done. Ecce works! Just need to add the small amount of support code in C at the start of the output file (as opposed to currently editing it in by hand)...
Graham Toal
graham_toal
Offline Send Email
May 5, 2008
5:55 pm
1054
... Beware of C's calling convention, it caught me out when I was learning to interface assembly and C. The compiler pushes function operands onto the stack...
Tim Wakeham
deltacentauri
Offline Send Email
May 6, 2008
3:08 am
1055
... I think that's a C language standard rather than an architecture-specific decision. It may be possible to write a C compiler that doesn't evaluate...
Graham Toal
graham_toal
Offline Send Email
May 6, 2008
4:03 am
1056
... Yeh it is part of the ansi standard calling convention, but it's unlike any other compiled language I know of which all push the parameters in forward ...
Tim Wakeham
deltacentauri
Offline Send Email
May 6, 2008
6:21 am
1057
... you've digested this lot. For the moment it's just filed with a bright red 'pending' flag next to it. I'll look at it more closely when I start writing...
Graham Toal
graham_toal
Offline Send Email
May 6, 2008
1:28 pm
1058
... the ... the ... Absolutely not. In Edinburgh compiler terms, what you're describing is the 'A[]' array that represents the concrete syntax. But the AST ...
Graham Toal
graham_toal
Offline Send Email
May 6, 2008
1:52 pm
1059
... Surely the trick is *not* to treat 'if (...) then ... else ...' as a statement, but as a kind of bracketing structure around statements. The semicolons...
Rainer Thonnes
rainer@...
Send Email
May 6, 2008
4:30 pm
1060
... Yep it's offsets from the base register. On function entry EBP is set to point to ESP, then a near CALL is issued which implicitly pushes the callee's...
Tim Wakeham
deltacentauri
Offline Send Email
May 7, 2008
2:15 am
1061
... That's not true. The CALL instruction doesn't push the callee's address, it jumps to it, having pushed the return address. At the point of call, the...
Rainer Thonnes
rainer@...
Send Email
May 7, 2008
9:39 am
1062
... I was under the impressed GCC only 'does' 32 bit protected mode. -Tim...
Tim Wakeham
deltacentauri
Offline Send Email
May 7, 2008
12:42 pm
1063
... You're probably right, I don't know if it can be configured not to assume that the default operand and address sizes are 32 bits, and I had forgotten that...
Rainer Thonnes
rainer@...
Send Email
May 7, 2008
2:02 pm
1064
... That's exactly how I knew it isn't possible, my measly attempt at kernel dev(and how i know a fair bit about gcc's assembly output) :). You are always...
Tim Wakeham
deltacentauri
Offline Send Email
May 7, 2008
3:15 pm
1065
... Yes, plain left to right, unless explicitly overridden with brackets, but there don't seem to be any instances of those in ecce. ... They are equivalent to...
Rainer Thonnes
rainer@...
Send Email
May 7, 2008
4:42 pm
Messages 1036 - 1065 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Advanced
Add to My Yahoo!      XML What's This?

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help