=head1 NAME
 
Parse::Eyapp::eyappintro - An introduction to Parse::Eyapp
 
=head1 SYNOPSIS
 
  use Parse::Eyapp;
  use Parse::Eyapp::Treeregexp;

  sub TERMINAL::info {
    $_[0]{attr}
  }

  my $grammar = q{
    %right  '='     # Lowest precedence
    %left   '-' '+' # + and - have more precedence than = Disambiguate a-b-c as (a-b)-c
    %left   '*' '/' # * and / have more precedence than + Disambiguate a/b/c as (a/b)/c
    %left   NEG     # Disambiguate -a-b as (-a)-b and not as -(a-b)
    %tree           # Let us build an abstract syntax tree ...

    %%
    line:
        exp <%name EXPRESION_LIST + ';'>
          { $_[1] } /* list of expressions separated by ';' */
    ;

    /* The %name directive defines the name of the class to which the node being built belongs */
    exp:
        %name NUM
        NUM
      | %name VAR
        VAR
      | %name ASSIGN
        VAR '=' exp
      | %name PLUS
        exp '+' exp
      | %name MINUS
        exp '-' exp
      | %name TIMES
        exp '*' exp
      | %name DIV
        exp '/' exp
      | %name UMINUS
        '-' exp %prec NEG
      | '(' exp ')'
          { $_[2] }  /* Let us simplify a bit the tree */
    ;

    %%
    sub _Error { die "Syntax error near ".($_[0]->YYCurval?$_[0]->YYCurval:"end of file")."\n" }

    sub _Lexer {
      my($parser)=shift; # The parser object

      for ($parser->YYData->{INPUT}) { # Topicalize
        m{\G\s+}gc;
        $_ eq '' and return('',undef);
        m{\G([0-9]+(?:\.[0-9]+)?)}gc and return('NUM',$1);
        m{\G([A-Za-z][A-Za-z0-9_]*)}gc and return('VAR',$1);
        m{\G(.)}gcs and return($1,$1);
      }
      return('',undef);
    }

    sub Run {
        my($self)=shift;
        $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error, );
    }
  }; # end grammar

  our (@all, $uminus);

  Parse::Eyapp->new_grammar( # Create the parser package/class
    input=>$grammar,
    classname=>'Calc', # The name of the package containing the parser
    firstline=>7       # String $grammar starts at line 7 (for error diagnostics)
  );
  my $parser = Calc->new();                # Create a parser
  $parser->YYData->{INPUT} = "2*-3+b*0;--2\n"; # Set the input
  my $t = $parser->Run;                    # Parse it!
  local $Parse::Eyapp::Node::INDENT=2;
  print "Syntax Tree:",$t->str;

  # Let us transform the tree. Define the tree-regular expressions ..
  my $p = Parse::Eyapp::Treeregexp->new( STRING => q{
      { #  Example of support code
        my %Op = (PLUS=>'+', MINUS => '-', TIMES=>'*', DIV => '/');
      }
      constantfold: /TIMES|PLUS|DIV|MINUS/:bin(NUM($x), NUM($y))
        => {
          my $op = $Op{ref($bin)};
          $x->{attr} = eval  "$x->{attr} $op $y->{attr}";
          $_[0] = $NUM[0];
        }
      uminus: UMINUS(NUM($x)) => { $x->{attr} = -$x->{attr}; $_[0] = $NUM }
      zero_times_whatever: TIMES(NUM($x), .) and { $x->{attr} == 0 } => { $_[0] = $NUM }
      whatever_times_zero: TIMES(., NUM($x)) and { $x->{attr} == 0 } => { $_[0] = $NUM }
    },
    OUTPUTFILE=> 'main.pm'
  );
  $p->generate(); # Create the tranformations

  $t->s($uminus); # Transform UMINUS nodes
  $t->s(@all);    # constant folding and mult. by zero

  local $Parse::Eyapp::Node::INDENT=0;
  print "\nSyntax Tree after transformations:\n",$t->str,"\n";



=head1 INTRODUCTION TO PARSING WITH Parse::Eyapp

