
Recursive Descent Parsing Overview
"Learn about recursive descent parsing, a top-down parsing technique that constructs parse trees starting from the top-level syntactic category. Explore examples and the approach of most top-down parsers. Discover a demonstration of a clite parser in Java."
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Recursive Descent Parsing COMP 3200 Fall 2021 David J Stucki
ALERT Project #2 due November 1 (next Monday) Reading Assignment #8 Language Presentations!
Recursive Descent Parser An example of Top-Down Parsing Begins with the top level syntactic category (non-terminal start symbol), building the parse tree from the root Constructs the tree in a left-to-right pass through the Token stream, generating the tree as a pre-order traversal Tokens (terminals) are leaves Syntactic categories (non-terminals) are internal nodes
Recursive Descent Parser Most top-down parsers assume an LL approach Left-to-right scan of input Left-most derivation via grammar (what does this mean?) Example: clite if statement Concrete: <if> if ( <exp> ) <stmt> [ else <stmt> ] Abstract: Conditional = Expression test; Statement tPart, ePart
Recursive Descent Parser Concrete: <if> if ( <exp> ) <stmt> [ else <stmt> ] Abstract: Conditional = Expression test; Statement tPart, ePart if ( x == 0 ) Conditional test result = 1; tPart ePart else result = 2; Expression Statement Statement
Recursive Descent Parser Demo: clite parser in Java