You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/03/28 21:15:34 UTC
cvs commit: embperl/Embperl/Syntax ASP.pm Embperl.pm EmbperlBlocks.pm EmbperlHTML.pm HTML.pm Mail.pm SSI.pm Text.pm
richter 01/03/28 11:15:34
Modified: . Tag: Embperl2c README
Embperl Tag: Embperl2c Syntax.pm
Embperl/Syntax Tag: Embperl2c ASP.pm Embperl.pm
EmbperlBlocks.pm EmbperlHTML.pm HTML.pm Mail.pm
SSI.pm Text.pm
Log:
Embperl 2 - docs
Revision Changes Path
No revision
No revision
1.19.6.8 +5 -3 embperl/README
Index: README
===================================================================
RCS file: /home/cvs/embperl/README,v
retrieving revision 1.19.6.7
retrieving revision 1.19.6.8
diff -u -r1.19.6.7 -r1.19.6.8
--- README 2001/03/28 11:03:08 1.19.6.7
+++ README 2001/03/28 19:15:31 1.19.6.8
@@ -9,7 +9,7 @@
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-$Id: README,v 1.19.6.7 2001/03/28 11:03:08 richter Exp $
+$Id: README,v 1.19.6.8 2001/03/28 19:15:31 richter Exp $
### !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !!
@@ -139,7 +139,9 @@
to a email address
+---> See README.v2 for addtional features of Embperl 2.0 <---
+
COMPATIBILITY
=============
@@ -150,7 +152,7 @@
perl5.004_04
perl5.005_01/02/03
perl5.6.0
-apache_1.3.0 - apache_1.3.17
+apache_1.3.0 - apache_1.3.19
apache + mod_ssl
apache_ssl (Ben SSL)
Stronghold 2.2
@@ -161,7 +163,7 @@
perl5.004_04
perl5.005_xx
perl5.6.0
-apache_1.3.0 - apache_1.3.17
+apache_1.3.0 - apache_1.3.19
on Windows 95/98 with
No revision
No revision
1.1.4.31 +73 -29 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.4.30
retrieving revision 1.1.4.31
diff -u -r1.1.4.30 -r1.1.4.31
--- Syntax.pm 2001/03/28 12:58:22 1.1.4.30
+++ Syntax.pm 2001/03/28 19:15:31 1.1.4.31
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Syntax.pm,v 1.1.4.30 2001/03/28 12:58:22 richter Exp $
+# $Id: Syntax.pm,v 1.1.4.31 2001/03/28 19:15:31 richter Exp $
#
###################################################################################
@@ -446,31 +446,69 @@
=head1 Defining your own Syntax
-=head2 sub new
- my $class = shift ;
+If you want to define your own syntax, you have to derive a new class from
+one of the existing ones and extent it with new tags/functionality. The
+best thing is to take a look at the syntax classes that comes with Embperl.
+(inside the directory Embperl/Syntax/).
-=head2 sub AddToRoot
- my ($self, $elements) = @_ ;
+For example if you want to add new html tags, derive from I<HTML::Embperl::Syntax::HTML>,
+if you want to add new metacommands derive from I<HTML::Embperl::Syntax::EmbperlBlocks>.
-=head2 sub AddInitCode
-sub AddInitCode
+Some of the classes define addtionaly methods to easily add new tags. See the
+respective pod file, which methods are available for a certain class.
- {
- my ($self, $compiletimecode, $initcode, $termcode, $procinfo) = @_ ;
+I<HTML::Embperl::Syntax> defines the basic methods to create a syntax:
-=head2 sub GetRoot
+=head1 Methods
-=head2 sub GetSyntax
- my ($name, $oldname) = @_ ;
+=head2 HTML::Embperl::Syntax -> new / $self -> new
+Create a new syntax class. This method should only be called inside a constructor
+of a derived class.
-=head2 sub CloneHash
- {
- my ($self, $old, $replace) = @_ ;
+=head2 $self -> AddToRoot ($elements)
+
+This adds a new element to the root of the parser tree. C<$elements> must be a
+hashref. See I<HTML::Embperl::Syntax::ASP> for an example.
+
+=head2 $self -> AddInitCode ($compiletimecode, $initcode, $termcode, $procinfo)
+
+This gives you the possibility to add some Perl code, that is always executed
+at the beginning of a document (C<$initcode>), at the end of the document
+(C<$termcode>) or at compile time (C<$compiletimecode>). The three strings must
+be valid Perl code. See I<HTML::Embperl::Syntax::SSI> for an example. C<$procinfo>
+is a hashref that can consits of addtional processor infos (see below) for the
+document.
+
+=head2 $self -> GetRoot
-=head1 Parameter
+Returns the root of the parser tree.
+=head2 HTML::Embperl::Syntax::GetSyntax ($name, $oldname)
+
+Returns a syntax object which is build form the syntaxes named
+in C<$name>. If C<$oldname> is given, C<$name> can start with a C<+> or C<->
+to add or subtract a syntax. This is normaly only needed by Embperl itself
+or to implement a syntax switch statement (see I<HTML::Embperl::Syntax::SSI>
+for an example.)
+
+
+=head2 $self -> CloneHash ($old, $replace)
+
+Clones a hash which is given as hashref in C<$old>, optional replace the tags
+given in the hashref C<$replace> and return a hashref to the new hash.
+
+
+
+=head1 Syntax Structure and Parameter
+
+Internaly the syntax object builds a data structure which serve as base for
+the parser. This structure consists of a list of tokens and options, which starts
+with a dash:
+
+=head2 Tokens
+
=over 4
=item '-lsearch' => 1
@@ -478,16 +516,18 @@
Do an linear serach instead of a binary search. This is necessary if the
tokens can't clearly separated.
-=item <name> => \%token
+=item <name> => \%tokendescription
All items which does not start with a slash are treated as names. The name
-of a token is only descriptiv and is used in error messages. The item must
+of a token is only descriptive and is used in error messages. The item must
contain a hashref which describes the token.
=back
=head2 Tokendescription
+Each token can have the following members:
+
=over 4
=item 'text' => '<'
@@ -517,15 +557,16 @@
=item 'endtag'
-Name of the tag that marks the end of a block.
+Name of the tag that marks the end of a block. This is used by the parser
+to track correct nesting.
-=item 'follow' => \%HtmlTags
+=item 'follow' => \%tokenlist
Hashref that specifices one or more tokens that must follow this token.
-=item 'inside' => \%Cmds
+=item 'inside' => \%tokenlist
-Hashref that specifices one or moer tokens that could occur inside
+Hashref that specifices one or more tokens that could occur inside
a node that is started with this token.
=item 'procinfo' =>
@@ -534,19 +575,22 @@
=back
-=head2 Processor info for Embperl
+=head2 Processor info
- embperl => {
- perlcode => '%#0%;',
- removenode => 1,
- },
+The processor info gives information how to compile this token to valid
+code that can be executed later on by the processor. There could be
+informations for multiple processors. At the moment only the I<embperl>
+processor is defined. Normaly you must not worry about different
+processor, because the syntax object knows inside that all procinfo is
+for the I<embperl> processor. I<procinfo> is a parameter to many methods,
+it is a hashref and can take the following items:
=over 4
=item perlcode => <string> or <arrayref>
-Code to generate. You can also specify a arrayref of string.
+Code to generate. You can also specify a arrayref of strings.
The first string which contains matching attributes are used.
The following special strings are replaced:
@@ -592,7 +636,7 @@
Sets the current node Index, if not already done
-=item %$q+%
+=item %$q%
Index of source Dom Tree
No revision
No revision
1.1.2.2 +5 -1 embperl/Embperl/Syntax/Attic/ASP.pm
Index: ASP.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/ASP.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- ASP.pm 2001/03/27 19:07:55 1.1.2.1
+++ ASP.pm 2001/03/28 19:15:32 1.1.2.2
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: ASP.pm,v 1.1.2.1 2001/03/27 19:07:55 richter Exp $
+# $Id: ASP.pm,v 1.1.2.2 2001/03/28 19:15:32 richter Exp $
#
###################################################################################
@@ -165,4 +165,8 @@
=head1 Author
Gerald Richter <ri...@dev.ecos.de>
+
+=head1 See Also
+
+HTML::Embperl::Syntax
1.1.2.4 +26 -1 embperl/Embperl/Syntax/Attic/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/Embperl.pm,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Embperl.pm 2001/03/17 22:20:52 1.1.2.3
+++ Embperl.pm 2001/03/28 19:15:32 1.1.2.4
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.1.2.3 2001/03/17 22:20:52 richter Exp $
+# $Id: Embperl.pm,v 1.1.2.4 2001/03/28 19:15:32 richter Exp $
#
###################################################################################
@@ -50,3 +50,28 @@
1 ;
+__END__
+
+=pod
+
+=head1 NAME
+
+Embperl syntax module for Embperl.
+
+=head1 SYNOPSIS
+
+[$ syntax Embperl $]
+
+=head1 DESCRIPTION
+
+This module provides the default syntax for Embperl and include all defintions
+from EmbperlHTML and EmbperlBlocks.
+
+=head1 Author
+
+Gerald Richter <ri...@dev.ecos.de>
+
+=head1 See Also
+
+HTML::Embperl::Syntax, HTML::Embperl::Syntax::EmbperlHTML, HTML::Embperl::Syntax::EmbperlBlocks
+
1.1.2.11 +27 -3 embperl/Embperl/Syntax/Attic/EmbperlBlocks.pm
Index: EmbperlBlocks.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/EmbperlBlocks.pm,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -r1.1.2.10 -r1.1.2.11
--- EmbperlBlocks.pm 2001/03/23 09:28:14 1.1.2.10
+++ EmbperlBlocks.pm 2001/03/28 19:15:32 1.1.2.11
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlBlocks.pm,v 1.1.2.10 2001/03/23 09:28:14 richter Exp $
+# $Id: EmbperlBlocks.pm,v 1.1.2.11 2001/03/28 19:15:32 richter Exp $
#
###################################################################################
@@ -486,20 +486,44 @@
HTML::Embperl::Syntax::EmbperlBlocks
+=head1 SYNOPSIS
+
+
=head1 DESCRIPTION
Class derived from HTML::Embperl::Syntax to define the syntax for
Embperl Blocks and metacommands.
-=head1 SYNOPSIS
+=head1 Methods
+
+I<HTML::Embperl::Syntax::EmbperlBlocks> defines the following methods:
+
+=head2 HTML::Embperl::Syntax::EmbperlBlocks -> new / $self -> new
-=head2 new
+Create a new syntax class. This method should only be called inside a constructor
+of a derived class.
+
=head2 AddMetaCmd ($cmdname, $procinfo)
+Add a new metacommand with name C<$cmdname> and use processor info from
+C<$procinfo>. See I<HTML::Embperl::Syntax> for a definition of procinfo.
+
=head2 AddMetaCmdWithEnd ($cmdname, $endname, $procinfo)
+Add a new metacommand with name C<$cmdname> and use processor info from
+C<$procinfo>. Addtionaly specify that a matching C<$endname> metacommand
+must be found to end the block, that is started by this metacommand.
+See I<HTML::Embperl::Syntax> for a definition of procinfo.
+
=head2 AddMetaCmdBlock ($cmdname, $endname, $procinfostart, $procinfoend)
+
+Add a new metacommand with name C<$cmdname> and and a second metacommand
+C<$endname> which ends the block that is started by C<$cmdname>.
+Use processor info from C<$procinfo>.
+See I<HTML::Embperl::Syntax> for a definition of procinfo.
+
+
=head1 Author
1.1.2.5 +33 -1 embperl/Embperl/Syntax/Attic/EmbperlHTML.pm
Index: EmbperlHTML.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/EmbperlHTML.pm,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- EmbperlHTML.pm 2001/03/26 10:29:18 1.1.2.4
+++ EmbperlHTML.pm 2001/03/28 19:15:32 1.1.2.5
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlHTML.pm,v 1.1.2.4 2001/03/26 10:29:18 richter Exp $
+# $Id: EmbperlHTML.pm,v 1.1.2.5 2001/03/28 19:15:32 richter Exp $
#
###################################################################################
@@ -149,3 +149,35 @@
1;
+
+
+
+__END__
+
+=pod
+
+=head1 NAME
+
+HTML::Embperl::Syntax::EmbperlHTML
+
+=head1 SYNOPSIS
+
+
+=head1 DESCRIPTION
+
+Class derived from HTML::Embperl::Syntax::HTML to define the syntax for
+HTML tags that Embperl processes.
+
+=head1 Methods
+
+I<HTML::Embperl::Syntax::EmbperlHTML> does not defines any methods.
+
+=head1 Author
+
+G. Richter (richter@dev.ecos.de)
+
+=head1 See Also
+
+HTML::Embperl::Syntax, HTML::Embperl::Syntax::HTML
+
+
1.1.2.10 +52 -4 embperl/Embperl/Syntax/Attic/HTML.pm
Index: HTML.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/HTML.pm,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -r1.1.2.9 -r1.1.2.10
--- HTML.pm 2001/03/22 09:04:52 1.1.2.9
+++ HTML.pm 2001/03/28 19:15:32 1.1.2.10
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: HTML.pm,v 1.1.2.9 2001/03/22 09:04:52 richter Exp $
+# $Id: HTML.pm,v 1.1.2.10 2001/03/28 19:15:32 richter Exp $
#
###################################################################################
@@ -285,21 +285,69 @@
HTML::Embperl::Syntax::HTML
+=head1 SYNOPSIS
+
+
=head1 DESCRIPTION
-Class derived from HTML::Embperl::Syntax to define the syntax for HTML
+Class derived from HTML::Embperl::Syntax to define the syntax for HTML.
+This class does not add functionalty of it own, it just provides
+methods add definitions for derived classes to implement their own
+tags.
-=head1 SYNOPSIS
+=head1 Methods
+
+I<HTML::Embperl::Syntax::HTML> defines the following methods:
+
+=head2 HTML::Embperl::Syntax::HTML -> new / $self -> new
-=head2 new
+Create a new syntax class. This method should only be called inside a constructor
+of a derived class.
=head2 AddTag ($tagname, $attrs, $attrsurl, $attrsnoval, $procinfo)
+Add a new HTML tag.
+
+=over 4
+
+=item $tagname
+
+Name of the HTML tag
+
+=item $attrs
+
+List of attributes that should be parsed out.
+
+=item $attrsurl
+
+List of attributes that should be parsed out. Any output inside the attribute value
+is url escaped.
+
+=item $attrsnoval
+
+List of attributes that should be parsed out and doesn't contain a value.
+
+=item $procinfo
+
+Processor info. See I<HTML::Embperl::Syntax> for a definition of procinfo.
+
+=back
+
=head2 AddComment ($tagname, $attrs, $attrsurl, $attrsnoval, $procinfo)
+Add a new HTML comment. Parameters are the same as for C<AddTag>.
+
=head2 AddTagBlock ($tagname, $attrs, $attrsurl, $attrsnoval, $procinfo)
+Add a new HTML tag with start and end tag (e.g. <table> and </table>).
+Parameters are the same as for C<AddTag>.
+
=head2 AddTagWithStart ($tagname, $startname, $attrs, $attrsurl, $attrsnoval, $procinfo)
+
+Add a new HTML tag which is an endtag for another tag. In opposite to C<AddTagBlock> the
+end tag can, but need not exists in the source.
+Parameters are the same as for C<AddTag>. Addtionaly the name of the starttag must be
+specified.
=head1 Author
1.1.2.3 +5 -1 embperl/Embperl/Syntax/Attic/Mail.pm
Index: Mail.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/Mail.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Mail.pm 2001/03/28 12:58:23 1.1.2.2
+++ Mail.pm 2001/03/28 19:15:33 1.1.2.3
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Mail.pm,v 1.1.2.2 2001/03/28 12:58:23 richter Exp $
+# $Id: Mail.pm,v 1.1.2.3 2001/03/28 19:15:33 richter Exp $
#
###################################################################################
@@ -171,4 +171,8 @@
=head1 Author
Gerald Richter <ri...@dev.ecos.de>
+
+=head1 See Also
+
+HTML::Embperl::Syntax, HTML::Embperl::Syntax::HTML
1.1.2.10 +18 -1 embperl/Embperl/Syntax/Attic/SSI.pm
Index: SSI.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/SSI.pm,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -r1.1.2.9 -r1.1.2.10
--- SSI.pm 2001/03/27 19:07:56 1.1.2.9
+++ SSI.pm 2001/03/28 19:15:33 1.1.2.10
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: SSI.pm,v 1.1.2.9 2001/03/27 19:07:56 richter Exp $
+# $Id: SSI.pm,v 1.1.2.10 2001/03/28 19:15:33 richter Exp $
#
###################################################################################
@@ -397,6 +397,8 @@
=head1 SYNOPSIS
+ [$ syntax SSI $]
+
DATE_GMT: <!-- #echo var='DATE_GMT' -->
DATE_LOCAL: <!-- #echo var='DATE_LOCAL' -->
DOCUMENT_NAME: <!-- #echo var='DOCUMENT_NAME' -->
@@ -406,6 +408,9 @@
=head1 DESCRIPTION
+The module make Embperl understand the following SSI tags. See
+Apaches mod_include (or Apache::SSI) for a description, what they
+do.
=over 4
@@ -433,13 +438,25 @@
=item * endif
+=item * syntax
+
+The syntax SSI is non standard and is used to change the syntax once you are
+in SSI syntax. It looks like
+
+ <!--#syntax type="Embperl" -->
+
=back
+
=head1 Author
Gerald Richter <ri...@dev.ecos.de>
Some ideas and parts of the code are taken from Apache::SSI by Ken Williams.
+
+=head1 See Also
+
+HTML::Embperl::Syntax, HTML::Embperl::Syntax::HTML
=cut
1.1.2.2 +6 -2 embperl/Embperl/Syntax/Attic/Text.pm
Index: Text.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/Text.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- Text.pm 2001/03/17 22:20:52 1.1.2.1
+++ Text.pm 2001/03/28 19:15:33 1.1.2.2
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Text.pm,v 1.1.2.1 2001/03/17 22:20:52 richter Exp $
+# $Id: Text.pm,v 1.1.2.2 2001/03/28 19:15:33 richter Exp $
#
###################################################################################
@@ -68,11 +68,15 @@
=head1 DESCRIPTION
This syntax does simply literal pass the text thru. That's usefull if you
-want to include text, without any interpretation.
+want to include text, without any interpretation. (e.g. with EmbperlObject)
=head1 Author
Gerald Richter <ri...@dev.ecos.de>
+
+=head1 See Also
+
+HTML::Embperl::Syntax
=cut
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org