Download presentation
Presentation is loading. Please wait.
Published byTabitha Lamb Modified over 9 years ago
1
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing SLR Parsing Muhammed Al-Mulhem March 1, 2009
2
2Dr. Muhammed Al-Mulhem Constructing SLR Table
3
March 1, 2009 3Dr. Muhammed Al-Mulhem Constructing SLR Table
4
March 1, 2009 4Dr. Muhammed Al-Mulhem SLR Table - Example Let us construct the SLR table for the augmented expression grammar. Let us construct the SLR table for the augmented expression grammar. E’ → E E → E + T | T T → T * F | F F → ( E ) | id
5
March 1, 2009 5Dr. Muhammed Al-Mulhem SLR Table - Example Assign numbers to the grammar rules Assign numbers to the grammar rules 0)E’ → E 1)E → E + T 2)E → T 3)T → T * F 4)T → F 5)F → ( E ) 6)F → id
6
March 1, 2009 6Dr. Muhammed Al-Mulhem SLR Table - Example The first item I 0 The first item I 0 E’ → ■ E E → ■ E + T E → ■ T T → ■ T * F T → ■ F F → ■ ( E ) F → ■ id The FSA with all sets of items for the grammar is shown next. The FSA with all sets of items for the grammar is shown next.
7
March 1, 2009 7Dr. Muhammed Al-Mulhem SLR Table - Example
8
March 1, 2009 8Dr. Muhammed Al-Mulhem SLR Table - Example
9
March 1, 2009 9Dr. Muhammed Al-Mulhem SLR Table - Example
10
March 1, 2009 10Dr. Muhammed Al-Mulhem SLR Table - Example Follow Set E’$ E + ) $ F * + ) $ T First Set E’ ( id E F T E’ → E E → E + T E → T T → T * F T → F F → ( E ) F → id
11
March 1, 2009 11Dr. Muhammed Al-Mulhem SLR Table - Example
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.