Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,617 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 982 people online right now. Registration is fast and FREE... Join Now!




Nested statements

 
Reply to this topicStart new topic

Nested statements, in need of you human googles

snoj
post 26 Jan, 2006 - 11:17 PM
Post #1


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


Does anyone here know of any articles that explain/teach the concept on how to navigate nested statements?

example:
CODE
if(something) {
    while(var == true) {
 if(i < 10000) {
     i++;
 } else {
     var = false;
 }
    }
}
if(a1_steak_sauce == GOOD) {
    print("let's eat the steak!");
}


I'm thinking recursion would be required of this. But anyway basically I'd like to learn how to be able to navigate and manipulate such a statement "tree".


Thanks all!
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 27 Jan, 2006 - 02:24 AM
Post #2


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,905



Thanked 34 times

Dream Kudos: 2800

Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions


It's not recursion.
Recursion is a function calling itself (direct) or a function f1 calling f2 that calls f1 (indirect).

Nested loops ain't that bad.
Try this.
Single step into your loop while keeping the loop variables in the Watch List.
That's a fun way to see how nested stuff works.
User is offlineProfile CardPM

Go to the top of the page

snoj
post 27 Jan, 2006 - 08:07 AM
Post #3


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


Maybe you misunderstand? I want to parse a nested statement structure. GEt the "data" out of it, and then rebuild it in, oh say, the php syntax.
User is offlineProfile CardPM

Go to the top of the page

William_Wilson
post 7 Apr, 2006 - 11:49 PM
Post #4


lost in compilation

Group Icon
Joined: 23 Dec, 2005
Posts: 3,970



Thanked 15 times

Dream Kudos: 3275

Expert In: Java, C, Javascript

My Contributions


The easiest way i've ever found to get/see the data from loops and nested loops is to generate the assembly code and then use a good debgger to watch all the stack values/registers. In this way you can see EVERY change each line of code makes (broken down into the simplest of code - without using binary)

This post has been edited by William_Wilson: 7 Apr, 2006 - 11:50 PM
User is offlineProfile CardPM

Go to the top of the page

snoj
post 8 Apr, 2006 - 05:33 AM
Post #5


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


Yeah....but that doesn't do much to offer insight into making a function/method/whatever to parse nested statements.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 03:09AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month