[ragel-users] Re: Simple URL parser
Adrian Thurston
thurs... at cs.queensu.ca
Wed May 28 20:59:57 UTC 2008
The eof actions are executed when p reaches eof, which is normally after
the last character in the buffer (assuming eof has been set to pe).
-Adrian
hsanson wrote:
> Adrian Thurston wrote:
>> Hi Horacio,
>>
>> The machine is not succeeding. It looks like hsegment is missing a
>> repetition operator.
>>
>> Yep, that's right, in version 6 the backend is called automatically.
>>
>> -Adrian
>>
>>
> Adrian, thanks very much for your support... I appreciate it.
> Unfortunately I am unable to grasp how Ragel works. I added the eof
> variable definition and created a very simple machine:
>
> main := ("http") $eof{ printf("reached eof\n"); };
>
> If I understand correctly I should see "reached eof" printed on console
> as soon as the parser finishes testing for the last "p" of "http".
> Running this under a debugger (gdb) I can see the eof condition is never
> tested and I get no output in console. And of course the url parser I am
> trying to implement also never reaches eof.
>
> Am I misunderstanding how ragel is supposed to work??
>
> thanks
> Horacio
>> Horacio Sanson wrote:
>>
>>> Strange, I installed ragel 6.2 and tried your last recommendation (use
>>> char *eof = pe) but I get the same behavior. The last write action
>>> never gets executed....
>>>
>>> BTW, this new version of ragel directly generates the C code (no xml
>>> in between) is this correct behavior or am I doing something wrong??
>>>
>>
>>
>
>
> >
>
More information about the ragel-users
mailing list