SlideShare a Scribd company logo
2
Most read
3
Most read
6
Most read
Non- Recursive Predictive Parsing
Non- Recursive Predictive Parsing
• Non-Recursive predictive parsing uses a parsing table that shows
which production rule to select from several alternatives available for
expanding a given non-terminal and the first terminal symbol that
should be produced by that non-terminal.
• The parsing table consists of rows and columns where there are row
for each non-terminal and a column for each terminal symbol
including S, the end marker for the input string.
non-recursive parser Components
• This non-recursive parser looks up which product to be applied in a
parsing table. A LL(1) parser has the following components:
• (1) buffer: an input buffer which contains the string to be passed
• (2) stack: a pushdown stack which contains a sequence of grammar symbols
• (3) A parsing table: a 2d array M[A, a]
• where
• A->non-terminal, a->terminal or $
• (4) output stream:
• end of the stack and an end of the input symbols are both denoted with $
Algorithm for non recursive Predictive Parsing:
• The main Concept ->With the help of FIRST() and FOLLOW() sets, this
parsing can be done using just a stack that avoids the recursive calls.
• For each rule, A->x in grammar G:
• For each terminal ‘a’ contained in FIRST(A) add A->x to M[A, a] in the parsing
table if x derives ‘a’ as the first symbol.
• If FIRST(A) contains null production for each terminal ‘b’ in FOLLOW(A), add
this production (A->null) to M[A, b] in the parsing table.
LR Parser
LR Parser
• LR parsing is one type of bottom up parsing. It is used to parse the
large class of grammars.
• In the LR parsing, "L" stands for left-to-right scanning of the input.
• "R" stands for constructing a right most derivation in reverse.
• "K" is the number of input symbols of the look ahead used to make
number of parsing decision.
Types of LR Parser
• LR parsing is divided into four parts: LR (0) parsing, SLR parsing, CLR
parsing and LALR parsing.
LR algorithm
• The LR algorithm requires stack, input, output and parsing table. In all
type of LR parsing, input, output and stack are same but parsing table
is different.
• Input buffer is used to indicate end of input and it contains the string
to be parsed followed by a $ Symbol.
• A stack is used to contain a sequence of grammar symbols with a $ at
the bottom of the stack.
• Parsing table is a two dimensional array. It contains two parts: Action
part and Go To part.

More Related Content

PPTX
Parsing in Compiler Design
PPTX
Three address code In Compiler Design
PPTX
Deadlock dbms
PPTX
CLR AND LALR PARSER
PPTX
Principal Sources of Optimization in compiler design
PPTX
Types of grammer - TOC
PPTX
Phases of Compiler
PDF
Code optimization in compiler design
Parsing in Compiler Design
Three address code In Compiler Design
Deadlock dbms
CLR AND LALR PARSER
Principal Sources of Optimization in compiler design
Types of grammer - TOC
Phases of Compiler
Code optimization in compiler design

What's hot (20)

PPT
Sliding window protocol
PPTX
Top down parsing
PPTX
Lexical Analysis - Compiler Design
PDF
Symbol table in compiler Design
PPTX
Three Address code
PPT
Top down parsing
PPTX
Passes of Compiler.pptx
PPTX
Specification-of-tokens
PPTX
2.8 normal forms gnf & problems
PPTX
Types of Parser
PPTX
LINEAR BOUNDED AUTOMATA (LBA).pptx
PPTX
A Role of Lexical Analyzer
PPTX
System calls
PPTX
Principal source of optimization in compiler design
PPTX
Code Optimization
PPTX
Ooad unit – 1 introduction
PPTX
Framing in data link layer
PPTX
CONTEXT FREE GRAMMAR
PPTX
Lexical analysis - Compiler Design
PPTX
Paging and segmentation
Sliding window protocol
Top down parsing
Lexical Analysis - Compiler Design
Symbol table in compiler Design
Three Address code
Top down parsing
Passes of Compiler.pptx
Specification-of-tokens
2.8 normal forms gnf & problems
Types of Parser
LINEAR BOUNDED AUTOMATA (LBA).pptx
A Role of Lexical Analyzer
System calls
Principal source of optimization in compiler design
Code Optimization
Ooad unit – 1 introduction
Framing in data link layer
CONTEXT FREE GRAMMAR
Lexical analysis - Compiler Design
Paging and segmentation
Ad

Similar to Non- Recursive Predictive Parsing.pptx (20)

