2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2012-09-11 21:53:38 +04:00
|
|
|
#ifndef cmGeneratorExpressionLexer_h
|
|
|
|
#define cmGeneratorExpressionLexer_h
|
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2012-09-11 21:53:38 +04:00
|
|
|
|
2016-09-01 21:59:28 +03:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <string>
|
2012-09-11 21:53:38 +04:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
struct cmGeneratorExpressionToken
|
|
|
|
{
|
2016-05-16 17:34:04 +03:00
|
|
|
cmGeneratorExpressionToken(unsigned type, const char* c, size_t l)
|
|
|
|
: TokenType(type)
|
|
|
|
, Content(c)
|
|
|
|
, Length(l)
|
2012-09-11 21:53:38 +04:00
|
|
|
{
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
enum
|
|
|
|
{
|
2012-09-11 21:53:38 +04:00
|
|
|
Text,
|
|
|
|
BeginExpression,
|
|
|
|
EndExpression,
|
|
|
|
ColonSeparator,
|
|
|
|
CommaSeparator
|
|
|
|
};
|
|
|
|
unsigned TokenType;
|
2016-05-16 17:34:04 +03:00
|
|
|
const char* Content;
|
2013-10-21 21:18:16 +04:00
|
|
|
size_t Length;
|
2012-09-11 21:53:38 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/** \class cmGeneratorExpressionLexer
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class cmGeneratorExpressionLexer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmGeneratorExpressionLexer();
|
|
|
|
|
2014-02-08 21:01:01 +04:00
|
|
|
std::vector<cmGeneratorExpressionToken> Tokenize(const std::string& input);
|
2012-09-11 21:53:38 +04:00
|
|
|
|
|
|
|
bool GetSawGeneratorExpression() const
|
|
|
|
{
|
|
|
|
return this->SawGeneratorExpression;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool SawBeginExpression;
|
|
|
|
bool SawGeneratorExpression;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|