Presentation is loading. Please wait.

Presentation is loading. Please wait.

Subject: Language Processor

Similar presentations


Presentation on theme: "Subject: Language Processor"— Presentation transcript:

1 Subject: Language Processor
Topic: Difference between LR(0) and SLR Parser Prepared By: Prof. Imran Ahmad Anjuman College Of Engineering & Technology Department Of Computer Science & Engineering.

2 Syllabus I) Introduction to compilers, compilers and translators, Cross Compiler, Phases of compilation and overview. Lexical Analysis (scanner): Regular languages, finite automata, regular expressions, scanner generator (lex, flex). II) Syntax Analysis: Syntax specification of programming languages, Design of top-down & bottom-up parsing technique, Design of LL(1) parser. LR parsing: Design of SLR, CLR, LALR parsers. Dealing with ambiguity of the grammar, Parser generator (yacc, bison) III) Syntax directed definitions, implementation of SDTS, Intermediate code representations (postfix, syntax tree, TAC), Intermediate code generation using syntax directed translation schemes for translation of controls structures, declarations, procedure calls, and Array reference. IV) Table Management: Storage allocation and run time storage administration, symbol table management. Error detection and recovery: Error recovery in LR parsing, Error recovery in LL parsing, automatic error recovery in YACC. V) Code optimization: Sources of optimization, loop optimization, control flow analysis, data flow analysis, setting up data flow equations to compute reaching definitions, available expressions, Live variables, Induction Variable, Common sub expression elimination. VI) Code generation: Problems in code generation, Simple code generator, Register allocation and assignment, Code generation from DAG, Peephole optimization.

3 Course Outcome Apply the knowledge of patterns, tokens & regular expressions for solving a problem To apply the knowledge of lex tool & yacc tool to construct a scanner & parser. Classify different translators. To design & conduct experiments for parser in compiler. To acquire the knowledge of modern compiler & its features. To develop program to solve Run Time compilation and execution from command prompt.

4 Difference between LR(0) and SLR Parser
Defination: Parser is a program which takes input from lexical analyzer and create the parsing tree of input to check wheather it is valid or not.

5 Difference between LR(0) and SLR Parser.Cont...
LR parser is a bottom up parser. L->left to right scanning R->right most derivation (0)->in LR(0) zero Look ahead S-> in SLR ‘S’ indicate simple r

6 Difference between LR(0) and SLR Parser Example Cont...

7 Difference between LR(0) and SLR Parser Example Cont...
In above Example the entry of r1,r2,r3 is in entire row in LR(0) parsing table Where as the entry of r1,r2,r3 is in according to follow of Non terminal in SLR parsing table Reduce(r) entry is less in SLR. SLR parser is more powerful then LR(O) parser.

8 Thank you.


Download ppt "Subject: Language Processor"

Similar presentations


Ads by Google