From owner-freebsd-hackers Fri Jan 3 7:45:17 2003 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 A92A737B401 for ; Fri, 3 Jan 2003 07:45:16 -0800 (PST) Received: from energyhq.homeip.net (213-97-200-73.uc.nombres.ttd.es [213.97.200.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBE7E43EA9 for ; Fri, 3 Jan 2003 07:45:13 -0800 (PST) (envelope-from flynn@energyhq.homeip.net) Received: from christine.energyhq.tk (christine.energyhq.tk [192.168.0.1]) by energyhq.homeip.net (Postfix) with SMTP id 73DA6AF581; Fri, 3 Jan 2003 16:45:00 +0100 (CET) Date: Fri, 3 Jan 2003 16:44:50 +0100 From: Miguel Mendez To: Chad David Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Reading rc.conf from C programs? Message-Id: <20030103164450.1d70c36e.flynn@energyhq.homeip.net> In-Reply-To: <20030102232023.GA86743@colnta.acns.ab.ca> References: <20030102012042.A16965@apotheosis.org.za> <20030101181840.P29988-100000@april.chuckr.org> <20030102152501.64332e55.flynn@energyhq.homeip.net> <20030102232023.GA86743@colnta.acns.ab.ca> X-Mailer: Sylpheed version 0.8.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) X-Face: 1j}k*2E>Y\+C~E|/wehi[:dCM,{N7/uE 3o# P,{t7gA/qnovFDDuyQV.1hdT7&#d)q"xY33}{_GS>kk'S{O]nE$A`T|\4&p\&mQyexOLb8}FO List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 2 Jan 2003 16:20:23 -0700 Chad David wrote: Hi, > 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. Thanks, looks like a very good start point. I'd need to do some hacking on it to also get the comments, which I use as tooltips in the GTK+ frontend, but is the kind of thing I'm looking for, so I can easily move between different rc.conf styles (NetBSD vs FreeBSD) without having to start from scratch every time. Cheers, -- Miguel Mendez - flynn@energyhq.homeip.net GPG Public Key :: http://energyhq.homeip.net/files/pubkey.txt EnergyHQ :: http://www.energyhq.tk Of course it runs NetBSD! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message