[ragel-users] When exactly is the eof variable required?

Grégory Pakosz gpakosz at yahoo.fr
Sun Feb 23 21:40:59 UTC 2014


I'm currently discovering Ragel and I am wondering when the eof
variable is required?

More exactly, I noticed in the following in the params.rl example:

output = '-o' 0? string 0 @output;

I understand the machines are defined to accept and consume NUL
characters. This is the reason why the params_execute function is
given strlen(argv[a])+1.

However, if I change params.rl to:

output = '-o' 0? string @output;

Then Ragel starts making use of the eof variable, which params.rl
doesn't define.

Can someone please explain me why removing that 0 in the machine makes
Ragel use the eof variable?

Thank you,

ragel-users mailing list
ragel-users at complang.org

More information about the ragel-users mailing list