Download presentation

Presentation is loading. Please wait.

Published byAlaina Stevenson Modified over 2 years ago

1
UMBC CMSC 331 O NLINE L ECTURE 3 P ART 1 SD Vick

2
What is Left Recursion? Left Recursion is when you have a grammar with one or more rules of the following form A -> A | Example where is and is c A -> A a b | c In the technique I’ll show you can’t directly (or indirectly) start with A 1) A -> A a b | Ac is illegal 2) A -> A a b | Bc so is this B -> d | Ae A -> B -> A Why?

3
What’s the General Rule? A -> A | A | … A m | n A A’ | A’ … n A’ A’ -> A’ | A’ | … m A’ |

4
-> ? | ! | a -> * | / | ->e | f Removing Left Recursion Consider the following Grammar Why is this Left Recursive? Now we must just pick our ’s and our ’s

5
The Mechanics -> ? | ! | a -> ? | a -> ! | Try the second rule on your own Here we have 2 ‘s and 1 , what if the situation was reversed?

Similar presentations

OK

Solving Inequalities. ● Solving inequalities follows the same procedures as solving equations. ● There are a few special things to consider with inequalities:

Solving Inequalities. ● Solving inequalities follows the same procedures as solving equations. ● There are a few special things to consider with inequalities:

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on game theory five nights Ppt on power generation by speed breaker games Ppt on project life cycle phases Ppt on air pollution for students Ppt on emotional intelligence by daniel goleman Ppt on acid-base indicators chemistry Ppt on power system restructuring Ppt on earth and space current Ppt on water pollution for class 9 Ppt on tricks in mathematics