Parsing is the activity of producing a syntax tree
from an input stream. The program example in the synopsis 
section shows an example of parsing. The variable C<$grammar>
contains a context free eyapp grammar defining the language 
of lists of arithmetic expressions. A context free grammar
is a mathematical device to define languages. The grammar
for the example in the synopsis section is:

   line: exp <+ ';'>  
   ;

   exp:
       NUM            
     | VAR         
     | VAR '=' exp
     | exp '+' exp    
     | exp '-' exp 
     | exp '*' exp
     | exp '/' exp 
     | '-'  exp 
     |   '(' exp ')' 
   ;

A grammar generates a language. A grammar is defined by a set of production rules. A production rule
has two components: a left hand side which is a I<syntactic variable> or I<non terminal> and a right hand side
which is a phrase made of syntactic variables and terminals. The left hand side (I<lhs>) and the right
hand side (I<rhs>) are usually separated by an arrow like in:

                                    exp -> VAR = exp

A note: the production rule

                        line: exp <+ ';'>

is not really a production rule but an abbreviation for two productions. It stands for:

                        line : exp
                             | line ';' exp
                        ;


A I<terminal> or I<token> never appears on the left hand side of a production rule.
The phrases of the language are those obtained 
succesively applying the production rules of the grammar until no more rules can be applied.
The succesive substitutions must start from the C<start> symbol of the grammar (C<line> in
the example). Such legal
sequence of substitutions is known as a I<derivation>. The following is an example of a
legal derivation (the big arrow C<=E<gt>> is read I<derives>):

  line => exp => VAR = exp => VAR = exp + exp => VAR = exp + NUM => VAR = VAR + NUM

thus the phrase C<VAR = VAR + NUM> belongs to the language generated by the former grammar.
A derivation like can be seen as a tree. For instance, the former derivation is equivalen (has 
the same information) than the tree:

                        line(exp(VAR, '=', exp(exp(VAR), '+',  exp(NUM))))

Such a tree is called a I<syntax tree> for the input C<VAR = VAR + NUM>.
A grammar is said to be I<ambiguous> if there are phrases in the generated language that have
more than one syntax tree. The grammar in the synopsis example is ambiguous. Here is an alternative
tree for the same phrase C<VAR = VAR + NUM>:

                        line(exp(exp(VAR, '=', exp(VAR)), '+', exp(NUM)))

Parsers created by C<eyapp> do not deal directly with the input. Instead they expect the input
to be processed by a I<lexical analyzer>. The lexical analyzer parses the input and produces
the next token. A I<token> is a pair. The first component is the name of the token (like C<NUM>
or C<VAR>) and the second is its attribute (i.e. ay information associated with the token, like 
that the value is C<4> for a C<NUM> or the identifier is C<temperature> for a
C<VAR>). Tokens are usually defined using regular expressions. Thus the token 
C<NUM> is characterized by C</[0-9]+(?:\.[0-9]+)?/> and the token
C<VAR> by C</[A-Za-z][A-Za-z0-9_]*/>. The subroutine C<_Lexer> in the tail section
is a typical example of a typical lexical analyzer:

    sub _Lexer {
      my($parser)=shift; # The parser object

      for ($parser->YYData->{INPUT}) { # Topicalize
        m{\G\s+}gc;     # skip whites
        $_ eq '' and return('',undef);
        m{\G([0-9]+(?:\.[0-9]+)?)}gc and return('NUM',$1);
        m{\G([A-Za-z][A-Za-z0-9_]*)}gc and return('VAR',$1);
        m{\G(.)}gcs and return($1,$1);
      }
      return('',undef);
    }

The input was saved in the C<YYData-E<gt>{INPUT}> section of the C<$parser>
object. The C<for> loop is a false C<for>: its goal is to make C<$_> an alias
of C<$parser-E<gt>YYData-E<gt>{INPUT}>. To catch the next pattern we use the anchor C<\G>.
The C<\G> anchor matches at the point where the previous C</g> match left off. 
Normally, when a scalar C<m{}g> match fails, the match position is reset and
C<\G> will start matching at the beginning of the string.
The C<c> option causes the match position to be retained following an unsuccessful match.
The couple C<('',undef)> signals the end of the input.

