Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

config::grammar::dynamic(3pm) [debian man page]

Config::Grammar::Dynamic(3pm)				User Contributed Perl Documentation			     Config::Grammar::Dynamic(3pm)

NAME
Config::Grammar::Dynamic - A grammar-based, user-friendly config parser DESCRIPTION
Config::Grammar::Dynamic is like Config::Grammar but with some additional features useful for building configuration grammars that are dynamic, i.e. where the syntax changes according to configuration entries in the same file. The following keys can be additionally specified in the grammar when using this module: Special Section Keys _dyn A subroutine reference (function pointer) that will be called when a new section of this syntax is encountered. The subroutine will get three arguments: the syntax of the section name (string or regexp), the actual name encountered (this will be the same as the first argument for non-regexp sections) and a reference to the grammar tree of the section. This subroutine can then modify the grammar tree dynamically. _dyndoc A hash reference that lists interesting names for the section that should be documented. The keys of the hash are the names and the values in the hash are strings that can contain an explanation for the name. The _dyn() subroutine is then called for each of these names and the differences of the resulting grammar and the original one are documented. This module can currently document differences in the _vars list, listing new variables and removed ones, and differences in the _sections list, listing the new and removed sections. _recursive Array containing the list of those sub-sections that are recursive, ie. that can contain a new sub-section with the same syntax as themselves. The same effect can be accomplished with circular references in the grammar tree or a suitable _dyn section subroutine (see below}, so this facility is included just for convenience. Special Variable Keys _dyn A subroutine reference (function pointer) that will be called when the variable is assigned some value in the config file. The subroutine will get three arguments: the name of the variable, the value assigned and a reference to the grammar tree of this section. This subroutine can then modify the grammar tree dynamically. Note that no _dyn() call is made for default and inherited values of the variable. _dyndoc A hash reference that lists interesting values for the variable that should be documented. The keys of the hash are the values and the values in the hash are strings that can contain an explanation for the value. The _dyn() subroutine is then called for each of these values and the differences of the resulting grammar and the original one are documented. This module can currently document differences in the _vars list, listing new variables and removed ones, and differences in the _sections list, listing the new and removed sections. COPYRIGHT
Copyright (c) 2000-2005 by ETH Zurich. All rights reserved. Copyright (c) 2007 by David Schweikert. All rights reserved. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHORS
David Schweikert, Tobias Oetiker, Niko Tyni perl v5.10.0 2007-09-25 Config::Grammar::Dynamic(3pm)

Check Out this Related Man Page

Gedcom::Grammar(3pm)					User Contributed Perl Documentation				      Gedcom::Grammar(3pm)

NAME
Gedcom::Grammar - a module to manipulate Gedcom grammars Version 1.16 - 24th April 2009 SYNOPSIS
use Gedcom::Grammar; my $st = $grammar->structure("GEDCOM"); my @sgr = $grammar->item("DATE"); my @items = $grammar->valid_items; my $min = $grammar->min; my $max = $grammar->max; my @items = $grammar->items; DESCRIPTION
A selection of subroutines to handle the grammar of a gedcom file. Derived from Gedcom::Item. HASH MEMBERS
Some of the more important hash members are: $grammar->{top} The top of the grammar tree. $grammar->{top}{structures} A reference to a hash mapping the names of all structures to the grammar objects. METHODS
structures my $st = $grammar->structure("GEDCOM"); Return the grammar item of the specified structure, if it exists, or undef. item my @sgr = $grammar->item("DATE"); Return a list of the possible grammar items of the specified sub-item, if it exists. min my $min = $grammar->min; Return the minimum permissible number of $grammar items max my $max = $grammar->max; Return the maximum permissible number of $grammar items items my @items = $grammar->items; Return a list of tags of the grammar's sub-items valid_items my @items = $grammar->valid_items; Return a hash detailing all the valid sub-items of the grammar item. The key is the tag of the sub-item and the value is an array of hashes with three members: grammar => the sub-item grammar min => the minimum permissible number of these sub-items max => the maximum permissible number of these sub-items perl v5.14.2 2012-04-12 Gedcom::Grammar(3pm)
Man Page