From 822b1c557ced78487a913c6158a9290ef56f4127 Mon Sep 17 00:00:00 2001 From: sater Date: Thu, 16 Aug 1984 16:08:39 +0000 Subject: [PATCH] Revised to include rcsid of pattern file in binary opt --- util/opt/mktab.y | 6 +++++- util/opt/patterns | 2 +- util/opt/scan.l | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/util/opt/mktab.y b/util/opt/mktab.y index f5bffa8aa..969c068a0 100644 --- a/util/opt/mktab.y +++ b/util/opt/mktab.y @@ -42,6 +42,7 @@ byte nparam[N_EX_OPS]; bool nonumlab[N_EX_OPS]; bool onlyconst[N_EX_OPS]; int nerrors=0; +char patid[128]; %} %union { @@ -61,7 +62,7 @@ int nerrors=0; %nonassoc NOT,COMP,UMINUS %nonassoc '$' -%token SFIT,UFIT,NOTREG,PSIZE,WSIZE,DEFINED,SAMESIGN,ROM,ROTATE +%token SFIT,UFIT,NOTREG,PSIZE,WSIZE,DEFINED,SAMESIGN,ROM,ROTATE,STRING %token MNEM %token NUMBER %type expr,argno,optexpr @@ -71,6 +72,7 @@ int nerrors=0; %% patternlist : /* empty */ + | STRING '\n' | patternlist '\n' | patternlist pattern ; @@ -297,6 +299,8 @@ printnodes() { printf("/* %3d */\t%3d,%6u,%6u,\n", p-nodes,p->ex_operator,p->ex_lnode,p->ex_rnode); printf("};\n\niarg_t iargs[%d];\n",maxpatlen); + if (patid[0]) + printf("static char rcsid[] = %s;\n",patid); } initio() { diff --git a/util/opt/patterns b/util/opt/patterns index 662e97b05..461d3a858 100644 --- a/util/opt/patterns +++ b/util/opt/patterns @@ -1,4 +1,4 @@ -/* $Header$ */ +"$Header$" loc adi loc sbi $2==w && $4==w: loc $1-$3 adi w ldc adi ldc sbi $2==2*w && $4==2*w: ldc $1-$3 adi 2*w loc adi loc adi $2==w && $4==w: loc $1+$3 adi w diff --git a/util/opt/scan.l b/util/opt/scan.l index 834f9cf6b..660c97a73 100644 --- a/util/opt/scan.l +++ b/util/opt/scan.l @@ -24,6 +24,7 @@ static char rcsid2[] = "$Header$"; extern long atol(); %} %% +\"[^"]*\" { strncpy(patid,yytext,sizeof(patid)); return(STRING); } notreg return(NOTREG); sfit return(SFIT); ufit return(UFIT); -- 2.34.1