NAME

MYDan::Node - Cluster information interpreter. Extends MYDan::Node::Range

SYNOPSIS

use MYDan::Node;

my $a = MYDan::Node->new( cache => '/database/file' );

$a->load( 'foo{2~9}{??==*=={foo,bar}!!baz}.bar' );

## ... see base class for other methods ...

QUERY

cluster

A cluster query is expressed as a tuple of elements, corresponding to columns of the cache table. See MYDan::Node::DBI::Cache.

Such a query is made when an element is indicated by the select symbol, and the other three are given as query conditions, expressed by a condition symbol followed a range expression. e.g. "{??==*=={foo,bar}!!baz}" may be translated into the following SQL statement,

"SELECT col1 FROM $TABLE WHERE col3 IN ('foo','bar') AND col4!='baz'"

callabck

A callback query is expressed as a callback symbol followed by the callback name, and optionally, followed by a query condition. See MYDan::Node::Call.

e.g. "{%%foo!!bar,baz}" means to get all elements returned by callback foo, except those indexed by bar and baz.

Naturally, '*' in a query condition means 'any', i.e. no condition. And a query expression may be recursive.

SYMBOLS

( in addition to those in the base class )

QUERY

'??' : select
'==' : in
'!!' : not

METHODS

db()

Returns cache db object.

cb()

Returns callback object.

GRAMMAR

( BNF rules additional to those in the base class )

complex

'{' [ <expr> | <call> | <cluster> ] '}'

call

<call_sym> <string> <query_cond>

cluster

[ <select_symbol> <query_cond> ** 3 ] |
[ <query_cond> <select_symbol> <query_cond> ** 2 ] |
[ <query_cond> ** 2 <select_symbol> <query_cond> ] |
[ <query_cond> ** 3 <select_symbol> ]

query_cond

<condition_symbol> <expr> |
<condition_symbol> <regex>