Re: config NO_F00F_HACK

1999-04-26 Thread Peter Wemm
Chris Costello wrote:

 On Sun, Apr 25, 1999, a.leidin...@wurzelausix.cs.uni-sb.de wrote:
  Hi,
 =20
  # ident LINT
  LINT:
   $Id: LINT,v 1.589 1999/04/24 21:45:44 peter Exp $
 =20
  with:
  option NO_F00F_HACK
 =20
  # config WORK
  WORK:15: unknown option NO_F0F_HACK
   ^
 
You made a typo.

No, it is a parsing/stringification botch.  It's parsed like this:

ID: NO_F
NUMBER: 00  (octal 0)
ID: F_HACK

Of course, an atoi of 00 and then a sprintf(%d) results in a single 0.

I've fixed this here and will commit it shortly, but I'm a bit nervous about
the scope of the change required to prevent this information loss. :-/  I
don't know enough lex/yacc to do context-sensitive tokenization.

Cheers,
-Peter



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Alexander Leidinger
On 26 Apr, Peter Wemm wrote:

 I've fixed this here and will commit it shortly, but I'm a bit nervous about
 the scope of the change required to prevent this information loss. :-/  I
 don't know enough lex/yacc to do context-sensitive tokenization.

What about
pseudo-device i4bq921
at the moment I have to quote.

Bye,
Alexander.

-- 
http://netchild.home.pages.de A.Leidinger @ wurzelausix.cs.uni-sb.de



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Peter Wemm
Alexander Leidinger wrote:
 On 26 Apr, Peter Wemm wrote:
 
  I've fixed this here and will commit it shortly, but I'm a bit nervous abou
t
  the scope of the change required to prevent this information loss. :-/  I
  don't know enough lex/yacc to do context-sensitive tokenization.
 
 What about
 pseudo-device i4bq921
 at the moment I have to quote.

I don't think anything much can be done about that..  The tokenizer
essentially ignores whitespace, so these are the same:
pseudo-device   snp 4
pseudo-device   snp4

Without the quotes, your example above is parsed something like this:
pseudo-device i 4   bq  921
Ie: a request for 4 units of the i device and 921 units of the bq device,
which do not exist, or it will be a syntax error.

Unfortunately, you can't use options i4bq921 since there is:
#if NI4BQ921  0and...
conf/files:i4b/layer2/i4b_l2fsm.c optional i4bq921

That 'N' prefix is for the unit count.

Sigh...

Cheers,
-Peter



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Jos Backus
On Mon, Apr 26, 1999 at 05:37:51PM +0800, Peter Wemm wrote:
[parsing hell elided]
 Sigh...

Maybe config should be rewritten in perl :-)

Ducking,
-- 
Jos Backus  _/ _/_/_/  Reliability means never
   _/ _/   _/   having to say you're sorry.
  _/ _/_/_/ -- D. J. Bernstein
 _/  _/ _/_/
jos.bac...@nl.origin-it.com  _/_/  _/_/_/  use Std::Disclaimer;


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Luoqi Chen
  On Sun, Apr 25, 1999, a.leidin...@wurzelausix.cs.uni-sb.de wrote:
   Hi,
  =20
   # ident LINT
   LINT:
$Id: LINT,v 1.589 1999/04/24 21:45:44 peter Exp $
  =20
   with:
   option NO_F00F_HACK
  =20
   # config WORK
   WORK:15: unknown option NO_F0F_HACK
^
  
 You made a typo.
 
 No, it is a parsing/stringification botch.  It's parsed like this:
 
 ID:   NO_F
 NUMBER:   00  (octal 0)
 ID:   F_HACK
 
 Of course, an atoi of 00 and then a sprintf(%d) results in a single 0.
 
 I've fixed this here and will commit it shortly, but I'm a bit nervous about
 the scope of the change required to prevent this information loss. :-/  I
 don't know enough lex/yacc to do context-sensitive tokenization.
 
This should be fairly simple, please try this,

Index: lang.l
===
RCS file: /home/ncvs/src/usr.sbin/config/lang.l,v
retrieving revision 1.19
diff -u -r1.19 lang.l
--- lang.l  1999/04/24 18:59:19 1.19
+++ lang.l  1999/04/26 11:47:35
@@ -105,11 +105,14 @@
 int hex __P((char *));
 
 %}
