From owner-freebsd-config Mon Jan 27 20:23:24 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id UAA16173 for config-outgoing; Mon, 27 Jan 1997 20:23:24 -0800 (PST) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA16151; Mon, 27 Jan 1997 20:23:17 -0800 (PST) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.2/8.7.3) id OAA07019; Tue, 28 Jan 1997 14:53:14 +1030 (CST) From: Michael Smith Message-Id: <199701280423.OAA07019@genesis.atrad.adelaide.edu.au> Subject: Re: Kernel config metasyntax In-Reply-To: <199701280416.OAA06928@genesis.atrad.adelaide.edu.au> from Michael Smith at "Jan 28, 97 02:46:53 pm" To: msmith@genesis.atrad.adelaide.edu.au (Michael Smith) Date: Tue, 28 Jan 1997 14:53:14 +1030 (CST) Cc: config@freebsd.org, chat@freebsd.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-config@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Michael Smith stands accused of saying: > > To add an option, you would write an option definition in the > metaconfiguration language. The example I provided _explicitly_ > parses the metaconfiguration language samples that I posted earlier; > it simply takes advange of the braced syntax and the Tcl parser to > avoid reinventing the wheel. If you want to parse the syntax in > another language, it's still easy. I haven't commented on Tatsumi's post yet (still too busy 8) but one thing that I should observe : Using a rigid syntax (eg. a Yacc syntax) is a Very Bad Idea, as it closes the definition of the language. The whole idea behind the attribute name/value pairing is that attribute-dependent functions should be triggered by the presence of the attribute, and it should be possible to add attributes to an option/whatever definition without having to tell the parser about it. (ie. if you eyeball the Tcl parser I posted, you'll notice that all it does is register the existence of the option, and pile all of the attributes supplied with it into the array. Later, anything that cares about options can access all of this and make up its own mind; the parser should not need to know or care what the attributes and their valus are.) -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[