[ragel-users] Basic Ragel parser - CS variable not changing

Luis Martin Gil martingil.luis at gmail.com
Wed May 4 12:45:54 UTC 2011


Hi everyone,

I am starting to use Ragel and I do need some help from you guys. This is
main.rl ( http://pastebin.com/vbinzrYg ), a Ragel + C simple program to
parse numbers according to this grammar *[0-9]+ ( '.' [0-9]+ )?;* . The
problem is that I am not able to get success parsing of correct inputs using
it.

This is the way I compile it :
*ragel -F0 main.rl*
*gcc -ggdb main.c -o main*

This is how I execute the program :
*$./main input.txt *
*
*
And this is the result : (please note that in the line is where is executed
the *%write init* and* %write exec *Ragel code)
*cs:  0*
*integer_first_final:  3*
*-----------*
*cs:  0*
*integer_first_final:  3*
*integer_error*
*Parsing "input.txt"... Failed!*

$cat input.txt
*1.1*

The CS variable is having an mysterious behavior. I would appreciate any
kind of help or guidance. Thanks.

Best,
Luis Martin Gil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20110504/5c61653a/attachment-0001.html>
-------------- next part --------------
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users


More information about the ragel-users mailing list