DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI

Size: px
Start display at page:

Download "DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI"

Transcription

1 DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Subject Name: CS2352 Principles of Compiler Design Year/Sem : III/VI UNIT I - LEXICAL ANALYSIS 1. What is the role of Lexical Analyzer? [NOV 2014] 2. Write regular expression to describe a language consist of strings made of even numbers a and b. [NOV 2014] 3. State any two reasons as to why phases of compiler should be grouped. [MAY 2014] 4. Why is buffering used in lexical analysis? What are the commonly used buffering methods? [MAY 2014] 5. How will you group the phases of compiler? [NOV 2013] 6. Write the regular expression for identifier and whitespace. [NOV 2013] 7. Define tokens, patterns and lexemes. [MAY 2013] 8. What is a Complier? [MAY 2013] 9. State some software tools that manipulate source program? 10. What are the cousins of compiler? 11. What are the main two parts of compilation? What are they performing? 12. What is a Structure editor? 13. What happens in Semantic analysis? 14. State some compiler construction tools? 15. What is a Loader? What does the loading process do? 16. What does the Link Editing does? 17. State some functions of Preprocessors 18. What is a preprocessor? 19. What is an assembler? 20. What is the need for separating the analysis phase into lexical analysis and parsing? 21. What are the issues of lexical analyzer? 22. What is a sentinel? What is its usage? 23. What is a regular expression? State the rules, which define regular expression? 24. What are the Error-recovery actions in a lexical analyzer? 25. What is cross compiler? Give an example. Part - B 1. a. Explain the need for grouping of phases of compiler. [NOV 2014] b. Explain a language for specifying the lexical analyzer. [NOV 2014] 2. a. Write short notes on Compiler Construction tools. [NOV 2014] b. Explain Specification and recognition of tokens. [NOV 2014] 3. a. Define the following terms : Compiler, Interpreter, Translator. [MAY 2014] b. Differentiate between lexeme, token and pattern. [MAY 2014] c. What are the issues in Lexical analysis? [MAY 2014] 4. Explain in detail the process of compilation. Illustrate the output of each phase of compilation of the input a=(b+c)*(b+c)*2. [MAY 2014]

2 5. a. Explain the different phases of a compiler in detail. [NOV 2013] b. Discuss the cousins of compiler. [NOV 2013] 6. a. Draw the DFA for the augmented regular expression (a b) * # directly using syntax tree. [NOV 2013] b. Discuss input buffering techniques in detail. [NOV 2013] 7. Explain in detail about the role of Lexical analyzer with the possible error recovery actions. [MAY 2013] 8. What are the phases of the compiler? Explain the phases in detail. Write down the output of each phase for the expression a:= b+c*50. [MAY 2013] 9. Explain the specification of tokens. 10. What are the cousins of a Compiler? Explain them in detail. 11. Describe how various phases could be combined as a pass in a compiler? 12. Briefly explain Compiler construction tools 13. For the following expression Position:=initial+ rate*60 Write down the output after each phase 14. Explain the role Lexical Analyzer and issues of Lexical Analyzer. 15. Explain tokens with its attributes. UNIT II - SYNTAX ANALYSIS & RUNTIME ENVIRONMENT 1. List out the various storage allocation strategies. [NOV 2014] 2. Write CF grammar to represent palindrome. [NOV 2014] 3. Define Lexeme. [MAY 2014] 4. Compare the features of DFA to NFA. [MAY 2014] Eliminate the left recursion from the following grammar A Ac/Aad/bd/ 5. Give Examples for Static check. [NOV 2013] 6. Eliminate the left recursion of the grammar. [NOV 2013] S Aa b A Ac Sd 7. What is meant by coercion? [MAY 2013] 8. What is the output of syntax analysis phase? What are the three general types of parsers for grammars? [MAY 2013] 9. What are the different strategies that a parser can employ to recover from a syntactic error? 10. What is phrase level error recovery? 11. What are the goals of error handler in a parser? 12. How will you define a context free grammar? 13. Define context free language. When will you say that two CFGs are equal? 14. Differentiate sentence and sentential form. 15. Give the definition for leftmost and canonical derivations. 16. What is a parse tree? 17. When will you call a grammar as the left recursive one? 18. What is an ambiguous grammar? Give an example. 19. Define left factoring. 20. What is parsing? 21. What is Top Down parsing? 22. What do you mean by Recursive Descent Parsing? 23. What is meant by Predictive parsing? 24. What do you mean by viable prefixes? 25. Define handle. What do you mean by handle pruning?

3 Part - B 1. a. Explain the specification of simple type checker. [NOV 2014] b. Explain runtime environment with suitable example. [NOV 2014] 2. Find the LALR for the given grammar and parse the sentence (a+b)*c [NOV 2014] E E+T T, T T*F F, F (E) id 3. Consider the following grammar [MAY 2014] S AS b A SA a Construct the SLR parse table for the grammar. Show the actions of the parser for the input string abab. 4. What is an ambiguous grammar? Is the following grammar ambiguous? Prove E E+E E * E (E) id. [MAY 2014] 5. Design an LALR parser for the following grammar and parse the input id = id. [NOV 2013] S L = R R L *R id R L 6. a. Discuss in detail about storage allocation strategies. [NOV 2013] b. Explain about various parameter passing methods in procedure calls. [NOV 2013] 7. a. Construct a predictive parser for the following grammar. [MAY 2013] S (L) a L L,S S b. List all LR (0) items for the following grammar [MAY 2013] S AS / b A SA / a 8. a. What are the different storage allocation strategies? Explain. [MAY 2013] b. Specify a type checker which can handle expressions, statements and functions. [MAY 2013] 9. a. What are preliminary steps that are to be carried out during parsing? Explain with suitable examples b. Explain the error recovery in predictive parsing. 10. What are the necessary conditions to be carried out before the construction of predictive parser? 11. i) Construct the predictive parser for the following grammar: S (L) a L L,S S. ii) Construct the behavior of the parser on the sentence (a, a) using the grammar specified above. 12. i) Give an algorithm for finding the FIRST and FOLLOW positions for a given non-terminal. ii) Consider the grammar, E TE E +TE T FT T *FT F (E) id. Construct a predictive parsing table for the grammar given above. Verify whether the input string id + id * id is accepted by the grammar or not. 13. Construct the predictive parser for the following grammar: S a (T) T T, S S Write down the necessary algorithms and define FIRST and FOLLOW. Show the behavior of the parser in the sentences, i. (a,(a,a))

