%{
#include "date.h"
-#include "gedcom_date.tab.h"
+#include "gedcom_date.tabgen.h"
#define YY_NO_UNPUT
gedcom_date_lval.string = buf[token_nr++]; \
return TOKEN; \
}
+
+#define ACTION_UNEXPECTED \
+ { gedcom_date_error(_("Unexpected input")); \
+ return BADTOKEN; \
+ }
+
+#define UNKNOWN_CALENDAR_TYPE \
+ { gedcom_date_error(_("Unknown calendar type")); \
+ return BADTOKEN; \
+ }
%}
[ \t]+ /* ignore whitespace between tokens */
@#DJULIAN@ SIMPLE_RETURN(ESC_DATE_JULN)
@#DHEBREW@ SIMPLE_RETURN(ESC_DATE_HEBR)
"@#DFRENCH R@" SIMPLE_RETURN(ESC_DATE_FREN)
+@#.+@ UNKNOWN_CALENDAR_TYPE
FROM SIMPLE_RETURN(MOD_FROM)
TO SIMPLE_RETURN(MOD_TO)
"/" SIMPLE_RETURN(SLASH)
[0-9]+ SIMPLE_RETURN(NUMBER)
+. ACTION_UNEXPECTED
+
%%
int yywrap()