PPTX
Predictive parser
PPTX
Top Down Parsing, Predictive Parsing
PPTX
Design of a two pass assembler
PPTX
Lecture 12 Bottom-UP Parsing.pptx
PDF
compiler design.pdf
PDF
Enscape 3D 3.6.6 License Key Crack Full Version
PDF
Wondershare UniConverter Crack Download Latest 2025
PPT
Code_generatio.lk,jhgfdcxzcvgfhjkmnjhgfcxvfghjmh
PDF
Wondershare Filmora Crack 12.0.10 With Latest 2025
PDF
Skype 125.0.201 Crack key Free Download
PPT
51114.-Compiler-Design-Syntax-Analysis-Top-down.ppt
PPT
51114.-Compiler-Design-Syntax-Analysis-Top-down.ppt
PPTX
Syntax Analysis - LR(0) Parsing in Compiler
PPT
Parsing
PPT
456589.-Compiler-Design-Code-Generation (1).ppt
PPT
456589.-Compiler-Design-Code-Generation (1).ppt
PPT
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
PPTX
UNit-4.pptx programming the basic computer
PPTX
Lexical Analyser PPTs for Third Lease Computer Sc. and Engineering
PPTX
Assembler - System Programming
Predictive parser
Top Down Parsing, Predictive Parsing
Design of a two pass assembler
Lecture 12 Bottom-UP Parsing.pptx
compiler design.pdf
Enscape 3D 3.6.6 License Key Crack Full Version
Wondershare UniConverter Crack Download Latest 2025
Code_generatio.lk,jhgfdcxzcvgfhjkmnjhgfcxvfghjmh
Wondershare Filmora Crack 12.0.10 With Latest 2025
Skype 125.0.201 Crack key Free Download
51114.-Compiler-Design-Syntax-Analysis-Top-down.ppt
51114.-Compiler-Design-Syntax-Analysis-Top-down.ppt
Syntax Analysis - LR(0) Parsing in Compiler
Parsing
456589.-Compiler-Design-Code-Generation (1).ppt
456589.-Compiler-Design-Code-Generation (1).ppt
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
UNit-4.pptx programming the basic computer
Lexical Analyser PPTs for Third Lease Computer Sc. and Engineering
Assembler - System Programming
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Encapsulation theory and applications.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Assigned Numbers - 2025 - Bluetooth® Document
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Web App vs Mobile App What Should You Build First.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
OMC Textile Division Presentation 2021.pptx
Programs and apps: productivity, graphics, security and other tools
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Encapsulation theory and applications.pdf
1 - Historical Antecedents, Social Consideration.pdf
Enhancing emotion recognition model for a student engagement use case through...
Encapsulation_ Review paper, used for researhc scholars
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A novel scalable deep ensemble learning framework for big data classification...
WOOl fibre morphology and structure.pdf for textiles
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
1. Introduction to Computer Programming.pptx
Unlocking AI with Model Context Protocol (MCP)
Assigned Numbers - 2025 - Bluetooth® Document

Non- Recursive Predictive Parsing.pptx

  • 2. Non- Recursive Predictive Parsing • Non-Recursive predictive parsing uses a parsing table that shows which production rule to select from several alternatives available for expanding a given non-terminal and the first terminal symbol that should be produced by that non-terminal. • The parsing table consists of rows and columns where there are row for each non-terminal and a column for each terminal symbol including S, the end marker for the input string.
  • 3. non-recursive parser Components • This non-recursive parser looks up which product to be applied in a parsing table. A LL(1) parser has the following components: • (1) buffer: an input buffer which contains the string to be passed • (2) stack: a pushdown stack which contains a sequence of grammar symbols • (3) A parsing table: a 2d array M[A, a] • where • A->non-terminal, a->terminal or $ • (4) output stream: • end of the stack and an end of the input symbols are both denoted with $
  • 4. Algorithm for non recursive Predictive Parsing: • The main Concept ->With the help of FIRST() and FOLLOW() sets, this parsing can be done using just a stack that avoids the recursive calls. • For each rule, A->x in grammar G: • For each terminal ‘a’ contained in FIRST(A) add A->x to M[A, a] in the parsing table if x derives ‘a’ as the first symbol. • If FIRST(A) contains null production for each terminal ‘b’ in FOLLOW(A), add this production (A->null) to M[A, b] in the parsing table.
  • 6. LR Parser • LR parsing is one type of bottom up parsing. It is used to parse the large class of grammars. • In the LR parsing, "L" stands for left-to-right scanning of the input. • "R" stands for constructing a right most derivation in reverse. • "K" is the number of input symbols of the look ahead used to make number of parsing decision.
  • 7. Types of LR Parser • LR parsing is divided into four parts: LR (0) parsing, SLR parsing, CLR parsing and LALR parsing.
  • 8. LR algorithm • The LR algorithm requires stack, input, output and parsing table. In all type of LR parsing, input, output and stack are same but parsing table is different.
  • 9. • Input buffer is used to indicate end of input and it contains the string to be parsed followed by a $ Symbol. • A stack is used to contain a sequence of grammar symbols with a $ at the bottom of the stack. • Parsing table is a two dimensional array. It contains two parts: Action part and Go To part.