%{ #include #include #define YYDEBUG 1 extern int yylex(void); static void yyerror (char const *msg) { extern int yylineno; printf ("%s (line %d)", msg, yylineno); abort (); } %} %token MAC_POOL X_MAC_POOL MAC %token SHARED_NETWORK MANUAL_DHCP DYNAMIC_DHCP MANUAL_BOOTP %token SUBNET IP NETMASK IDENTIFIER RANGE STRING NUMBER %union { char *ident; char *string; long num; } %% config: section config | /* empty */ ; section: MAC_POOL { ; } | X_MAC_POOL { ; }