%{ #include #include extern FILE* yyin; extern int yyleng; extern char* yytext; extern int yylex (); extern int yyparse (); extern int yyerror ( const char* message ); %} %token TOKEN_LBRACE %token TOKEN_RBRACE %start S %% S : TOKEN_LBRACE S TOKEN_RBRACE { fprintf ( stdout, "regle 1\n" ); } | TOKEN_LBRACE TOKEN_RBRACE { fprintf ( stdout, "regle 2\n" ); } ; %%