SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
compiler design BCS613C question bank 2022 scheme
Module-1 Chapter 1
Introduction: Language Processors, The structure of Compiler, The evolution of
Programming Languages, The science of Building a Compiler, Applications of Compiler
Technology, Programming Language Basics
1. Define Compiler. Differentiate between Compiler and Interpreter and Lexical analyzer v/s
Paser.
2. With an neat diagram , explain Language Processing System.
3. Explain various phases of compiler. Show the translation for an Assignment statement:
Position = initial + rate * 60.
4. Write a note on the following
a. The evolution of Programming Language c. Science of building a compiler
b. Application of Compiler Technology
5. Explain Environment and state variables. Difference between Static and dynamic Scope with an
example.
Module-1 Chapter 2
A Simple Syntax Directed Translator: Introduction, Syntax Definition, Syntax Directed Translation, Parsing.
1. Explain the concept of syntax directed definition.
i) Give a SDD for a simple desk calculator / simple type declaration
2. Write a postfix SDT for desk calculator and show parser stack implementation.
3. What is annotated parse tree, Parse tree and syntax tree?
Construct Syntax tree, parse tree and annotated PT for the input string 3 * 5 + 4n.
4. Write annotated parse tree for expression 5 + 4 * 3n and (3+4)*(5+6)where grammar is
L -> En
E-> E+T|T
T ->T*F |F
F -> (E) digit
5. Define SDD. Explain synthesis attribute and inherited attribute with an example.
6. What is parser. Explain the role of parser with neat diagram. Explain its types.
7. What is Top down Parser. Briefly explain problem associated with top down parser.
Module-2 Chapter 1
Lexical Analysis: The Role of Lexical Analyzer, Input buffering, Specification of Tokens,
Recognition of Tokens, The lexical Analyzer Generator Lex.
1. Explain the role of lexical analysis.
2. What is meant by input buffering? Write an algorithm for look ahead code with sentinels.
3. List and explain reasons for separating analysis portion of a compiler into lexical analysis and
syntax analysis phases.
4. What are tokens, patterns, lexemes, attributes for tokens. Identify tokens, patterns , lexemes for
the following
a) printf(“Total=%d/n”,score);
b) Const pi=3.1416;
c) float limited square(x) float x {
/*returns x-squared, but never more than 100*/
return(x<=-10.0 || x>=10.0)?100:x*x;
}
Into appropriate lexemes. Which lexemes should get lexical values.
5. Write definition of operations on languages.
6. What are regular expression and regular set. Write algebraic laws for regular expressions.
7. Explain specification of tokens(Strings,language,alphabets,prefix/suffix strings etc).
8. Write regular definition for
a) Identifiers b) unsigned numbers. C) tokens
9. Construct the transition diagram for recognizing the following
a. Unsigned numbers c. relop e. reserved words and Identifers
b. Whitespace d. Delimiters
10. Construct the transition diagrams for a set of keywords like begin, end, if then and else and.
identifiers and constants along with a minimum set of relational operators.
11. Explain the structure of lex with its specification (Language for specifying lexical analyzers)
Module-2 Chapter 2
Syntax Analysis: Introduction, Context Free Grammars, Writing a Grammar
1. Explain the role of parser. Explain error recovery strategies.
2. Give a formal definition of a CFG. Design a CFG for a simple arithmetic expression.
3. What is left recursion? Explain with an algorithm for eliminating the same with an example.
4. What is left factoring? Rewrite the following grammar after "left factored
1) S->iEts | iEtSeS | a 2) S->bSSaaS| bSSaSb| bSb | a
E->b
5. What is ambiguous grammar? Show that following grammar is ambiguous:
S->S+S|S*S|id. Give an unambiguous grammar for the above grammar such that has highest
priority and has less priority and both are left associative.
6. Consider the context free grammar S → SS + ISS SSa
And the string aa + a*
i) Give a left most derivation for the string
ii) Give a right most derivation for the string
iii) Give a parse tree for the string
iv) Is the grammar ambiguous or unambiguous? Justify.
v). Describe the language generated by this grammar
vi) Remove the left recursion from the grammar?
vii) Left factor this grammar

More Related Content

