I'm having some trouble with BNF. I can't tell what seems to be the standard way of doing things (if there is one), and whether or not there are types like char or int or whatever already built in.
However, my main problem is not understand how the part of the BNF in curly braces works.
Given something like:
exp : term {$$ = $1;}
| exp '+' term {$$ = $1 + $3;}
| exp '-' term {$$ = $1 - $3;}
;
(This was handily stolen from somewhere, and is for yacc / C)
What are the things in the curly braces actually saying? I've looked at a similar thing for the happy parser generator too, and been similarly confused.