Provide support for retaining the version number found in a config file.

llvm-svn: 15995
This commit is contained in:
Reid Spencer 2004-08-22 18:03:25 +00:00
parent 3820372162
commit f222ee6546
2 changed files with 14 additions and 0 deletions

View File

@ -89,6 +89,7 @@ namespace llvm {
struct ConfigData {
ConfigData();
std::string version; ///< The version number.
std::string langName; ///< The name of the source language
StringTable opts; ///< The o10n options for each level
Action PreProcessor; ///< PreProcessor command line

View File

@ -181,6 +181,18 @@ namespace {
error("Expecting '='");
}
void parseVersion() {
if (next() == EQUALS) {
while (next_is_real()) {
if (token == STRING || token == OPTION)
confDat->version = ConfigLexerState.StringVal;
else
error("Expecting a version string");
}
} else
error("Expecting '='");
}
void parseLang() {
switch (next() ) {
case NAME:
@ -357,6 +369,7 @@ namespace {
void parseAssignment() {
switch (token) {
case VERSION: parseVersion(); break;
case LANG: parseLang(); break;
case PREPROCESSOR: parsePreprocessor(); break;
case TRANSLATOR: parseTranslator(); break;