Upcoming SlideShare
×

# انااااااااااااا

385 views

Published on

Published in: Technology, Education
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
385
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
21
0
Likes
1
Embeds 0
No embeds

No notes for slide

### انااااااااااااا

1. 1. PREDICTIVE PARSING RAWAN ALOMRANI AMAL IBRAHEM MZOON MOHMMED SAHAR AHMED AHLAM AHMED
2. 2. Predictive Parsing Recursive-descent parsing is a top-down method of syntax analysis in which a set of recursive procedures is used to process the input. One procedure is associated with each nonterminal of a grammar. Here, we consider a simple form of recursive-descent parsing, called predictive parsing, in which the lookahead symbol unambiguously determines the flow of control through the procedure body for each nonterminal. The sequence of procedure calls during the analysis of an input string implicitly defines a parse tree for the input, and can be used to build an explicit parse tree, if desired.
3. 3. Predictive Parsing The goal of predictive parsing is to construct a top-down parser that never backtracks. To do so, we must transform a grammar in two ways: eliminate left recursion, and perform left factoring. These rules eliminate most common causes for backtracking although they do not guarantee a completely backtrack-free parsing (called LL(1) as we will see later).
4. 4. Predictive Parsing • no backtracking • efficient • needs a special form of grammars (LL(1) grammars). • Recursive Predictive Parsing is a special form of Recursive Descent parsing without backtracking. • Non-Recursive (Table Driven) Predictive Parser is also known as LL(1) parser.
5. 5. Predictive Parsing A special case of recursive-descent parsing that does not require backtracking • Must always know which production to use based on current input symbol • Can often create appropriate grammar: – removing left-recursion – left factoring the resulting grammar