eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PluggableParseNodeVisitor':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: PluggableParseNodeVisitor


Inheritance:

   Object
   |
   +--ParseNodeVisitor
      |
      +--PluggableParseNodeVisitor

Package:
stx:libcomp
Category:
System-Compiler-Support
Version:
rev: 1.2 date: 2016/04/28 22:45:44
user: cg
file: PluggableParseNodeVisitor.st directory: libcomp
module: stx stc-classLibrary: libcomp

Description:


a pluggable node visitor.
setup with:
    actionForNodeClass:aClass put:aBlock
    
for example, if you are only interested in assignments,
use the following code:
    |v|
    v := PluggableParseNodeVisitor new.
    v actionForNodeClass:AssignmentNode put:[:node | Transcript showCR:node. true].
    v visit:(Parser parse:code in:someClass.


Instance protocol:

setup
o  actionForNodeClass: aNodeClass put: aBlock
setup so that for nodes of type aNodeClass, aBlock is invoked.
If the block returns true, subnodes (eg. right side of assignments, etc.)
will be enumerated as well.
Otherwise, no subnodes are visited.

visiting
o  visit: aNodeObject
redefined to look for an action for this node's class.
If there is one, it can specify if subnodes are to be visited too



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 29 Mar 2024 04:51:30 GMT