[ragel-users] Parsing a component of a machine

Adrian Thurston thurston at complang.org
Tue Feb 3 02:49:18 UTC 2009


Yes you can do it that way, but you don't need a separate file. You can include definitions from a different machine specification in the same file.

-Adrian
------Original Message------
From: Iñaki Baz Castillo
To: ragel-users at complang.org
ReplyTo: ragel-users at complang.org
Sent: Feb 2, 2009 4:58 AM
Subject: Re: [ragel-users] Parsing a component of a machine

2009/2/2 Adrian Thurston <thurston at complang.org>:
> Yes you can. Just make a machine specification containing common statements and then use the include feature.

Ok, I was thinking about that exactly. Also I think I should use
"fgoto" since I have the following grammar:


- From header: display_name uri header_params

- URI

- More stuff (CRLF, SP, TAB, vchar...)


So if I'm not wrong I could insert all the common stuff in a separate
file (using later "include") and create two machines:

- from_header
- uri

So when parsing a "from_header" I should use "fgoto" to parse the
internal URI. I hope this is the correct way.

Really thanks a lot.


-- 
Iñaki Baz Castillo
<ibc at aliax.net>

_______________________________________________
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