On Thu, Jan 02, 2003 at 03:25:01PM +0100, Miguel Mendez wrote:
> On Wed, 1 Jan 2003 18:24:40 -0500 (EST)
> Chuck Robey <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Since my little baby was mentioned, I thought I'd just comment :)
>
> > > You could perhaps copy the way that "The Fish" does it?
> > >
> > > Take a look at "ports/sysutils/thefish".
> > >
> > > The "parser.c" code appears to read /etc/{,defaults/}rc.conf and
> > > place all the options into a linked list.
>
> I can tell you I wholeheartedly hate parser.c :) and regret having not
> started with lex/yacc since day 1. Since the next major release will
> support not only FreeBSD, but NetBSD as well, I'm redoing the parser in
> a more flexible way. But again, it was my first parser, and so far seems
> to work fine :) I've concentrated more on other aspects of the program
> too.Here is a very simple lex/yacc parser that reads simple key value pairs. The whole thing took about 30 minutes to write. Exclusive states may not be the easiest or best way to handle the parts of the sh syntax that need to be ignored, but it was a quick way to handle the if, which was all I cared about. -- Chad David [EMAIL PROTECTED] www.FreeBSD.org [EMAIL PROTECTED] ISSci Inc. Calgary, Alberta Canada
readrc.tar.gz
Description: application/tar-gz

