allow more flexable syntax

This commit is contained in:
Marty Kraimer
1993-08-11 16:44:25 +00:00
parent 6e79e7fded
commit 5c866bf66c
3 changed files with 15 additions and 3 deletions
-1
View File
@@ -22,7 +22,6 @@ yyreset()
^"PV:" { return(PV); }
"Type:" { return(TYPE); }
{ return(CLOSE); }
\n { line_num++; return(CLOSE); }
"$$end" { return(CLOSE); }
{d}+ { yylval.Str=(char *)malloc(strlen(yytext)+1);
+10
View File
@@ -71,6 +71,16 @@ header: PV WORD TYPE WORD WORD
if(status) printMessage("dbCreateRecord");
}
header: PV WORD TYPE WORD
{
strcpy(rectype,$4);
strcpy(recname,$2);
status = dbFindRecdes(pdbentry,rectype);
if(status) printMessage("dbFindRecdes");
status = dbCreateRecord(pdbentry,recname);
if(status) printMessage("dbCreateRecord");
}
fields: field
| fields field
;
+5 -2
View File
@@ -96,7 +96,7 @@ char **argv;
while(!status) {
int generate_nl;
printf("\nPV: %s Type: %s (atdb)",dbGetRecordName(pdbentry),rectype);
printf("\nPV: %s Type: %s",dbGetRecordName(pdbentry),rectype);
printf("\n");
generate_nl=FALSE;
status = dbFirstFielddes(pdbentry,TRUE);
@@ -114,7 +114,10 @@ char **argv;
}
status=dbNextFielddes(pdbentry,TRUE);
}
printf("\f\n");
if(oldshortform)
printf("\f\n");
else
printf("\n$$end\n");
status = dbNextRecord(pdbentry);
}
status = dbNextRecdes(pdbentry);