diff --git a/src/dbtools/dbLoadTemplate.h b/src/dbtools/dbLoadTemplate.h index a341b8098..29f7a0b52 100644 --- a/src/dbtools/dbLoadTemplate.h +++ b/src/dbtools/dbLoadTemplate.h @@ -3,8 +3,7 @@ * 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 +* EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ /* dbLoadTemplate.h */ diff --git a/src/dbtools/dbLoadTemplate.y b/src/dbtools/dbLoadTemplate.y index 0a919dda6..5fb4fbfa7 100644 --- a/src/dbtools/dbLoadTemplate.y +++ b/src/dbtools/dbLoadTemplate.y @@ -30,7 +30,7 @@ static int yyerror(); static char *sub_collect = NULL; static char** vars = NULL; static char* db_file_name = NULL; -static int var_count,sub_count; +static int var_count, sub_count; %} @@ -45,7 +45,7 @@ static int var_count,sub_count; %union { - int Int; + int Int; char Char; char *Str; double Real; @@ -54,191 +54,192 @@ static int var_count,sub_count; %% template: templs - | subst - ; + | subst + ; templs: templs templ - | templ - ; + | templ + ; templ: templ_head O_BRACE subst C_BRACE - | templ_head - { - if(db_file_name) - dbLoadRecords(db_file_name,NULL); - else - fprintf(stderr,"Error: no db file name given\n"); - } - ; + | templ_head + { + if (db_file_name) + dbLoadRecords(db_file_name, NULL); + else + fprintf(stderr, "Error: no db file name given\n"); + } + ; templ_head: DBFILE WORD - { - var_count=0; - if(db_file_name) dbmfFree(db_file_name); - db_file_name = dbmfMalloc(strlen($2)+1); - strcpy(db_file_name,$2); - dbmfFree($2); - } - | DBFILE QUOTE - { - var_count=0; - if(db_file_name) dbmfFree(db_file_name); - db_file_name = dbmfMalloc(strlen($2)+1); - strcpy(db_file_name,$2); - dbmfFree($2); - } - ; + { + var_count = 0; + if (db_file_name) + dbmfFree(db_file_name); + db_file_name = dbmfMalloc(strlen($2)+1); + strcpy(db_file_name, $2); + dbmfFree($2); + } + | DBFILE QUOTE + { + var_count = 0; + if (db_file_name) + dbmfFree(db_file_name); + db_file_name = dbmfMalloc(strlen($2)+1); + strcpy(db_file_name, $2); + dbmfFree($2); + } + ; subst: PATTERN pattern subs - | PATTERN pattern - | var_subs - ; + | PATTERN pattern + | var_subs + ; pattern: O_BRACE vars C_BRACE - { + { #ifdef ERROR_STUFF - int i; - for(i=0;i;] %% -"pattern" { return(PATTERN); } -"file" { return(DBFILE); } +"pattern" { return(PATTERN); } +"file" { return(DBFILE); } {doublequote}({dstringchar}|{escape})*{doublequote} | {singlequote}({sstringchar}|{escape})*{singlequote} { - yylval.Str = dbmfStrdup(yytext+1); - yylval.Str[strlen(yylval.Str)-1] = '\0'; - return(QUOTE); - } + yylval.Str = dbmfStrdup(yytext+1); + yylval.Str[strlen(yylval.Str)-1] = '\0'; + return(QUOTE); +} {bareword}+ { - yylval.Str = dbmfStrdup(yytext); - return(WORD); - } + yylval.Str = dbmfStrdup(yytext); + return(WORD); +} -"=" { return(EQUALS); } -"," { return(COMMA); } -"{" { return(O_BRACE); } -"}" { return(C_BRACE); } +"=" { return(EQUALS); } +"," { return(COMMA); } +"{" { return(O_BRACE); } +"}" { return(C_BRACE); } -{comment}.* ; -{whitespace} ; -{newline} { line_num++; } +{comment}.* ; +{whitespace} ; +{newline} { line_num++; } . { - char message[40]; + char message[40]; - sprintf(message,"invalid character '%c'", yytext[0]); - yyerror(message); + sprintf(message, "invalid character '%c'", yytext[0]); + yyerror(message); - /* Suppress compiler warning messages */ - if (0) yyunput('c',NULL); - if (0) yy_switch_to_buffer(NULL); - } + /* Suppress compiler warning messages */ + if (0) yyunput('c',NULL); + if (0) yy_switch_to_buffer(NULL); +} %%