[ragel-users] access prefix

Brian Maher brian at brimworks.com
Tue Apr 26 04:02:24 UTC 2011


If it makes a difference, I actually keep p, pe, and eof in my
"struct" for managing ragel state, so if %access defined a prefix for
*all* state variables, then it would be a welcome change from my
perspective.

Although Adrian is right about p, pe, and eof being rather
"transient", I find it easier to write functions that take a single
"struct" argument that manages the ragel state.  This way I can write
a function called state_machine that encapsulates all my actions for
the state machine, but ends up delegating each action to a function
that takes the "struct" as an argument.  I just find this way of
writing code is easier for me and my editor to digest.

Cheers,
-Brian

On Mon, Apr 25, 2011 at 9:06 AM, Adrian Thurston <thurston at complang.org> wrote:
> Hi,
>
> The p, pe, and eof variables are not modified because they do not need to be
> maintained across partial executions of state machines. They are normally
> declared as local variables in the function that contains the write exec.
>
> The cs variable should be modified. If you are finding it isn't for some
> language, then that would definitely be a bug.
>
> -Adrian
>
> On 11-04-25 12:37 AM, ygrek wrote:
>>
>> Hello,
>>
>>  Is there any reason why %access defines prefix for all state variables
>> except some (p,pe,cs,eof)?
>>  I think it would be useful to specify prefix for all state variables (and
>> then override some variables if
>>  needed with individual %variable declarations).
>>
>
> --
> 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
>



-- 
Brian Maher >> Glory to God <<

_______________________________________________
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