diff --git a/util/opt/mktab.y b/util/opt/mktab.y index f5bffa8a..969c068a 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 662e97b0..461d3a85 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 834f9cf6..660c97a7 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);