semi: "{" vallist "}"
| "{" "}""
;
val: tSTR
| tInt
;
vallist: vallist , val
| val
;
You have a number of problems, some of which are probably just typos in your copy-paste (what you have above will be rejected by bison).
Your main problem is probably using "
(double quotes) for your tokens, which for the most part doesn't do anything useful -- it creates a 'new' token that is not the same as the single character token your lexer probably returns.
Instead, you want to use '
(single quotes):
semi: '{' vallist '}'
| '{' '}'
;
val: tSTR
| tInt
| semi
;
vallist: vallist ',' val
| val
;