C<Parse::Eyapp> can analyze your grammar and produce a parser from your grammar.
Actually C<Parse::Eyapp> is a I<translation scheme> analyzer. A I<translation scheme> 
scheme is a context free grammar where the right hand sides of the productions 
have been augmented with semantic actions (i.e. with chunks of Perl code):

                                A -> alpha { action(@_) } beta

The analyzer generated by Eyapp executes C<{ action(@_) }> after all the semantic actions
asssociated with C<alpha> have been executed and before the execution of any of the semantic 
actions associated with C<beta>. 

Notice that ambiguous grammars produce ambiguous translation schemes: 
since a phrase may have two syntactic
trees it will be more than one tree-traversing and consequently more than one 
way to execute the embedded semantic actions. Certainly different execution
orders will usually produce different results. Thus, syntactic ambiguities translate
onto semantic ambiguities. That is why it is important to resolve all the 
ambiguities and conflicts that may arise in our grammar. This is the function 
of the C<%left> and C<%right> declarations on the header section:

  my $grammar = q{
    # header section
    %right  '='     # Lowest precedence
	    %left   '-' '+' # + and - have more precedence than = Disambiguate a-b-c as (a-b)-c
	    %left   '*' '/' # * and / have more precedence than + Disambiguate a/b/c as (a/b)/c
	    %left   NEG     # Disambiguate -a-b as (-a)-b and not as -(a-b)
	    %tree           # Let us build an abstract syntax tree ...

	    %%
	    .... # body section
	    %%
	    .... # tail section
  };

Priority can be assigned to tokens by using the C<%left> and C<%right> declarations. Tokens in
lines below have more precedence than tokens in line above. By giving token C<'+'> more precedence
than token C<'='> we solve the ambiguity for phrases like C<VAR = VAR + NUM>. The tree

line(exp(VAR, '=', exp(exp(VAR), '+',  exp(NUM))))

will be built, discarding the other tree. Since priority means earlier evaluation
and the evaluation of semantic actions is bottom up, the deeper the associated subtree the higher
the priority.

In a translation scheme the embedded actions modify the attributes
associated with the symbols of the grammar.

A -> alpha { action(@_) } beta

I<Each symbol on the right hand side
of a production rule has an associated scalar attribute>. In C<eyapp> the attributes of the symbol
to the left of C<action> are passed as arguments to C<action> (in the example, those of C<alpha>). 
These arguments are preceded by a reference to the syntax analyzer object.
There is no way inside an ordinary C<eyapp> program for an intermediate C<action> to 
access the attributes of the symbols
on its right, i.e. those associated with the symbols of C<beta>. This restriction is lifted 
if you  use the C<%metatree> directive to build a full translation scheme. 
See 
L<Parse::Eyapp::translationschemestut>
to know more about full translation schemes.

Actions on the 
right hand side counts as symbols and so they can be referenced by its positional arument
in later actions in the same production rule. For intermediate actions, the value returned by the C<action> is 
the attribute associated with such action. For an action at the end of the rule:

                                A -> alpha { lastaction(@_) } 

the returned value constitutes the attribute of the left hand side of the rule (the
attribute of C<A> in this case). The action at the end of the right hand side is 
called the I<action associated with the production rule>. When no explicit action
has been associated with a production rule the I<default action> applies. In C<Parse::Eyapp>
the programmer can define what is the default action. 

A very special
action is "I<build the node associated with this production rule>" which
is performed by the C<YYBuildAST> method of the parser object:

                %default action { goto &Parse::Eyapp::Driver::YYBuildAST }

The C<%tree> directive used in the L</SYNOPSIS> example
is an abbreviation for this and has the effect of building an abstract syntax tree
for the input.

The call to 

       Parse::Eyapp->new_grammar( # Create the parser package/class
          input=>$grammar,
          classname=>"Calc", # The name of the package containing the parser
        );

compiles C<$grammar> and 
produces a new class C<Calc> containing
a LALR parser for such grammar. The call

                          $parser = Calc->new()

creates a parser object for the language generated by C<$grammar>.
Using the  C<YYParse> of the parser object:

        $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error, )

