renamed "ignored" flag to "process" in token definitions

This commit is contained in:
Josh Holtrop 2010-05-18 14:22:11 -04:00
parent 953796ec23
commit b90b83ab0f
4 changed files with 9 additions and 7 deletions

View File

@ -71,7 +71,7 @@ refptr<string> Parser::buildTokenList()
*tokenlist += " "; *tokenlist += " ";
*tokenlist += "{ \"" + m_tokens[i]->getName() + "\", \"" *tokenlist += "{ \"" + m_tokens[i]->getName() + "\", \""
+ m_tokens[i]->getCString() + "\", " + m_tokens[i]->getCString() + "\", "
+ (m_tokens[i]->getIgnored() ? "true" : "false") + " }"; + (m_tokens[i]->getProcessFlag() ? "true" : "false") + " }";
if (i < m_tokens.size() - 1) if (i < m_tokens.size() - 1)
*tokenlist += ", \\\n"; *tokenlist += ", \\\n";
} }
@ -232,6 +232,7 @@ bool Parser::parseInputFile(char * buff, int size)
if (ovector[8] >= 0 && ovector[9] >= 0 if (ovector[8] >= 0 && ovector[9] >= 0
&& ovector[9] - ovector[8] > 0) && ovector[9] - ovector[8] > 0)
{ {
td->setProcessFlag(true);
code = ""; /* FIXME: function definition */ code = ""; /* FIXME: function definition */
gathering_code = true; gathering_code = true;
} }

View File

@ -51,7 +51,7 @@ static string c_escape(const string & orig)
TokenDefinition::TokenDefinition() TokenDefinition::TokenDefinition()
: m_ignored(false) : m_process(false)
{ {
} }
@ -76,9 +76,9 @@ bool TokenDefinition::create(const string & name,
{ {
(*parts)[i] = trim((*parts)[i]); (*parts)[i] = trim((*parts)[i]);
string & s = (*parts)[i]; string & s = (*parts)[i];
if (s == "i") if (s == "p")
{ {
m_ignored = true; m_process = true;
} }
else else
{ {

View File

@ -12,12 +12,13 @@ class TokenDefinition
const std::string & definition, const std::string & flags); const std::string & definition, const std::string & flags);
std::string getCString() const; std::string getCString() const;
std::string getName() const { return m_name; } std::string getName() const { return m_name; }
bool getIgnored() const { return m_ignored; } bool getProcessFlag() const { return m_process; }
void setProcessFlag(bool p) { m_process = p; }
protected: protected:
std::string m_name; std::string m_name;
std::string m_definition; std::string m_definition;
bool m_ignored; bool m_process;
}; };
#endif #endif

View File

@ -38,7 +38,7 @@ bool I_CLASSNAME::parse(istream & i)
struct { struct {
const char * name; const char * name;
const char * definition; const char * definition;
bool ignored; bool process;
pcre * re; pcre * re;
pcre_extra * re_extra; pcre_extra * re_extra;
} tokens[] = { } tokens[] = {