Machine definitions that depend on each other

chrsan chr... at gmail.com
Tue May 15 13:43:56 UTC 2007


Hi!

I'm working with Ragel for the first time, implementing a CSS scanner/
parser.
I've run into trouble having machine definitions that depend on each
other. In the following
example term refers to function which in turn refers to expr that
refers to term.

What's the best way to solve this in Ragel?
I haven't come up with a way to solve this by rearranging the
definitions.

function = ident '(' s* expr ')' s*;
term = ( ( ( unary_operator? ( unary_term | num ident ) ) | string |
ident | uri ) s* ) | hexcolor | function;
operator = ( '/' | ',' ) s*;
expr = term ( operator? term )*;

Thanks in advance,
Christer Sandberg



More information about the ragel-users mailing list