JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

CS601PC: COMPILER DESIGN

B.Tech III Year II Semester (R16)

Course Objectives:

  • To understand the various phases in the design of a compiler.
  • To understand the design of top-down and bottom-up parsers.
  • To understand syntax directed translation schemes.
  • To introduce lex and yacc tools.
  • To learn to develop algorithms to generate code for a target machine.

Course Outcomes:

  • Ability to design, develop, and implement a compiler for any language.
  • Able to use lex and yacc tools for developing a scanner and a parser.
  • Able to design and implement LL and LR parsers.
  • Able to design algorithms to perform code optimization in order to improve the performance of a program in terms of space and time complexity.
  • Ability to design algorithms to generate machine code

UNIT - I

Introduction: Language Processors, the structure of a compiler, the science of building a compiler, programming language basics. Lexical Analysis: The Role of the Lexical Analyzer, Input Buffering, Recognition of Tokens, The Lexical-Analyzer Generator Lex, Finite Automata, From Regular Expressions to Automata, Design of a Lexical-Analyzer Generator, Optimization of DFA-Based Pattern Matchers.

UNIT - II

Syntax Analysis: Introduction, Context-Free Grammars, Writing a Grammar, Top-Down Parsing, Bottom-Up Parsing, Introduction to LR Parsing: Simple LR, More Powerful LR Parsers, Using Ambiguous Grammars, Parser Generators.

UNIT - III

Syntax-Directed Translation: Syntax-Directed Definitions, Evaluation Orders for SDD's, Applications of Syntax-Directed Translation, Syntax-Directed Translation Schemes, and Implementing L-Attributed SDD's. Intermediate-Code Generation: Variants of Syntax Trees, Three-Address Code, Types and Declarations, Type Checking, Control Flow, Back patching, Switch-Statements, Intermediate Code for Procedures.

R16 B.TECH CSE.

UNIT - IV

Run-Time Environments: Storage organization, Stack Allocation of Space, Access to Nonlocal Data on the Stack, Heap Management, Introduction to Garbage Collection, Introduction to Trace-Based Collection. Code Generation: Issues in the Design of a Code Generator, The Target Language, Addresses in the Target Code, Basic Blocks and Flow Graphs, Optimization of Basic Blocks, A Simple Code Generator, Peephole Optimization, Register Allocation and Assignment, Dynamic Programming Code-Generation.

UNIT - V

Machine-Independent Optimizations: The Principal Sources of Optimization, Introduction to Data-Flow Analysis, Foundations of Data-Flow Analysis, Constant Propagation, Partial- Redundancy Elimination, Loops in Flow Graphs.

TEXT BOOKS

  • 1. Compilers: Principles, Techniques and Tools, Second Edition, Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffry D. Ullman, Pearson.

REFERENCE BOOKS

  • 1. Compiler Construction-Principles and Practice, Kenneth C Louden, Cengage Learning.
  • 2. Modern compiler implementation in C, Andrew W Appel, Revised edition, Cambridge University Press.
  • 3. The Theory and Practice of Compiler writing, J. P. Tremblay and P. G. Sorenson, TMH
  • 4. Writing compilers and interpreters, R. Mak, 3rd edition, Wiley student edition.
  • 5. lex & yacc – John R. Levine, Tony Mason, Doug Brown, O’reilly R16 B.TECH CSE. WEB TECHNOLOGIES B.Tech. III Year II Sem. L T P C Course Code: CS602PC 4 0 0 4

Course Objectives:

  • To introduce PHP language for server side scripting
  • To introduce XML and processing of XML Data with Java
  • To introduce Server side programming with Java Servlets and JSP
  • To introduce Client side scripting with Javascript and AJAX.

Course Outcomes:

  • gain knowledge of client side scripting, validation of forms and AJAX programming
  • have understanding of server side scripting with PHP language
  • have understanding of what is XML and how to parse and use XML Data with Java
  • To introduce Server side programming with Java Servlets and JSP

UNIT - I

Introduction to PHP: Declaring variables, data types, arrays, strings, operators, expressions, control structures, functions, Reading data from web form controls like text boxes, radio buttons, lists etc., Handling File Uploads, Connecting to database (MySQL as reference), executing simple queries, handling results, Handling sessions and cookies File Handling in PHP: File operations like opening, closing, reading, writing, appending, deleting etc. on text and binary files, listing directories

UNIT - II

XML: Introduction to XML, Defining XML tags, their attributes and values, Document Type Definition, XML Schemas, Document Object Model, XHTML Parsing XML Data - DOM and SAX Parsers in java.

UNIT - III

Introduction to Servlets: Common Gateway Interface (CGI), Lifecycle of a Servlet, deploying a servlet, The Servlet API, Reading Servlet parameters, Reading Initialization parameters, Handling Http Request & Responses, Using Cookies and Sessions, connecting to a database using JDBC.

UNIT - IV

Introduction to JSP: The Anatomy of a JSP Page, JSP Processing, Declarations, Directives, Expressions, Code Snippets, implicit objects, Using Beans in JSP Pages, Using Cookies and session for session tracking, connecting to database in JSP.

R16 B.TECH CSE.

UNIT - V

Client side Scripting: Introduction to Javascript: Javascript language - declaring variables, scope of variables, functions, event handlers (onclick, onsubmit etc.), Document Object Model, Form validation. Simple AJAX application.

TEXT BOOKS:

  • 1. Web Technologies, Uttam K Roy, Oxford University Press
  • 2. The Complete Reference PHP – Steven Holzner, Tata McGraw-Hill

REFERENCE BOOKS:

  • 1. Web Programming, building internet applications, Chris Bates 2 nd edition, Wiley Dreamtech
  • 2. Java Server Pages –Hans Bergsten, SPD O’Reilly
  • 3. Java Script, D. Flanagan, O’Reilly,SPD.
  • 4. Beginning Web Programming-Jon Duckett WROX.
  • 5. Programming World Wide Web, R. W. Sebesta, Fourth Edition, Pearson.
  • 6. Internet and World Wide Web – How to program, Dietel and Nieto, Pearson. R16 B.TECH CSE.

Loading Question Papers

Fetching data from database...