Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
arpeggio-gm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
backend
arpeggio-gm
Commits
847eaf59
Commit
847eaf59
authored
Oct 22, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small addition to docs
parent
ae5a209f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
index.rst
docs/index.rst
+10
-1
No files found.
docs/index.rst
View file @
847eaf59
...
...
@@ -447,7 +447,16 @@ To apply your visitor class on the parse tree use ``visit_parse_tree`` function.
The first parameter is a parse tree you get from the ``parser.parse`` call while the second parameter is an
instance of your visitor class. Semantic analysis can be run in debug mode if you set ``debug`` parameter
to ``True`` during visitor construction.
to ``True`` during visitor construction. You can use this flag to print your own debug information from
visitor methods.
.. code:: python
class MyLanguageVisitor(PTNodeVisitor):
def visit_somerule(self, node, children):
if self.debug:
print("Visiting some rule!")
During semantic analysis, each ``visitor_xxx`` method gets current parse tree node as the first parameter and
the evaluated children nodes as the second parameter.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment