In my yacc file I have things like the following:
var_declaration : type_specifier ID ';'
| type_specifier ID '[' NUM ']' ';' ;
type_specifier : INT | VOID ;
ID, NUM, INT, and VOID are tokens that get returned from flex, so yacc has no problems recognizing them. The problem is that in the above there are things like ‘[‘ and ‘;’. When these are recognized by flex, what should be returned to yacc?
You can just return the characters themselves. Tokens are guaranteed not to conflict with ASCII characters:
http://www.gnu.org/software/bison/manual/html_node/Token-Decl.html
So in your flex file,
is OK.