tree walker evaluator
Søren Hauberg
soren at hauberg.org
Wed Feb 4 06:13:43 CST 2009
ons, 04 02 2009 kl. 01:18 -0500, skrev John W. Eaton:
> I was planning to have a separate tree_debugger class derived from the
> tree_evaluator class and that would replace some of the functions in
> the tree_evaluator class to do the debugging stuff before calling the
> corresponding fucntion from the tree_evaluator class. For example:
>
> void
> tree_debugger::visit_statement (tree_statement& stmt)
> {
> // check to see if breakpoint is set and debugging things...
> ...
> ...
> ...
>
> tree_evaluator::visit_statement (stmt);
> }
>
> Although it is probably possible to make this work, it did not seem
> worth the effort, and I wasn't sure I could correctly implement
> switching between the normal and debugging evaluators at arbitrary
> times. So I decided to simply check a flag in the tree_evaluator
> methods that need to do debugging things. I don't think this adds
> much overhead and it allows reliable switching between the normal and
> debugging evaluators.
I was under the impression that such a class would also be used for
building a profiler. If so, will that complicate things?
> Comments? Bug reports?
I'm using very recent checkouts as my main development system, and the
it seems your change just-works :-)
Søren
More information about the Octave-maintainers
mailing list