[ragel-users] setting the initial state

Nate nathan.sweet at gmail.com
Thu Apr 7 03:43:20 UTC 2011

Hi Adrian and friends,

I need to re-parse some input, starting at an offset and an initial state. I
know I can just set "p" to the offset and "cs" to the state, however, my
states are meaningful outside of the parser. My program is a language parser
for syntax highlighting, so I need int constants that represent the type of
tokens founds. I need some way of saying, "parse this char[] at offset X
using initial token type LITERAL_CHAR". I don't care if the LITERAL_CHAR
constant is the same as the parser state, but I need some way of setting
"cs" to a specific machine name or label.

I came across a post on the mailing list from 2007 saying, "For a really
long time now I've been meaning to implement a new feature which should help
you out. %% write entry <machine_or_label>;". This would work nicely I
think. I guess it has been a *really* really long time now, eh? :D Is there
any chance that this feature could be implemented soonly?


Ragel is so awesome! :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20110406/6bd9c4fb/attachment-0001.html>
-------------- next part --------------
ragel-users mailing list
ragel-users at complang.org

More information about the ragel-users mailing list