# Empty string in an ambiguous grammar?

I'm a bit confused by the role of the empty string in this ambiguous grammar:

A' -> A
A -> if A B
A -> null
B -> [empty string]
B -> else S


So what does B -> empty string mean/do? Does that mean B could transition to A? And "if", "else", and "null are terminals, then what is the empty string?

• It appears that "empty string" is also a terminal. Also, your first production should be $S\rightarrow A$. Nov 15 '21 at 16:21

A'

Notice that on the last line, B is replaced by the empty string -- nothing. It goes away. (We could have instead decided to replace B by else S.)