summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-09-11 17:53:38 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-18 21:02:23 (GMT)
commitf1eacf0e07759b57d100dbf5d83c70e4028bcb54 (patch)
tree8ccbb516aa96dd286e81f690845b7ddf72741f35 /Source/cmGeneratorExpression.h
parent1d3db6b34df827566ffe5615d568de0ef64d3e61 (diff)
downloadCMake-f1eacf0e07759b57d100dbf5d83c70e4028bcb54.zip
CMake-f1eacf0e07759b57d100dbf5d83c70e4028bcb54.tar.gz
CMake-f1eacf0e07759b57d100dbf5d83c70e4028bcb54.tar.bz2
cmGeneratorExpression: Re-write for multi-stage evaluation
The expressions may be parsed and then cached and evaluated multiple times. They are evaluated lazily so that literals such as ',' can be treated as universal parameter separators, and can be processed from results without appearing literally, and without interfering with the parsing/evaluation of the entire expression.
Diffstat (limited to 'Source/cmGeneratorExpression.h')
-rw-r--r--Source/cmGeneratorExpression.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index a023eb0..00e6907 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -19,6 +19,8 @@ class cmTarget;
class cmMakefile;
class cmListFileBacktrace;
+struct cmGeneratorExpressionEvaluator;
+
/** \class cmGeneratorExpression
* \brief Evaluate generate-time query expression syntax.
*
@@ -36,24 +38,29 @@ public:
cmListFileBacktrace const& backtrace,
bool quiet = false);
+ ~cmGeneratorExpression();
+
/** Evaluate generator expressions in a string. */
const char* Process(std::string const& input);
const char* Process(const char* input);
+ void Parse(const char* input);
+ const char* Evaluate(cmMakefile* mf, const char* config,
+ bool quiet = false);
+
/** Get set of targets found during evaluations. */
std::set<cmTarget*> const& GetTargets() const
{ return this->Targets; }
private:
+ std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
cmMakefile* Makefile;
const char* Config;
cmListFileBacktrace const& Backtrace;
bool Quiet;
- std::vector<char> Data;
- std::stack<size_t> Barriers;
- cmsys::RegularExpression TargetInfo;
- cmsys::RegularExpression TestConfig;
+
std::set<cmTarget*> Targets;
- bool Evaluate();
- bool Evaluate(const char* expr, std::string& result);
- bool EvaluateTargetInfo(std::string& result);
+ const char* Input;
+ bool NeedsParsing;
+
+ std::string Output;
};