Started by WhiteRose, February 05, 2014, 11:40:05 pm
QuoteFor each of the following grammars, devise predictive parsers and show the parsing tables. You may left-factor and/or eliminate left-recursion form your grammars first if needed:S --> 0 S 1 | 0 1S --> + S S | * S S | aS --> S ( S ) S | epsilon
S --> 0 S 1 | 0 1 // has common left factor S --> 0 B B --> S 1 | 1S --> + S S | * S S | a // no common left factor but common middle S --> A B | a A --> + | * B --> S SS --> S ( S ) S | epsilon // no idea
Quote from: KK20 on February 06, 2014, 12:30:24 amI can't remember any of this.
Quote from: winkioI do not speak to bricks, either as individuals or in wall form.
Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.
Quote from: locowhiteknight on February 08, 2014, 09:21:16 pmNot sure if it will help at all, but this presentation seemed to be fairly clear (in comparison to some of the other reference sources I found ). Of course I've never had a class on compilers, so take that with a grain of salt. He touches on left-recursion grammar in modern programming languages towards the end of the video. Spoiler: ShowHideLooks tough, but I'm sure you'll get it!