Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3225254
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:19:05+00:00 2026-05-17T16:19:05+00:00

I have a recursive-descent tree object. I want to be able to set a

  • 0

I have a recursive-descent tree object. I want to be able to set a breakpoint and inspect it in the Xcode debugger. Inspecting the top level works just fine. But after I go down a level or so, the debugger says the values of the ivars are out of scope. Is there any way I can keep this from happening?

EDIT:

In response to a comment —

The ivar is an object of class Expression. The nesting mostly comes from the body ivar, which is typically an NSMutableArray of expression objects. So you might have a structure like this:

-Expression
—body (2 expressions)
—–0 Expression
——-body (1 expression)
———-0 Expression
————body [empty]
—–1 Expression
——-body [empty]

There is also a head ivar, which is an object of class Token, which in turn has some string ivars, does not nest.

The way I use the debugger — I set a breakpoint in a method inside the Expression object. I then click on the disclosure triangle for arguments, then for self, then for the body ivar, then for expressions within the body ivar, and so on. But eventually the debugger stops telling me the values of things.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:19:06+00:00Added an answer on May 17, 2026 at 4:19 pm

    I recommend adding this to your Expression class. Then you can po [expression explode] in the debugger to print the tree of an expression. A prerequisite is a proper -description method for your Expressionclass that prints out the rest of the ivars.

    - (void) explodeAtLevel:(int)aLevel {
        NSMutableString* out = [[NSMutableString alloc] init];
    
        for (int i = 0;  i < aLevel; i++) [out appendString:@"-"];
    
        [out appendString:self.description];
        printf("%s\n", [out UTF8String]);
        [out release];
    
        for (id *subitem in body)
          if ([subitem isMemberOfClass:[Expression class]])
            [((Expression*)subitem) explodeAtLevel:(aLevel + 1)];
    }
    
    
    - (void) explode {
      [self explodeAtLevel:0];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do recursive ascent parsers work? I have written a recursive descent parser myself
I have a recursive algorithm which steps through a string, character by character, and
If you have a recursive structure, say, child tables located inside td cells of
I have been experimenting with Lambda expressions in Oxygene. Very simple recursive lambda expression
I have to rename a complete folder tree recursively so that no uppercase letter
I am trying to make a recursive-descent parser in Ruby for a grammar, which
I've written a pretty simple recursive-descent parser in Java, but having some issues with
As a purely academic exercise, I'm writing a recursive descent parser from scratch --
For all you compiler gurus, I wanna write a recursive descent parser and I
I have a recursive function that returns a value. public function getparent ($user) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.