Nested statements

in need of you human googles

Page 1 of 1

4 Replies - 3584 Views - Last Post: 08 April 2006 - 06:33 AM Rate Topic: -----

#1 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 64
  • View blog
  • Posts: 3,505
  • Joined: 31-March 03

Nested statements

Posted 27 January 2006 - 12:17 AM

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

example:
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!

Is This A Good Question/Topic? 0
  • +

Replies To: Nested statements

#2 born2c0de  Icon User is offline

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

Reputation: 175
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Nested statements

Posted 27 January 2006 - 03:24 AM

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.
Was This Post Helpful? 0
  • +
  • -

#3 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 64
  • View blog
  • Posts: 3,505
  • Joined: 31-March 03

Re: Nested statements

Posted 27 January 2006 - 09:07 AM

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.
Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 199
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Nested statements

Posted 08 April 2006 - 12:49 AM

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: 08 April 2006 - 12:50 AM

Was This Post Helpful? 0
  • +
  • -

#5 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 64
  • View blog
  • Posts: 3,505
  • Joined: 31-March 03

Re: Nested statements

Posted 08 April 2006 - 06:33 AM

Yeah....but that doesn't do much to offer insight into making a function/method/whatever to parse nested statements.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1