The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Gedcom::Grammar - a class to manipulate Gedcom grammars

Version 1.05 - 20th July 1999

SYNOPSIS

  use Gedcom::Grammar;

  my $st = $grammar->structures("GEDCOM")
  my $sgr = $grammar->child("DATE")
  my @children = $grammar->valid_children

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->structures("GEDCOM")

Return the grammar item of the specified structure, if it exists, or undef.

child

  my $sgr = $grammar->child("DATE")

Return the grammar item of the specified child, if it exists, or undef.

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

children

  my @children = $grammar->children

Return a list of tags of the grammar's children

valid_children

  my @children = $grammar->valid_children

Return a hash detailing all the valid children of the grammar item. The key is the tag of the child and the value is another hash with three members:

  grammar => the child grammar
  min     => the minimum permissible number of these children
  max     => the maximum permissible number of these children