Save this video free

[HD] EECS4302 F26 - 2026-11-24 (Tuesday) - Lecture 20

Jackie Wang · 1:05:50 · Watch on YouTube

Part of York University EECS3342/EECS4302. See all 36 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Jackie Wang explains why a top-down parser that follows leftmost derivations can loop forever on left-recursive grammars, using the expression grammar and input `a + a * a` as examples. The lecture distinguishes direct from indirect left recursion, traces an equivalent right-recursive grammar, and introduces a two-phase algorithm that substitutes productions to prevent indirect recursion before rewriting direct recursion, potentially adding epsilon productions.

Key takeaways

Chapters

0:00 Project Milestone, Report, and Optional Makeup-Test Announcements
2:17 Top-Down Parsing Setup for `a + a * a`
4:59 Repeated Rule Choice Creates a Recursive Parse Branch
7:06 Why the Leftmost Derivation Enters an Infinite Loop
12:47 Left Recursion Is the Grammar Problem, Not the Parser
16:00 Detecting Direct and Indirect Left Recursion
22:00 Compare Equivalent Left- and Right-Recursive Grammars
27:40 Build the Parse Tree for `a + a * a`
37:10 ANTLR, Grammar Preprocessing, and Assignment 3 Scope
39:38 Input and Output Assumptions for Left-Recursion Removal
43:48 Order Variables and Understand the Nested-Loop Pass
50:46 Phase One Substitutes Productions to Break Indirect Recursion
56:40 Phase Two Rewrites Direct Left Recursion as Right Recursion
1:01:28 Review the Two Transformation Patterns and Exam Guidance

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:05 Okay. So, some important announcement to make. Um, first of all, your project template, I kind of released that early. So, please take a look. We can definitely start writing a report early uh for your team. That's definitely something you can do. But if you got any questions about the report, do let me know or we can speak about it during the milestone 2 meeting. The pattern is going to be the same. I'll give you the guide uh before the Thursday class but there'll be no surprise since submission procedure. So, we're gonna have an inerson meeting. Uh, it's going to be tenatively Tuesday next week, but I just need to confirm the availability of the TA, but most likely you can assume you can mark that in pencil on your calendar. And then, okay, so this is something uh hopefully that will help optional I think for

0:52 programming test for those of you who didn't do as well makeup test. Okay, so the same coverage and I'm not going to make it more difficult, just the same. All right. So, I think I will find a time uh most likely uh next uh Thursday. All right. I will confirm. Okay. So, I'm going to confirm in class on Thursday uh this week. So, you got about a week to really do it. So, there's no uh additional coverage. There's no additional question. So, you can expect the same format. Okay. So uh but just to be fair to your fellow student who did well in the first time but you can still get an A for sure you know for this test okay it's fair game okay but it's optional so if you actually

1:40 don't feel like you want to attend it you just don't come right but I think

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jackie Wang.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.