clang 18.0.0git
Public Member Functions | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

 VAOptExpansionContext (Preprocessor &PP)
 
void reset ()
 
const TokengetEOFTok () 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

Definition at line 151 of file VariadicMacroSupport.h.

References clang::Token::setKind(), and clang::Token::startToken().

Member Function Documentation

◆ beginsWithPlaceholder()

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

Definition at line 186 of file VariadicMacroSupport.h.

◆ endsWithPlaceholder()

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

Definition at line 191 of file VariadicMacroSupport.h.

◆ getEOFTok()

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

Definition at line 169 of file VariadicMacroSupport.h.

◆ getLeadingSpaceForStringifiedToken()

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

Definition at line 212 of file VariadicMacroSupport.h.

◆ getNumberOfTokensPriorToVAOpt()

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

Definition at line 206 of file VariadicMacroSupport.h.

◆ getVAOptLoc()

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

Definition at line 229 of file VariadicMacroSupport.h.

References clang::SourceLocation::isValid().

◆ hasCharifyBefore()

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

Definition at line 197 of file VariadicMacroSupport.h.

Referenced by hasStringifyOrCharifyBefore().

◆ hasPlaceholderAfterHashhashAtStart()

void clang::VAOptExpansionContext::hasPlaceholderAfterHashhashAtStart ( )
inline

Definition at line 179 of file VariadicMacroSupport.h.

◆ hasPlaceholderBeforeRParen()

void clang::VAOptExpansionContext::hasPlaceholderBeforeRParen ( )
inline

◆ hasStringifyOrCharifyBefore()

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

Definition at line 202 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 159 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 171 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: