Unit - 1 University Questions
Unit - 1 University Questions
PART-A
1. Define Token.APRIL/MAY20ll MAY/JUNE 2013
The token can be defined as a meaningful group or cha racters over the character set of the
programming language like identifiers, keywords, constants and others.
2. Define Symbol Table. NOV DEC 2 6 MAY/JUNE 2014
A Symbol table is a data structure containing a record for each identifier, w ith 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.
3. What is a Complier? MAY/JUNE 2007
A Complier is a program that reads a program written in one language-the source language-
and translatcs it in to an cquivalcnt program in another language-the targct language. As an
iinponaot part of this translation process, the compiler reports to its user the presence of
errors in the source program.
4. What is an interpreter? NOV/DEC 2017
Intrprctcr is a prOgram Which convcrts source language to machinc languagc ine by line.
No intermediate object code is nerated, hence are memory efficient. Ex: Python, COBOL.
5. What do you mean by C ross-Compiler? NOV/DEC 2017
A cross compiler is a comfier capable of creating executable code for a latfgmor other than
the one on which the compiler is run. (ie). A compiler may run on one machine and produce
target code for another machine.
6. What are the cousins of compiler?
(APRIL/MAY2004 APRIL/MAY2005 APRIL/MAY 2012 MAYY/JUNE 2013 MAY/JUNE
2012. APRIL/MAY 2017)
● compilers
● Preprocessors
● Assemblers
● Loaders
● Link editors.
7. What are the main two parts of compilation?What are they performing?
MAY/JUNE 2016 , APRIL/MAY 2010, APRIL/MAY 2017a APRIL/MAY 2018
The two main parts are
● Analysis part breaks up the source program into constituent pieces and creates . An
● Synthesis part constructs the desired target program from the intermediate
representation.
8. What are an assembler and interpreter? APRIL/MAY 2011
Assembler is a program, which converts the assembly language in to machine language.
Interpreter is a program which converts source language into machine language line by line.
9. State any two reasons as to why phases of compiler should be grouped.
MAY/JUNE 2014
The reasons for grouping,
1.Implementation purpose
2.Compiler work is based on two things; one is based on language other one is based on
machine.
10.State some compiler construction tools?NOV/DEC 2016, APRIL/MAY2008
o Scanner generators
o Syntax-directed
o translation engines
o Automatic code generator
o Data flow engines.
o Parse generator
11. What is a preprocessor? Nov/Dec 2004
A preprocessor is one, which produces input to compilers. source program may be divided
into modules stored in separate files. The task of collecting the source program is sometimes
entrusted to a distinct program called a preprocessor. The preprocessor may also expand
macros into source language statements.
12. Depict diagrammatically how a language is processed. MAY/JUNE 2016
● €-is a regular expression that denotes {€} that is the set containing the empty
string
{a}
● Suppose r and s are regular expressions denoting the languages L(r ) and L(s)
Then,
o (r )/(s) is a regular expression denoting L(r) U L(s).
23.Why is buffering used in lexical analysis? What are the commonly used
buffering methods?MAY/JUNE 2014
Lexical analyzer needs to get the source program statement from character by character,
without buffering it is difficult to synchronize the speed between the read write hardware
and the lexical program. Methods are two way buffering and sentinels.
24.Write regular expression to describe a languages consist of strings made of even
numbers a and b.NOV/DEC 2014
((a+b)(a+b))*
25.What are the various parts in LEX program? APRIL/MAY 2017
Lex specification has three parts declarations
%%
pattern specifications
%%
support routines
26.Write regular expression for identifier and number. NOV/DEC 2012,
APRIL/MAY 2017
For identifier (a-z)((a-z)|(0-9))*other symbols For numbers (0-9)(0-9)*
27.What is a sentinel? What is its usage? April/May 2004
A Sentinel is a special character that cannot be part of the source program. Normally we
use ‘eof’ as the sentinel. This is used for speeding-up the lexical analyzer.
28.Differentiate tokens, patterns, lexeme. NOV/DEC 2016
output. This set of strings is described by a rule called a pattern associated with the
token
● € is a regular expression denoting { € }, that is, the language containing only the
empty string.
● For each ‘a’ in Σ, is a regular expression denoting { a }, the language with only
1. What are the various phases of a compiler? Explain each phase in detail
APRIL/MAY 2011, APRIL/MAY 2012, MAY/JUNE 2014, MAY/JUNE 2013,NOV/DEC 2016,
NOV/DEC 2017
2. Explain the various Cousins of Compiler. APRIL/MAY 2011, APRIL/MAY 2012
,NOV/DEC2014,MAY/JUNE 2015,NOV/DEC2017
3. What are the cousins of a Compiler? Explain them in detail. Explain the need for
grouping of phases of compiler. NOV/DEC 2014,APRIL/MAY 2017
4. Write about the Error handling in different phases. (OR) Explain various Error
encountered in different phases of compiler. MAY/JUNE 2016, NOV/DEC 2016
5. Draw the transition diagram for relational operators and unsigned numbers.
APRIL/MAY2017
6. For the following expression Position: =initial+ rate*60.Write down the output after
each phase.MAY/JUNE 2016, APRIL/MAY 2017
7. Explain language processing system with neat diagram. MAY/JUNE 2016
8. Explain Input Buffering with example. NOV/DEC 2011
9. Explain the specification of tokens, MAY/JUNE 2016,MAY/JUNE 2013,
APRIL/MAY 2008,NOV/DEC 2014
10. Elaborate in detail the recognition of tokens. APRIL/MAY 2012, NOV/DEC 2014
11.Write an algorithm to convert NFA to DFA and minimize DFA. Give an
example.NOV/DEC 2017
12.What are the issues in Lexical analysis? MA Y/JUNE 2016,APRIL/MAY 2012,
MAY/JUNE 2013
13.Minimize the regular expression (a+b)*abb. (NFA toDFA)MAY/JUNE
2016,NOV/DEC 2016, MAY/JUNE 2014, AP IL/MAY 2017, NOV/DEC 2017
14.What is input buffering? Explain technique of buffer pair.MAY/JUNE 2015
15.Differentiate tokens, patterns, lexeme. MAY/JUNE 2016, APRIL/MAY 2017
16.Conversion from Regular Expression to DFA without constructing NFA Example
a*( b*/ c* ) ( a / c ) *o.121) NOV/DEC 2017
17.
1. Explain Input Buffering with example. NOV/DEC 2011
2. Explain the specification oftokens, MAY/JUNE 2016,MAY/JUNE 2013,
APRIL/MAY 2008,NOV/DEC 2014
3. Elaborate in detail the recognition of tokens. APRIL/MAY 2012, NOV/DEC
2014
4. Write an algorithm to convert NFA to DFA and minimize DFA. Give an
example.NOV/DEC 2017
5. What are the issues in Lexical analysis? MA Y/JUNE 2016,APRIL/MAY 2012,
MAY/JUNE 2013
6. Minimize the regular expression (a+b)*abb. (NFA toDFA)MAY/JUNE
2016,NOV/DEC 2016, MAY/JUNE 2014, AP IL/MAY 2017, NOV/DEC 2017
7. What is input buffering? Explain technique of buffer pair.MAY/JUNE 2015
8. Differentiate tokens, patterns, lexeme. MAY/JUNE 2016, APRIL/MAY 2017
9. Conversion from Regular Expression to DFA without constructing NFA Example
a*( b*/ c* ) ( a / c ) *o.121) NOV/DEC 2017
10.
11.