On 2/11/07, David Chisnall <[EMAIL PROTECTED]> wrote:
On 11 Feb 2007, at 21:05, Yen-Ju Chen wrote:

>  Ragel help you write a XML parser.
>  It matches a string/regex and fire a function/method call you
> assigned.
>  So if a '<message><bod' is received,
>  you can matches '<message>' and fire call_message_tag()
>  and keep '<bod' in buffer for the next iteration.
>  If you have a home-made XML parser,
>  it basically replace the part where you need to match string
>  using strcmp or NSScanner.
>
>  Here is another description:
>  http://www.zedshaw.com/tips/ragel_state_charts.html
>  Just read the top introduction part.
>  The rest is not very useful in this discussion.

Aha!  Yes, it does seem like it would be useful.  My XML parser code
is quite ugly in places (lots of C preprocessor stuff), so it would
be nice to be able to replace all of that with something simpler to
maintain.  I shall have a play with Ragel at some point.

 I quickly port part of  hpricot to Objective-C.
 it is under svn etoile/branches/yjchen/hpricot_scan/
 After compilation, it can read and split out html syntax.
 I just finished it and haven't test it throughly.
 Maybe it will help you to start with.

 Have fun.

 Yen-Ju


_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev


_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to