From: joel de guzman (isis-tech_at_[hidden])
Date: 2001-06-02 11:19:13
From: "Alexander Hirner" :
> Action<Symbol> looks like this:
> void Process (const string &strSymbol, char const*
> everything compiled fine.
> but what would you think is strSymbol by passing
> 'one + 3 * 3'
> to the scanner/parser in Compile (/*...*/):
> but it is
> one + 3 * 3
> , so the whole string?
> 3 * 3 + one
> works contrary?! (strSymbol = "one")
> what am i doing wrong?
> thx in advance, ThaFacka
OK now I got it. You are doing fine! Nothing wrong.
strSymbol points to the first char in the matched string.
what you should do is check out 'end'. this points to the
last char of the matched string. So the length of the
matched string is (end - strSymbol).
Hope this helps,
Joel de Guzman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk