swh:1:snp:3cba5856b0ddc3feab6c3c2d096d614b02c883ec
Raw File
Tip revision: e4a0d8f39987a4574336892106b39781fd2d4e50 authored by Brad King on 16 March 2018, 11:34:34 UTC
CMake 3.10.3
Tip revision: e4a0d8f
cmGeneratorExpressionLexer.h
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#ifndef cmGeneratorExpressionLexer_h
#define cmGeneratorExpressionLexer_h

#include "cmConfigure.h" // IWYU pragma: keep

#include <stddef.h>
#include <string>
#include <vector>

struct cmGeneratorExpressionToken
{
  cmGeneratorExpressionToken(unsigned type, const char* c, size_t l)
    : TokenType(type)
    , Content(c)
    , Length(l)
  {
  }
  enum
  {
    Text,
    BeginExpression,
    EndExpression,
    ColonSeparator,
    CommaSeparator
  };
  unsigned TokenType;
  const char* Content;
  size_t Length;
};

/** \class cmGeneratorExpressionLexer
 *
 */
class cmGeneratorExpressionLexer
{
public:
  cmGeneratorExpressionLexer();

  std::vector<cmGeneratorExpressionToken> Tokenize(const std::string& input);

  bool GetSawGeneratorExpression() const
  {
    return this->SawGeneratorExpression;
  }

private:
  bool SawBeginExpression;
  bool SawGeneratorExpression;
};

#endif
back to top