1 Compiler Structure And Basic Concepts

Compiler Design and Construction · Unit 1 · 3 hrs

Compiler Structure and Basic Concepts

Exam-focused notes for Compiler Structure and Basic Concepts (Compiler Design and Construction, CSC376): what the TU syllabus asks and how it has actually been tested, with 6 solved past questions from this unit.

What this unit covers

  • Compiler Structure: Analysis and Synthesis Model of Compilation
  • different sub-phases within analysis and synthesis phases
  • Basic concepts related to Compiler such as interpreter, simple One-Pass Compiler, preprocessor, macros, symbol table and error handler

different sub-phases within analysis and synthesis phases

20815 marks

Explain different phases of compiler in brief. [5]

A compiler operates in phases, where each phase takes a program in one representation and produces output in another representation. There are two major phases of compilation: --- In the analysis part, an intermediate representation is created from the give...

Full solved answer →

Basic concepts related to Compiler such as interpreter, simple One-Pass Compiler, preprocessor, macros, symbol table and error handler

20785 marks

Define compiler and differentiate it with an interpreter. [5]

A compiler is a translator software program that takes its input in the form of a program written in a particular (high-level) programming language and produces output in the form of a program in another language (typically machine language or object code)....

Full solved answer →
20766 marks

Discuss the importance of error handler in compiler. How is it manipulated in the different phases of compilation?[6]

During the compilation of a source program, errors can be encountered at any phase of compilation. An error handler is a component that is invoked whenever such an error is detected. Its importance can be summarized as follows: - It detects and reports erro...

Full solved answer →
20756 marks

Difference between compiler and interpreter. "Symbol table is necessary component of compiler". Justify this statement with examples.[6]

--- Basis Compiler Interpreter --------- Translation Translates the entire source program at once into machine code Translates and executes the source program line by line Speed Faster execution after compilation Slower execution due to line-by-line process...

Full solved answer →
2081.15 marks

What are the roles of macros and preprocessor? Discuss about one pass and multi pass compiler. [5]

--- A preprocessor is a tool that processes the source code before it is passed to the compiler. It is generally considered a part of the compiler system and produces input for the compiler proper. i) Macro Processing: A preprocessor allows a user to define...

Full solved answer →

Compiler Structure

20766 marks

Explain briefly about different phases involved in compiler, with a block diagram[6]

A compiler translates a source program written in a high-level language into an equivalent target program (usually machine code). This translation is carried out through a series of well-defined phases, grouped into two major parts: the Analysis phase (Fron...

Full solved answer →