class VAOptDefinitionContext

Declaration

class VAOptDefinitionContext { /* full declaration omitted */ };

Description

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

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:66

Member Variables

private SmallVector<clang::SourceLocation, 8> UnmatchedOpeningParens
Contains all the locations of so far unmatched lparens.
private const clang::IdentifierInfo* const Ident__VA_OPT__

Method Overview

Methods

VAOptDefinitionContext(clang::Preprocessor& PP)

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:74

Parameters

clang::Preprocessor& PP

clang::SourceLocation
getUnmatchedOpeningParenLoc() const

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:92

bool isAtTopLevel() const

Description

Are we at the top level within the __VA_OPT__?

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:113

bool isInVAOpt() const

Description

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

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:83

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

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:77

Parameters

const clang::Token& T

bool sawClosingParen()

Description

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.

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:100

void sawOpeningParen(
    clang::SourceLocation LParenLoc)

Description

Call this function each time an lparen is seen.

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:107

Parameters

clang::SourceLocation LParenLoc

void sawVAOptFollowedByOpeningParens(
    const clang::SourceLocation LParenLoc)

Description

Call this function as soon as you see __VA_OPT__ and '('.

Declared at: clang/include/clang/Lex/VariadicMacroSupport.h:86

Parameters

const clang::SourceLocation LParenLoc