dlang-community / Pegged

A Parsing Expression Grammar (PEG) module, using the D programming language.
534 stars 66 forks source link

I can't find the Wikipedia ParseTree handling code in the Pegged wiki any more... #318

Closed enjoysmath closed 1 year ago

enjoysmath commented 1 year ago

Can you link me to that example that has the switch-case statement of the different Wikipedia hierarchical sections?

I'm not parsing Wikipedia, I just think it's a good example of what to do with the ParseTree.

veelo commented 1 year ago

Not sure what example you are referring to. If you want to see an example of how a ParseTree is used in real life, there is one inside Pegged itself: https://github.com/PhilippeSigaud/Pegged/blob/913c545472e523031ad57065a47fd3c717dae86b/pegged/grammar.d#L196 This is how Pegged interprets its own grammar to generate the PEG parser from a user-supplied grammar.