Google

TOP --> CcDoc

class CCcDocPrepExpr

This class handles the expression tree stuff for the pre-processor. for #if statements. It is pretty primitive.

A sample usage is shown below:


 CCcDocPrepExpr* expr = CCcDocPrepExpr::Create(this,"#if defined(FOO) || defined(SPAM)");
 if(expr) {
   bool eval = expr->Eval(true); // eval with debug turned on
  CCcDocPrepExpr::Destroy(expr);
 }
 

Author:
Joe Linoff

Version:
$Id: ccdocprepexpr.h,v 1.4 1999/06/12 18:10:33 jdl Exp $

Source:
../../ccdoc/src/ccdocprepexpr.h:39

Methods Index

Create
[public] Create an expression subtree and return a pointer to the root of the tree.
Destroy
[public] Destroy the expression subtree.
Dump
[public] Dump the contents of the internal expression tree.
Eval
[public] Evaluate an expression tree.


Methods

Dump

public void Dump ( const char * prefix = 0 ,
                   uint level = 0 ) const ;

Dump the contents of the internal expression tree.

Parameters:
fp The output file.
prefix An optional prefix for each output line.
level The current nesting level.

Eval

public long Eval ( CCcDocPrep * obj ,
                   ulong lineno ,
                   const char * src ,
                   const char * linebuf ,
                   bool debugFlag = false ,
                   uint level = 0 ,
                   bool reportUndefSymsFlag = true ) const ;

Evaluate an expression tree.

Parameters:
obj The CCcDocPrep parent object.
lineno Source file line number.
src Source file name.
linebuf Line information.
debugFlag If true, turns on internal debugging messages.
level The current nesting level.
reportUndefSymsFlag Report undefined symbols.

Return:
Non-zero if the expression evaluated to true or 0 otherwise.

Create

public static CCcDocPrepExpr * Create ( CCcDocPrep * obj ,
                                        const char * line ) ;

Create an expression subtree and return a pointer to the root of the tree.

Parses lines of the form:


 #if defined(SPAM) && ( defined(FOO) || defined(BAR) )
 

Parameters:
obj The CCcDocPrep parent object.
line The line.

Destroy

public static void Destroy ( CCcDocPrepExpr * expr ) ;

Destroy the expression subtree.

Parameters:
expr The root of the expression tree that is returned by Create.

This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.