[ragel-users] properties list

Adrian Thurston adrian.thurston at esentire.com
Tue Dec 1 18:10:57 UTC 2009


Torsten Curdt wrote:
> 1. Are actions the right way to access/extract the content of the
> tokens? I would love to have the key/value pair available in the
> machine definition of the assignment.

Yes. Ragel makes no assumptions about how the programmer wishes to 
allocate memory for input buffers. Avoiding such assumptions precludes 
automatic capture of matched items.

Your choices are to copy characters into a buffer byte by byte, or to 
retain pointers. The latter approach requires more care if it is 
expected that interesting items span input buffers.

> 2. I've had a look at the C grammar but did not really understand how
> the comment rules worked. I tried with that approach but I could not
> capture and access the comment text.

See Chapter Four of the manual.

> 3. Does whitespace has to be handled just as any other input? No
> special treatment?

Correct.

> 4. What about unicode support? I've read that UTF8 should be possible.
> What about UTF16?

Yes, parsing UTF16 is possible. Ragel is only concerned with processing 
arrays of fixed size characters. These can be 1, 2, 4, etc bytes wide. 
The rest is up to you.

-Adrian





More information about the ragel-users mailing list