ErrorReporterTree Struct Reference

#include <error.h>

Collaboration diagram for ErrorReporterTree:

Collaboration graph
[legend]

Detailed Description

This structure provides a means for caching errors so that they can be reported back later in the manner of 'stack traces'. Should be useful for more detailed reporting from parser, external calls, etc.

Usage will be

bool has_error = 0; error_reporter_tree_start(); do_subordinate_tasks(); if(error_reporter_tree_has_error()){ has_error = 1; }else{ has_error = 0 } error_reporter_tree_end(); if(has_error){ ERROR_REPORTER_NOLINE(ASC_USER_ERROR,"failed"); }else{ ERROR_REPORTER_NOLINE(ASC_USER_SUCCESS,"success"); }

The next 'error_reporter' call after an outermost 'error_reporter_tree_end' will cause the error tree to be output to the error reporting channel.

If an 'error_reporter' is found *inside* an an 'error_reporter_tree_start' and 'error_reporter_tree_end', the error message is kept and not output.

If the latest set of errors (those found inside the last start..end) are not important, they can be discarded using error_reporter_tree_clear. This will not clear the entire error tree, as there may be errors higher-up that we don't want to discard.

After a call to error_reporter_tree_clear(), further errors can still be added within the current TREECURRENT context.


Data Fields

error_reporter_meta_t * err
ErrorReporterTreehead
ErrorReporterTreetail
ErrorReporterTreenext
ErrorReporterTreeparent


Field Documentation

struct ErrorReporterTree* ErrorReporterTree::head

first on the list of child errors

struct ErrorReporterTree* ErrorReporterTree::tail

last on the list of child errors

struct ErrorReporterTree* ErrorReporterTree::next

next error in the present list

struct ErrorReporterTree* ErrorReporterTree::parent

parent error (or NULL)


The documentation for this struct was generated from the following file:
Generated on Thu Jul 17 04:00:58 2008 for libascend by  doxygen 1.5.1