clang 22.0.0git
PPEmbedParameters.h
Go to the documentation of this file.
1//===--- PPEmbedParameters.h ------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Defines all of the preprocessor directive parmeters for #embed
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LEX_PPEMBEDPARAMETERS_H
14#define LLVM_CLANG_LEX_PPEMBEDPARAMETERS_H
15
17#include "clang/Lex/Token.h"
18#include "llvm/ADT/SmallVector.h"
19
20namespace clang {
21
22/// Preprocessor extension embed parameter "clang::offset"
23/// `clang::offset( constant-expression )`
31
32/// Preprocessor standard embed parameter "limit"
33/// `limit( constant-expression )`
41
42/// Preprocessor standard embed parameter "prefix"
43/// `prefix( balanced-token-seq )`
51
52/// Preprocessor standard embed parameter "suffix"
53/// `suffix( balanced-token-seq )`
61
62/// Preprocessor standard embed parameter "if_empty"
63/// `if_empty( balanced-token-seq )`
71
73 std::optional<PPEmbedParameterLimit> MaybeLimitParam;
74 std::optional<PPEmbedParameterOffset> MaybeOffsetParam;
75 std::optional<PPEmbedParameterIfEmpty> MaybeIfEmptyParam;
76 std::optional<PPEmbedParameterPrefix> MaybePrefixParam;
77 std::optional<PPEmbedParameterSuffix> MaybeSuffixParam;
79
80 size_t PrefixTokenCount() const {
82 return MaybePrefixParam->Tokens.size();
83 return 0;
84 }
85 size_t SuffixTokenCount() const {
87 return MaybeSuffixParam->Tokens.size();
88 return 0;
89 }
90};
91} // end namespace clang
92
93#endif
SmallVector< Token, 2 > Tokens
PPEmbedParameterIfEmpty(SmallVectorImpl< Token > &&Tokens, SourceRange R)
PPEmbedParameterLimit(size_t Limit, SourceRange R)
PPEmbedParameterOffset(size_t Offset, SourceRange R)
SmallVector< Token, 2 > Tokens
PPEmbedParameterPrefix(SmallVectorImpl< Token > &&Tokens, SourceRange R)
PPEmbedParameterSuffix(SmallVectorImpl< Token > &&Tokens, SourceRange R)
SmallVector< Token, 2 > Tokens
A trivial tuple used to represent a source range.
The JSON file list parser is used to communicate input to InstallAPI.
std::optional< PPEmbedParameterIfEmpty > MaybeIfEmptyParam
std::optional< PPEmbedParameterOffset > MaybeOffsetParam
std::optional< PPEmbedParameterLimit > MaybeLimitParam
std::optional< PPEmbedParameterSuffix > MaybeSuffixParam
std::optional< PPEmbedParameterPrefix > MaybePrefixParam