diff --git a/src/dbtools/dbLoadTemplate.y b/src/dbtools/dbLoadTemplate.y index 21006793d..40bc40274 100644 --- a/src/dbtools/dbLoadTemplate.y +++ b/src/dbtools/dbLoadTemplate.y @@ -27,7 +27,6 @@ static int yyerror(); #define VAR_MAX_VARS 100 static char *sub_collect = NULL; -static MAC_HANDLE *macHandle = NULL; static char** vars = NULL; static char* db_file_name = NULL; static int var_count,sub_count; diff --git a/src/dbtools/dbLoadTemplate_lex.l b/src/dbtools/dbLoadTemplate_lex.l index 063df2453..848ec5190 100644 --- a/src/dbtools/dbLoadTemplate_lex.l +++ b/src/dbtools/dbLoadTemplate_lex.l @@ -1,5 +1,14 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ -word [a-zA-Z0-9_\.\^~/\*#\[\]%:;!|\-&\$\(\)@\?\+<>] +word [a-zA-Z0-9_\.\^~/\*#\[\]%:;!|\-&\$\(\)@\?\+<>] par [\"\'] notquote [^\"] @@ -17,19 +26,32 @@ value {notquote}|{escapequote} "file" { return(DBFILE); } "=" { return(EQUALS); } -{par}{value}*{par} { yylval.Str = dbmfStrdup(yytext); - yylval.Str[strlen(yylval.Str)-1] = '\0'; - return(QUOTE); - } +{par}{value}*{par} { + yylval.Str = dbmfStrdup(yytext); + yylval.Str[strlen(yylval.Str)-1] = '\0'; + return(QUOTE); + } -{word}+ { yylval.Str = dbmfStrdup(yytext); - return(WORD); - } +{word}+ { + yylval.Str = dbmfStrdup(yytext); + return(WORD); + } "{" { return(O_BRACE); } "}" { return(C_BRACE); } -. ; \n { line_num ++;} +. { + char message[20]; + YY_BUFFER_STATE *dummy=0; + + sprintf(message,"invalid character '%c'",yytext[0]); + yyerror(message); + + /*The following suppress compiler warning messages*/ + if (0) yyunput('c',(unsigned char *) message); + if (0) yy_switch_to_buffer(*dummy); + } + %%