clang 20.0.0git
|
Contains information on the token's role in a macro expansion. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/FormatToken.h"
Public Member Functions | |
MacroExpansion (MacroRole Role) | |
Public Attributes | |
MacroRole | Role |
The token's role in the macro expansion. | |
llvm::SmallVector< FormatToken *, 1 > | ExpandedFrom |
The stack of macro call identifier tokens this token was expanded from. | |
unsigned | StartOfExpansion = 0 |
The number of expansions of which this macro is the first entry. | |
unsigned | EndOfExpansion = 0 |
The number of currently open expansions in ExpandedFrom this macro is the last token in. | |
Contains information on the token's role in a macro expansion.
Given the following definitions: A(X) = [ X ] B(X) = < X > C(X) = X
Consider the macro call: A({B(C(C(x)))}) -> [{<x>}]
In this case, the tokens of the unexpanded macro call will have the following relevant entries in their macro context (note that formatting the unexpanded macro call happens after formatting the expanded macro call): A( { B( C( C(x) ) ) } ) Role: NN U NN NN NNUN N N U N (N=None, U=UnexpandedArg)
[ { < x > } ]
Role: H E H E H E H (H=Hidden, E=ExpandedArg) ExpandedFrom[0]: A A A A A A A ExpandedFrom[1]: B B B ExpandedFrom[2]: C ExpandedFrom[3]: C StartOfExpansion: 1 0 1 2 0 0 0 EndOfExpansion: 0 0 0 2 1 0 1
Definition at line 265 of file FormatToken.h.
|
inline |
Definition at line 266 of file FormatToken.h.
References Role.
unsigned clang::format::MacroExpansion::EndOfExpansion = 0 |
The number of currently open expansions in ExpandedFrom
this macro is the last token in.
Definition at line 284 of file FormatToken.h.
llvm::SmallVector<FormatToken *, 1> clang::format::MacroExpansion::ExpandedFrom |
The stack of macro call identifier tokens this token was expanded from.
Definition at line 277 of file FormatToken.h.
MacroRole clang::format::MacroExpansion::Role |
The token's role in the macro expansion.
When formatting an expanded macro, all tokens that are part of macro arguments will be MR_ExpandedArg, while all tokens that are not visible in the macro call will be MR_Hidden. When formatting an unexpanded macro call, all tokens that are part of macro arguments will be MR_UnexpandedArg.
Definition at line 274 of file FormatToken.h.
Referenced by MacroExpansion().
unsigned clang::format::MacroExpansion::StartOfExpansion = 0 |
The number of expansions of which this macro is the first entry.
Definition at line 280 of file FormatToken.h.