context-free-grammarebnfebnf-syntactic-exception

What is the difference between EBNF and CFG


I understand that EBNF can be used to express Context Free Grammar, but is there any difference between the two?

I am asking because there are questions that ask to convert EBNF to CFG, but as of my current understanding, they look same. Therefore, what is the intention behind this conversion?


Solution

  • EBNF can be used to write a context-free grammar.

    The latin alphabet can be used to write English.

    Pascal can be used to express an algorithm.

    A "context-free grammar" is an abstract thing which you can write out in EBNF form for machine input. The actual context-free grammar is a mathematical object. It has standard notation, but the standard notation is really for human consumption.