About the rc.conf parsing thread
Miguel Mendez
flynn at energyhq.es.eu.org
Mon Apr 19 04:08:30 PDT 2004
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 at energyhq.es.eu.org>
http://www.energyhq.es.eu.org
PGP Key: 0xDC8514F1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040419/b96c7ed9/attachment.bin
More information about the freebsd-hackers
mailing list