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 417 - 446 of 1320   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Simplify | Expand   (Group by Topic) Author Sort by Date ^
417
--Code Snippet-- Dim x as Integer = 2 Print x I was curious how others have handled this in the past. I have a generic literal node in my syntax tree for...
Chris Cranford
chrisc062677
Offline Send Email
Oct 2, 2004
1:45 am
418
In an earlier post on 9/21, I asked what information I should store in the symbol table. I made reference to the following key elements: - Name/ID - Type -...
Chris Cranford
chrisc062677
Offline Send Email
Oct 2, 2004
8:12 am
419
... I have my tokenizer generate different tokens. For each identifier the tokenizer scans, it keeps track of whether certain characters occurred. E.g. int...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Oct 2, 2004
9:24 am
420
... I had intended to post some examples from compilers I've looked at (not having done this seriously myself in a long time) but couldn't remember where to...
Graham Toal
graham_toal
Offline Send Email
Oct 2, 2004
5:14 pm
421
... This is a drawback of the lex/yacc style of parsing where you tokenize first with no regard for context and then parse a token stream. An alternative is to...
Graham Toal
graham_toal
Offline Send Email
Oct 2, 2004
5:36 pm
422
... What's the problem? That's what you *want*, isn't it? At the end of a procedure you cannot access any variables inside that procedure and you never need...
Graham Toal
graham_toal
Offline Send Email
Oct 2, 2004
5:43 pm
423
... Ideally I do want to perform this promotion because I do not want to force the user to handle casting of types within my script language. Thus: Print 4/2...
Chris Cranford
chrisc062677
Offline Send Email
Oct 2, 2004
6:26 pm
424
So basically then the symbol table is used to validate only that the references to variables, functions, constants, and sub-routines that have been encountered...
Chris Cranford
chrisc062677
Offline Send Email
Oct 2, 2004
7:02 pm
425
... What a lovely bit of innuendo. There's nothing quite like nailing one's colours to the mast, hidden inside a brown paper envelope....
Rainer Thonnes
rainer@...
Send Email
Oct 2, 2004
9:34 pm
426
... Depends how you choose to implement it. You can be 'pure' and not have your parser do any declaration checking, and just create AST nodes with the raw...
Graham Toal
graham_toal
Offline Send Email
Oct 2, 2004
10:23 pm
427
Graham - I just decided to take your advice and rewrote my two visitor classes into one class that does both symbol table population and type checking within ...
Chris Cranford
chrisc062677
Offline Send Email
Oct 2, 2004
11:46 pm
428
... The next significant step isn't necessary in your compiler as you do not yet have flow control, and I suspect that if you do have boolean expressions, you...
Graham Toal
graham_toal
Offline Send Email
Oct 3, 2004
1:56 am
429
I decided to use my simple program: dim i as integer = 2 dim j as integer = 3 print 2/i+5; ... Line #2: DIM i AS Integer = 2 ... PUSH 2 PUSHA @i STORE ...
Chris Cranford
chrisc062677
Offline Send Email
Oct 3, 2004
2:07 am
430
... Peter Robertson invented an intermediate code for multiple target languages many years ago. He made a critical observation which was that an intermediate...
Graham Toal
graham_toal
Offline Send Email
Oct 3, 2004
3:10 am
431
Graham - My goal is bytecode output. Is there anyhing I need to consider with how I handle my addressing? Again I hate asking so many questions, but just ...
Chris Cranford
chrisc062677
Offline Send Email
Oct 3, 2004
3:19 am
432
... for your basic-like language, with no procedures or nested declarations yet, just do the obvious thing of assigning an offset to the variable. Let's say ...
Graham Toal
graham_toal
Offline Send Email
Oct 3, 2004
5:02 am
433
Hi, does anybody know of a flexible, simple and cross-platform (or at least portable) bytecode and associated VM to deploy to? I originally wanted to use the...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Oct 3, 2004
12:10 pm
434
... yet, ... say ... an int ... address ... something ... Since all my data types are 8/16/32 bit values (real is single precision IEEE) couldn't I simply say...
Chris Cranford
chrisc062677
Offline Send Email
Oct 3, 2004
12:35 pm
435
Right now when I encounter a constant declaration in my source, I add a symbol table entry with that name like as follows: const MYVALUE = 2 ConstDecl /...
Chris Cranford
chrisc062677
Offline Send Email
Oct 3, 2004
3:20 pm
436
... yet, ... say ... an int ... address ... something ... Since all my data types are 8/16/32 bit values (real is single precision IEEE) couldn't I simply say...
Chris Cranford
chrisc062677
Offline Send Email
Oct 3, 2004
3:26 pm
437
... Before you start constant expression elimination, but otherwise as late as you want. Doing such substitutions late means you don't discard information ...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Oct 3, 2004
4:20 pm
438
... I wrote it in Java. Though I could have written it in C++ just the same. I just thought Java out of a spontaneous thought. I usually hate Java, but it was...
M. Uli Kusterer
witness_of_t...
Offline Send Email
Oct 3, 2004
7:05 pm
439
... Don't know Java, can't help. Seems to be a lot of stuff easily findable with Google: http://joeq.sourceforge.net/other_os_java.htm As for other VMs,...
Graham Toal
graham_toal
Offline Send Email
Oct 4, 2004
1:21 pm
440
... You might give Parrot a try: http://www.parrotcode.org/ From the webpage: Parrot is a virtual machine designed to execute bytecode for interpreted...
ed_davis2
Offline Send Email
Oct 4, 2004
4:23 pm
441
How have others handled constructing your AST with the IF/ELSEIF/ELSE syntax?...
Chris Cranford
chrisc062677
Offline Send Email
Oct 4, 2004
7:33 pm
442
... I haven't done it myself but I might add it to my demo soon just to check my common-sense guess, which is that you use a simple if/then/else node, and...
Graham Toal
graham_toal
Offline Send Email
Oct 4, 2004
9:57 pm
443
... My nodes allow any number of children. This works well in a number of cases. IF can be: (IF <expr> <truepart> <falsepart>) Where <falsepart> can be NULL. A...
Richard Pennington
pennington6809
Offline Send Email
Oct 5, 2004
1:36 am
444
I think I've got the hang of at least the "parsing" to the abstract syntax tree down pat. My parser now successfully creates an AST for variable declarations,...
Chris Cranford
chrisc062677
Offline Send Email
Oct 5, 2004
2:01 am
445
... Hmm. Maybe it is a question of approach. I picture my AST as something I process to do something else. One of the side effects of processing my AST is to...
Richard Pennington
pennington6809
Offline Send Email
Oct 5, 2004
2:29 am
446
... OK, I'm not getting it here. What exactly is the difficulty? You have an expression like "X = Y + 1" The ast looks like = / \ Var(X) Op(+) / \ Var(Y)...
Graham Toal
graham_toal
Offline Send Email
Oct 5, 2004
2:42 am
Messages 417 - 446 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