ENH: Using lex-based tokenizer and a simple recursive-descent parser in place of the old hand-coded parser for CMake listfiles.

This commit is contained in:
Brad King
2003-12-08 13:36:59 -05:00
parent 380ee8ca36
commit 00ae7ea261
6 changed files with 2722 additions and 233 deletions

View File

@@ -79,25 +79,7 @@ public:
//! Flush cache file out of cache.
void FlushCache(const char* path);
/**
* Read a CMake command (or function) from an input file. This
* returns the name of the function and a list of its
* arguments. The last argument is the name of the file that
* the ifstream points to, and is used for debug info only.
*/
static bool ParseFunction(std::ifstream&, cmListFileFunction& function,
const char* filename, bool& parseError,
long& line);
/**
* Extract white-space separated arguments from a string.
* Double quoted strings are accepted with spaces.
* This is called by ParseFunction.
*/
static void GetArguments(std::string& line,
std::vector<cmListFileArgument>& arguments);
private:
// Cache the file
bool CacheFile(const char* path, bool requireProjectCommand);
@@ -107,5 +89,4 @@ private:
static cmListFileCache* Instance; // singelton pointer
};
#endif