Date: Mon, 19 Apr 2004 13:07:35 +0200 From: Miguel Mendez <flynn@energyhq.es.eu.org> To: rodrigc@crodrigues.org Cc: hackers@freebsd.org Subject: About the rc.conf parsing thread Message-ID: <20040419130735.549b0979.flynn@energyhq.es.eu.org>
next in thread | raw e-mail | index | archive | help
--Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Craig & the rest, Just to add my $0.2 to the subject, you could have a look at the program I wrote (sysutils/thefish) which does what you mention. It has a dual interface (Gtk and libdialog) and the parser is quite good IMHO. The first iteration of the parsing backend was hand-coded, which I'd like to suggest you not to do. I rewrote the parser by moving all the lexical analysis code to a lex file. This will give you more flexibility and save time whenever you need to readjust your parser. If you don't know lex/yacc google for some tutorial, it becomes extremely useful whenever you want to parse anything but the most trivial files. Another hint, you might notice (I did) that coming up with a good enough data structure is vital for parser <-> GUI communication. I'd probably would have done it in a slightly different way now, but what I came up with works fine, feel free to take a look at that one too. The biggest part of my program is, by far, the GUI code. If you're going with GTK I'd suggest using the gtk_tree_view* set of functions, extremely useful and flexible stuff. Qt probably has a similar set of widgets. And the URI: http://www.energyhq.es.eu.org/thefish.html, it's in ports as well like I mentioned. Cheers, -- Miguel Mendez <flynn@energyhq.es.eu.org> http://www.energyhq.es.eu.org PGP Key: 0xDC8514F1 --Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (NetBSD) iD8DBQFAg7L9nLctrNyFFPERAl6UAJ9y20edp8gWGNUlfECVuu9UzGXISgCeO4lk iuidVLQ0vBq0o1B+yqghh5M= =LrWJ -----END PGP SIGNATURE----- --Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040419130735.549b0979.flynn>