O'Reilly logo

Express Learning: Principles of Compiler Design by ITL Education Solutions Limited

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3

Specification of Programming languages

1. Explain context-free grammar (CFG) and its four components with the help of an example.

Ans: The context-free grammar (CFG) was developed by Chomsky in 1965. A CFG is used to specify the syntactic structure of a programming language constructs like expressions and statements. The CFG is also known as Backus-Naur Form (BNF). A CFG comprises four components, namely, nonterminals, terminals, productions, and start symbol.

images The non-terminals (also known as syntactic variables) represent the set of strings in a language.

The terminals (also known as tokens) represent the symbols of the language.

The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required