100%(17)17 out of 17 people found this document helpful
This preview shows page 1 out of 1 page.
Unit 2QuestionIn your own words, describe the steps of compilation described by Niklaus Wirth in his 2005 text “Compiler Construction”. You must include a description of what a ‘Context Free Grammar’ is, and how it relates to the compilation process.AnswerThe process of compilation as state by Niklaus Wirth in his book, Compiler Construction, involves:“Lexical Analysis- The sequence of characters of a source text is translated into a corresponding sequenceof symbols of the vocabulary of the language.Syntax Analysis(Parsing) - The sequence of symbols is transformed into a representation recognizable tothe structure of the source text. Type Checking– This verifies whether the compatibility rules are observed by a program. Code Generation- A sequence of instructions taken from the instruction set of the target computer isgenerated via the parsing representation result” (Wirth, 2005).Context Free Grammar (CFG) is a set of recursive rules which is used to generate all possible strings in agiven formal language. “It contains terminal symbols, which are the characters of the alphabet that appear