![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
also, what order should i traverse my tree in?
everyone suggested postorder, but i have no clue how that's possible preorder makes much more sense, but then people called me weird. but the reason i think preorder would work while postorder might not is because procedures are defined towards the top of the tree, and then they are called towards the bottom of the tree .... so if i see the function call towards the bottom of the tree, i would have no idea what it is, unless i move all the way up and find out it's a procedure! until then, it would just be an identifier for me, with no meaning i hope i am making sense |
|
|
|
|
|
#12 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
also, how am i supposed to handle different "procedures" within the program i supposed to interpret
|
|
|
|
|
|
#13 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
I would create a map of all the procedures with their locations. When calling a procedure, you push the current address/line on the call stack, and when the procedure returns you continue at the previously stored value.
|
|
|
|
|
|
#14 |
|
Professional Programmer
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 376
Rep Power: 0
![]() |
ProgrammingNoob, instead of posting 4 posts in a row, just edit your previous one to add more information.
__________________
I am Addicted to Linux! |
|
|
|
|
|
#15 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
Quote:
you see what i am saying? |
|
|
|
|
|
|
#16 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
Quote:
my understanding was ... when you edit something, the forum posters wont find out about it until they open the thread and bother to read the edited post carefully i dont expect so much work from you people .... let's face you're all busy so whats the other way of posting my q's if i have 4 different q's? now if i make a separate thread for each of the question, i can understand how that be considered a problem (oh btw .... i really apologize if i am wrong about what i said about editing) |
|
|
|
|
|
|
#17 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
King was probably just suggesting that you append to you post if it's the last one in the thread; however, IIRC there is only a 1/2 hr window in which to edit a post. If you have something else to say after that, just posting a new reply is fine, but if you can edit and just add on to the last post, that would be preferrable.
|
|
|
|
|
|
#18 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
Quote:
but i know ... it can be annoying ... oh well! i will try to be more careful |
|
|
|
|
|
|
#19 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 154
Rep Power: 3
![]() |
the instructions given by my prof:
1)Save formal parameters on the stack 2)save local variables on the stack 3)initialize formal parameters with the values of actual parameters 4)interpret the procedure body 5)restore local variables and formal parameters from the stack what does he mean by "store formal parameters and variables on the stack"? did he mean store their names? if yes, then when he said initialize formal parameters with the values of actual paramters, am i supposed to link the name (a string type) to the value (integer type)? (btw it's pretty safe to assume that there will be only one parameter passed) oh also, what about the actual parameter? can i just have the value of the actual parameter be the value of a global variable? simple? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running executables in C++ | crawforddavid2006 | C++ | 22 | Jun 26th, 2006 12:00 PM |
| Create an Interpreter | proudnerd | Coder's Corner Lounge | 12 | May 20th, 2006 10:24 AM |
| Bad interpreter? | a thing | Bash / Shell Scripting | 4 | May 18th, 2006 3:31 AM |
| [ANN] New script engine (Basic sintax) | MKTMK | C++ | 3 | Sep 1st, 2005 5:51 PM |
| Voicexml Interpreter | mehul_haria | Other Web Development Languages | 1 | Mar 18th, 2005 11:01 AM |