Grégory Pakosz
2014-02-23 21:40:59 UTC
Hello,
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,
Gregory
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,
Gregory