<div dir="auto">Have you tried PyParsing and/or Grako? They're some of my favorites (well, I like PLY too, but I'm thinking you wouldn't like it too much).<div dir="auto"><br><div data-smartmail="gmail_signature" dir="auto">--<br>Ryan (ライアン)<br>Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else<br><a href="http://refi64.com">http://refi64.com</a></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 3, 2017 3:26 AM, "Neil Girdhar" <<a href="mailto:mistersheik@gmail.com">mistersheik@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 3, 2017 at 2:31 AM Mark Lawrence via Python-ideas <<a href="mailto:python-ideas@python.org" target="_blank">python-ideas@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03/04/2017 02:22, Neil Girdhar wrote:<br class="m_8555798341745343610gmail_msg">
> Same.  One day, Python will have a decent parsing library.<br class="m_8555798341745343610gmail_msg">
><br class="m_8555798341745343610gmail_msg">
<br class="m_8555798341745343610gmail_msg">
Nothing here <a href="https://wiki.python.org/moin/LanguageParsing" rel="noreferrer" class="m_8555798341745343610gmail_msg" target="_blank">https://wiki.python.org/moin/<wbr>LanguageParsing</a> suits your needs?<br class="m_8555798341745343610gmail_msg"></blockquote><div><br></div><div>No, unfortunately.</div><div><br></div><div>I tried to make a simple grammar that parses latex code, and it was basically impossible with these tools.</div><div><br></div><div>From what I remember, you need the match objects to be able to accept or reject their matched sub-nodes.<br><br>It's same thing if you want to parse Python in one pass (not the usual two passes that CPython does whereby it creates an AST and then validates it).  It would be cooler to validate as you go since the errors can be much richer since you have the whole parsing context?</div><div><br></div><div>It's been a while, so I might be forgetting something, but I remember thinking that I'll check back in five years and see if anything new has come out.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="m_8555798341745343610gmail_msg">
--<br class="m_8555798341745343610gmail_msg">
My fellow Pythonistas, ask not what our language can do for you, ask<br class="m_8555798341745343610gmail_msg">
what you can do for our language.<br class="m_8555798341745343610gmail_msg">
<br class="m_8555798341745343610gmail_msg">
Mark Lawrence<br class="m_8555798341745343610gmail_msg">
<br class="m_8555798341745343610gmail_msg">
______________________________<wbr>_________________<br class="m_8555798341745343610gmail_msg">
Python-ideas mailing list<br class="m_8555798341745343610gmail_msg">
<a href="mailto:Python-ideas@python.org" class="m_8555798341745343610gmail_msg" target="_blank">Python-ideas@python.org</a><br class="m_8555798341745343610gmail_msg">
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" class="m_8555798341745343610gmail_msg" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br class="m_8555798341745343610gmail_msg">
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" class="m_8555798341745343610gmail_msg" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br class="m_8555798341745343610gmail_msg">
<br class="m_8555798341745343610gmail_msg">
--<br class="m_8555798341745343610gmail_msg">
<br class="m_8555798341745343610gmail_msg">
---<br class="m_8555798341745343610gmail_msg">
You received this message because you are subscribed to a topic in the Google Groups "python-ideas" group.<br class="m_8555798341745343610gmail_msg">
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/python-ideas/FSd6xLHowg8/unsubscribe" rel="noreferrer" class="m_8555798341745343610gmail_msg" target="_blank">https://groups.google.com/d/<wbr>topic/python-ideas/<wbr>FSd6xLHowg8/unsubscribe</a>.<br class="m_8555798341745343610gmail_msg">
To unsubscribe from this group and all its topics, send an email to <a href="mailto:python-ideas%2Bunsubscribe@googlegroups.com" class="m_8555798341745343610gmail_msg" target="_blank">python-ideas+unsubscribe@<wbr>googlegroups.com</a>.<br class="m_8555798341745343610gmail_msg">
For more options, visit <a href="https://groups.google.com/d/optout" rel="noreferrer" class="m_8555798341745343610gmail_msg" target="_blank">https://groups.google.com/d/<wbr>optout</a>.<br class="m_8555798341745343610gmail_msg">
</blockquote></div></div>
<br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
<br></blockquote></div></div>