TITLE
Tcl::Glob - Parse and compile glob notation expressions.
DESCRIPTION
A parser for Tcl-stype glob notation.
Functions
compile_glob(PMC source, PMC adverbs :slurpy :named)
Return the result of compiling the glob expression given by glob(PMC mob, PMC adverbs :slurpy :named)
Parses a glob expression,
returning the corresponding parse glob_literal(PMC mob, PMC adverbs)
Scan a literal from a string,
stopping at any metacharacters such as glob_quest(PMC mob, PMC adverbs)
Process a glob_star(PMC mob, PMC adverbs)
Process a glob_enum(PMC mob, PMC adverbs)
Parse an enumerated character list,
such as [abcd],
[!abcd],
and [^0-9].
glob_alt(PMC mob, PMC adverbs)
Parse an enumerated character list,
such as [abcd],
[!abcd],
and [^0-9].
- register(string name, pmc compsub) Registers this compiler object as
- compile(pmc code [, "option" => value, ... ]) Compile
source
.
Normally this function is obtained using compreg 'Tcl::Glob'
instead of calling it directly.Returns the compiled regular expression.
If a target
named parameter is supplied,
then it will return the parse tree (target='parse'),
the expression tree (target='exp'),
or the resulting PIR code (target='PIR').
PGE::Match
object.
*
or [
.
Return the matched portion,
with the result_object
set to the decoded literal.
?
wildcard character in a glob.
For this we just return a CCShortcut that is set to '.'
*
wildcard character in a glob.
This is a little bit more complex,
as we have to return a quantified '.'.
name
and using compsub
as the subroutine to call for performing compilation.
source
(possibly modified by any provided options).BUGS AND LIMITATIONS
This is basically a cut and paste of PGE::Glob. There should probably be much less code duplication here.
AUTHOR
PGE::Glob was originally authored by Jonathan Scott Duff (duff@pobox.com), It has been updated for later versions of PGE by Patrick R. Michaud (pmichaud@pobox.com).