Clean up several problems with lexical analyzer.

This commit is contained in:
W. Eric Norum
2006-11-17 14:24:45 +00:00
parent 207171d336
commit 34316144bd
2 changed files with 9 additions and 7 deletions

View File

@@ -242,8 +242,8 @@ sub_pat: WORD EQUALS WORD
static int yyerror(char* str)
{
fprintf(stderr,"Substitution file parse error\n");
fprintf(stderr,"line %d:%s\n",line_num,yytext);
fprintf(stderr,"Substitution file parse error : \"%s\"\n", str);
fprintf(stderr,"line %d:\"%s\"\n",line_num,yytext);
return(0);
}
@@ -254,7 +254,7 @@ int epicsShareAPI dbLoadTemplate(char* sub_file)
FILE *fp;
int ind;
line_num=0;
line_num=1;
if( !sub_file || !*sub_file)
{

View File

@@ -8,8 +8,8 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
word [a-zA-Z0-9_\.\^~/\*#\[\]%:;!|\-&\$\(\)@\?\+<>]
par [\"\']
word [a-zA-Z0-9_\.\^~/\*#\[\]%:;!|\-&\$\(\)@\?\+<>\']
par [\"]
notquote [^\"]
escapequote \\\"
@@ -20,14 +20,14 @@ value {notquote}|{escapequote}
%%
\#.*\n ;
\#.*\n { line_num++; }
"pattern" { return(PATTERN); }
"file" { return(DBFILE); }
"=" { return(EQUALS); }
{par}{value}*{par} {
yylval.Str = dbmfStrdup(yytext);
yylval.Str = dbmfStrdup(yytext+1);
yylval.Str[strlen(yylval.Str)-1] = '\0';
return(QUOTE);
}
@@ -42,6 +42,8 @@ value {notquote}|{escapequote}
\n { line_num ++;}
[ \t,] { ; }
. {
char message[20];
YY_BUFFER_STATE *dummy=0;