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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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 552 - 581 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
552
I'm trying to figure out which is the best way to parse the following simple grammar, using a hand-written parser: stmtseq = {stmt} stmt = "if" expr "then"...
Ed Davis
ed_davis2
Online Now Send Email
Jun 4, 2005
5:26 pm
553
... The closing square bracket is in the wrong place, isn't it? ... The grammar is incomplete and glosses over the existence of "normal" simple statements,...
Rainer Thonnes
rainer@...
Send Email
Jun 5, 2005
10:25 pm
554
... Sorry about that. It should be: stmt = "if" expr "then" stmtseq ["else" stmtseq] "endif" ... I did mean "not". The loop should continue while one of...
Ed Davis
ed_davis2
Online Now Send Email
Jun 6, 2005
7:30 pm
555
... Hmm. What am I missing here? Is "token" not the same thing as what "is_token" looks at before consuming it? If so, then it seems to me that all the...
Rainer Thonnes
rainer@...
Send Email
Jun 6, 2005
8:58 pm
556
Hello All, I designed a new object oriented programming language named "Awal" as part of my MS Computer Sciences thesis. Now I want to develop a fully working...
Adeel Javed
chadeeljaved
Offline Send Email
Jun 10, 2005
9:56 am
557
I'm trying to figure out how to generate quads. I can generate p-code while parsing, or generate an AST and generate p-code from that, but I have not figured...
Ed Davis
ed_davis2
Online Now Send Email
Jun 18, 2005
1:44 pm
558
... There is *very little* to do actually. Your AST is almost exactly in the right format; you just have to output each AST entry in the right order. for each...
Graham Toal
graham_toal
Offline Send Email
Jun 18, 2005
6:30 pm
559
... Wow - it turned out to be so easy. I've looked at your example many times, but for some reason it never clicked. However, something you said in the above...
Ed Davis
ed_davis2
Online Now Send Email
Jun 18, 2005
9:46 pm
560
... A brief aside from the subject... what you describe above is what happens so often in programming, at least to me - I can read all the books, look at...
Graham Toal
graham_toal
Offline Send Email
Jun 18, 2005
11:48 pm
561
... In the else part, you need explicit tests for left and/or right also being leaf nodes. If they are, don't gen_expr - just use the name... so... ... will...
Graham Toal
graham_toal
Offline Send Email
Jun 19, 2005
12:25 pm
562
... I can definitely relate. Mine was Wirth's Pascal-s. It seemed like such a mystery until only just a few years ago. ... Nope! ... Me too. Thanks again for...
Ed Davis
ed_davis2
Online Now Send Email
Jun 21, 2005
1:36 am
563
... Just thought I'd thank everyone who answered to this question I posed. I went through all of your answers. There were lots of great VMs there, but they all...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Jun 23, 2005
6:40 pm
564
Hi, I used to hand-grow all my parsers, and a while ago thought I'd give Flex/Yacc a try again. I actually got it to wonderfully lex and parse my language, but...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Jun 23, 2005
6:46 pm
565
... You have to define yyval as a union. I hand-grow by lexers so there may be a specific typename to use, but in any case here is the start of one of my...
Olivier Galibert
galibert@...
Send Email
Jun 23, 2005
6:55 pm
566
Hello, ... Here is something I wrote a while ago: http://fuse.superglue.se/mcc_i386.tar.gz It's a compiler for a small subset of C. I don't think you can call...
Mauro Persano
mauro_persano
Online Now Send Email
Jun 23, 2005
6:56 pm
567
... They're not using flex/bison anymore but hand-made recursive parsers instead... OG....
Olivier Galibert
galibert@...
Send Email
Jun 23, 2005
6:59 pm
568
... Thanks, that filled in some of the blanks. Somehow I completely overlooked %type in favor of %token, which caused part of my problem. Your example showed...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Jun 23, 2005
7:50 pm
569
... AFAIK that's a new development, though. I remember reading somewhere (gnustep-discuss?) that this new parser was checked in only recently. But I think the...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Jun 23, 2005
7:50 pm
570
... It was actual, practical code, that's exactly what I had hoped for. Yes, it's a little larger than I'd have needed, but it demonstrated that I was on the...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Jun 23, 2005
7:51 pm
571
... See this page: http://epaperpress.com/lexandyacc/ He has a simple calculator like language, and compiles to either an AST or to byte-code. ...
Ed Davis
ed_davis2
Online Now Send Email
Jun 23, 2005
8:13 pm
572
... If you are working in C++, there are more interesting ways to work, like Boost.Spirit (http://www.boost.org/libs/spirit/index.html) - but you need to be a...
Daniel K. O.
danielosmari
Offline Send Email
Jun 24, 2005
4:15 am
573
Just curious if there was still anyone out there. Chris [Non-text portions of this message have been removed]...
Chris Cranford
chrisc062677
Offline Send Email
Sep 16, 2005
9:50 pm
574
If I define two regular-expression rules such as: "if" { return TT_IF; } [a-zA-Z]([a-zA-Z]|[0-9] { return TT_IDENTIFIER; } Then in my code I have something...
chris.cranford@...
chrisc062677
Offline Send Email
Sep 17, 2005
12:17 am
575
... Assuming this is a general question and not specific to yacc/lex ... there are two ways of combining lexers and parsers. The yacc/lex model is that you...
Graham Toal
graham_toal
Offline Send Email
Sep 17, 2005
5:34 am
576
... The Edinburgh Computer History Project has quite a few versions of the same basic parser as it was developed over the years, but this is about the earliest...
Graham Toal
graham_toal
Offline Send Email
Sep 17, 2005
6:15 am
577
... Not sure what lexer you're using, but FLex always returns the longest possible match. Cheers, -- M. Uli Kusterer http://www.zathras.de...
Uli Kusterer
witness_of_t...
Offline Send Email
Sep 17, 2005
9:12 am
578
... Yep :-) By the way, found this today: http://easynews.dl.sourceforge.net/sourceforge/inger/CompilerConstruction.pdf 246 page book on writing a compiler for...
Graham Toal
graham_toal
Offline Send Email
Sep 17, 2005
3:18 pm
579
I actually ran across a PDF on oolex yesterday and found that their approach made sense to me. What it described was the concept that each lexer rule is in a...
chris.cranford@...
chrisc062677
Offline Send Email
Sep 17, 2005
8:16 pm
580
Someone also mentioned that FLex/Lex returns against the rule with the longest match. Assuming you have "IF " as your input and two rules, one for 'IF' and...
chris.cranford@...
chrisc062677
Offline Send Email
Sep 17, 2005
8:22 pm
581
... I dunno, why don't you try it out! Here's an oldie from the 60's: in FORTRAN you can have a for loop DO 10 I = 1, 10 and a simple assignment DO10I = 1.10 ...
Graham Toal
graham_toal
Offline Send Email
Sep 17, 2005
9:13 pm
Messages 552 - 581 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