lecture07
web.stanford.edu · 1,914 words · saved by 1 readers
N/A
Top-Down Parsing CS143 Lecture 7 Instructor: Fredrik Kjolstad Slide design by Prof. Alex Aiken, with modifications 1 Predictive Top-Down Parsers • Like recursive-descent but parser can “predict” which production to use – By looking at the next few tokens – No backtracking • Predictive parsers accept LL(k) grammars – L means “left-to-right” scan of input – L means “leftmost derivation” – k means “predict based on k tokens of lookahead” – In practice, LL(1) is used…
related reading
- CS [45]12[01] Spring 2023courses.cs.cornell.edu
- Laurence Tratt: Which Parsing Approach?tratt.net
- Context-free grammar - Wikipediaen.wikipedia.org
- Chris's Wiki :: blog/programming/WhyRDParsersForMeutcc.utoronto.ca
- Reading 12: Regular Expressions & Grammarsweb.mit.edu
- Parsing Expressions · Crafting Interpreterscraftinginterpreters.com
- Pratt Parsers: Expression Parsing Made Easy - journal.stuffwithstuff.comjournal.stuffwithstuff.com
- L-system - Wikipediaen.wikipedia.org
- Chomsky hierarchy - Wikipediaen.wikipedia.org
- “Next-token predictor” is the wrong mental model for LLMsgmcgoldr.github.io
- Shunting yard algorithm - Wikipediaen.wikipedia.org
- web.stanford.edu/class/cs143/lectures/lecture06.pdfweb.stanford.edu