Hi,

The only way to do this is to either take a pointer to everything up to, but not including the newline, then chomp off the trailing '==='. This is because the state machine is capable of the representing the notion of being in more than one state at once, but the data collection mechanism is not. You can ask the pioneers of computer science why that is ;)

-Adrian

On 11-01-27 11:38 PM, S.Geist wrote:
I'm trying to build a parser for text lines of the form:

=== line: {any chars here except \n} ===\n

I don't think I comprehend too well the way Ragel works, because I'm
failing miserably at my task.
Here's the code I've came up with: http://pastebin.com/rtp3dRSV

And the output:


$ echo "=== line: balpblap lapsl = klbokqe pblpel ===" | ./a.out
balpblap lapsl
balpblap lapsl = klbokqe pblpel
balpblap lapsl = klbokqe pblpel =
balpblap lapsl = klbokqe pblpel ==

What I need to do is extract the "{any chars here except \n}" part;
can anyone give me some hints on how to achieve this?

Thanks in advance!

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users


_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to