Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpc/hpc/platid_gen BUGFIX:



details:   https://anonhg.NetBSD.org/src/rev/25358aafd0fa
branches:  trunk
changeset: 504458:25358aafd0fa
user:      takemura <takemura%NetBSD.org@localhost>
date:      Sat Mar 03 12:51:44 2001 +0000

description:
BUGFIX:
  - line number go wrong when directives appear.
  - a directives in a pair of {} make syntax error.

diffstat:

 sys/arch/hpc/hpc/platid_gen/Makefile |  26 +++++++++++++-------------
 sys/arch/hpc/hpc/platid_gen/gram.y   |   5 +++--
 sys/arch/hpc/hpc/platid_gen/scan.l   |   4 ++--
 3 files changed, 18 insertions(+), 17 deletions(-)

diffs (78 lines):

diff -r be36ebd15516 -r 25358aafd0fa sys/arch/hpc/hpc/platid_gen/Makefile
--- a/sys/arch/hpc/hpc/platid_gen/Makefile      Sat Mar 03 08:14:06 2001 +0000
+++ b/sys/arch/hpc/hpc/platid_gen/Makefile      Sat Mar 03 12:51:44 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2001/02/04 05:19:14 takemura Exp $
+#      $NetBSD: Makefile,v 1.3 2001/03/03 12:51:44 takemura Exp $
 
 S=     ../../../..
 
@@ -24,17 +24,17 @@
 DEFFILE                =       $S/arch/hpc/conf/platid.def
 PLATIDGEN      =       $S/arch/hpc/hpc/platid_gen/${PROG}
 
-${GENHDR}: ${DEFFILE}
-       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
-       ${PLATIDGEN} -header < ${DEFFILE} >> ${GENHDR}
-${MASK_H}: ${DEFFILE}
-       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
-       ${PLATIDGEN} -mask_h < ${DEFFILE} >> ${MASK_H}
-${MASK_C}: ${DEFFILE}
-       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
-       ${PLATIDGEN} -mask_c < ${DEFFILE} >> ${MASK_C}
-${NAME_C}: ${DEFFILE}
-       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET}
-       ${PLATIDGEN} -name_c < ${DEFFILE} >> ${NAME_C}
+${GENHDR}: ${DEFFILE} ${PROG}
+       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET} || rm ${.TARGET}
+       ${PLATIDGEN} -header < ${DEFFILE} >> ${GENHDR} || rm ${.TARGET}
+${MASK_H}: ${DEFFILE} ${PROG}
+       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET} || rm ${.TARGET}
+       ${PLATIDGEN} -mask_h < ${DEFFILE} >> ${MASK_H} || rm ${.TARGET}
+${MASK_C}: ${DEFFILE} ${PROG}
+       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET} || rm ${.TARGET}
+       ${PLATIDGEN} -mask_c < ${DEFFILE} >> ${MASK_C} || rm ${.TARGET}
+${NAME_C}: ${DEFFILE} ${PROG}
+       awk -f ../platid_copyright.awk ${DEFFILE} > ${.TARGET} || rm ${.TARGET}
+       ${PLATIDGEN} -name_c < ${DEFFILE} >> ${NAME_C} || rm ${.TARGET}
 
 .include <bsd.prog.mk>
diff -r be36ebd15516 -r 25358aafd0fa sys/arch/hpc/hpc/platid_gen/gram.y
--- a/sys/arch/hpc/hpc/platid_gen/gram.y        Sat Mar 03 08:14:06 2001 +0000
+++ b/sys/arch/hpc/hpc/platid_gen/gram.y        Sat Mar 03 12:51:44 2001 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: gram.y,v 1.2 2001/02/04 05:19:15 takemura Exp $        */
+/*     $NetBSD: gram.y,v 1.3 2001/03/03 12:51:44 takemura Exp $        */
 
 /*-
  * Copyright (c) 1999
@@ -101,7 +101,8 @@
 sub_item:
   sym '=' sym { $$ = new_node(N_MODIFIER, 0, $1, $3, NULL); }|
   ent { $$ = $1; } |
-  '{' sub_list '}' { $$ = $2; };
+  '{' sub_list '}' { $$ = $2; } |
+   DIRECTIVE { $$ = new_node(N_DIRECTIVE, 0, $1, NULL, NULL); };
 
 ent : sym name_opt {
        $2->ptr1 = $1;
diff -r be36ebd15516 -r 25358aafd0fa sys/arch/hpc/hpc/platid_gen/scan.l
--- a/sys/arch/hpc/hpc/platid_gen/scan.l        Sat Mar 03 08:14:06 2001 +0000
+++ b/sys/arch/hpc/hpc/platid_gen/scan.l        Sat Mar 03 12:51:44 2001 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: scan.l,v 1.2 2001/02/04 05:19:15 takemura Exp $        */
+/*     $NetBSD: scan.l,v 1.3 2001/03/03 12:51:44 takemura Exp $        */
 
 /*-
  * Copyright (c) 1999
@@ -49,7 +49,7 @@
 %}
 
 %%
-#[^\n]*\n              { yylval.str = strdup(yytext); return DIRECTIVE; }
+#[^\n]*\n              { yylval.str = strdup(yytext); yyline++; return DIRECTIVE; }
 \"([^"]|\\\")*\"       { yylval.str = getstr(yytext); return NAME; }
 [a-zA-Z][0-9a-zA-Z]*   { yylval.str = strdup(yytext); return FSYM; }
 [a-zA-Z][_0-9a-zA-Z]*  { yylval.str = strdup(yytext); return MOD; }



Home | Main Index | Thread Index | Old Index