Utility functions for extracting information from SQL schema files. More...
Functions | |
void | extractTable (const std::string &filename, const std::string &tablename, TableInfo &att) |
Extract all info for the named table in the named schema file. | |
void | string2words (const std::string &str, StringMap &words) |
bool | isAttrEntry (const std::string &word) |
Does the word correspond to the name of an attribute? | |
bool | isCreateTable (const std::string &w1, const std::string &w2, const std::string &w3, const std::string &tablename) |
bool | isEndOfTable (const std::string &word) |
Does the word correspond to the end of the text describing a table? | |
bool | isTag (const std::string &word) |
Does the word correspond to one of our in house --/X tags? | |
Variables | |
const std::string | TAGHEAD = "--/" |
Utility functions for extracting information from SQL schema files.
void SqlParser::extractTable | ( | const std::string & | filename, | |
const std::string & | tablename, | |||
TableInfo & | att | |||
) |
Extract all info for the named table in the named schema file.
References TableInfo::addName(), TableInfo::addTag(), isAttrEntry(), isCreateTable(), isEndOfTable(), isTag(), TableInfo::setTableName(), string2words(), and TAGHEAD.
Referenced by extractMetadata(), extractSources(), and main().
bool SqlParser::isAttrEntry | ( | const std::string & | word | ) |
Does the word correspond to the name of an attribute?
Referenced by extractTable().
bool SqlParser::isCreateTable | ( | const std::string & | w1, | |
const std::string & | w2, | |||
const std::string & | w3, | |||
const std::string & | tablename | |||
) |
Do the three words correspond to a "CREATE TABLE [name]" directive?
Referenced by extractTable().
bool SqlParser::isEndOfTable | ( | const std::string & | word | ) |
Does the word correspond to the end of the text describing a table?
Referenced by extractTable().
bool SqlParser::isTag | ( | const std::string & | word | ) |
Does the word correspond to one of our in house --/X tags?
References TAGHEAD.
Referenced by extractTable().
void SqlParser::string2words | ( | const std::string & | str, | |
StringMap & | words | |||
) |
Decompose a "sentence" into its individual "words" as delimited by spaces This is different from the split function in the string utility functions in that here we deal with the special case of whitespace
Referenced by extractTable().
const std::string SqlParser::TAGHEAD = "--/" |
Referenced by extractTable(), and isTag().