NAME

Hyper::Developer::Generator::Control::ContainerFlow - Abstract Base class with code generation features

VERSION

This document describes Hyper::Developer::Generator::Control::ContainerFlow 0.01

DESCRIPTION

This class can handle two different Grammars. See pod of Hyper::Control::Flow for more details.

Action grammar

The abstract action grammar in something like BNF notation looks like this. Comments are perl style.

# lines have (optionsl) ; ends
<line> ::= <line_content> ";"

# line contains one of
<line_content> ::= <@identifier> "=" <constant>     #  a.b.c = "Foo";
   | <@identifier>=<@identifier>                    #  a.b.c = a;
   | <method>                                       #  a.b = a.method();

# id trees may be used with . (like hashref trees in TT or HTC)
<@identifier> ::= <identifier> ( "." <identifier>)*

# single ids are alphanumeric
<identifier> ::= /\b[A-z0-9_]+\b/

# constants start with ', " or numbers
constant ::= ['"0-9].*

# methods are suffixed with ()
<method> ::= <@identifier> "()"

Examples:

# <@identifier> = <@identifier>
cSelectPerson.mRole = mInitiatorRole;
cSelectPerson = mInitiatorData.mInitiator;

# <@identifier> = <constant>
cSelectPerson.mRole = 'Superuser';
cSelectPerson.mRole = "Superuser";
cSelectPerson.mRole = 42;

# method
this.testMethod();
testMethod();

Condition grammar

# lines consist of one expression or an operand
<line>     ::= <expr>          # 1 < 2 || 1 > 2
               | <operand>     # test()

# expressions consist of operand, cmp operator, operand, and optionally
# a logical operator and another exception
<expr>     :== <operand> <cmpop> <operand> (<logop> <expr>)?

# operands are either a constant, a method or an identifier
<operand>  :==  <constant>
               | <method>
               | <identifier>

# methods end with ()
<method>   :== <@identifier> "()"

# id trees may be used with . (like hashref trees in TT or HTC)
<@identifier> ::= <identifier> ( "." <identifier>)*

# single ids are alphanumeric, but must start with a character
<identifier> ::= /\b[A-z][A-z0-9_]+\b/

# compare operators are eq, ne, ==, !=
<cmpop>    :== 'eq' | 'ne' | '==' | '!='

# Logical operators are || && or and
<logop>    :==  '||' | '&&' | 'or' | 'and'

Operator precedence is standard perl.

Examples:

mGroovyMovie.mOscar eq 'true'
mGroovyMovie.mOscar ne 'grrzwrrz("drrrz")'
mGroovyMovie.mOscar == 123
mGroovyMovie.mOscar != 10e30

mGroovyMovie.mOscar == 1 && mGroovyMovie.mHimbeere == 30

mGroovyMovie.mOscar == Get_Value() || mHimbeere == mOscar.himbeere.value()
mGroovyMovie.mOscar == mGroovyMovie.mHimbeere

SUBROUTINES/METHODS

####

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

DEPENDENCIES

  • version

  • Hyper::Developer::Generator::Control

  • Class::Std

  • Parse::RecDescent

  • Hyper::Error

INCOMPATIBILITIES

BUGS AND LIMITATIONS

RCS INFORMATIONS

Last changed by

$Author: ac0v $

Id

$Id: ContainerFlow.pm 333 2008-02-18 22:59:27Z ac0v $

Revision

$Revision: 333 $

Date

$Date: 2008-02-18 23:59:27 +0100 (Mon, 18 Feb 2008) $

HeadURL

$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper-Developer/branches/0.07/lib/Hyper/Developer/Generator/Control/ContainerFlow.pm $

AUTHOR

Andreas Specht <ACID@cpan.org>

LICENSE AND COPYRIGHT

Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.