.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Config::Grammar::Dynamic 3pm" .TH Config::Grammar::Dynamic 3pm "2018-07-08" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Config::Grammar::Dynamic \- A grammar\-based, user\-friendly config parser .SH "DESCRIPTION" .IX Header "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. .PP The following keys can be additionally specified in the grammar when using this module: .SS "Special Section Keys" .IX Subsection "Special Section Keys" .IP "_dyn" 12 .IX Item "_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. .IP "_dyndoc" 12 .IX Item "_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 \fI_dyn()\fR 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. .IP "_recursive" 12 .IX Item "_recursive" Array containing the list of those sub-sections that are \fIrecursive\fR, ie. that can contain a new sub-section with the same syntax as themselves. .Sp The same effect can be accomplished with circular references in the grammar tree or a suitable \fB_dyn\fR section subroutine (see below}, so this facility is included just for convenience. .SS "Special Variable Keys" .IX Subsection "Special Variable Keys" .IP "_dyn" 12 .IX Item "_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. .Sp Note that no \fI_dyn()\fR call is made for default and inherited values of the variable. .IP "_dyndoc" 12 .IX Item "_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 \fI_dyn()\fR 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. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2000\-2005 by \s-1ETH\s0 Zurich. All rights reserved. Copyright (c) 2007 by David Schweikert. All rights reserved. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHORS" .IX Header "AUTHORS" David Schweikert, Tobias Oetiker, Niko Tyni