Compiler Design exam short question and answer








1) What is compiler?

The compiler is a program that reads a program written in one language which is known as source language or source code and converts it into another language known as machine language is called compiler .

2) State some software tools that manipulate source program?

>> structure editors
>> pretty printers
>> static checkers
>> Interpreters

3) What are the cousins of compiler?

>> Pre - processor
>> Assembler
>> Loaders
>> Link editors


4) What are the main two parts of compilation ? what are they performing the two main parts are.

Analysis parts: It breaks up the source program into constituent pieces and create an intermediate representation of the source program.

Synthesis part : It constructs the desired target program from the intermediate representation.



5) How many phases dose analysis consists?

The analysis of source program is divided into mainly three phases. They are -

>> Linear analysis

>> Hierarchical Analysis

>> Semantic Analysis


6) What linear analysis do ?

It involves a scanner which read stream of character from left to right. It is then grouped into various tokens having collective meaning.


7) What Hierarchical Analysis do?

Based on collective meaning , the character or tokens are categorized or grouped hierarchically into nested groups.


8) What what semantic analysis do?

this phase is used to check whether the components of the source program are meaningful or not.


9) What is Loader? What dose the loading process do ?

Loader is a major component of an operating system that ensure all the necessary programs and libraries are load, which is essential during the startip phase of running a program.

>> it loads the programs ,libraries or executable files into memory and execute them.

>> It calculate the size of program and creates memory spaces for it .


10) How much function a loader performs ?

2 functions -

>> Loading
>> Link editing.


11) What is symbol table?

A symbol table is a data structure containing a record for each identifier,with fields for the attributes of the identifier.The data structure allows us to find the record for each identifier quickly and to store or retrieve data from that record quickly.


12) What are the general phase of compiler ?

 >> Lexical analysis

>> Syntax analysis

>> Semantic Analysis

>> Intermediate code generator

>> Code optimization

>> Code generation


13) What is an assembler ?

Assembler also like as compiler. But it converts source language into assembly language.


14) What is lexeme ?

Lexeme : A lexeme is a sequence of character in the source program that matches pattern for a token and identified by the lexical analyzer as an instance of that token.



15) What is regular set ?

A language denoted by regular expression is said to be a regular set .



16) What are the error- recovery actions in a lexical analyzer?

>> Deleting an extraneous character

>> Inserting missing character

>> Replacing an incorrect character by a correct character

>> Transportation of two characters.


17) Parsing tree also known as ----------?

Ans : Syntax Analysis.



18) System program such a compiler designed  so  that  they are…

Ans : Re-enter-able



19) What is the output of lexical analyzer?

Ans : A list of tokens.



20) In which phase of compiler grammar of the programming is checked ?

Ans : Syntax analysis.



21) Which types of error can check compiler?

Ans : Syntax error


22) A lexical analysis is about breaking a sequence of characters into-------

Ans : Tokens


23) What is pre- processor ?

In computer science , a pre- processor is a program that processes its input data to produce output that is used as input to another program. The output said to be a pre- processed form of the input data, which is often used by some subsequent programs like compilers.

So In short , It is a part of compiler which produce input to compiler.The source program may be divided into modules stored in separate files.The task of collecting the source program is sometimes entrusted to distinct program called a pre- processor.


24) Write down some functions of pr e- processor?

Ans :
>> Macro processing
>> File inclusion
>> Relational pre- processors
>> Language extensions


25) What is lexical Analysis?

The first phase of compiler is lexical analysis. This is also known as linear analysis in which the stream of characters making the source program is read from left to right and grouped into tokens that are sequences of characters having a collective meaning .

26) Construct a regular expression for the language.

L = { w E {a,b} ends in abb }

Ans : {a/b}*abb.


27)What is recognizer?

Recognizer is a machine. These are machines which accept the strings belonging to certain language.If the valid string of such language are accepted by the machine then it is said that the corresponding language is accepted by that machine, otherwise it is rejected.



Important and related post :

>> What is application software and system software
>> incremental model with details.
>> Software Engineering | Classification of Software Requirements
>>What is operating system 
>>What is traffic monitoring system 
>> what is computer virus and names of virus.
>>What is embedded control system  
>> What is compiler .
>> What is linker.
>> What is Interpreter
>> Modern Principles Of Software Development
>> Types of Software Testing
>> Software Testing | Basics
>> Software Engineering | Debugging Approaches


Post a Comment

0 Comments