|
Boost Users : |
From: peter_foelsche_at_[hidden]
Date: 2008-05-06 14:54:52
Dear All,
I tried to integrate my flex scanner into boost::sprit.
I wrote my own iterator -- the value is int to represent the tokenid:
struct CScannerIterator:std::iterator<input_iterator_tag, int, ptrdiff_t, int*, int&>
{
....
boost::any yylval;
std::string m_sFileName;
int m_iTokenId;
int m_iLineNumber;
};
Then I tried to write my parser -- using chlit<int>(TokenId) to represent a token returned from the parser:
m_sExpression = chlit<int>(TK_INTEGER)[create_integer_expression(_rSelf.m_pStack)]
The problem is that the action for the chlit rule is getting passed an int instead of the iterator.
I need access to the yylval returned from the scanner.
Any idea on how to accomplish this?
Peter
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net