Abstract

This is the right place to introduce the concept of context-free languages and context-free grammars. Context-free grammars play a vital role in the compiler construction process. Implementation of a parser in the compiler construction is achieved by context-free grammars. This chapter gives deep insights on context-free grammars and languages. We introduce formal notations for context-free grammars followed by string derivations. We present two types of derivations, leftmost derivation and rightmost derivation. We also present a method to check the ambiguity of a context-free grammar. The concept of a parse tree plays an important role in ambiguity checking. Further, we describe the CFG simplification methods, useless symbols, null productions, and unit productions. The chapter concludes with the normal forms of CFG. Learners will be able to convert the given context free grammar into a normalized context-free grammar.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.