clang 24.0.0git
clang::VAOptExpansionContext Class Reference

A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a macro during macro expansion. More...

#include "clang/Lex/VariadicMacroSupport.h"

Inheritance diagram for clang::VAOptExpansionContext:
[legend]

Public Member Functions

 VAOptExpansionContext (Preprocessor &PP)
void reset ()
const Token & getEOFTok () const
void sawHashOrHashAtBefore (const bool HasLeadingSpace, const bool IsHashAt)
void hasPlaceholderAfterHashhashAtStart ()
void hasPlaceholderBeforeRParen ()
bool beginsWithPlaceholder () const
bool endsWithPlaceholder () const
bool hasCharifyBefore () const
bool hasStringifyOrCharifyBefore () const
unsigned int getNumberOfTokensPriorToVAOpt () const
bool getLeadingSpaceForStringifiedToken () const
void sawVAOptFollowedByOpeningParens (const SourceLocation VAOptLoc, const unsigned int NumPriorTokens)
SourceLocation getVAOptLoc () const
bool isVAOptToken (const Token &T) const
bool isInVAOpt () const
 Returns true if we have seen the VA_OPT and '(' but before having seen the matching ')'.
bool sawClosingParen ()
 Call this function each time an rparen is seen.
void sawOpeningParen (SourceLocation LParenLoc)
 Call this function each time an lparen is seen.

Detailed Description

A class for tracking whether we're inside a VA_OPT during a traversal of the tokens of a macro during macro expansion.

Definition at line 118 of file VariadicMacroSupport.h.

Constructor & Destructor Documentation

◆ VAOptExpansionContext()

clang::VAOptExpansionContext::VAOptExpansionContext ( Preprocessor & PP)
inline

Member Function Documentation

◆ beginsWithPlaceholder()

bool clang::VAOptExpansionContext::beginsWithPlaceholder ( ) const
inline

Definition at line 190 of file VariadicMacroSupport.h.

◆ endsWithPlaceholder()

bool clang::VAOptExpansionContext::endsWithPlaceholder ( ) const
inline

Definition at line 195 of file VariadicMacroSupport.h.

◆ getEOFTok()

const Token & clang::VAOptExpansionContext::getEOFTok ( ) const
inline

Definition at line 173 of file VariadicMacroSupport.h.

◆ getLeadingSpaceForStringifiedToken()

bool clang::VAOptExpansionContext::getLeadingSpaceForStringifiedToken ( ) const
inline

Definition at line 216 of file VariadicMacroSupport.h.

◆ getNumberOfTokensPriorToVAOpt()

unsigned int clang::VAOptExpansionContext::getNumberOfTokensPriorToVAOpt ( ) const
inline

Definition at line 210 of file VariadicMacroSupport.h.

◆ getVAOptLoc()

SourceLocation clang::VAOptExpansionContext::getVAOptLoc ( ) const
inline

Definition at line 233 of file VariadicMacroSupport.h.

◆ hasCharifyBefore()

bool clang::VAOptExpansionContext::hasCharifyBefore ( ) const
inline

Definition at line 201 of file VariadicMacroSupport.h.

Referenced by hasStringifyOrCharifyBefore().

◆ hasPlaceholderAfterHashhashAtStart()

void clang::VAOptExpansionContext::hasPlaceholderAfterHashhashAtStart ( )
inline

Definition at line 183 of file VariadicMacroSupport.h.

◆ hasPlaceholderBeforeRParen()

void clang::VAOptExpansionContext::hasPlaceholderBeforeRParen ( )
inline

◆ hasStringifyOrCharifyBefore()

bool clang::VAOptExpansionContext::hasStringifyOrCharifyBefore ( ) const
inline

Definition at line 206 of file VariadicMacroSupport.h.

References hasCharifyBefore().

◆ isInVAOpt()

bool clang::VAOptDefinitionContext::isInVAOpt ( ) const
inline

Returns true if we have seen the VA_OPT and '(' but before having seen the matching ')'.

Definition at line 83 of file VariadicMacroSupport.h.

◆ isVAOptToken()

bool clang::VAOptDefinitionContext::isVAOptToken ( const Token & T) const
inline

Definition at line 77 of file VariadicMacroSupport.h.

◆ reset()

void clang::VAOptExpansionContext::reset ( )
inline

Definition at line 163 of file VariadicMacroSupport.h.

◆ sawClosingParen()

bool clang::VAOptDefinitionContext::sawClosingParen ( )
inline

Call this function each time an rparen is seen.

It returns true only if the rparen that was just seen was the eventual (non-nested) closing paren for VAOPT, and ejects us out of the VAOPT context.

Definition at line 100 of file VariadicMacroSupport.h.

◆ sawHashOrHashAtBefore()

void clang::VAOptExpansionContext::sawHashOrHashAtBefore ( const bool HasLeadingSpace,
const bool IsHashAt )
inline

Definition at line 175 of file VariadicMacroSupport.h.

◆ sawOpeningParen()

void clang::VAOptDefinitionContext::sawOpeningParen ( SourceLocation LParenLoc)
inline

Call this function each time an lparen is seen.

Definition at line 107 of file VariadicMacroSupport.h.

◆ sawVAOptFollowedByOpeningParens()

void clang::VAOptExpansionContext::sawVAOptFollowedByOpeningParens ( const SourceLocation VAOptLoc,
const unsigned int NumPriorTokens )
inline

The documentation for this class was generated from the following file: