debian man page for cql::visitor

Query: cql::visitor

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

CQL::Visitor(3pm)					User Contributed Perl Documentation					 CQL::Visitor(3pm)

NAME
CQL::Visitor - visit nodes in a CQL parse tree
SYNOPSIS
package MyVisitor; use base qw( CQL::Visitor ); sub term { my ($self,$node) = @_; # do something to the node } # later on my $parser = CQL::Parser->new(); my $root = $parser->parse($cql); my $visitor = MyVisitor->new(); $vistor->visit($root);
DESCRIPTION
CQL::Visitor provides a simple interface for visiting nodes in your parse tree. It could be useful if you want to do something like change a query like this: dc.title=foo and dc.creator=bar into title=foo and creator=bar Or some similar procedure. You simply create a new subclass of CQL::Visitor and override the appropriate method, such as term(). Every term that is encountered during the traversal will be handed off to your term() method. Note: at the moment only term() is supported because that's what was needed, but if you need other ones feel free to add them, or ask for them.
METHODS
new() visit() Call this to traverse your parse tree, starting at the root. term() Your subclass should override this, and do something meaningful with the CQL::TermNode object. perl v5.12.4 2009-12-02 CQL::Visitor(3pm)
Related Man Pages
tree::simple::visitor::findbyuid(3pm) - debian
tree::simple::visitor::loaddirectorytree(3pm) - debian
tree::simple::visitor::preordertraversal(3pm) - debian
tree::simple::visitor::tonestedarray(3pm) - debian
tree::simple::visitor::variabledepthclone(3pm) - debian
Similar Topics in the Unix Linux Community
awk or sed - Convert 2 lines to 1 line
One instance of comparing grep and awk
A (ksh) Library For and From UNIX.com
How to copy a column of multiple files and paste into new excel file (next to column)?
New UNIX and Linux History Sections