I have no idea what a colon means in BNF or EBNF. It's not listed anywhere on the internet. Anyway, my professor decided to assign it in the homework. I think he is confusing it with a semicolon or something. I'm still not even sure what the semicolon means. Here is some context:
Given the following CFG (context free grammar) for declarations:
D -> D ; D
D -> id : T
T -> char
T -> integer
Give an attribute grammar that defines type of an identifier (id stands for identifier).
Anyone think they can help?
;
and:
are simply terminals, just likeid
,char
andinteger
. So your code could be something like this: