GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CQL::VISITOR (3)

.ds Aq ’

NAME

CQL::Visitor - visit nodes in a CQL parse tree

CONTENTS

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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CQL::VISITOR (3) 2012-11-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.