mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-07 21:34:32 +08:00
First iteration of parser tree docs.
This commit is contained in:
36
docs/docs/parser_tree.rst
Normal file
36
docs/docs/parser_tree.rst
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
.. _parser-tree:
|
||||||
|
|
||||||
|
Parser Tree
|
||||||
|
===========
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
.. automodule:: parso.python
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
|
||||||
|
|
||||||
|
Parser Tree Base Class
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
All nodes and leaves have these methods/properties:
|
||||||
|
|
||||||
|
.. autoclass:: parso.tree.NodeOrLeaf
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
|
||||||
|
|
||||||
|
Python Parser Tree
|
||||||
|
------------------
|
||||||
|
|
||||||
|
.. automodule:: parso.python.tree
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
||||||
|
:show-inheritance:
|
||||||
|
|
||||||
|
|
||||||
|
Utility
|
||||||
|
-------
|
||||||
|
|
||||||
|
.. autofunction:: parso.tree.search_ancestor
|
||||||
@@ -9,6 +9,14 @@ can also be created by directly instantiating ``Grammar``. More information
|
|||||||
about the resulting objects can be found in the :ref:`parser tree documentation
|
about the resulting objects can be found in the :ref:`parser tree documentation
|
||||||
<plugin-api-classes>`.
|
<plugin-api-classes>`.
|
||||||
|
|
||||||
|
The simplest way of using parso is without even loading a grammar:
|
||||||
|
|
||||||
|
.. sourcecode:: python
|
||||||
|
|
||||||
|
>>> import parso
|
||||||
|
>>> parso.parse('foo + bar')
|
||||||
|
<Module: @1-1>
|
||||||
|
|
||||||
.. automodule:: parso.grammar
|
.. automodule:: parso.grammar
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
|
|||||||
Reference in New Issue
Block a user