14. LL Parsing

preview_player
Показать описание
This time, we take a look a the LL parsing algorithm for (some) Context-Free Grammars.

Рекомендации по теме
Комментарии
Автор

I want to thank you for you taking time to answer my questions. Its been decades since I did a compiler class. I managed to use your course up this point to create an expression parser grammar by hand that I checked against Gammophone to be LL(1). I used left-factoring and Head | Tail recursion.

However, my grammar only works if integers and floats have been tokenized. I'm reasonably sure LL cannot work if digits are tokens. So now I have to decide to use PEG with digit tokens or write a smarter tokenizer. I'm leaning towards the latter.

jasperschellingerhout
Автор

You kind of briefly glossed over it, but the fact that language theory looks at the rules to **generate** text, while parsers look at the text to **interpret** it into something useful (i.e. the AST) has always irritated me immensely. It makes it much harder to intuitively apply the theory to usable logic. It would have been nice if the theory had been modified for computer science to fit practical computing.
In other words, being able to produce (derive) text from a grammar is absolutely useless.

ErikBongers