Why does this not work?

David McGaughey mcgoy1 at clearwire.net
Wed Feb 25 01:18:09 UTC 2009

Greetings!  And sincerely thank you for this great reply.  I work for a very
poor city government - so bad off that I must use my personal e-mail for
this list.  So - I can't pay to have new development, but!  I did go and
purchase a t-shirt after reading this reply.  Thank you!

One other small question:  Would it be possible to pre-process the
dhcpd.conf file, following all the includes and making a new super,
temporary dhcpd.conf file that contains all the includes - and then - run
your PARSER and your LEXER on that?

I bought a shirt, but doubt it'll pay for that much work.  Sorry.

David McGaughey

Lubbock, Texas

mcgoy at plumbearcat.com



-----Original Message-----
From: dhcp-users-bounces at lists.isc.org
[mailto:dhcp-users-bounces at lists.isc.org] On Behalf Of David W. Hankins
Sent: Tuesday, February 24, 2009 11:25 AM
To: Users of ISC DHCP
Subject: Re: Why does this not work?

On Mon, Feb 23, 2009 at 07:24:30PM -0600, David McGaughey wrote:
> If I replace the include with the contents of the file, it works

Unfortunately, 'include' is processed by the PARSER, not the LEXER.
This is like programmer legalese to most folks, so the point is that
the file is read like "a second config file", the same function
creates a new parser instance, which attaches a new lexer instance,
which opens the named file and starts reading lexicons on behalf
of the parser, which is reading those as if from the global root

So no matter where 'include' appears in the config file, it always
behaves as though the file's contents were entered in the global

We should probably make it illegal or warn when the include isn't
written in the global scope, but it's almost as much work as just
fixing it so the lexer can process the statement like you'd expect.

David W. Hankins	"If you don't do it right the first time,
Software Engineer		     you'll just have to do it again."
Internet Systems Consortium, Inc.		-- Jack T. Hankins
dhcp-users mailing list
dhcp-users at lists.isc.org

More information about the dhcp-users mailing list