4 ii. (((a,a),,(a),a) 14. i) What is an operator grammar? Draw the precedence function graph for the following table. a ( ), $ a > > > ( < < = < ) > > >, < < > > $ < < ii) Check whether the following grammar is SLR (1) or not. Explain your answer with reasons. S L = R S R L * R L id R L. 15. For the operators given below, calculate the operator-precedence relations and operator precedence function id, +, *, $ 16. Check whether the following grammar is a LL(1) grammar S iets ietses a E b Also define the FIRST and FOLLOW procedures. 17. Consider the grammar E E + E E * E (E) id Show the sequence of moves made by the shift-reduce parser on the input id 1 + id 2 * id 3 and determine whether the given string is accepted by the parser or not. 18. i) What is a shift-reduce parser? Explain in detail the conflicts that may occur during shiftreduce parsing. ii) For the grammar given below, calculate the operator precedence relation and the precedence functions E E + E E - E E * E E / E E E (E) -E id 19. i) Consider the grammar given below. E E + T E T T T * F T F F (E) F id Construct an LR parsing table for the above grammar. Give the moves of LR parser on id*id+id ii) Briefly explain error recovery in LR parsing. 20. Construct a canonical parsing table for the grammar given below S CC C cc d

5 UNIT III INTERMEDIATE CODE GENERATION 1. What are the types of intermediate languages? [NOV 2014] 2. Give syntax directed translation for case statement. [NOV 2014] 3. What is the significance of intermediate code? [MAY 2014] 4. Write the various three address code form of intermediate code. [MAY 2014] 5. Define Back patching. [NOV 2013] 6. Translate the arithmetic expression a * -(b+c) into syntax tree and postfix notation. [NOV 2013] 7. What are the various ways of representing intermediate languages? [MAY 2013] 8. What are the benefits of using machine-independent intermediate form? [MAY 2013] 9. How can you generate three-address code? 10. What is a syntax tree? Draw the syntax tree for the assignment statement 11. What is postfix notation? 12. What is the usage of syntax directed definition. 13. Why Three address code is named so? 14. Define three-address code. 15. State quadruple 16. What is called an abstract or syntax tree? 17. What are triples? 18. Draw the DAG for a := b * -c + b * -c 19. What is meant by declaration? 20. Define Boolean Expression. 21. How semantic rules are defined? 22. What are the two primary purposes of Boolean Expressions? 23. What do you mean by viable prefixes? 24. What is meant by Shot-Circuit or jumping code? 25. What are the methods of representing a syntax tree? 26. Explain the following functions: i) makelist(i) ii) merge(p 1,p 2 ) iii) backpatch(p,i) Part - B 1. Generate intermediate code for the following code segment along with the required syntax directed translation scheme. [NOV 2014] While (i<10) If(i % 2 == 0) Evensum = evensum + i; Else Oddsum = oddsum + i; 2. Generate intermediate code for the following code segment along with the required syntax directed translation scheme. [NOV 2014] s=s+a[i][j]; 3. How would you convert the following into intermediate code? Give a suitable example. a. Assignment Statements [MAY 2014] b. Case Statements 4. a. Write notes on back patching. [MAY 2014] b. Explain the sequence of stack allocation processes for a function call. [MAY 2014] 5. a. Write the translation scheme for flow of control statements. [NOV 2013] b. Explain and compare in detail the various implementation forms of three address code. 6. a. Write the grammar and translation scheme for procedure call statements. [NOV 2013] b. Draw the DAG for the following three address code. [NOV 2013] d = b * c e = a + b b = b * c a = e - d

6 7. How would you generate the intermediate code for the flow of control statements? Explain with examples. [MAY 2013] 8. What are the various ways of calling the procedures? Explain in detail. [MAY 2013] 9. What is the 3 address code? Mention its types. How would you implement the three address statements? Explain with suitable examples. 10. Explain how declaration is done in a procedure using syntax directed translation. 11. Brief Intermediate code generation for Basic block, Control Flow and Boolean Expressions. 12. Write about quadruple and triple with its structure. 13. Explain the data structure used for implementing Symbol Table. 14. Compare the various data structures used for Symbol Table construction. 15. Explain about Back patching using Boolean Expressions. 16. Explain about Back patching using Flow of Control statements. UNIT IV CODE GENERATION 1. Differentiate between basic block and flow graph. [NOV 2014] 2. Draw DAG to represent a[i] = b[i]; a[i]=&t; [NOV 2014] 3. Define symbol table. [MAY 2014] 4. Name the techniques in loop optimization. [MAY 2014] 5. What is the use of Next-use information? [NOV 2013] 6. List the fields in an activation record. [NOV 2013] 7. Define basic blocks and flow graphs. [MAY 2013] 8. Give any four applications of DAG. [MAY 2013] 9. What are basic blocks? 10. What is a flow graph? 11. Discuss back-end and front end? 12. Define relocatable object module. 13. What is meant by multi register operations? 14. What is meant by peephole optimization? 15. List the types of addressing modes:- 16. What is input to code generator? 17. How the use of registers is subdivided into 2 sub-problems? 18. How would you calculate the cost of an instruction? 19. What are the primary structure preserving transformations on basic blocks? 20. Give some examples for 3 address statements. 21. What are the characteristics of peephole optimization? 22. What is a recursive procedure? 23. What are the common methods for associating actual and formal parameters? 24. Define DAG. 25. What are the issues in the design of code generators? 26. What are the various forms of target programs? 27. What is register descriptor and address descriptor? Part - B 1. a. Explain register allocation and assignment with suitable example. [NOV 2014] b. Explain code generation phase with simple code generation algorithm. [NOV 2014] 2. Generate DAG representation of the following code and list out the applications of DAG representation. [NOV 2014] I = 1; while (i<=10) do Sum+ = a[i]; 3. Discuss the various issues in code generation with examples. [MAY 2014] 4. Define a Directed Acyclic Graph. Construct a DAG and write the sequence of instructions for the expression a + a * (b-c) + (b-c) * d [MAY 2014]

