What do you think about local functions (as in Pascal, Modula2, Oberon, Ada, etc.)? I can't decide whether I love them or hate them. For instance, I've seen...
... Pro. Back in the days when the only choices were Fortran or Algol, nested functions were the default expectation, and Fortran was seen as being deficient;...
... My very first Language was Fortran, in a college course in 1977. While I liked programming, I didn't much care for Fortran. My next language was Algol-W,...
I have developed a small language (compiler to p-code , p-code interpreter ) using Cocor compiler construction tool and c++. I am a novice in compiler...
... Passing on a note from one of our members who knows a lot more about this than me (mildly edited [in brackets] for context): } Nested procedures aren't...
I NOTICED THAT THE DIAGRAM CAME OUT BADLY IN THE LAST POST , HERE IT IS AGAIN. MEMORY CELL ARRAY _________ [|Memory |] [|Cell 1 |] [|_______|] [|Varname|] ...
Hi: I really need help here. The following code contains my Flex file which is already finished, my Bison file which I'm told is all wrong, and a copy of...
Hello, ... For starters, the syntax of your yacc file seems to be wrong. For instance, when you say open_decl ECL_OPEN ... it probably should look like ...
Dear Mauro: Yes it is. But of a different kind. I'm supposed to take xml code, parse it, use C, and finally input this data as sql. I said its homework,...
... and finally input this data as sql. I said its homework, but of a different kind, because its a project which will be counted on as a final. In other...
It is worth bearing in mind that Intel machines directly support displays with the ENTER and LEAVE instructions. These automate the setting up of the display....
Paul Cockshott
wpc@...
Apr 5, 2005 2:22 pm
550
... The page above is slightly updated, and I've used that algorithm in a real(ish) program: http://www.gtoal.com/athome/utils/xpp.c.html It's worth having a...
... Heh, it just shows that some things never go out of style. Thanks for the example. Rick Clark Discover Yahoo! Find restaurants, movies, travel and more fun...
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"...
... 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@...
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...
... 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@...
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...
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...
... 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...
... 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...
... 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...
... 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...
... 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...
... 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...
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...
... 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@...
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...
... They're not using flex/bison anymore but hand-made recursive parsers instead... OG....
Olivier Galibert
galibert@...
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...