/src/CMake/Source/cmGeneratorExpressionLexer.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <cstddef> |
8 | | #include <string> |
9 | | #include <vector> |
10 | | |
11 | | struct cmGeneratorExpressionToken |
12 | | { |
13 | | cmGeneratorExpressionToken(unsigned type, char const* c, size_t l) |
14 | 463k | : TokenType(type) |
15 | 463k | , Content(c) |
16 | 463k | , Length(l) |
17 | 463k | { |
18 | 463k | } |
19 | | enum |
20 | | { |
21 | | Text, |
22 | | BeginExpression, |
23 | | EndExpression, |
24 | | ColonSeparator, |
25 | | CommaSeparator |
26 | | }; |
27 | | unsigned TokenType; |
28 | | char const* Content; |
29 | | size_t Length; |
30 | | }; |
31 | | |
32 | | /** \class cmGeneratorExpressionLexer |
33 | | * |
34 | | */ |
35 | | class cmGeneratorExpressionLexer |
36 | | { |
37 | | public: |
38 | | cmGeneratorExpressionLexer(); |
39 | | |
40 | | std::vector<cmGeneratorExpressionToken> Tokenize(std::string const& input); |
41 | | |
42 | | bool GetSawGeneratorExpression() const |
43 | 0 | { |
44 | 0 | return this->SawGeneratorExpression; |
45 | 0 | } |
46 | | |
47 | | private: |
48 | | bool SawBeginExpression = false; |
49 | | bool SawGeneratorExpression = false; |
50 | | }; |