7 5. a. Discuss runtime storage management in detail. [NOV 2013] b. Write short notes on structure preserving transformation of basic blocks. [NOV 2013] 6. Construct DAG and three address code for the following C program. [NOV 2013] i = 1; s = 0; while (i < = 10) { s = s + a [i] [i] i = i + 1 } 7. a. Discuss briefly about simple code generation algorithm. [MAY 2013] b. For the flow graph shown below, write the three address statements and construct the DAG. [MAY 2013] (1) t1:=4 * i (2) t2 := a[t1] (3) t3 := 4 * i (4) t4 := b[t3] (5) t5 := t2 * t4 (6) t6 := prod + t5 (7) prod := t6 (8) t7 := I + 1 (9) i := t7 (10) if i<=20 goto (1) 8. Discuss labeling algorithm with an example. [MAY 2013] 9. Discuss about the run time storage management of a code generator. 10. Explain the simple code generator with a suitable example. 11. Explain about Transformations on Basic Blocks. 12. Discuss in detail about Basic Block and Flow graph. 13. Construct the Basic block for below given three address code t1 : = a * a t2 : = a * b t3 : = 2 * t2 t4 : = t1 + t3 t5 : = b * b t6 : = t4 + t5 14. Consider the following source code for dot product of two vectors a and b of length 20 begin prod :=0; i:=1; do begin prod :=prod+ a[i] * b[i]; i :=i+1; end while i <= 20 end Construct Three address code, Basic Block and Flow Graph. 15. Explain in the DAG representation of the basic block with example. Write down the algorithm for construction of DAG.

8 UNIT V CODE OPTIMIZATION 1. Represent the following in flow graph. [NOV 2014] I = 1; sum = 0; while(i<= 10){sum+ =i;i++;} 2. What is global data flow analysis? [NOV 2014] 3. What do you mean by Cross- Compiler? [MAY 2014] 4. How would you represent the dummy blocks with no statements indicated in global data flow analysis? [MAY 2014] 5. Define loop unrolling with example. [NOV 2013] 6. What is an Optimizing compiler? [NOV 2013] 7. What is constant folding? [MAY 2013] 8. What are the properties of optimizing compilers? [MAY 2013] 9. Explain the principle sources of optimization. 10. What are the patterns used for code optimization? 11. Define local optimization. 12. What is code motion? 13. Give the block diagram of organization of code optimizer. 14. What are the advantages of the organization of code optimizer? 15. Define Local transformation & Global Transformation. 16. Give examples for function preserving transformations. 17. What is meant by Common Sub expressions? 18. What is meant by Dead Code? 19. What are the techniques used for loop optimization? 20. What is meant by Reduction in strength? 21. What is meant by loop invariant computation? 22. Write short notes on activation tree. 23. Define data flow equations. 24. Define static scope rule and dynamic rule Part - B 1. a. Explain Principle sources of optimization. [NOV 2014] b. Illustrate optimization of basic blocks with an example. [NOV 2014] 2. Explain peephole optimization and various code improving Transformations. [NOV 2014] 3. Discuss in detail the process of optimization of basic blocks. Give an example.[may 2014] 4. What is data flow analysis? Explain data flow abstraction with examples. [MAY 2014] 5. a. Write in detail about loop optimization. [NOV 2013] b. Discuss the characteristics of peephole optimization. [NOV 2013] 6. Discuss in detail about global data flow analysis. [NOV 2013] 7. a. Explain the data-flow analysis of structured programs. [MAY 2013] b. Write global common sub expression elimination algorithm with example. [MAY 2013] 8. Discuss in detail about technique used for Loop optimization. [MAY 2013] 9. Explain about Optimization of Basic Block. 10. Explain in detail of Loops in Flow graph. 11. What is bootstrapping? Explain the approach to compiler development 12. Explain the various source language issues. 13. Write about Data Flow Analysis of structural programs. 14. Explain various code optimization techniques in detail. 15. Generate target code for the given program segments: main( ) { int i,j; i = 4; j = i + 5; }

SYED AMMAL ENGINEERING COLLEGE (An ISO 9001:2008 Certified Institution) Dr. E.M. Abdullah Campus, Ramanathapuram

SYED AMMAL ENGINEERING COLLEGE (An ISO 9001:2008 Certified Institution) Dr. E.M. Abdullah Campus, Ramanathapuram CS6660 COMPILER DESIGN Question Bank UNIT I-INTRODUCTION TO COMPILERS 1. Define compiler. 2. Differentiate compiler and interpreter. 3. What is a language processing system? 4. List four software tools

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / EVEN SEMESTER

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / EVEN SEMESTER KINGS COLLEGE OF ENGINEERING PUNALKULAM DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR 2010-2011 / EVEN SEMESTER SUBJECT CODE\SUBJECT NAME: CS1352 \ PRINCIPLES OF COMPILER DESIGN QUESTION BANK

More information

Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov Compiler Design (170701)

Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov Compiler Design (170701) Gujarat Technological University Sankalchand Patel College of Engineering, Visnagar B.E. Semester VII (CE) July-Nov 2014 Compiler Design (170701) Question Bank / Assignment Unit 1: INTRODUCTION TO COMPILING

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 20 DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK VI SEMESTER CS6660 COMPILER DESIGN Regulation 20 Academic Year 207 8 Prepared by Ms. S.

More information

Question Bank. 10CS63:Compiler Design

Question Bank. 10CS63:Compiler Design Question Bank 10CS63:Compiler Design 1.Determine whether the following regular expressions define the same language? (ab)* and a*b* 2.List the properties of an operator grammar 3. Is macro processing a

More information

PRINCIPLES OF COMPILER DESIGN

PRINCIPLES OF COMPILER DESIGN PRINCIPLES OF COMPILER DESIGN 2 MARK QUESTIONS WITH ANSWERS UNIT I 1. What is a Complier? A Complier is a program that reads a program written in one language-the source language-and translates it in to

More information

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS

DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING UNIT -1-INTRODUCTION TO COMPILERS 2 MARK QUESTIONS BHARATHIDASAN ENGINEERING COLLEGE DEPARTMENT OF INFORMATION TECHNOLOGY / COMPUTER SCIENCE AND ENGINEERING Year & Semester : III & VI Degree & Branch : B.E (CSE) /B.Tech (Information Technology) Subject

