logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Gedcom::Grammar - a module to manipulate GEDCOM grammars

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.36.0                                       2022-10-16                               Gedcom::Grammar(3pm)

Name

       Gedcom::Grammar - a module to manipulate GEDCOM grammars

       Version 1.22 - 15th November 2019

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;

See Also