/usr/share/perl5/CQL/Node.pm is in libcql-parser-perl 1.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | package CQL::Node;
use strict;
use warnings;
use base qw( Clone );
use Carp qw( croak );
=head1 NAME
CQL::Node - base class for nodes in a CQL parse tree
=head1 SYNOPSIS
n/a
=head1 DESCRIPTION
All the CQL node classes inherit from CQL::Node. CQL::Node
essentially gurantees that its children implements some methods.
=head2 toCQL()
=cut
sub toCQL {
my $self = shift;
## poor mans interface
croak( ref($self) . " forgot to implement toCQL()!!!" );
}
=head2 toXCQL()
=cut
sub toXCQL {
my $self = shift;
croak( ref($self) . " forgot to implement toXCQL()!!!" );
}
=head2 toSwish()
=cut
sub toSwish {
my $self = shift;
## poor mans interface
croak( ref($self) . " forgot to implement toSwish()!!!" );
}
=head2 toLucene()
=cut
sub toLucene {
my $self = shift;
croak( ref($self) . " forgot to implement toLucene()!!!" );
}
=head2 clone()
Creates a copy of a node, and it's children. Useful if you want to modify
the tree but keep a copy of the original.
=cut
# internal method for adding namespace information to top level
# elements in XCQL generated by children.
sub addNamespace {
my ($self,$level,$xml) = @_;
# only add namespace to top level element
return $xml if $level != 0;
# kind of hackish way of adding namespace to the first
# open tag we see
$xml =~ s{^<([^ ]*?)>}{<$1 xmlns="http://www.loc.gov/zing/cql/xcql/">};
return $xml;
}
1;
|