PPT
Introduction to compiler
PPT
Compiler Design Basics
DOCX
Cs6660 compiler design may june 2016 Answer Key
PDF
Cs2303 theory of computation all anna University question papers
PPTX
Compiler construction tools
PPT
Introduction to Compiler Construction
PPTX
COMPILER DESIGN
Introduction to compiler
Compiler Design Basics
Cs6660 compiler design may june 2016 Answer Key
Cs2303 theory of computation all anna University question papers
Compiler construction tools
Introduction to Compiler Construction
COMPILER DESIGN

What's hot (20)

PDF
Formal Languages and Automata Theory Unit 1
PPTX
LALR Parser Presentation ppt
PPTX
Our presentation on algorithm design
PPT
Divide and conquer
PPTX
A brief introduction to SQLite PPT
PPTX
LINEAR BOUNDED AUTOMATA (LBA).pptx
PPT
Finite automata
PPT
Symbol Table, Error Handler & Code Generation
PPTX
closure properties of regular language.pptx
PPTX
Ambiguous & Unambiguous Grammar
PPTX
4.6 halting problem
PDF
Natural Language Processing
PPTX
Theory of Automata and formal languages unit 1
PDF
N Queens problem
PDF
Hill climbing algorithm in artificial intelligence
PPTX
LL(1) parsing
PDF
Syntax Directed Definition and its applications
PPTX
Directory implementation and allocation methods
DOCX
Multiversion Concurrency Control Techniques
Formal Languages and Automata Theory Unit 1
LALR Parser Presentation ppt
Our presentation on algorithm design
Divide and conquer
A brief introduction to SQLite PPT
LINEAR BOUNDED AUTOMATA (LBA).pptx
Finite automata
Symbol Table, Error Handler & Code Generation
closure properties of regular language.pptx
Ambiguous & Unambiguous Grammar
4.6 halting problem
Natural Language Processing
Theory of Automata and formal languages unit 1
N Queens problem
Hill climbing algorithm in artificial intelligence
LL(1) parsing
Syntax Directed Definition and its applications
Directory implementation and allocation methods
Multiversion Concurrency Control Techniques
Ad

Similar to compiler design BCS613C question bank 2022 scheme (20)

DOC
Pcd question bank
PPT
Unit1.ppt
DOCX
Compiler Design
PPT
SS & CD Module 3
PPT
Module 2
PDF
Compilers Design
PDF
COMPILER DESIGN- Introduction & Lexical Analysis:
PPTX
ppt_cd.pptx ppt on phases of compiler of jntuk syllabus
DOCX
Compiler design important questions
PPTX
CC week 1.pptx
PDF
C compiler(final)
PDF
Compiler question bank
PPT
Compiler Design in Computer Applications
PPTX
Structure of the compiler
PPTX
Introduction to Compilers
PDF
lec00-Introduction.pdf
PPTX
Lexical Analyser PPTs for Third Lease Computer Sc. and Engineering
PPTX
Plc part 2
PDF
Compiler_Design_Introduction_Unit_2_IIT.pdf
PPTX
Ss ui lecture 2
Pcd question bank
Unit1.ppt
Compiler Design
SS & CD Module 3
Module 2
Compilers Design
COMPILER DESIGN- Introduction & Lexical Analysis:
ppt_cd.pptx ppt on phases of compiler of jntuk syllabus
Compiler design important questions
CC week 1.pptx
C compiler(final)
Compiler question bank
Compiler Design in Computer Applications
Structure of the compiler
Introduction to Compilers
lec00-Introduction.pdf
Lexical Analyser PPTs for Third Lease Computer Sc. and Engineering
Plc part 2
Compiler_Design_Introduction_Unit_2_IIT.pdf
Ss ui lecture 2
Ad

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Institutional Correction lecture only . . .
PPTX
Cell Structure & Organelles in detailed.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Lesson notes of climatology university.
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
RMMM.pdf make it easy to upload and study
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Cell Types and Its function , kingdom of life
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
Final Presentation General Medicine 03-08-2024.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
O7-L3 Supply Chain Operations - ICLT Program
Institutional Correction lecture only . . .
Cell Structure & Organelles in detailed.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Lesson notes of climatology university.
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
VCE English Exam - Section C Student Revision Booklet
RMMM.pdf make it easy to upload and study
STATICS OF THE RIGID BODIES Hibbelers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Cell Types and Its function , kingdom of life
Abdominal Access Techniques with Prof. Dr. R K Mishra
Supply Chain Operations Speaking Notes -ICLT Program
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
102 student loan defaulters named and shamed – Is someone you know on the list?

