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

PerlBean::Style - contains PerlBean code style information

SYNOPSIS

 TODO

ABSTRACT

PerlBean code style information

DESCRIPTION

PerlBean::Style class for code generation style

EXPORT

By default nothing is exported.

codegen

This tag contains variables usefull for the actual code generation. You should not need to use this tag.

$AN2MBF

The value which would be obtained through the singleton object's get_attribute_name_to_method_base_filter() method.

$MOF

The value which would be obtained through the singleton object's get_method_operation_filter() method.

$IND

The value which would be obtained through the singleton object's get_indent() method.

$AC

The value which would be obtained through the singleton object's get_str_after_comma() method.

$ACS

The value which would be obtained through the singleton object's get_str_around_complex_subscripts() method.

$AO

The value which would be obtained through the singleton object's get_str_around_operators() method.

$BCP

The value which would be obtained through the singleton object's get_str_between_conditional_and_parenthesis() method.

$BFP

The value which would be obtained through the singleton object's get_str_between_function_and_parenthesis() method.

@PBCC

The values which would be obtained through the singleton object's get_str_post_block_close_curl() method and the replacement of __IND_BLOCK__ with the correct indentation. The ARRAY's index is the level of indentation. 10(!) levels of indentation are available.

@PBOC

The values which would be obtained through the singleton object's get_str_pre_block_open_curl() method and the replacement of __IND_BLOCK__ with the correct indentation. The ARRAY's index is the level of indentation. 10(!) levels of indentation are available.

CONSTRUCTOR

new( [ OPT_HASH_REF ] )

Creates a new PerlBean::Style object. OPT_HASH_REF is a hash reference used to pass initialization options. On error an exception Error::Simple is thrown.

Options for OPT_HASH_REF may include:

attribute_name_to_method_base_filter

Passed to set_attribute_name_to_method_base_filter(). Defaults to \&default_attribute_name_to_method_base_filter.

indent

Passed to set_indent(). Defaults to ' '.

method_operation_filter

Passed to set_method_operation_filter(). Defaults to \&default_method_operation_filter.

str_after_comma

Passed to set_str_after_comma(). Defaults to ' '.

str_around_complex_subscripts

Passed to set_str_around_complex_subscripts(). Defaults to ' '.

str_around_operators

Passed to set_str_around_operators(). Defaults to ' '.

str_between_conditional_and_parenthesis

Passed to set_str_between_conditional_and_parenthesis(). Defaults to ' '.

str_between_function_and_parenthesis

Passed to set_str_between_function_and_parenthesis(). Defaults to ''.

str_post_block_close_curl

Passed to set_str_post_block_close_curl(). Defaults to "\n__IND_BLOCK__".

str_pre_block_open_curl

Passed to set_str_pre_block_open_curl(). Defaults to ' '.

METHODS

default_attribute_name_to_method_base_filter(ATTRIBUTE)

Class method. Default attribute name to method filter. ATTRIBUTE is the attribute name. This method adds a _ character to ATTRIBUTE and returns it.

default_method_operation_filter(OPERATION)

Class method. Default method operation filter. OPERATION is the operation name. This method plainly returns the OPERATION.

instance([OPT_HASH_REF])

Always returns the same PerlBean::Style -singleton- object instance. The forst time it is called, parameter OPT_HASH_REF -if specified- is passed to the constructor.

set_attribute_name_to_method_base_filter(VALUE)

Set the subroutine that converts an attribute name to the method base. VALUE is the value. Default value at initialization is \&default_attribute_name_to_method_base_filter. On error an exception Error::Simple is thrown.

VALUE must be a reference of:
CODE
get_attribute_name_to_method_base_filter()

Returns the subroutine that converts an attribute name to the method base.

set_indent(VALUE)

Set the string used for ONE indentation. VALUE is the value. Default value at initialization is ' '. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_indent()

Returns the string used for ONE indentation.

set_method_operation_filter(VALUE)

Set the subroutine that formats the method operation. VALUE is the value. Default value at initialization is \&default_method_operation_filter. On error an exception Error::Simple is thrown.

VALUE must be a reference of:
CODE
get_method_operation_filter()

Returns the subroutine that formats the method operation.

set_str_after_comma(VALUE)

Set the string after each comma. VALUE is the value. Default value at initialization is ' '. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_after_comma()

Returns the string after each comma.

set_str_around_complex_subscripts(VALUE)

Set the string around "complex" subscripts(inside brackets). VALUE is the value. Default value at initialization is ' '. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_around_complex_subscripts()

Returns the string around "complex" subscripts(inside brackets).

set_str_around_operators(VALUE)

Set the string around most operators. VALUE is the value. Default value at initialization is ' '. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_around_operators()

Returns the string around most operators.

set_str_between_conditional_and_parenthesis(VALUE)

Set the string between condiftionals (for, if, while...) and parenthesis. VALUE is the value. Default value at initialization is ' '. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_between_conditional_and_parenthesis()

Returns the string between condiftionals (for, if, while...) and parenthesis.

set_str_between_function_and_parenthesis(VALUE)

Set the string between function name and its opening parenthesis. VALUE is the value. Default value at initialization is ''. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_between_function_and_parenthesis()

Returns the string between function name and its opening parenthesis.

set_str_post_block_close_curl(VALUE)

Set the string printed after the closing curly of a multi-line BLOCK. Any string __IND_BLOCK__ in the value is replaced with the correct block indentation. VALUE is the value. Default value at initialization is "\n__IND_BLOCK__". On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_post_block_close_curl()

Returns the string printed after the closing curly of a multi-line BLOCK. Any string __IND_BLOCK__ in the value is replaced with the correct block indentation.

set_str_pre_block_open_curl(VALUE)

Set the string printed before the opening curly of a multi-line BLOCK. Any string __IND_BLOCK__ in the value is replaced with the correct block indentation. VALUE is the value. Default value at initialization is ' '. On error an exception Error::Simple is thrown.

VALUE must match regular expression:
.*
get_str_pre_block_open_curl()

Returns the string printed before the opening curly of a multi-line BLOCK. Any string __IND_BLOCK__ in the value is replaced with the correct block indentation.

SEE ALSO

PerlBean, PerlBean::Attribute, PerlBean::Attribute::Boolean, PerlBean::Attribute::Factory, PerlBean::Attribute::Multi, PerlBean::Attribute::Multi::Ordered, PerlBean::Attribute::Multi::Unique, PerlBean::Attribute::Multi::Unique::Associative, PerlBean::Attribute::Multi::Unique::Associative::MethodKey, PerlBean::Attribute::Multi::Unique::Ordered, PerlBean::Attribute::Single, PerlBean::Collection, PerlBean::Method, PerlBean::Method::Constructor

BUGS

None known (yet.)

HISTORY

First development: January 2003

AUTHOR

Vincenzo Zocca

COPYRIGHT

Copyright 2003 by Vincenzo Zocca

LICENSE

This file is part of the PerlBean module hierarchy for Perl by Vincenzo Zocca.

The PerlBean module hierarchy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

The PerlBean module hierarchy 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. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the PerlBean module hierarchy; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA