%{
#include <stdio.h>
#include <string.h>
/* Command-line options:
-C -p -a -n -t -o -j 1 -k 2,3
-N is_month */
%}
struct months {
char *name;
int number;
int days;
int leap_days;
};
%%
january, 1, 31, 31
february, 2, 28, 29
march, 3, 31, 31
april, 4, 30, 30
may, 5, 31, 31
june, 6, 30, 30
july, 7, 31, 31
august, 8, 31, 31
september, 9, 30, 30
october, 10, 31, 31
november, 11, 30, 30
december, 12, 31, 31
%%
/* Auxiliary code goes here... */
int main () {
int hash_value = hash("may", sizeof("may"));
printf("Hash value of may is %d\n", hash_value);
printf("may is in hash function = %s", in_word_set("may", sizeof("may")));
}