[ragel-users] Basic Ragel parser - CS variable not changing
Adrian Thurston
thurston at complang.org
Wed May 4 14:51:15 UTC 2011
Hi Luis,
I don't see the exact input file ... but my guess is that it includes a
newline? Note that ragel always parses *exactly* the grammar that you
give it. It does not scan forward looking for a match or disregard
trailing data.
-Adrian
On 11-05-04 05:45 AM, Luis Martin Gil wrote:
> 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
>
>
>
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users
--
Dr. Adrian D. Thurston
http://www.complang.org/thurston/
_______________________________________________
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