Taxi::Mysql::MacroUtils - extendable full-text index using mysql: macro expansion utilities |
Taxi::Mysql::MacroUtils - extendable full-text index using mysql: macro expansion utilities
##======================================================================== ## PRELIMINARIES
use Taxi::Mysql::MacroUtils;
##======================================================================== ## Inheritance
$generator = $CLASS_OR_OBJ->new(%args); undef = $CLASS_OR_OBJ->DESTROY();
##======================================================================== ## API: Calling objects
undef = newSymbolGenerator($generator); undef = freeSymbolGenerator($generator);
##======================================================================== ## Utils: Symbol Generation
$sym = macro_gensym();
##======================================================================== ## Utils: Macro expansion
$thingy_expanded = macro_expand($thingy, {$from=>$to, ...});
Taxi::Mysql::MacroUtils provides symbol generation and macro expansion utitilities for Taxi::Mysql. It is used by Taxi::Mysql::Query::Base and Taxi::Mysql::Query::Parser.
Variable counter for 'macro_gensym()': ($prefix=>$ctr, ...)
Pseudo-set of extant symbol generators. see newSymbolGenerator(), freeSymbolGenerator().
Taxi::Mysql::MacroUtils exports the following tagged sets:
newSymbolGenerator(), freeSymbolGenerator(), macro_gensym()
$generator = $CLASS_OR_OBJ->new(%args);
If you inherit from MacroUtils,
calling the inerhited new()
method will register your
object $obj as a symbol generator.
undef = $CLASS_OR_OBJ->DESTROY();
... and the inheritd DESTROY()
method will unregister it.
undef = newSymbolGenerator($generator); undef = $generator->newSymbolGenerator()
Register a symbol generator (any $generator that might call macroGensym())
undef = freeSymbolGenerator($generator);
Unregister a registered symbol generator.
$sym = macro_gensym(); $sym = macro_gensym($symbol_prefix)
Generates a new symbol $sym with optional prefix $symbol_prefix. Note that the 'symbols' generated just plain perl strings, and have nothing to do with e.g. perl's Gensym module.
$var_prefix defaults to '__symbol__'
$thingy_expanded = macro_expand($thingy, \%macros);
Performs only a single pass of macro expansion over $thingy. Macros to expand are given in the HASH-ref \%macros. Only string-substitutions on non-reference scalar lvalues in $thingy are performed. No checks for circular references in $thingy are performed.
Perl by Larry Wall.
Bryan Jurish <moocow@ling.uni-potsdam.de>
Copyright (C) 2006 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
perl(1), Taxi::Mysql(3perl).
Taxi::Mysql::MacroUtils - extendable full-text index using mysql: macro expansion utilities |