More information

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur 603203. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : III & VI Section : CSE 1 & 2 Subject Code : CS6660 Subject Name : COMPILER

More information

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad - 00 043 INFORMATION TECHNOLOGY TUTORIAL QUESTION BANK Name AUTOMATA AND COMPILER DESIGN Code A03 Class III B. Tech I Semester Branch

More information

INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS)

INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS) Name Code Class Branch INSTITUTE OF AERONAUTICAL ENGINEERING (AUTONOMOUS) Dundigal, Hyderabad - 500 043 Year 0-0 INFORMATION TECHNOLOGY ASSIGNMENT QUESTIONS AUTOMATA AND COMPILER DESIGN A50513 III B. Tech

More information

Compiler Design Aug 1996

Compiler Design Aug 1996 Aug 1996 Part A 1 a) What are the different phases of a compiler? Explain briefly with the help of a neat diagram. b) For the following Pascal keywords write the state diagram and also write program segments

More information

2068 (I) Attempt all questions.

2068 (I) Attempt all questions. 2068 (I) 1. What do you mean by compiler? How source program analyzed? Explain in brief. 2. Discuss the role of symbol table in compiler design. 3. Convert the regular expression 0 + (1 + 0)* 00 first

More information

1. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail.

1. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail. Code No: R05320502 Set No. 1 1. Explain the input buffer scheme for scanning the source program. How the use of sentinels can improve its performance? Describe in detail. 2. Construct predictive parsing

More information

VIVA QUESTIONS WITH ANSWERS

VIVA QUESTIONS WITH ANSWERS VIVA QUESTIONS WITH ANSWERS 1. What is a compiler? A compiler is a program that reads a program written in one language the source language and translates it into an equivalent program in another language-the

More information

About the Authors... iii Introduction... xvii. Chapter 1: System Software... 1

About the Authors... iii Introduction... xvii. Chapter 1: System Software... 1 Table of Contents About the Authors... iii Introduction... xvii Chapter 1: System Software... 1 1.1 Concept of System Software... 2 Types of Software Programs... 2 Software Programs and the Computing Machine...

More information

The analysis part breaks up the source program into constituent pieces and creates an intermediate representation of the source program.

The analysis part breaks up the source program into constituent pieces and creates an intermediate representation of the source program. COMPILER DESIGN 1. What is a compiler? A compiler is a program that reads a program written in one language the source language and translates it into an equivalent program in another language-the target

More information

Section A. A grammar that produces more than one parse tree for some sentences is said to be ambiguous.

Section A. A grammar that produces more than one parse tree for some sentences is said to be ambiguous. Section A 1. What do you meant by parser and its types? A parser for grammar G is a program that takes as input a string w and produces as output either a parse tree for w, if w is a sentence of G, or

More information

GUJARAT TECHNOLOGICAL UNIVERSITY

GUJARAT TECHNOLOGICAL UNIVERSITY Type of course: Core GUJARAT TECHNOLOGICAL UNIVERSITY SUBJECT NAME: Compiler Design SUBJECT CODE: 21701 B.E. 7 th SEMESTER Prerequisite: Data Structures and Algorithms, Theory of Computation, Rationale:

More information

1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8]

1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8] Code No: R05311201 Set No. 1 1. (a) What are the closure properties of Regular sets? Explain. (b) Briefly explain the logical phases of a compiler model. [8+8] 2. Compute the FIRST and FOLLOW sets of each

More information

CS 2210 Sample Midterm. 1. Determine if each of the following claims is true (T) or false (F).