compiler design BCS613C question bank 2022 scheme

  • 2. Module-1 Chapter 1 Introduction: Language Processors, The structure of Compiler, The evolution of Programming Languages, The science of Building a Compiler, Applications of Compiler Technology, Programming Language Basics 1. Define Compiler. Differentiate between Compiler and Interpreter and Lexical analyzer v/s Paser. 2. With an neat diagram , explain Language Processing System. 3. Explain various phases of compiler. Show the translation for an Assignment statement: Position = initial + rate * 60. 4. Write a note on the following a. The evolution of Programming Language c. Science of building a compiler b. Application of Compiler Technology 5. Explain Environment and state variables. Difference between Static and dynamic Scope with an example. Module-1 Chapter 2 A Simple Syntax Directed Translator: Introduction, Syntax Definition, Syntax Directed Translation, Parsing. 1. Explain the concept of syntax directed definition. i) Give a SDD for a simple desk calculator / simple type declaration 2. Write a postfix SDT for desk calculator and show parser stack implementation. 3. What is annotated parse tree, Parse tree and syntax tree? Construct Syntax tree, parse tree and annotated PT for the input string 3 * 5 + 4n. 4. Write annotated parse tree for expression 5 + 4 * 3n and (3+4)*(5+6)where grammar is L -> En E-> E+T|T T ->T*F |F F -> (E) digit 5. Define SDD. Explain synthesis attribute and inherited attribute with an example. 6. What is parser. Explain the role of parser with neat diagram. Explain its types. 7. What is Top down Parser. Briefly explain problem associated with top down parser.
  • 3. Module-2 Chapter 1 Lexical Analysis: The Role of Lexical Analyzer, Input buffering, Specification of Tokens, Recognition of Tokens, The lexical Analyzer Generator Lex. 1. Explain the role of lexical analysis. 2. What is meant by input buffering? Write an algorithm for look ahead code with sentinels. 3. List and explain reasons for separating analysis portion of a compiler into lexical analysis and syntax analysis phases. 4. What are tokens, patterns, lexemes, attributes for tokens. Identify tokens, patterns , lexemes for the following a) printf(“Total=%d/n”,score); b) Const pi=3.1416; c) float limited square(x) float x { /*returns x-squared, but never more than 100*/ return(x<=-10.0 || x>=10.0)?100:x*x; } Into appropriate lexemes. Which lexemes should get lexical values. 5. Write definition of operations on languages. 6. What are regular expression and regular set. Write algebraic laws for regular expressions. 7. Explain specification of tokens(Strings,language,alphabets,prefix/suffix strings etc). 8. Write regular definition for a) Identifiers b) unsigned numbers. C) tokens 9. Construct the transition diagram for recognizing the following a. Unsigned numbers c. relop e. reserved words and Identifers b. Whitespace d. Delimiters 10. Construct the transition diagrams for a set of keywords like begin, end, if then and else and. identifiers and constants along with a minimum set of relational operators. 11. Explain the structure of lex with its specification (Language for specifying lexical analyzers)
  • 4. Module-2 Chapter 2 Syntax Analysis: Introduction, Context Free Grammars, Writing a Grammar 1. Explain the role of parser. Explain error recovery strategies. 2. Give a formal definition of a CFG. Design a CFG for a simple arithmetic expression. 3. What is left recursion? Explain with an algorithm for eliminating the same with an example. 4. What is left factoring? Rewrite the following grammar after "left factored 1) S->iEts | iEtSeS | a 2) S->bSSaaS| bSSaSb| bSb | a E->b 5. What is ambiguous grammar? Show that following grammar is ambiguous: S->S+S|S*S|id. Give an unambiguous grammar for the above grammar such that has highest priority and has less priority and both are left associative. 6. Consider the context free grammar S → SS + ISS SSa And the string aa + a* i) Give a left most derivation for the string ii) Give a right most derivation for the string iii) Give a parse tree for the string iv) Is the grammar ambiguous or unambiguous? Justify. v). Describe the language generated by this grammar vi) Remove the left recursion from the grammar? vii) Left factor this grammar