allow more flexable syntax
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user