CS 2210 Sample Midterm. 1. Determine if each of the following claims is true (T) or false (F). CS 2210 Sample Midterm 1. Determine if each of the following claims is true (T) or false (F). F A language consists of a set of strings, its grammar structure, and a set of operations. (Note: a language

More information

LECTURE NOTES ON COMPILER DESIGN P a g e 2

LECTURE NOTES ON COMPILER DESIGN P a g e 2 LECTURE NOTES ON COMPILER DESIGN P a g e 1 (PCCS4305) COMPILER DESIGN KISHORE KUMAR SAHU SR. LECTURER, DEPARTMENT OF INFORMATION TECHNOLOGY ROLAND INSTITUTE OF TECHNOLOGY, BERHAMPUR LECTURE NOTES ON COMPILER

More information

QUESTIONS RELATED TO UNIT I, II And III

QUESTIONS RELATED TO UNIT I, II And III QUESTIONS RELATED TO UNIT I, II And III UNIT I 1. Define the role of input buffer in lexical analysis 2. Write regular expression to generate identifiers give examples. 3. Define the elements of production.

More information

VETRI VINAYAHA COLLEGE OF ENGINEERING AND TECHNOLOGY

VETRI VINAYAHA COLLEGE OF ENGINEERING AND TECHNOLOGY VETRI VINAYAHA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6660 COMPILER DESIGN III year/ VI sem CSE (Regulation 2013) UNIT I -INTRODUCTION TO COMPILER PART A

More information

SYLLABUS UNIT - I UNIT - II UNIT - III UNIT - IV CHAPTER - 1 : INTRODUCTION CHAPTER - 4 : SYNTAX AX-DIRECTED TRANSLATION TION CHAPTER - 7 : STORA

SYLLABUS UNIT - I UNIT - II UNIT - III UNIT - IV CHAPTER - 1 : INTRODUCTION CHAPTER - 4 : SYNTAX AX-DIRECTED TRANSLATION TION CHAPTER - 7 : STORA Contents i SYLLABUS UNIT - I CHAPTER - 1 : INTRODUCTION Programs Related to Compilers. Translation Process, Major Data Structures, Other Issues in Compiler Structure, Boot Strapping and Porting. CHAPTER

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK VI SEMESTER CS6660-COMPILER DESIGN Regulation 2013 Academic Year 2017 18 (Even)

More information

PSD3A Principles of Compiler Design Unit : I-V. PSD3A- Principles of Compiler Design

PSD3A Principles of Compiler Design Unit : I-V. PSD3A- Principles of Compiler Design PSD3A Principles of Compiler Design Unit : I-V 1 UNIT I - SYLLABUS Compiler Assembler Language Processing System Phases of Compiler Lexical Analyser Finite Automata NFA DFA Compiler Tools 2 Compiler -

More information

4. An interpreter is a program that

4. An interpreter is a program that 1. In an aboslute loading scheme, which loader function is accomplished by programmer? A. Allocation B. LInking C. Reallocation D. both (A) and (B) 2. A compiler program written in a high level language

More information

SYNTAX ANALYSIS 1. Define parser. Hierarchical analysis is one in which the tokens are grouped hierarchically into nested collections with collective meaning. Also termed as Parsing. 2. Mention the basic

More information

Roll No. :... Invigilator's Signature :. CS/B.Tech(CSE)/SEM-7/CS-701/ LANGUAGE PROCESSOR. Time Allotted : 3 Hours Full Marks : 70

Roll No. :... Invigilator's Signature :. CS/B.Tech(CSE)/SEM-7/CS-701/ LANGUAGE PROCESSOR. Time Allotted : 3 Hours Full Marks : 70 Name : Roll No. :... Invigilator's Signature :. CS/B.Tech(CSE)/SEM-7/CS-701/2011-12 2011 LANGUAGE PROCESSOR Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates

More information

CST-402(T): Language Processors

CST-402(T): Language Processors CST-402(T): Language Processors Course Outcomes: On successful completion of the course, students will be able to: 1. Exhibit role of various phases of compilation, with understanding of types of grammars

More information

Syntax Analysis Part I

Syntax Analysis Part I Syntax Analysis Part I Chapter 4: Context-Free Grammars Slides adapted from : Robert van Engelen, Florida State University Position of a Parser in the Compiler Model Source Program Lexical Analyzer Token,

More information

G.PULLAIH COLLEGE OF ENGINEERING & TECHNOLOGY

G.PULLAIH COLLEGE OF ENGINEERING & TECHNOLOGY G.PULLAI COLLEGE OF ENGINEERING & TECNOLOGY Nandikotkur Road, Kurnool 518002 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Semester VI (2017-2018) COURSE DESCRIPTION Course Code : 15A05601 Course Title

More information

CS6660-COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS PART A

CS6660-COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS PART A CS6660-COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS PART A 1. What does translator mean? A translator is a program that takes a input program on one programming language (source language) and produces

More information

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN Course Code : CS0301 Course Title : Compiler Design Semester : V Course Time : July Dec 2011 DAY SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF CSE COURSE PLAN SECTION

More information

UNIT I INTRODUCTION TO COMPILING

UNIT I INTRODUCTION TO COMPILING UNIT I INTRODUCTION TO COMPILING 1. Define compiler? A compiler is a program that reads a program written in one language (source language) and translates it into an equivalent program in another language

More information

Compiler Design Overview. Compiler Design 1

Compiler Design Overview. Compiler Design 1 Compiler Design Overview Compiler Design 1 Preliminaries Required Basic knowledge of programming languages. Basic knowledge of FSA and CFG. Knowledge of a high programming language for the programming

More information

Syntax Analysis. Chapter 4

Syntax Analysis. Chapter 4 Syntax Analysis Chapter 4 Check (Important) http://www.engineersgarage.com/contributio n/difference-between-compiler-andinterpreter Introduction covers the major parsing methods that are typically used

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design i About the Tutorial A compiler translates the codes written in one language to some other language without changing the meaning of the program. It is also expected that a compiler should make the target

More information

QUESTION BANK CHAPTER 1 : OVERVIEW OF SYSTEM SOFTWARE. CHAPTER 2: Overview of Language Processors. CHAPTER 3: Assemblers

QUESTION BANK CHAPTER 1 : OVERVIEW OF SYSTEM SOFTWARE. CHAPTER 2: Overview of Language Processors. CHAPTER 3: Assemblers QUESTION BANK CHAPTER 1 : OVERVIEW OF SYSTEM SOFTWARE 1) Explain Analysis-synthesis model/fron end backend model of compiler 2) Explain various phases of compiler and symbol table. Consider the statement

More information

Life Cycle of Source Program - Compiler Design

Life Cycle of Source Program - Compiler Design Life Cycle of Source Program - Compiler Design Vishal Trivedi * Gandhinagar Institute of Technology, Gandhinagar, Gujarat, India E-mail: raja.vishaltrivedi@gmail.com Abstract: This Research paper gives

More information

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING DEPARTMENT OF CSE COURSE PLAN Course Code : CS0301 Course Title : Compiler Design Semester : V Course Time

More information

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN

SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN SRM UNIVERSITY FACULTY OF ENGINEERING AND TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND ENGINEERING COURSE PLAN Course Code : CS1014 Semester: VI Course Title : System Software and Compiler Design Course Time:

More information

EDAN65: Compilers, Lecture 06 A LR parsing. Görel Hedin Revised:

EDAN65: Compilers, Lecture 06 A LR parsing. Görel Hedin Revised: EDAN65: Compilers, Lecture 06 A LR parsing Görel Hedin Revised: 2017-09-11 This lecture Regular expressions Context-free grammar Attribute grammar Lexical analyzer (scanner) Syntactic analyzer (parser)

More information

CS606- compiler instruction Solved MCQS From Midterm Papers

CS606- compiler instruction Solved MCQS From Midterm Papers CS606- compiler instruction Solved MCQS From Midterm Papers March 06,2014 MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01 Final Term MCQ s and Quizzes CS606- compiler instruction If X is a

More information

UNIT-III BOTTOM-UP PARSING

UNIT-III BOTTOM-UP PARSING UNIT-III BOTTOM-UP PARSING Constructing a parse tree for an input string beginning at the leaves and going towards the root is called bottom-up parsing. A general type of bottom-up parser is a shift-reduce

More information

University of Technology Department of Computer Sciences. Final Examination st Term. Subject:Compilers Design

University of Technology Department of Computer Sciences. Final Examination st Term. Subject:Compilers Design Subject:Compilers Design Division: All Branches Examiner:Dr. Abeer Tariq University of Technology Department of Computer Sciences 2102 Final Examination 2011-2012 1 st Term Year:Third Time: 3 Hours Date:

More information

CSE P 501 Compilers. LR Parsing Hal Perkins Spring UW CSE P 501 Spring 2018 D-1

CSE P 501 Compilers. LR Parsing Hal Perkins Spring UW CSE P 501 Spring 2018 D-1 CSE P 501 Compilers LR Parsing Hal Perkins Spring 2018 UW CSE P 501 Spring 2018 D-1 Agenda LR Parsing Table-driven Parsers Parser States Shift-Reduce and Reduce-Reduce conflicts UW CSE P 501 Spring 2018

