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...
Want to share photos of your group with the world? Add a group photo to Flickr.

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 819 - 848 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
819
I've gone a different path. Should I return and continue developing on this, or should I continue lexical analysis? Basically, instead of merging multiple...
compiler_builder
compiler_bui...
Offline
Mar 1, 2008
11:27 am
820
... I didn't reply right away because I wanted to think about this for a little first. I want to encourage you to work on parts of your compiler that you're...
Graham Toal
graham_toal
Offline Send Email
Mar 2, 2008
3:25 am
821
I've suspended lexer development. I've seperated the parsing functionality into several functions like parse_operator, is_operator, is_whitespace, etc. At this...
compiler_builder
compiler_bui...
Offline
Mar 2, 2008
10:51 pm
822
... is prompt ... under ... Ok so I decided to give this a go as well. I have a little background knowledge already (read the dragon book a couple years back...
Tim
deltacentauri
Offline Send Email
Mar 9, 2008
3:42 pm
823
... assumption that compiling is a 3rd or 4th year subject whereas I think you can usefully start learning the subject pretty much as soon as you've mastered ...
Graham Toal
graham_toal
Offline Send Email
Mar 9, 2008
4:21 pm
824
On Sun, Mar 2, 2008 at 5:51 PM, compiler_builder ... We're not looking at operator precedence here, just a simple left to right evaluation with the added twist...
Graham Toal
graham_toal
Offline Send Email
Mar 9, 2008
4:30 pm
825
... code ... This is based on the first version of 'simple.c' that you posted: #include <stdio.h> #include <string.h> int get_expression(char *expression, int...
Graham Toal
graham_toal
Offline Send Email
Mar 9, 2008
8:39 pm
826
... Depending on how simple you're willing to accept, you could have something that you could call a compiler within a week or two (and by that I mean just...
Graham Toal
graham_toal
Offline Send Email
Mar 9, 2008
9:03 pm
827
... I'd hope my programming is good enough given I do it for a living. I'd read your previous advice not to use complicated data structures and language...
timmeh@...
deltacentauri
Offline Send Email
Mar 9, 2008
11:46 pm
828
These are the modifications I made. Old line: if ((ch == '\0') || (strchr(terminators, ch) != NULL)) { New line: if ((ch == '\0') || (strchr(terminators, ch)...
compiler_builder
compiler_bui...
Offline
Mar 10, 2008
12:19 am
829
... You got it. Now modify this code so that instead of performing the calculation on the fly, you output instructions for what someone would key on a...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
3:12 am
830
... terminators); Exactly. Now instead of a calculator whose only purpose is "get_expression", if you handle other language features the same way, eg...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
3:34 am
831
PS this was my version of the same code that I was holding off posting until you came up with the recursive parsing solution for yourself. It's almost...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
3:43 am
832
Your mission, if you choose to accept it, is to explain how to calculate an expression which contains operators of different precedences. So following the...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
4:10 am
833
... Ok, so this one was pretty easy until i hit the parentheses which caused me some dramas, but it seems to work nice now. At this point I'm kinda wondering...
timmeh@...
deltacentauri
Offline Send Email
Mar 10, 2008
5:28 am
834
... How do I know which function should I trigger? ... It's a deal. :-) ... Should this be something like (not literally): if (ch == '=') variable['x'] =...
compiler_builder
compiler_bui...
Offline
Mar 10, 2008
7:47 am
835
You take an expression and start reading it from left to right. Each time you encounter a * or a / you take a number immediately left and immediately right of...
compiler_builder
compiler_bui...
Offline
Mar 10, 2008
5:47 pm
836
... And you thought compiler writing was difficult :-) You guys are getting ahead of me a little! I'll need to spend some time working out where we go next...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
5:52 pm
837
On Mon, Mar 10, 2008 at 2:47 AM, compiler_builder ... In this style of parsing, you start with a top-level procedure that accepts the entire program, and it in...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
6:13 pm
838
On Mon, Mar 10, 2008 at 12:47 PM, compiler_builder ... So if I have 1 + 2 + 3 * 4 * 5, you're saying I stop when I get to the "* 4" and replace 3 * 4 with 12,...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
6:27 pm
839
On Mon, Mar 10, 2008 at 12:47 PM, compiler_builder ... Here's a totally equivalent problem but phrased differently. It might suggest a different solution or...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
6:58 pm
840
... Defer that decision until you get in trouble. Two reasons. 1) you haven't written enough yet that you should even care if you have to throw it away; and...
Graham Toal
graham_toal
Offline Send Email
Mar 10, 2008
8:09 pm
841
... Both, i've had needs several times for a particular compiler for some task. At the moment I have some spare time and really want to get the theory into my...
timmeh@...
deltacentauri
Offline Send Email
Mar 11, 2008
6:26 am
842
... not so ... quite an ... There's a fairly good book I'ld recommend that specialises in interpreters, called "Writing Interactive Compilers and Interpreters"...
Graham Toal
graham_toal
Offline Send Email
Mar 11, 2008
1:32 pm
843
... not so ... quite an ... Virtual machines (in the sense of a bytecode definition, rather than the vmware sort of emulation) raise some interesting issues. ...
Graham Toal
graham_toal
Offline Send Email
Mar 11, 2008
3:13 pm
844
... Ok so i have a bit more background theory so i skipped the step of trying to trying to explain to kids how to work operator precedence. Thinking about how...
timmeh@...
deltacentauri
Offline Send Email
Mar 12, 2008
3:25 am
845
... Ok so I added another precedence level just to make sure I had the right of it, and things seem to be working nicely. So next step is identifiers, which I...
timmeh@...
deltacentauri
Offline Send Email
Mar 12, 2008
3:49 am
846
Last update for today, I added assignments, so you can have something like : a = 5 * 9 ^ 6 Then of course you can have identifiers in expressions like: b = 8 /...
timmeh@...
deltacentauri
Offline Send Email
Mar 12, 2008
4:45 am
847
I'm getting too old for late nighters! It looks good but I'll read it more closely tomorrow. btw would you start posting the compiler output now along with...
Graham Toal
graham_toal
Offline Send Email
Mar 12, 2008
5:55 am
848
... From: Graham Toal To: compilers101@yahoogroups.com Sent: Wednesday, March 12, 2008 3:55 PM Ok so I gave some thought to the theoretical problem i had with...
Tim Wakeham
deltacentauri
Offline Send Email
Mar 12, 2008
1:11 pm
Messages 819 - 848 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