C<YYParse> is called with arguments a reference to the lexical analyzer and 
a reference to the error diagnostic subroutine C<_Error>. Such subroutine
will be called by C<YYParse> when an error occurs. Is therefore convenient
to give a meaningful diagnostic:

    sub _Error { 
      die "Syntax error near "
      .($_[0]->YYCurval?$_[0]->YYCurval:"end of file")."\n" 
    }

The parser method C<YYCurval> returns the value of the current token.
A more accurate error diagnostic subroutine can be obtained if  
the lexical analyzer is modified so that
tokens keep the line number where they start (i.e. the token 
is a pair C<(TOKENNAME, [ ATTRIBUTE, LINENUMBER])>. In such case 
the C<_Error> subroutine can be rewritten as:

  sub _Error {
    my($token)=$_[0]->YYCurval;
    my($what)= $token ? "input: '$token->[0]' in line $token->[1]" : "end of input";
    my @expected = $_[0]->YYExpect();
    my $expected = @expected? "Expected one of these tokens: '@expected'":"";

    croak "Syntax error near $what. $expected\n";
  }

The C<YYExpect> method returns the set of tokens that were expected when
the error occurred.

The input in 

                $parser->YYData->{INPUT} 

is then analyzed by C<YYParse> and 
an abstract syntax tree is built. The tree rooted on a C<Parse::Eyapp::Node>
can be displayed using the method C<str>:

                    local $Parse::Eyapp::Node::INDENT=2;
                    print "Syntax Tree:",$t->str;

The following is the description of the syntax tree produced by the call C<$t-E<gt>str> for the 
list of expressions C<"2*-3+b*0;--2\n";>:

  pl@nereida:~/LEyapp/examples$ synopsis.pl
  Syntax Tree:
  EXPRESION_LIST(
    PLUS(
      TIMES(
        NUM(
          TERMINAL[2]
        ),
        UMINUS(
          NUM(
            TERMINAL[3]
          )
        ) # UMINUS
      ) # TIMES,
      TIMES(
        VAR(
          TERMINAL[b]
        ),
        NUM(
          TERMINAL[0]
        )
      ) # TIMES
    ) # PLUS,
    UMINUS(
      UMINUS(
        NUM(
          TERMINAL[2]
        )
      ) # UMINUS
    ) # UMINUS
  ) # EXPRESION_LIST

Did you notice that the C<TERMINAL> nodes appear I<decorated> with its attribute?
This is because each time the C<Parse::Eyapp::Node> method C<str>
visits a node checks if the node has a method C<info> (i.e. C<$node-E<gt>can(info)>).
If so, the C<info> method is called and the string returned is concatenated
in the description string. This is the reason for these three lines at the beginning of the
L</SYNOPSIS> example:

                    sub TERMINAL::info {
                      $_[0]{attr}
                    }

C<Parse::Eyapp> not only gives support to parsing
but to later phases of the translation process: 
tree transformations and
scope analysis (scope analysis is the task to find which definition
applies to an use of an object in the source). The program in the synopsis 
section shows an example of a tree transformation
specification. Tree transformations are specified using
a language called I<Tree regular expressions>.
The transformation object is created by the 
constructor C<Parse::Eyapp::Treeregexp-E<gt>new>.

  my $p = Parse::Eyapp::Treeregexp->new( STRING => q{
      { #  Example of support code
        my %Op = (PLUS=>'+', MINUS => '-', TIMES=>'*', DIV => '/');
      }
      constantfold: /TIMES|PLUS|DIV|MINUS/:bin(NUM($x), NUM($y))
        => {
          my $op = $Op{ref($bin)};
          $x->{attr} = eval  "$x->{attr} $op $y->{attr}";
          $_[0] = $NUM[0];
        }
      uminus: UMINUS(NUM($x)) => { $x->{attr} = -$x->{attr}; $_[0] = $NUM }
      zero_times_whatever: TIMES(NUM($x), .) and { $x->{attr} == 0 } => { $_[0] = $NUM }
      whatever_times_zero: TIMES(., NUM($x)) and { $x->{attr} == 0 } => { $_[0] = $NUM }
    },
  );

The set of transformations specified in the example
are

=over 2 

=item * 

The transformation C<constantfold> produces
I<constant folding> i.e. trees of expressions
like C<3*2+4> are reduced to the tree for C<10> 

      { #  Example of support code
        my %Op = (PLUS=>'+', MINUS => '-', TIMES=>'*', DIV => '/');
      }
      constantfold: /TIMES|PLUS|DIV|MINUS/:bin(NUM($x), NUM($y))
        => {
          my $op = $Op{ref($bin)};
          $x->{attr} = eval  "$x->{attr} $op $y->{attr}";
          $_[0] = $NUM[0];
        }

Here C<constantfold> is the name of the transformation. 
The treeregexp compiler will produce an object C<$constantfold>
implementing the transformation. After the name
comes the tree pattern: 

          /TIMES|PLUS|DIV|MINUS/:bin(NUM($x), NUM($y))

It matches any subtree rooted in any node belonging to one of 
these classes: C<TIMES> or C<PLUS> or C<DIV> or C<MINUS> that has
two children belonging to the C<NUM> class. The Perl code after the big arrow
is executed on any matching subtree. We can refer to the root of the subtree
using the variable C<$bin>. We can also refer to the child of the first C<NUM> node
using C<$x>. In the same way C<$y> refers to the child of the second C<NUM>
node. Since there are two C<NUM> nodes in the pattern, we refer to them inside
the transformation part using the array C<@NUM>:

                         $_[0] = $NUM[0];

The action uses and C<eval> and the hash C<%Op> to compute the 
corresponding reduction of the two nodes. The hash C<%Op> was defined in a previous
section containing support code. You can insert in any place of a treeregexp 
program such support code by surrounding it with curly brackets.
The subtree that matched (that is in C<$_[0]>) is substituted
by its left child:

                         $_[0] = $NUM[0];


=item * 

The transformations C<zero_times_whatever>
and C<whatever_times_zero> produce
the simplification of trees corresponding
to multiplications by zero. 
Trees for expressions like C<(a+b)*0>
or C<0*(b-4)>  are reduced 
to the tree for 0.

  zero_times_whatever: TIMES(NUM($x), .) and { $x->{attr} == 0 } => { $_[0] = $NUM }

Here C<zero_times_whatever> is the name of the transformation.
The pattern C<TIMES(NUM($x), .)> matches any C<TIMES> node 
with two children and whose first child belongs to the C<NUM>
class. The dot matches any subtree, indicating that we don't care what
sort of tree the right child is. The third component

                   { $x->{attr} == 0 }

is the semantic pattern. If both the shape pattern and the semantic pattern
apply the action after the arrow is applied. The subtrees
is substituted by its left child.

=item *

The transformation C<uminus> simplifies
the tree for unary minus of constant expressions.

      uminus: UMINUS(NUM($x)) => { $x->{attr} = -$x->{attr}; $_[0] = $NUM }

It matches trees rooted in a C<UMINUS> node whose only child is a C<NUM> node.
In such case the sign of the number that is the attribute of the C<TERMINAL> node 
is changed and the tree is substituted by its single child.

=back

The call

                  $p->generate(); 

compiles the transformation specification producing
a set of transformations C<$constantfold>, 
C<$zero_times_whatever>, C<whatever_times_zero> and  C<$uminus>.
Transformations are C<Parse::Eyapp::YATW> objects. The list variable
C<@all> refer to the whole set of C<Parse::Eyapp::YATW> 
transformations.

The nodes of the abstract syntax tree are objects. The class
(C<NUM>, C<TIMES>, C<UMINUS>, etc.) defines the type of node.
All node classes inherit from the class C<Parse::Eyapp::Node>.
C<Parse::Eyapp::Node> provides a set of methods to manipulate nodes.
Among these methods are C<str>, C<m> and C<s>. The C<m> and C<s> methods 
resemble the matching and substitution operators for regular
expressions. But instead of regular expressions they work 
with tree transformations or C<treeregexp>s or, more
precisely with C<Parse::Eyapp::YATW> objects.
By calling:

                          $t->s($uminus);

subtrees like 

                  UMINUS(UMINUS(NUM(TERMINAL[2])))

are simplified to

                                   NUM(TERMINAL[2])

The call to

                           $t->s(@all);

applies the whole set of transformations. The transformations in C<@all> 
are iteratively
applied to the tree C<$t> until no transformation succeeds: Yes, that means that
a inappropriate set of transformations my hang your program.

Thus, the former syntax tree for C<"2*-3+b*0;--2\n";> 
becomes:

  EXPRESION_LIST(NUM(TERMINAL[-6]),NUM(TERMINAL[2]))

The analyzer has been able to optimize - at compile time -
the computation of these two expressions

                    2*-3+b*0;
                    --2

reducing them to the computation of:

                     -6;
                      2



=head1 SEE ALSO

=over

=item * 
L<Parse::Eyapp>, 
L<Parse::Eyapp::eyapplanguageref>, 
L<Parse::Eyapp::debugingtut>,
L<Parse::Eyapp::translationschemestut>,
L<Parse::Eyapp::Driver>,
L<Parse::Eyapp:Node>,
L<Parse::Eyapp::YATW>,
L<Parse::Eyapp::Treeregexp>,
L<Parse::Eyapp::Scope>,
L<Parse::Eyapp::Base>,


=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/languageintro.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/debuggingtut.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/eyapplanguageref.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/Treeregexp.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/Node.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/YATW.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/Eyapp.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/Base.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/translationschemestut.pdf> 

=item * The pdf file in L<http://nereida.deioc.ull.es/~pl/perlexamples/MatchingTrees.pdf> 

=item * The tutorial I<Parsing Strings and Trees with> C<Parse::Eyapp>
(An Introduction to Compiler Construction in seven pages) in
L<http://nereida.deioc.ull.es/~pl/eyapsimple/> 

=item *
perldoc L<eyapp>, 

=item *
perldoc L<treereg>,

=item *
perldoc L<vgg>,

=item * I<Analisis Lexico y Sintactico>, (Notes for a course in compiler 
construction) by  Casiano Rodriguez-Leon. 
Available at  L<http://nereida.deioc.ull.es/~pl/perlexamples/>
Is the more complete and reliable source for Parse::Eyapp. However is in Spanish.

=item *
L<Parse::Yapp>,

=item *
Man pages of yacc(1),

=item *
Man pages of bison(1),

=item *
L<Language::AttributeGrammar>

=item *
L<Parse::RecDescent>.

=item *
L<HOP::Parser>

=item *
L<HOP::Lexer>

=item * ocamlyacc tutorial at 
L<http://plus.kaist.ac.kr/~shoh/ocaml/ocamllex-ocamlyacc/ocamlyacc-tutorial/ocamlyacc-tutorial.html>

=back

=head1 REFERENCES

=over

=item *
The classic Dragon's book I<Compilers: Principles, Techniques, and Tools> 
by Alfred V. Aho, Ravi Sethi and
Jeffrey D. Ullman (Addison-Wesley 1986)

=back



=head1 AUTHOR
 
Casiano Rodriguez-Leon (casiano@ull.es)

=head1 ACKNOWLEDGMENTS

This work has been supported by CEE (FEDER) and the Spanish Ministry of
I<Educacion y Ciencia> through I<Plan Nacional I+D+I> number TIN2005-08818-C04-04
(ULL::OPLINK project L<http://www.oplink.ull.es/>). 
Support from Gobierno de Canarias was through GC02210601
(I<Grupos Consolidados>).
The University of La Laguna has also supported my work in many ways
and for many years.

A large percentage of  code is verbatim taken from L<Parse::Yapp> 1.05.
The author of L<Parse::Yapp> is Francois Desarmenien.
 
I wish to thank Francois Desarmenien for his L<Parse::Yapp> module, 
to my students at La Laguna and to the Perl Community. Special thanks to 
my family and Larry Wall.

=head1 LICENCE AND COPYRIGHT
 
Copyright (c) 2006-2008 Casiano Rodriguez-Leon (casiano@ull.es). All rights reserved.

Parse::Yapp copyright is of Francois Desarmenien, all rights reserved. 1998-2001
 
These modules are free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 



