Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jan 1997 13:55:11 +1030 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        jkh@time.cdrom.com (Jordan K. Hubbard)
Cc:        msmith@atrad.adelaide.edu.au, hosokawa@mt.cs.keio.ac.jp, keithl@wakko.gil.net, chat@freebsd.org, config@freebsd.org
Subject:   Kernel config metasyntax
Message-ID:  <199701280325.NAA06408@genesis.atrad.adelaide.edu.au>
In-Reply-To: <18310.854101530@time.cdrom.com> from "Jordan K. Hubbard" at "Jan 24, 97 02:25:30 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Jordan K. Hubbard stands accused of saying:
> > I really don't like that much.  How about :
> > 
> > # file : kern_options.kci
> > 
> > option "DDB" {
> > 	description	"Enables the kernel debugger"
> > 	manref		"ddb(4)"
> > }
> > [ Other examples elided ]
> 
> I like it!  Who's gonna write the yacc specification! :-)

Uhh, why do we want a yacc parser for this?  

What's wrong with :

proc option {name attrib} {

	global Options;

	lappend Options(list) $name;

	foreach attrp $attrib {
		set aname [lindex $attrp 0];
		set aval [lrange $attrp 1 end];
		set Options($name:$aname) $aval;
	}
}

proc config_read {dir} {

	set cfiles [glob -nocomplain $dir/*.kci];

	foreach f $cfiles {
		source $f;
	}
}

(note error/range checking elided for clarity)

> 					Jordan

-- 
]] 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  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701280325.NAA06408>