Spirit Lex: Which token definition generated this token?
Sorry if this is a newbie question, but I need to know which token definition produced a certain token. When I print the token ID, I just get an integer. I need to know which regex generated this token. Edit: Here's how I define my tokens: template <typename LexerT> class Tokens: public lex::lexer<LexerT> { public: Tokens(const std::string& input): lineNo_(1) { using boost::spirit::lex::_start; using boost::spirit::lex::_end; using boost::spirit::lex::_pass; using boost::phoenix::ref; using boost::phoenix::construct; // macros this->self.add_pattern ("EXP", "(e|E)(\\+|-)?\\d+") ("SUFFIX", "