More information

3. Syntax Analysis. Andrea Polini. Formal Languages and Compilers Master in Computer Science University of Camerino

3. Syntax Analysis. Andrea Polini. Formal Languages and Compilers Master in Computer Science University of Camerino 3. Syntax Analysis Andrea Polini Formal Languages and Compilers Master in Computer Science University of Camerino (Formal Languages and Compilers) 3. Syntax Analysis CS@UNICAM 1 / 54 Syntax Analysis: the

More information

Let us construct the LR(1) items for the grammar given below to construct the LALR parsing table.

Let us construct the LR(1) items for the grammar given below to construct the LALR parsing table. MODULE 18 LALR parsing After understanding the most powerful CALR parser, in this module we will learn to construct the LALR parser. The CALR parser has a large set of items and hence the LALR parser is

More information

Torben./Egidius Mogensen. Introduction. to Compiler Design. ^ Springer

Torben./Egidius Mogensen. Introduction. to Compiler Design. ^ Springer Torben./Egidius Mogensen Introduction to Compiler Design ^ Springer Contents 1 Lexical Analysis 1 1.1 Regular Expressions 2 1.1.1 Shorthands 4 1.1.2 Examples 5 1.2 Nondeterministic Finite Automata 6 1.3

More information

Context-free grammars

Context-free grammars Context-free grammars Section 4.2 Formal way of specifying rules about the structure/syntax of a program terminals - tokens non-terminals - represent higher-level structures of a program start symbol,

More information

Formal Languages and Compilers Lecture VII Part 3: Syntactic A

Formal Languages and Compilers Lecture VII Part 3: Syntactic A Formal Languages and Compilers Lecture VII Part 3: Syntactic Analysis Free University of Bozen-Bolzano Faculty of Computer Science POS Building, Room: 2.03 artale@inf.unibz.it http://www.inf.unibz.it/

More information

CS5363 Final Review. cs5363 1

CS5363 Final Review. cs5363 1 CS5363 Final Review cs5363 1 Programming language implementation Programming languages Tools for describing data and algorithms Instructing machines what to do Communicate between computers and programmers

More information

UNIT III & IV. Bottom up parsing

UNIT III & IV. Bottom up parsing UNIT III & IV Bottom up parsing 5.0 Introduction Given a grammar and a sentence belonging to that grammar, if we have to show that the given sentence belongs to the given grammar, there are two methods.

More information

General Overview of Compiler

General Overview of Compiler General Overview of Compiler Compiler: - It is a complex program by which we convert any high level programming language (source code) into machine readable code. Interpreter: - It performs the same task

More information

Compiler Construction: Parsing

Compiler Construction: Parsing Compiler Construction: Parsing Mandar Mitra Indian Statistical Institute M. Mitra (ISI) Parsing 1 / 33 Context-free grammars. Reference: Section 4.2 Formal way of specifying rules about the structure/syntax

More information

CSE 401 Compilers. LR Parsing Hal Perkins Autumn /10/ Hal Perkins & UW CSE D-1

CSE 401 Compilers. LR Parsing Hal Perkins Autumn /10/ Hal Perkins & UW CSE D-1 CSE 401 Compilers LR Parsing Hal Perkins Autumn 2011 10/10/2011 2002-11 Hal Perkins & UW CSE D-1 Agenda LR Parsing Table-driven Parsers Parser States Shift-Reduce and Reduce-Reduce conflicts 10/10/2011

More information

Downloaded from Page 1. LR Parsing

Downloaded from  Page 1. LR Parsing Downloaded from http://himadri.cmsdu.org Page 1 LR Parsing We first understand Context Free Grammars. Consider the input string: x+2*y When scanned by a scanner, it produces the following stream of tokens:

More information

PART 3 - SYNTAX ANALYSIS. F. Wotawa TU Graz) Compiler Construction Summer term / 309

PART 3 - SYNTAX ANALYSIS. F. Wotawa TU Graz) Compiler Construction Summer term / 309 PART 3 - SYNTAX ANALYSIS F. Wotawa (IST @ TU Graz) Compiler Construction Summer term 2016 64 / 309 Goals Definition of the syntax of a programming language using context free grammars Methods for parsing

More information

R13 SET Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA.

R13 SET Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA. R13 SET - 1 III B. Tech I Semester Regular Examinations, November - 2015 1 a) What constitutes a programming environment? [3M] b) What mixed-mode assignments are allowed in C and Java? [4M] c) What is

More information

UNIT I INTRODUCTION TO COMPILER 1. What is a Complier? A Complier is a program that reads a program written in one language-the source language-and translates it in to an equivalent program in another

More information

CJT^jL rafting Cm ompiler

CJT^jL rafting Cm ompiler CJT^jL rafting Cm ompiler ij CHARLES N. FISCHER Computer Sciences University of Wisconsin Madison RON K. CYTRON Computer Science and Engineering Washington University RICHARD J. LeBLANC, Jr. Computer Science

More information

1. The output of lexical analyser is a) A set of RE b) Syntax Tree c) Set of Tokens d) String Character

1. The output of lexical analyser is a) A set of RE b) Syntax Tree c) Set of Tokens d) String Character 1. The output of lexical analyser is a) A set of RE b) Syntax Tree c) Set of Tokens d) String Character 2. The symbol table implementation is based on the property of locality of reference is a) Linear

More information

LR Parsing Techniques

LR Parsing Techniques LR Parsing Techniques Introduction Bottom-Up Parsing LR Parsing as Handle Pruning Shift-Reduce Parser LR(k) Parsing Model Parsing Table Construction: SLR, LR, LALR 1 Bottom-UP Parsing A bottom-up parser

More information

CS 4201 Compilers 2014/2015 Handout: Lab 1

CS 4201 Compilers 2014/2015 Handout: Lab 1 CS 4201 Compilers 2014/2015 Handout: Lab 1 Lab Content: - What is compiler? - What is compilation? - Features of compiler - Compiler structure - Phases of compiler - Programs related to compilers - Some

More information

Group B Assignment 9. Code generation using DAG. Title of Assignment: Problem Definition: Code generation using DAG / labeled tree.

