Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h1>About <a href="http://www.dabeaz.com/ply/ply.html" rel="nofollow noreferrer">PLY</a></h1> <p>PLY is a parser generator tool that uses reflection to read token definitions and production rules written in pure Python. You can, for example, define tokens with a simple string attribution or with methods containing a regular expression in its docstring.</p> <p>To install PLY on your machine for python2/3, follow the steps outlined below:</p> <ol> <li>Download the source code from <a href="http://www.dabeaz.com/ply/ply-3.10.tar.gz" rel="nofollow noreferrer">here</a>.</li> <li>Unzip the downloaded zip file</li> <li>Navigate into the unzipped <code>ply-3.10</code> folder</li> <li>Run the following command in your terminal: <code>python setup.py install</code></li> </ol> <p>If you completed all the above, you should now be able to use the PLY module. You can test it out by opening a python interpreter and typing <code>import ply.lex</code>.</p> <p>Note: Do <em>not</em> use <code>pip</code> to install PLY, it will install a broken distribution on your machine.</p> <hr> <p>Examples of token definitions with code to interpret value:</p> <pre><code>def t_BOOLEAN(token): r'(?:true|false)' token.value = token.value == "true" return token def t_NUMBER(token): r'[0-9]+' token.value = int(token.value) return token </code></pre> <hr> <ul> <li><p>Project page: <a href="http://www.dabeaz.com/ply/" rel="nofollow noreferrer">http://www.dabeaz.com/ply/</a></p></li> <li><p>Main docs: <a href="http://www.dabeaz.com/ply/ply.html" rel="nofollow noreferrer">http://www.dabeaz.com/ply/ply.html</a></p></li> </ul> <hr> <h1>Related tags:</h1> <ul> <li><a href="http://stackoverflow.com/tags/python"><strong>python</strong></a><br> The <a href="http://www.python.org" rel="nofollow noreferrer">Python Language</a></li> <li><a href="http://stackoverflow.com/tags/parsing"><strong>parsing</strong></a> </li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload