Boost logo

Boost :

From: Alexander Hirner (hirner_at_[hidden])
Date: 2001-06-02 10:48:48


hi evb!

to first say, im no c++ nor a parser guru..
so i wanted to add some functionality to
test2.cpp (the calculater VM) contained in the
recent released Spirit source.
my goal was to add some constants like
pi (3.14, wanna make floats work too..),
one (1) or _testconst1 (f. e. 51) to it.

i´ve added a new rule:
Rule<> symbol = doSymbol (+alnum);
and changed rule expr1 to this:
expr1 = integer | symbol | group;

the Process func-header in struct Symbol : public
Action<Symbol> looks like this:
void Process (const string &strSymbol, char const*
end)

everything compiled fine.
but what would you think is strSymbol by passing
'one + 3 * 3'
to the scanner/parser in Compile (/*...*/):
       one
but it is
       one + 3 * 3
, so the whole string?
but
       3 * 3 + one
works contrary?! (strSymbol = "one")

what am i doing wrong?
thx in advance, ThaFacka

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk