diff --git a/TokenDefinition.cc b/TokenDefinition.cc index 3545e41..634aaf3 100644 --- a/TokenDefinition.cc +++ b/TokenDefinition.cc @@ -105,7 +105,7 @@ string TokenDefinition::getClassDefinition() const { ret += " virtual void process(const Matches & matches);\n"; } - ret += "protected:\n"; + ret += "\n"; ret += m_data + "\n"; ret += "};\n"; return ret; diff --git a/tmpl/parser.cc b/tmpl/parser.cc index 05c6eb9..76cb238 100644 --- a/tmpl/parser.cc +++ b/tmpl/parser.cc @@ -138,6 +138,7 @@ bool I_CLASSNAME::parse(istream & i) return false; } token->process(matches); + m_tokens.push_back(token); buff_pos += longest_match_length; } } diff --git a/tmpl/parser.h b/tmpl/parser.h index e802b81..f27f86a 100644 --- a/tmpl/parser.h +++ b/tmpl/parser.h @@ -10,6 +10,7 @@ #include #include #include +#include {%user_includes%} @@ -119,17 +120,6 @@ template void refptr::destroy() #endif -class I_CLASSNAME -{ - public: - I_CLASSNAME(); - bool parse(std::istream & in); - const char * getError() { return m_errstr; } - - protected: - const char * m_errstr; -}; - class Matches { public: @@ -165,12 +155,26 @@ class Token : public Node protected: int m_type; + + public: {%token_data%} }; typedef refptr TokenRef; {%token_classes%} +class I_CLASSNAME +{ + public: + I_CLASSNAME(); + bool parse(std::istream & in); + const char * getError() { return m_errstr; } + + protected: + const char * m_errstr; + std::list m_tokens; +}; + #ifdef I_NAMESPACE }; #endif