I read formal grammar's definition from Wikipedia, and it seems like there can be such a grammar like:
S -> A
//no more rules
S and A are both non-terminals.
What language does it generates? I've thought several possibilities and rationales:
- An empty set, because replacing S to A doesn't generates any actual strings which only contains terminals.
- Any set can be an answer, because it's like solving equation S = A, to figure out what is S. Since there are no restrictions to set A, set A and set S can be anything.
- This is not a valid grammar because it doesn't make any sense that A, which is non terminal, doesn't have any descriptions.
Which one is right?