added TokenDefinition::getClassName()
This commit is contained in:
parent
3f3dd81e67
commit
5219989f2a
@ -157,7 +157,7 @@ refptr<string> Parser::buildBuildToken()
|
||||
t++)
|
||||
{
|
||||
*buildToken += "case " + (*t)->getIdentifier() + ":\n";
|
||||
*buildToken += " token = new " + (*t)->getName() + "();\n";
|
||||
*buildToken += " token = new " + (*t)->getClassName() + "();\n";
|
||||
*buildToken += " break;\n";
|
||||
}
|
||||
return buildToken;
|
||||
|
@ -99,8 +99,7 @@ string TokenDefinition::getCString() const
|
||||
|
||||
string TokenDefinition::getClassDefinition() const
|
||||
{
|
||||
string ret = "class ";
|
||||
ret += m_name + " : public Token {\n";
|
||||
string ret = "class "+ getClassName() + " : public Token {\n";
|
||||
ret += "public:\n";
|
||||
if (m_process)
|
||||
{
|
||||
@ -117,7 +116,7 @@ string TokenDefinition::getProcessMethod() const
|
||||
string ret;
|
||||
if (m_code != "")
|
||||
{
|
||||
ret += "void " + m_name + "::process(Matches matches) {\n";
|
||||
ret += "void " + getClassName() + "::process(Matches matches) {\n";
|
||||
ret += m_code + "\n";
|
||||
ret += "}\n";
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ class TokenDefinition
|
||||
std::string getCode() const { return m_code; }
|
||||
std::string getClassDefinition() const;
|
||||
std::string getProcessMethod() const;
|
||||
std::string getIdentifier() { return std::string("TK_") + m_name; }
|
||||
std::string getIdentifier() const { return "TK_" + m_name; }
|
||||
std::string getClassName() const { return "Tk" + m_name; }
|
||||
|
||||
protected:
|
||||
std::string m_name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user