eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RBPluggableProgramNodeVisitor':

Home

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

Class: RBPluggableProgramNodeVisitor


Inheritance:

   Object
   |
   +--RBProgramNodeVisitor
      |
      +--RBPluggableProgramNodeVisitor

Package:
stx:goodies/refactoryBrowser/parser
Category:
Refactory-Support
Version:
rev: 1.2 date: 2021/01/20 11:42:42
user: cg
file: RBPluggableProgramNodeVisitor.st directory: goodies/refactoryBrowser/parser
module: stx stc-classLibrary: parser

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  passByNode: 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

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 03 Dec 2024 17:11:35 GMT