Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python parser Module tutorial

Tags:

python

parsing

I am writing an application which reads an input file that currently has its own grammar, which is processed by lex/yacc.

I'm looking to modify this so as to make this input file a Python script instead, and was wondering if someone can point me to a beginner's guide to using the parser module in Python. I'm fairly new to Python itself, but have worked through a fair chunk of the online tutorial.

From what I have researched, I know there are options (such as pyparsing) which can allow me to keep the existing grammar and use Pyparsing as a replacement for lex/yacc. However, I am curious to learn the Python parser module in more detail and explore its feasibility.

Thanks.

like image 795
endbegin Avatar asked Mar 03 '26 21:03

endbegin


1 Answers

You mean the parser module? It's a parser for Python source code only, not a general purpose parser. You can't use it to parse anything else.

like image 97
Jochen Ritzel Avatar answered Mar 06 '26 12:03

Jochen Ritzel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!