Context-Free Grammars


As of now somewhat i am able to understand context free grammar first and second paragraph.
However an example will be more helpful.
My most needed help paragraph especally this sentence:
An example will be helpful ->Starting from a sentence consisting of a single distinguished nonterminal. My understanding in js increasing gradually and with your help i can further increase the understanding. Thank you.

For the "Starting from" sentence, a common example is where the goal symbol is Script and the resulting language is the (infinite) set of all JS scripts. The 'replacement' process would start with the production for Script.

Note that the ECMAScript spec is not a good place to learn about context-free grammars. It's also not a good place to learn JS from scratch. But there's no end of resources on the web for learning both of these.

1 Like

Thankyou for answer (I will check it out) and opinion :+1:.