From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 19 04:08:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9560616A4CE for ; Mon, 19 Apr 2004 04:08:30 -0700 (PDT) Received: from mindfields.energyhq.es.eu.org (73.Red-213-97-200.pooles.rima-tde.net [213.97.200.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B4AC43D48 for ; Mon, 19 Apr 2004 04:08:24 -0700 (PDT) (envelope-from flynn@energyhq.es.eu.org) Received: from scienide.energyhq.es.eu.org (scienide.energyhq.es.eu.org [192.168.100.1]) by mindfields.energyhq.es.eu.org (Postfix) with SMTP id 2D28236844; Mon, 19 Apr 2004 13:08:20 +0200 (CEST) Date: Mon, 19 Apr 2004 13:07:35 +0200 From: Miguel Mendez To: rodrigc@crodrigues.org Message-Id: <20040419130735.549b0979.flynn@energyhq.es.eu.org> Organization: X-Mailer: Sylpheed version 0.9.9-gtk2-20040229 (GTK+ 2.4.0; i386--netbsdelf) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9" cc: hackers@freebsd.org Subject: About the rc.conf parsing thread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 11:08:30 -0000 --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 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--