[ragel-users] making fgoto a no-op

Adrian Thurston thurs... at cs.queensu.ca
Mon Apr 21 14:50:56 UTC 2008


Hi Martin,

In the -G2 machine cs isn't always kept up to date inside the execution
loop. You could init another variable using

int targ_cs = ftargs;

and then base the logic on that.

-Adrian


Martin Pirker wrote:
> Dear readers....
> 
> I have
> 
> %%{
> 
> action check_data {
>   check_foo(......);
>   fgoto *cs;     # no-op if no error occured, else stop with error
> }
> 
> }%%
> 
> 
> check_foo(.....) {
>   if (........) {
>     cs = machine_error;
>   }
> }
> 
> 
> Question:
> I can't check the data using the Ragel machine and don't
> want to place the code in the action{...} definition. So I call
> out to the language side, but still want to use the Ragel
> error state as feedback/abort, if errors do happen.
> 
> What are (could be) the side effects of directly manipulating
> cs this way or is that approach ok?
> 
> 
> Thanks,
> Martin
> 
> > 
> 



More information about the ragel-users mailing list