1 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 and design complexity of compiler. 2. Design various types of parses and perform operations like string parsing and error handling. 3. Demonstrate syntax directed translation schemes, their implementation for different programming language constructs. 4. Implement different code optimization and code generation techniques using standard data structures.
2 UNIT I: Introduction [CO1] Outcomes: 1. To understand the design complexity of language processor. 2. To understand the functions of various phases of compilation. 3. To understand allied concepts like cross compilation, bootstrapping etc.
3 Motivation Early days software were written in assembly language. The software was machine specific. No portability. Separate module for separate task [Assembler, Linker, Loader]. Software cost for operation increased. First complier FORTRAN IN 1950 Total 18 person-years to build.
4 Typical Compilation Process Source program with macros Preprocessor Source program Compiler Target assembly program assembler Relocatable machine code linker Absolute machine code
5 Compiler A compiler acts as a translator, transforming human-oriented programming languages into computeroriented machine languages. Ignore machine-dependent details for programmer A program that reads a program written in one language (source language) and translates it into an equivalent program in another language (target language). Two components Understand the program (make sure it is correct) Rewrite the program in the target language. Traditionally, the source language is a high level language and the target language is a low level language (machine code). Source program Compiler Target program Error message
6 Compilation process Compilation of a program proceeds through a fixed series of phases Each phase use an (intermediate) form of the program produced by an earlier phase. [Cascading effect] Subsequent phases operate on lower-level code representations. [Close to system] Each phase may consist of a number of passes over the program representation Pascal, FORTRAN, C languages designed for one-pass compilation, which explains the need for function prototypes Single-pass compilers need less memory to operate Java, C++ and ADA are multi-pass
7 Two major operations Any compiler must perform two major tasks Compiler Analysis Synthesis Analysis of the source program Synthesis of a machine-language program
8 Block Schematic: Modern Compilers Source Program Tokens Syntactic (Character Stream) Scanner Parser Structure Semantic Routines Intermediate Representation Error recovery and Symbol and Attribute Tables Intermediate Code Generator Code Optimizer (Used by all Phases of The Compiler) Code Generator Target machine code
9 Block Schematic Source Program Tokens Syntactic (Character Stream) Scanner Parser Structure Semantic Routines Scanner The scanner begins the analysis of the source program by reading the input, character by character, and grouping characters into individual words and symbols (tokens) RE ( Regular expression ) NFA ( Non-deterministic Finite Automata ) DFA ( Deterministic Finite Automata ) LEX Intermediate Representation Intermediate Code Generator Code Optimizer Code Generator Target machine code
10 Block Schematic Source Program Tokens Syntactic (Character Stream) Scanner Parser Structure Semantic Routines Parser Given a formal syntax specification (typically as a contextfree grammar [CFG] ), the parse reads tokens and groups them into units as specified by the productions of the CFG being used. As syntactic structure is recognized, the parser either calls corresponding semantic routines directly or builds a syntax tree. CFG ( Context-Free Grammar ) BNF ( Backus-Naur Form ) GAA ( Grammar Analysis Algorithms ) LL, LR, SLR, LALR Parsers YACC Intermediate Representation Intermediate Code Generator Code Optimizer Code Generator Target machine code
11 Block Schematic Source Program Tokens Syntactic (Character Stream) Scanner Parser Structure Semantic Routines Semantic Routines Perform two functions Check the static semantics of each construct Do the actual translation The heart of a compiler Syntax Directed Translation Semantic Processing Techniques IR (Intermediate Representation) Intermediate Representation Intermediate Code Generator Code Optimizer Code Generator Target machine code
12 Block Schematic Source Program Tokens Syntactic (Character Stream) Scanner Parser Structure Semantic Routines Optimizer The IR code generated by the semantic routines is analyzed and transformed into functionally equivalent but improved IR code This phase can be very complex and slow Peephole optimization Loop optimization, register allocation, code scheduling Local Optimization Register and Temporary Management Peephole Optimization Intermediate Representation Intermediate Code Generator Code Optimizer Code Generator Target machine code
13 Block Schematic Source Program Tokens Syntactic (Character Stream) Scanner Parser Structure Semantic Routines Code Generator Interpretive Code Generation Generating Code from Tree/Dag Grammar-Based Code Generator Generally in Machine language for better understanding of course Intermediate Representation Intermediate Code Generator Code Optimizer Code Generator Target machine code
15 Compiler Front-end / Back-end Source program (character stream) Scanner (lexical analysis) Tokens Abstract syntax tree or other intermediate form Intermediate Code Generation Front end analysis Parser (syntax analysis) Parse tree Semantic Analysis Abstract syntax tree or other intermediate form Back end synthesis Modified intermediate form Code Optimization Assembly or object code Machine Specific Code Generation Modified assembly or object code
16 Phases Functionalities
17 Lexical Analyzer Lexical analysis breaks up a program into tokens/lexicon Grouping characters into non- separable units (tokens) Changing a stream to characters to a stream of tokens program gcd (input, output); var i, j : integer; begin read (i, j); while i <> j do if i > j then i := i - j else j := j - i; writeln (i) end. Comment on kinds of errors reported by lexical analyzer program gcd ( input, output ) ; var i, j : integer ; begin read ( i, j ) ; while i <> j do if i > j then i := i - j else j := i - i ; writeln ( i ) end.
18 Syntax Analyzer Grammatical check of tokens. A syntax error is produced by the compiler when the program does not meet the grammatical specification. For grammatically correct program, this phase generates an internal representation that is easy to manipulate in later phases Typically a syntax tree (also called a parse tree). A grammar of a programming language is typically described by a context free grammar, which also defines the structure of the parse tree.
19 Syntax Analyzer: Parser: Parse Tree The syntax defines the syntactic categories for language constructs Statements Expressions Declarations Categories are subdivided into more detailed categories A Statement is a For-statement If-statement Assignment
20 Semantic Analysis/SDTS Semantic analysis is applied by a compiler to discover the meaning of a program by analyzing its parse tree or abstract syntax tree. A program without grammatical errors may not always be correct program. pos = init + rate * 60 What if pos is a char while init and rate are integers? This kind of errors cannot be found by the parser Semantic analysis finds this type of error and ensure that the program has a meaning. C++: Semantically strong language?
21 Types of Semantic Checks Static semantic checks (done by the compiler) are performed at compile time Type checking Every variable is declared before used Identifiers are used in appropriate contexts Check subroutine call arguments Check labels Dynamic semantic checks are performed at run time, and the compiler produces code that performs these checks Array subscript values are within bounds Arithmetic errors, e.g. division by zero Pointers are not dereferenced unless pointing to valid object A variable is used but hasn't been initialized When a check fails at run time, an exception is raised
22 Semantic Analysis A language is strongly typed if (type) errors are always detected. Errors are either detected at compile time or at run time Languages that are strongly typed are Ada, Java, ML, Haskell Languages that are not strongly typed are Fortran, Pascal, C/C++, Lisp Strong typing makes language safe and easier to use, but potentially slower because of dynamic semantic checks In some languages, most (type) errors are detected late at run time which is detrimental to reliability e.g. early Basic, Lisp, Prolog, some script languages
23 Intermediate Code Generator Conversion of parse tree into intermediate code. Various forms of intermediate code: Quadruple, Triplet, Indirect Triplet etc. Temporary storage is used in representation. Proper use of data structures is key factor.
24 Code Optimization Purpose: To improve efficiency of code. To reduce time required for execution. Types Local Optimization Loop Optimization Peep-hole Optimization Role of data structures and their memory implementation is important [Trees/Graphs] Optimization: Machine independent Machine dependent
25 Code Generation Purpose: To convert optimized code into machine code. Depends upon machine architecture. For learning purpose assembly language code will be used. Example: MOVF id3, R2 MULF #60.0, R2 MOVF id2, R1 ADDF R2, R1 MOVF R1, id1
26 Summary Compiler front-end: lexical analysis, syntax analysis, semantic analysis Tasks: understanding the source code, making sure the source code is written correctly Compiler back-end: Intermediate code generation/improvement, and Machine code generation/improvement. Tasks: translating the program to a semantically the same program (in a different language).
27 Questions Explain the various phases of compilation. Open source tools: for various phases of compilation. File name in which details of keywords of C language are stored. Its locations and structure. C++ is semantically strong language? Justify Any five rules to design lexical analyzer. For example:?! symbols are not considered as valid tokens. Advantages of Late and Early binding approaches. How to decide the complier is one pass or two pass. Any two rules. How to classify the front end and back end component of any software product.
28 Course Curriculum UNIT-I Introduction to Compilers- Compilers and translators, Phases of compiler design, cross compiler, Bootstrapping, Design of Lexical analyser, LEX. UNIT-II Syntax Analysis- Specification of syntax of programming languages using CFG, Top-down parser, design of LL(1) parser, bottom up parsing technique, LR parsing, Design of SLR, CLR, LALR parsers, YACC. UNIT-III Syntax directed translation- Study of syntax directed definitions & syntax directed translation schemes, implementation of SDTS, intermediate notations- postfix, syntax tree, TAC, translation of expressions, controls structures, declarations, procedure calls, Array reference. UNIT-IV Storage allocation & Error Handling- Run time storage administration stack allocation, symbol table management, Error detection and recovery- lexical, syntactic and semantic. UNIT-V Code optimization- Important code optimization techniques, loop optimization, control flow analysis, data flow analysis, Loop invariant computation, Induction variable removal, Elimination of Common sub expression. UNIT-VI Code generation Problems in code generation, Simple code generator, Register allocation and assignment, Code generation from DAG, Peephole optimization. Web resource: TEXTBOOKS Aho, Sethi, and Ullman; Compilers Principles Techniques and Tools; Second Edition, Pearson education, Alfred V. Aho and Jeffery D. Ullman; Principles of Compiler Design; Narosa Pub. House, Vinu V. Das; Compiler Design using Flex and Yacc; PHI Publication, 2008.
Working of the Compilers Manisha Yadav Nisha Thakran IT DEPARTMENT IT DEPARTMENT DCE,GURGAON DCE,GURGAON Abstract- The objective of the paper is to depict the working of the compilers that were designed
Copyright R.A. van Engelen, FSU Department of Computer Science, 2000 Overview of Compilers and Interpreters Common compiler and interpreter configurations Virtual machines Integrated programming environments
COP4020 ming Languages Compilers and Interpreters Robert van Engelen & Chris Lacher Overview Common compiler and interpreter configurations Virtual machines Integrated development environments Compiler
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
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
LECTURE 3 Compiler Phases COMPILER PHASES Compilation of a program proceeds through a fixed series of phases. Each phase uses an (intermediate) form of the program produced by an earlier phase. Subsequent
CS131: Programming Languages and Compilers Spring 2017 Course Information Instructor: Fu Song Office: Room 1A-504C, SIST Building Email: email@example.com Class Hours : Tuesday and Thursday, 8:15--9:55
Formal Languages and Compilers Lecture I: Introduction to Compilers Free University of Bozen-Bolzano Faculty of Computer Science POS Building, Room: 2.03 firstname.lastname@example.org http://www.inf.unibz.it/ artale/
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...
COMP-421 Compiler Design Presented by Dr Ioanna Dionysiou Administrative! Next time reading assignment [ALSU07] Chapters 1,2 [ALSU07] Sections 1.1-1.5 (cover in class) [ALSU07] Section 1.6 (read on your
Introduction to Compiler Construction Robert van Engelen http://www.cs.fsu.edu/~engelen/courses/cop5621 COP5621 Compiler Construction Copyright Robert van Engelen, Florida State University, 2005 Syllabus
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
Language Implementation Methods The Design and Implementation of Programming Languages Compilation Interpretation Hybrid In Text: Chapter 1 2 Compilation Interpretation Translate high-level programs to
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:
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
COMPILER DESIGN LECTURE NOTES UNIT -1 1.1 OVERVIEW OF LANGUAGE PROCESSING SYSTEM 1.2 Preprocessor A preprocessor produce input to compilers. They may perform the following functions. 1. Macro processing:
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:
Introduction to Compiler Construction Robert van Engelen http://www.cs.fsu.edu/~engelen/courses/cop5621 COP5621 Compiler Construction Copyright Robert van Engelen, Florida State University, 2007-2011 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/)
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
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
Objective PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS Explain what is meant by compiler. Explain how the compiler works. Describe various analysis of the source program. Describe the
Life Cycle of Source Program - Compiler Design Vishal Trivedi * Gandhinagar Institute of Technology, Gandhinagar, Gujarat, India E-mail: email@example.com Abstract: This Research paper gives
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
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
DESIGN OF LANGUAGE PROCESSORS Semester II (Computer Engineering) SUB CODE: MECE201 Teaching Scheme (Credits and Hours): Teaching scheme Total Evaluation Scheme L T P Total Credit Theory Mid Sem Exam CIA
Chapter 1 :: Introduction Introduction Programming Language Pragmatics Michael L. Scott Why are there so many programming languages? evolution -- we've learned better ways of doing things over time socio-economic
SYL-410-2014C CS 410 - Compiler Construction West Virginia fall semester 2014 August 18, 2014 syllabus 1.0 Course location: 107 ERB, Evansdale Campus Course times: Tuesdays and Thursdays, 2:00-3:15 Course
Subject with Code KALASALINGAM UNIVERSITY ANAND NAGAR, KRISHNAN KOIL 626 126 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ODD SEMESTER 2013-2014 Semester/Branch/Section Credits : 3 COURSE PLAN : Compiler
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
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
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.
Introduction Chapter 1 Slides adapted from : Robert van Engelen, Florida State University Alex Aiken and Sean Treichler, Stanford University Compilers and Interpreters Compilation Translation of a program
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
Crafting a Compiler with C (II) 資科系 林偉川 Compiler V S Interpreter Compilation - Translate high-level program to machine code Lexical Analyzer, Syntax Analyzer, Intermediate code generator(semantics Analyzer),
1 LANGUAGE TRANSLATORS UNIT: 3 Syllabus Source Program Analysis: Compilers Analysis of the Source Program Phases of a Compiler Cousins of Compiler Grouping of Phases Compiler Construction Tools. Lexical
CD Assignment I 1. Explain the various phases of the compiler with a simple example. The compilation process is a sequence of various phases. Each phase takes input from the previous, and passes the output
DEPARTMENT OF INFORMATION TECHNOLOGY AUTOMATA AND COMPILER DESIGN B.Tech-IT, III Year -I Sem Dr. Smriti Agrawal Assoc. Professor J.B.Institute of Engg & Technology Yenkapally, Moinabad(Mandal) Himathnagar(post),Hydreabad
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
Introduction Translators Interpreters High-level intermediate code which is interpreted e.g. Program in a representation translator Program in another representation BASIC, LISP, APL command s, e.g. UNIX-shell
COMP455: COMPILER AND LANGUAGE DESIGN Dr. Alaa Aljanaby University of Nizwa Spring 2013 Chapter 1: Introduction Compilers draw together all of the theory and techniques that you ve learned about in most
Lecture 5 Compilers and interpreters FAMNIT March, 2018. 1 Slides Lecture by Jan Karabaš Compilers and interpreters Programming II FAMNIT, 2015 Additional literature: Michael L. Scott, Programming Language
Chapter 2 :: Programming Language Syntax Michael L. Scott firstname.lastname@example.org, 2015 1 Regular Expressions A regular expression is one of the following: A character The empty string, denoted by Two regular
Overview Roadmap Language Translators: Interpreters & Compilers Context of a compiler Phases of a compiler Compiler Construction tools Terminology How related to other CS Goals of a good compiler 1 Compilers
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
Yacc: A Syntactic Analysers Generator Compiler-Construction Tools The compiler writer uses specialised tools (in addition to those normally used for software development) that produce components that can
Compiling Regular Expressions COMP360 Logic is the beginning of wisdom, not the end. Leonard Nimoy Compiler s Purpose The compiler converts the program source code into a form that can be executed by the
Formats of Translated Programs Compilers differ in the format of the target code they generate. Target formats may be categorized as assembly language, relocatable binary, or memory-image. Assembly Language
UNIT I LEXICAL ANALYSIS Translator: It is a program that translates one language to another Language. Source Code Translator Target Code 1. INTRODUCTION TO LANGUAGE PROCESSING The Language Processing System
1 Part 5 Program Analysis Principles and Techniques Front end 2 source code scanner tokens parser il errors Responsibilities: Recognize legal programs Report errors Produce il Preliminary storage map Shape
What do Compilers Produce? Pure Machine Code Compilers may generate code for a particular machine, not assuming any operating system or library routines. This is pure code because it includes nothing beyond
Chapter 1 :: Programming Language Pragmatics Michael L. Scott Early computers (1940s) cost millions of dollars and were programmed in machine language machine s time more valuable than programmer s machine
CS426 Compiler Construction David Padua Department of Computer Science University of Illinois at Urbana-Champaign 0. Course organization 2 of 23 Instructor: David A. Padua 4227 SC, 333-4223 Office Hours:
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
Course Title Course Code Compiler Design CE702 Theory : 03 Course Credit Practical : 01 Tutorial : 00 Course Learning Outcomes The objectives of this course are Credits : 04 Improve the theory and practice
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
CS 314 Principles of Programming Languages Lecture 2: Syntax Analysis Zheng (Eddy) Zhang Rutgers University January 22, 2018 Announcement First recitation starts this Wednesday Homework 1 will be release
Semantic Processing Copyright c 2000 by Antony L. Hosking. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies
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
Introduction to Compiler Design Lecture 1 Chapters 1 and 2 Robb T. Koether Hampden-Sydney College Wed, Jan 14, 2015 Robb T. Koether (Hampden-Sydney College) Introduction to Compiler Design Wed, Jan 14,
Theoretical Part Chapter one:- - What are the Phases of compiler? Six phases Scanner Parser Semantic Analyzer Source code optimizer Code generator Target Code Optimizer Three auxiliary components Literal
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
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
CMSC 330: Organization of Programming Languages Context Free Grammars 1 Architecture of Compilers, Interpreters Source Analyzer Optimizer Code Generator Abstract Syntax Tree Front End Back End Compiler
Concepts of Programming Languages Lecture 1 - Introduction Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages Spring 2014
Chapter 2 - Programming Language Syntax September 20, 2017 Specifying Syntax: Regular expressions and context-free grammars Regular expressions are formed by the use of three mechanisms Concatenation Alternation
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
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
What is a compiler? What is a compiler? Traditionally: Program that analyzes and translates from a high level language (e.g., C++) to low-level assembly language that can be executed by hardware int a,
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
Lexical Scanning COMP360 Captain, we re being scanned. Spock Reading Read sections 2.1 3.2 in the textbook Regular Expression and FSA Assignment A new assignment has been posted on Blackboard It is due
More detailed overview of compiler front end Structure of a compiler Today we ll take a quick look at typical parts of a compiler. This is to give a feeling for the overall structure. source program lexical
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
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
MIDTERM EXAM (Solutions) Total Score: 100, Max. Score: 83, Min. Score: 26, Avg. Score: 57.3 1. (10 pts.) List all major categories of programming languages, outline their definitive characteristics and
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.