Group B Assignment 9. Code generation using DAG. Title of Assignment: Problem Definition: Code generation using DAG / labeled tree. Group B Assignment 9 Att (2) Perm(3) Oral(5) Total(10) Sign Title of Assignment: Code generation using DAG. 9.1.1 Problem Definition: Code generation using DAG / labeled tree. 9.1.2 Perquisite: Lex, Yacc,

More information

COMPILER DESIGN LEXICAL ANALYSIS, PARSING

COMPILER DESIGN LEXICAL ANALYSIS, PARSING COMPILER DESIGN LEXICAL ANALYSIS, PARSING 1. Which of the following system program forgoes the production of object code to generate absolute machine code and load it into the Physical main storage location

More information

COMPILER DESIGN. For COMPUTER SCIENCE

COMPILER DESIGN. For COMPUTER SCIENCE COMPILER DESIGN For COMPUTER SCIENCE . COMPILER DESIGN SYLLABUS Lexical analysis, parsing, syntax-directed translation. Runtime environments. Intermediate code generation. ANALYSIS OF GATE PAPERS Exam

More information

Front End. Hwansoo Han

Front End. Hwansoo Han Front nd Hwansoo Han Traditional Two-pass Compiler Source code Front nd IR Back nd Machine code rrors High level functions Recognize legal program, generate correct code (OS & linker can accept) Manage

More information

NARESHKUMAR.R, AP\CSE, MAHALAKSHMI ENGINEERING COLLEGE, TRICHY Page 1

NARESHKUMAR.R, AP\CSE, MAHALAKSHMI ENGINEERING COLLEGE, TRICHY Page 1 SEM / YEAR : VI / III CS2352 PRINCIPLES OF COMPLIERS DESIGN UNIT III INTERMEDIATE CODE GENERATION PART A 1. What are the benefits of intermediate code generation? (A.U May 2008) A Compiler for different

More information

Bottom-up parsing. Bottom-Up Parsing. Recall. Goal: For a grammar G, withstartsymbols, any string α such that S α is called a sentential form

Bottom-up parsing. Bottom-Up Parsing. Recall. Goal: For a grammar G, withstartsymbols, any string α such that S α is called a sentential form Bottom-up parsing Bottom-up parsing Recall Goal: For a grammar G, withstartsymbols, any string α such that S α is called a sentential form If α V t,thenα is called a sentence in L(G) Otherwise it is just

More information

Principles of Programming Languages [PLP-2015] Detailed Syllabus

