Upload
ahmad-siddiqui
View
216
Download
0
Embed Size (px)
Citation preview
8/12/2019 15306_Syll_CSE415
1/2
CSE415:COMPILER DESIGN
L:2 T:0 P:0
Course Objectives:
An ability to design and implement a significant portion of a compiler for a language
Working knowledge of the major phases of compilation
Apply the ideas, the techniques, and the knowledge acquired for the purpose of other
software design
Unit I
Overview of compilation: The structure of a compiler, The applications of
compiler technology, Lexical Analysis, Syntax Analysis, Semantic Analysis,Intermediate Code Generation, Symbol Table management, Compiler-Construction
Tools, Implementation of High Level Programing Language, Optimizations for
Computer Architecture, Design of new Computer Architecture, Program Translation,Software Productivity Tools
Lexical Analysis: Role of lexical analyzer, Lexical Analysis versus Parsing, Tokens,
Patterns, and Lexemes, Attributes for tokens, Lexical errors, Input buffering, Bufferpairs, Sentinels, specifications of tokens, Strings and Languages, Operations on
Languages, Regular Expressions, Regular Definitions, Recognition of tokens,
Transition diagrams, Lex - Lexical-Analyzer Generator, Use of Lex, Structure of LexPrograms, Conflict resolution in Lex, The Lookahead operator, Hand-written lexical
analyzers, Examples of LEX programs.
Unit II
Syntax Analysis: Role of a parser, Representative Grammars, Syntax error
handling, Context-Free Grammars, Definition of Context-Free Grammar, Notational
conventions, Derivations, Parse trees and Ambiguity, Verifying the Language
generated by a grammar, Context-Free Grammar versus Regular Expressions, Use of
context-free grammars (CFG) in the specification of the syntax of programminglanguages,, Writing a grammar, Lexical versus Syntactic analysis, Eliminatingambiguity, Elimination of Left Recursion, Techniques for writing grammars for
programming languages (removal left recursion, etc.), Left factoring, Non- context-
free constructs in programming languages, Top-down parsing, Recursive descentparsing., FIRST & FOLLOW sets, LL(1) conditions, Predictive parsing., Handle pruning,
Shift-reduce parsing, operator precedence grammars, LR-parsing, LR(0) automaton,
Valid items, LR-parsing algorithm, Viable prefixes, SLR(1), LR(1), and LALR(1)parsing, Error recovery, Examples of programming language grammars., YACC, error
recovery with YACC and examples of YACC specifications
Unit III
Syntax Directed Translation: Syntax-directed definitions (attribute grammars),
Inherited and Synthesized attributes, Evaluation orders for SDD's, Dependencygraphs, Ordering the Evaluation of Attributes, S-Attributed Definitions, L-Attributed
Definitions, Applications of syntax directed translation, Construction of Syntax Trees,The Structure of a Type, Implementing L-Attributed SDD's, L-Attributed SDD's and LLParsing
Unit IV
Semantic analysis: Symbol tables and their data structures, Representation of
scope, Semantic analysis of expressions, Assignment, and control-flow statements,Declarations of variables and functions, function calls, etc. using S- and L-attributed
SDDs (treatment of arrays and structures included), Semantic error recovery
Unit V
Credits:2
Page:1/2 Print Date : 2/8/2014 12:01:52 PM
8/12/2019 15306_Syll_CSE415
2/2
Unit V Intermediate Code Generation: Three address Code, Quadruples, Triples, Trees
and their usees, Static Single Assignment Form, Flow graphs, SSA forms and their
uses, Translation of expressions (including array references with subscripts) andassignment statements, Operations within Expressions, Addressing Array Elements,
Translation of Array References, Translation of control-flow statements if-then-else,
while-do, and switch, Short-circuit code and control-flow translation of Booleanexpressions, Control-Flow Analysis, Backpatching, Different intermediate
representations, Examples to illustrate intermediate code generation for all constructs
Unit VI
Run Time Environments: storage organization, Stack allocation of space.,
Activation Trees, Activation Records, Calling Sequences, Variable-Length Data on the
Stack, Access to non-local data on the stack in the case of procedures with and
without nesting of procedures, Data Access Without Nested Procedures, Issues withNested Procedures, A Language with Nested Procedure Declarations
Introduction to machine code generation and optimization: Simple machine
code generation, examples of machine-independent code optimizations, Register andAddress Descriptors, The Code-Generation Algorithm, A running example:Quicksort
Text Books:
1. Compilers Principles, Techniques and Tools by Alfred V.Aho, Monica S.Lam ,Ravi
Sethi, Jeffrey D.Ullman, Pearson, 2nd Edition, (2007)
References:
1. Lex & Yacc by Levine,Mason and Brown, OREILLY, 2nd Edition, (2012)
2. Engineering a Compiler by K.D. Cooper, and Linda Torczon, Morgan Kaufmann
Publishers, 1st Edition, (2004)
Page:2/2 Print Date : 2/8/2014 12:01:52 PM