SIr, thanks very much...

very cool, i understand, you explain very well...

This solution fix my problem...


cheers





2014-11-28 8:45 GMT-02:00 Ulya Fokanova <skvad...@gmail.com>:

> Sorry for a late reply!
> Your letter somehow got to spam, so I overlooked it.
>
> There are some errors in your program:
>
> First of all, re2c rule for path
>     "href=".+'>'    { return PATH; }
> should look like
>     "href="[^>]+'>'    { return PATH; }
> because ".+" will consume all characters except "\n", so when re2c reaches
> ">",
> it will happily consume it and proceed to the end of the string. "[>]" is
> what you need.
>
> Next, I changed the main re2c loop. You put the loop in 'main', so that
> you have to
> returne from 'scan' every time on default character:
>     [^]    { return END; }
> It's a possible way to do things, but very inefficient: you have to call
> 'scan' on each
> input character. A much better way (and the usual way for re2c) is to make
> a loop
> inside of 'scan':
>     for (;;) {
>         ... // re2c code
>     }
> And instead of 'return END;' in default rule simply go to the start of
> 'for':
>     [^]    { continue; }
> But you should be careful with the end of the string:
>     "\x00"    { return END; }
> This rule *must* go before the default rule '[^]'. (It's better to use the
> new default rule '*':
> it always has the lowest priority.)
>
> Please see the full working example in attach. Hope that helped!
>
> Ulya
>
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Re2c-general mailing list
> Re2c-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/re2c-general
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Re2c-general mailing list
Re2c-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/re2c-general

Reply via email to