Principles of Programming Languages [PLP-2015] Detailed Syllabus Principles of Programming Languages [PLP-2015] Detailed Syllabus This document lists the topics presented along the course. The PDF slides published on the course web page (http://www.di.unipi.it/~andrea/didattica/plp-15/)

More information

ECE251 Midterm practice questions, Fall 2010

ECE251 Midterm practice questions, Fall 2010 ECE251 Midterm practice questions, Fall 2010 Patrick Lam October 20, 2010 Bootstrapping In particular, say you have a compiler from C to Pascal which runs on x86, and you want to write a self-hosting Java

More information

Parsing. Handle, viable prefix, items, closures, goto s LR(k): SLR(1), LR(1), LALR(1)

Parsing. Handle, viable prefix, items, closures, goto s LR(k): SLR(1), LR(1), LALR(1) TD parsing - LL(1) Parsing First and Follow sets Parse table construction BU Parsing Handle, viable prefix, items, closures, goto s LR(k): SLR(1), LR(1), LALR(1) Problems with SLR Aho, Sethi, Ullman, Compilers

More information

UNIT IV INTERMEDIATE CODE GENERATION

UNIT IV INTERMEDIATE CODE GENERATION UNIT IV INTERMEDIATE CODE GENERATION 2 Marks 1. Draw syntax tree for the expression a=b*-c+b*-c 2. Explain postfix notation. It is the linearized representation of syntax tree.it is a list of nodes of

More information

MODULE 14 SLR PARSER LR(0) ITEMS

MODULE 14 SLR PARSER LR(0) ITEMS MODULE 14 SLR PARSER LR(0) ITEMS In this module we shall discuss one of the LR type parser namely SLR parser. The various steps involved in the SLR parser will be discussed with a focus on the construction

More information

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING PRINCIPLES OF COMPILER DESIGN 2 MARKS UNIT I INTRODUCTION TO COMPILING 1. Define compiler? A compiler is a program that reads a program written in one language (source language) and translates it into

More information

SEM / YEAR : VI / III CS2352 PRINCIPLES OF COMPLIERS DESIGN UNIT I - LEXICAL ANALYSIS PART - A

SEM / YEAR : VI / III CS2352 PRINCIPLES OF COMPLIERS DESIGN UNIT I - LEXICAL ANALYSIS PART - A SEM / YEAR : VI / III CS2352 PRINCIPLES OF COMPLIERS DESIGN UNIT I - LEXICAL ANALYSIS PART - A 1. What is a compiler? (A.U Nov/Dec 2007) A compiler is a program that reads a program written in one language

More information

Final Term Papers 2013

Final Term Papers 2013 Solved by: Sahar (well wisher) Class BSCS 6 th Semester Subject CS606 (COMPILER CONSTRUCTION) Solution Type: Final Term Solved Subjective including Papers of Year : 2013,2012,2011,2010,2009 2006 Institute:

More information

TABLE OF CONTENTS S.No DATE TOPIC PAGE No UNIT I LEXICAL ANALYSIS 1 Introduction to Compiling-Compilers 6 2 Analysis of the source program 7 3 The

TABLE OF CONTENTS S.No DATE TOPIC PAGE No UNIT I LEXICAL ANALYSIS 1 Introduction to Compiling-Compilers 6 2 Analysis of the source program 7 3 The TABLE OF CONTENTS S.No DATE TOPIC PAGE No UNIT I LEXICAL ANALYSIS 1 Introduction to Compiling-Compilers 6 2 Analysis of the source program 7 3 The phases 9 4 Cousins 11 5 The grouping of phases 13 6 Compiler

More information

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division SECOND SEMESTER 2015-2016 Course Handout (Part II) Date:23-01-2017 In addition to part I (General Handout for all courses appended to the time table) this portion gives further specific details regarding

More information

Compilerconstructie. najaar Rudy van Vliet kamer 140 Snellius, tel rvvliet(at)liacs(dot)nl. college 3, vrijdag 22 september 2017

Compilerconstructie. najaar Rudy van Vliet kamer 140 Snellius, tel rvvliet(at)liacs(dot)nl. college 3, vrijdag 22 september 2017 Compilerconstructie najaar 2017 http://www.liacs.leidenuniv.nl/~vlietrvan1/coco/ Rudy van Vliet kamer 140 Snellius, tel. 071-527 2876 rvvliet(at)liacs(dot)nl college 3, vrijdag 22 september 2017 + werkcollege

More information

Appendix A The DL Language

Appendix A The DL Language Appendix A The DL Language This appendix gives a description of the DL language used for many of the compiler examples in the book. DL is a simple high-level language, only operating on integer data, with

More information

Compiler Code Generation COMP360

Compiler Code Generation COMP360 Compiler Code Generation COMP360 Students who acquire large debts putting themselves through school are unlikely to think about changing society. When you trap people in a system of debt, they can t afford

More information

List of Figures. About the Authors. Acknowledgments

List of Figures. About the Authors. Acknowledgments List of Figures Preface About the Authors Acknowledgments xiii xvii xxiii xxv 1 Compilation 1 1.1 Compilers..................................... 1 1.1.1 Programming Languages......................... 1

More information

BSCS Fall Mid Term Examination December 2012

BSCS Fall Mid Term Examination December 2012 PUNJAB UNIVERSITY COLLEGE OF INFORMATION TECHNOLOGY University of the Punjab Sheet No.: Invigilator Sign: BSCS Fall 2009 Date: 14-12-2012 Mid Term Examination December 2012 Student ID: Section: Morning

More information

Parsing. Rupesh Nasre. CS3300 Compiler Design IIT Madras July 2018

Parsing. Rupesh Nasre. CS3300 Compiler Design IIT Madras July 2018 Parsing Rupesh Nasre. CS3300 Compiler Design IIT Madras July 2018 Character stream Lexical Analyzer Machine-Independent Code Code Optimizer F r o n t e n d Token stream Syntax Analyzer Syntax tree Semantic

More information

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100 GATE- 2016-17 Postal Correspondence 1 Compiler Design Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts,

More information

EXAM. CS331 Compiler Design Spring Please read all instructions, including these, carefully

EXAM. CS331 Compiler Design Spring Please read all instructions, including these, carefully EXAM Please read all instructions, including these, carefully There are 7 questions on the exam, with multiple parts. You have 3 hours to work on the exam. The exam is open book, open notes. Please write

More information

Concepts Introduced in Chapter 4

Concepts Introduced in Chapter 4 Concepts Introduced in Chapter 4 Grammars Context-Free Grammars Derivations and Parse Trees Ambiguity, Precedence, and Associativity Top Down Parsing Recursive Descent, LL Bottom Up Parsing SLR, LR, LALR

More information

1. INTRODUCTION TO LANGUAGE PROCESSING The Language Processing System can be represented as shown figure below.

1. INTRODUCTION TO LANGUAGE PROCESSING The Language Processing System can be represented as shown figure below. UNIT I Translator: It is a program that translates one language to another Language. Examples of translator are compiler, assembler, interpreter, linker, loader and preprocessor. Source Code Translator

More information

Syntax Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

Syntax Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay Syntax Analysis (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay September 2007 College of Engineering, Pune Syntax Analysis: 2/124 Syntax

More information

Lecture 8: Deterministic Bottom-Up Parsing

Lecture 8: Deterministic Bottom-Up Parsing Lecture 8: Deterministic Bottom-Up Parsing (From slides by G. Necula & R. Bodik) Last modified: Fri Feb 12 13:02:57 2010 CS164: Lecture #8 1 Avoiding nondeterministic choice: LR We ve been looking at general

More information

CS131: Programming Languages and Compilers. Spring 2017

CS131: Programming Languages and Compilers. Spring 2017 CS131: Programming Languages and Compilers Spring 2017 Course Information Instructor: Fu Song Office: Room 1A-504C, SIST Building Email: songfu@shanghaitech.edu.cn Class Hours : Tuesday and Thursday, 8:15--9:55

More information

Context-Free Grammar. Concepts Introduced in Chapter 2. Parse Trees. Example Grammar and Derivation

Context-Free Grammar. Concepts Introduced in Chapter 2. Parse Trees. Example Grammar and Derivation Concepts Introduced in Chapter 2 A more detailed overview of the compilation process. Parsing Scanning Semantic Analysis Syntax-Directed Translation Intermediate Code Generation Context-Free Grammar A

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science and Engineering

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Computer Science and Engineering TEST 1 Date : 24 02 2015 Marks : 50 Subject & Code : Compiler Design ( 10CS63) Class : VI CSE A & B Name of faculty : Mrs. Shanthala P.T/ Mrs. Swati Gambhire Time : 8:30 10:00 AM SOLUTION MANUAL 1. a.

More information

A simple syntax-directed

A simple syntax-directed Syntax-directed is a grammaroriented compiling technique Programming languages: Syntax: what its programs look like? Semantic: what its programs mean? 1 A simple syntax-directed Lexical Syntax Character

More information

Principle of Compilers Lecture IV Part 4: Syntactic Analysis. Alessandro Artale

Principle of Compilers Lecture IV Part 4: Syntactic Analysis. Alessandro Artale Free University of Bolzano Principles of Compilers Lecture IV Part 4, 2003/2004 AArtale (1) Principle of Compilers Lecture IV Part 4: Syntactic Analysis Alessandro Artale Faculty of Computer Science Free

More information

CS308 Compiler Principles Syntax Analyzer Li Jiang

CS308 Compiler Principles Syntax Analyzer Li Jiang CS308 Syntax Analyzer Li Jiang Department of Computer Science and Engineering Shanghai Jiao Tong University Syntax Analyzer Syntax Analyzer creates the syntactic structure of the given source program.

More information

Lecture 7: Deterministic Bottom-Up Parsing

Lecture 7: Deterministic Bottom-Up Parsing Lecture 7: Deterministic Bottom-Up Parsing (From slides by G. Necula & R. Bodik) Last modified: Tue Sep 20 12:50:42 2011 CS164: Lecture #7 1 Avoiding nondeterministic choice: LR We ve been looking at general

More information