Skip to content

CPreproc::If

Stores a preprocessor '#if' directive and nested directives.

Synopsis

Declared in <src/midend/programTransformation/astOutlining/If.hh>

class If;

Types

Name

Description

Case

Stores one case of a preprocessor '#if' directive.

Cases_t

Stores the cases composing an '#if' directive.

const_iterator

const_reverse_iterator

iterator

reverse_iterator

Member Functions

Name

Description

If [constructor]

Default constructor.

~If [destructor]

Destructor‐‐‐frees memory associated with cases.

appendCase

Appends a new case.

begin

end

firstCase

getParent

isValid

Returns 'true' if this appears to be a complete '#if' directive.

lastCase

rbegin

rend

setParent

Sets the parent directive.

Private Data Members

Name

Description

cases_

Stores the cases composing this directive.

parent_

Parent directive (may be NULL).

Description

If represents one instance of a preprocessor '#if' directive, including all its cases. That is, a If object corresponding to the following '#if' directive,

#if C_1 ... #elif C_2 ... #elif C_k ... #endif // k+1

stores a sequence of k cases plus the final '#endif'. One may view a If object as a container of cases (If::Cases).

In addition, If represents the complete tree of nested '#if' directives. See the case object, If::Case, for more information.

Created with MrDocs