Fork me on GitHub
#instaparse
<
2018-05-31
>
sova-soars-the-sora15:05:48

hey @aengelberg, how does instaparse work? i was looking at the source and it looks like it makes multiple passes until it's successfully consumed the whole input string, correct? and if a parse doesn't work, an "error node is embedded in the tree" so it knows not to try that parse again?

aengelberg16:05:49

@sova this talk explains the internals pretty well https://www.youtube.com/watch?v=b2AUW6psVcE

sova-soars-the-sora16:05:44

oh nice. thank you! i was very curious because it's very powerful and very fast and i don't remember things being so fast in compilers class 😄

aengelberg16:05:21

glad to hear it's fast! Although what makes Instaparse really unique is that it works well with left-recursive and ambiguous grammars

aengelberg16:05:52

something like

S = 'a' | S 'a'
usually doesn't work in normal parsers

sova-soars-the-sora16:05:21

leftwards-building strings... I see that is cool

sova-soars-the-sora16:05:40

I want to do some language processing stuff -- eventually reduce articles people write to synopses and relevant tags. i feel like that's very possible but i gotta think a bit more on the approach. like checking words against a dictionary to try and focus on nouns and verbs

sova-soars-the-sora16:05:49

aha, now i know why the file is called .gll 😄

sova-soars-the-sora17:05:26

"send me all your old magazine subscriptions before any new ones" is a good way to explain how it works briefly.

👍 4