File: printVisitor.xotcl

package info (click to toggle)
xotcl 1.6.8-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,468 kB
  • sloc: ansic: 22,485; tcl: 2,531; sh: 791; makefile: 141
file content (27 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

package provide xotcl::xml::printVisitor 1.0
package require -exact xotcl::xml::parser 1.0
package require XOTcl 1

namespace eval ::xotcl::xml::printVisitor {
    namespace import ::xotcl::*

    ##############################################################################
    #
    # Small debugging visitor that just uses node's print method to print the 
    # node tree
    #
    ##############################################################################

    Class PrintVisitor -superclass NodeTreeVisitor -parameter parser
    PrintVisitor instproc visit objName {
	puts [$objName print]
    }
    PrintVisitor instproc interpretNodeTree node {
	$node accept [self]
    }

    namespace export PrintVisitor
}

namespace import ::xotcl::xml::printVisitor::*