-WORD   [-A-Za-z_][-A-Za-z_]*
+WORD   [A-Za-z_][-A-Za-z_]*
+ALNUM  [A-Za-z_][-A-Za-z_0-9]*
+%s NONUM
 %%
-{WORD} {
+NONUM{WORD}  {
int i;
 
+   BEGIN(0);
if ((i = kw_lookup(yytext)) == -1)
{
yylval.str = strdup(yytext);
@@ -118,6 +121,22 @@
}
tprintf((%s) , yytext);
return i;
+   }
+INITIAL{WORD} {
+   int i;
+
+   if ((i = kw_lookup(yytext)) == -1)
+   REJECT
+   if (i == CONTROLLER || i == DEVICE || i == DISK ||
+   i == PSEUDO_DEVICE || i == AT || i == ON)
+   BEGIN(NONUM);
+   tprintf((%s) , yytext);
+   return i;
+   }
+INITIAL{ALNUM} {
+   yylval.str = strdup(yytext);
+   tprintf(id(%s) , yytext);
+   return ID;
}
 \\\[^]+\\\  {
yytext[strlen(yytext)-2] = '';
 Cheers,
 -Peter
 

-lq


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Peter Wemm
Luoqi Chen wrote:
   On Sun, Apr 25, 1999, a.leidin...@wurzelausix.cs.uni-sb.de wrote:
Hi,
   =20
# ident LINT
LINT:
 $Id: LINT,v 1.589 1999/04/24 21:45:44 peter Exp $
   =20
with:
option NO_F00F_HACK
   =20
# config WORK
WORK:15: unknown option NO_F0F_HACK
 ^
   
  You made a typo.
  
  No, it is a parsing/stringification botch.  It's parsed like this:
  
  ID: NO_F
  NUMBER: 00  (octal 0)
  ID: F_HACK
  
  Of course, an atoi of 00 and then a sprintf(%d) results in a single 0
.
  
  I've fixed this here and will commit it shortly, but I'm a bit nervous abou
t
  the scope of the change required to prevent this information loss. :-/  I
  don't know enough lex/yacc to do context-sensitive tokenization.
  
 This should be fairly simple, please try this,

It works here fine, but I can't pretend that I understand it. :-)  Will you
commit it?

Cheers,
-Peter



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Daniel C. Sobral
Jos Backus wrote:
 
 On Mon, Apr 26, 1999 at 05:37:51PM +0800, Peter Wemm wrote:
 [parsing hell elided]
  Sigh...
 
 Maybe config should be rewritten in perl :-)

If it properly respected spaces, it would have been enough.
comments about things that ignore spaces elided

--
Daniel C. Sobral(8-DCS)
d...@newsguy.com
d...@freebsd.org

Well, Windows works, using a loose definition of 'works'...


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-26 Thread Luoqi Chen
 It works here fine, but I can't pretend that I understand it. :-)  Will you
 commit it?
 
 Cheers,
 -Peter
 
There's some problems with one I posted (e.g. can't deal with cases where
a keyword is followed immediately by a number like irq1), I'll commit a
better one.

-lq


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



config NO_F00F_HACK

1999-04-25 Thread A . Leidinger
Hi,

# ident LINT
LINT:
 $Id: LINT,v 1.589 1999/04/24 21:45:44 peter Exp $

with:
option NO_F00F_HACK

# config WORK
WORK:15: unknown option NO_F0F_HACK

with:
option NO_F00F_HACK

# config WORK
Don't forget to do a ``make depend''

Bye,
Alexander.

-- 
http://netchild.home.pages.de A.Leidinger @ wurzelausix.cs.uni-sb.de



To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-current in the body of the message



Re: config NO_F00F_HACK

1999-04-25 Thread Chris Costello
On Sun, Apr 25, 1999, a.leidin...@wurzelausix.cs.uni-sb.de wrote:
 Hi,
 
 # ident LINT
 LINT:
  $Id: LINT,v 1.589 1999/04/24 21:45:44 peter Exp $
 
 with:
 option NO_F00F_HACK
 
 # config WORK
 WORK:15: unknown option NO_F0F_HACK
  ^

   You made a typo.

-- 
Chris Costelloch...@calldei.com
Make sure all variables are initialized before use.


pgpyX4tJId8X8.pgp
Description: PGP signature