Embperl::Syntax::MsgIdExtract - Embperl::Syntax::MsgIdExtract documentation


Embperl documentation Contained in the Embperl distribution.

Index


Code Index:

NAME

Top

Embperl::Syntax::MsgIdExtract

SYNOPSIS

Top

DESCRIPTION

Top

Class derived from Embperl::Syntax to define the syntax for the internationalisation using "[= =]" Embperl blocks and metacommands.

See Embperl, section I18N for details.

Methods

Top

Embperl::Syntax::MsgIdExtract defines the following methods:

Embperl::Syntax::MsgIdExtract -> new / $self -> new

Create a new syntax class. This method should only be called inside a constructor of a derived class.

AddMetaCmd ($cmdname, $procinfo)

Add a new metacommand with name $cmdname and use processor info from $procinfo. See Embperl::Syntax for a definition of procinfo.

AddMetaCmdWithEnd ($cmdname, $endname, $procinfo)

Add a new metacommand with name $cmdname and use processor info from $procinfo. Addtionaly specify that a matching $endname metacommand must be found to end the block, that is started by this metacommand. See Embperl::Syntax for a definition of procinfo.

AddMetaCmdBlock ($cmdname, $endname, $procinfostart, $procinfoend)

Add a new metacommand with name $cmdname and and a second metacommand $endname which ends the block that is started by $cmdname. Use processor info from $procinfo. See Embperl::Syntax for a definition of procinfo.

Author

Top

G. Richter (richter@dev.ecos.de)

See Also

Top

Embperl::Syntax


Embperl documentation Contained in the Embperl distribution.

###################################################################################
#
#   Embperl - Copyright (c) 1997-2010 Gerald Richter / ECOS
#
#   You may distribute under the terms of either the GNU General Public
#   License or the Artistic License, as specified in the Perl README file.
#
#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#   $Id: MsgIdExtract.pm 355574 2005-12-09 18:15:54Z richter $
#
###################################################################################
 


package Embperl::Syntax::MsgIdExtract ;

use Embperl::Syntax (':types') ;

use strict ;
use vars qw{@ISA %Blocks %BlocksOutput %BlocksOutputLink} ;



@ISA = qw(Embperl::Syntax) ;


###################################################################################
#
#   Methods
#
###################################################################################

# ---------------------------------------------------------------------------------
#
#   Create new Syntax Object
#
# ---------------------------------------------------------------------------------

sub new

    {
    my $self = shift ;

    $self = Embperl::Syntax::new ($self) ;

    if (!$self -> {-epbMsgIdExtract})
        {
        $self -> {-epbMsgIdExtract}     = $self -> CloneHash (\%Blocks) ;

        $self -> AddToRoot ($self -> {-epbMsgIdExtract}) ;
        }

    return $self ;
    }



%Blocks = (
    '-lsearch' => 1,
    'Embperl command escape' => {
        'text' => '[[',
        'nodename' => '[',
        'nodetype' => ntypCDATA,
        },
     'Embperl comment' => {
        'text' => '[#',
        'end'  => '#]',
#        'inside' => \%MetaComment,
        'procinfo' => {
            embperl => { 
                compilechilds => 0,
                removenode  => 3, 
                },
            },
        },
     'Embperl output msg id' => {
        'text' => '[=',
        'end'  => '=]',
        'unescape' => 1,
        removespaces  => 72,
        'procinfo' => {
            embperl => { 
                    perlcode => 
                        [
                        '$Embperl::Syntax::MsgIdExtract::Ids{%#\'0%} = q{} if (!exists ($Embperl::Syntax::MsgIdExtract::Ids{%#\'0%})) ;', 
			],
                    removenode    => 4,
                    compilechilds => 0,
                    }
            },
        },
     'Embperl output msg id gettext' => {
        'text' => 'gettext',
        'end'  => ')',
        'unescape' => 1,
        follow  => {
            'bracktes' =>
                {
                'text' => '(',
                'end'  => ')',
                follow  => {
                    'Quote ""' => 
                        {
                        'text'   => '"',
                        'end'    => '"',
                        removespaces  => 72,
                        'procinfo' => {
                            embperl => { 
                                    perlcode => 
                                        [
                                        '$Embperl::Syntax::MsgIdExtract::Ids{%#\'0%} = q{} if (!exists ($Embperl::Syntax::MsgIdExtract::Ids{%#\'0%})) ;', 
			                ],
                                    removenode    => 4,
                                    compilechilds => 0,
                                    }
                            },
                        },
                    'Quote \'\'' => 
                        {
                        'text'   => '\'',
                        'end'    => '\'',
                        removespaces  => 72,
                        'procinfo' => {
                            embperl => { 
                                    perlcode => 
                                        [
                                        '$Embperl::Syntax::MsgIdExtract::Ids{%#\'0%} = q{} if (!exists ($Embperl::Syntax::MsgIdExtract::Ids{%#\'0%})) ;', 
			                ],
                                    removenode    => 4,
                                    compilechilds => 0,
                                    }
                            },
                        },
                    },
                },
            },
        },
      ) ;  
   

1;


__END__