Hyper::Developer::Generator::Control::ContainerFlow - Abstract Base class with code generation features
This document describes Hyper::Developer::Generator::Control::ContainerFlow 0.01
This class can handle two different Grammars. See pod of Hyper::Control::Flow for more details.
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();
# 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.
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
version
Hyper::Developer::Generator::Control
Class::Std
Parse::RecDescent
Hyper::Error
$Author: ac0v $
$Id: ContainerFlow.pm 333 2008-02-18 22:59:27Z ac0v $
$Revision: 333 $
$Date: 2008-02-18 23:59:27 +0100 (Mon, 18 Feb 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper-Developer/branches/0.07/lib/Hyper/Developer/Generator/Control/ContainerFlow.pm $
Andreas Specht <ACID@cpan.org>
<ACID@cpan.org>
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.
To install Hyper::Developer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hyper::Developer
CPAN shell
perl -MCPAN -e shell install Hyper::Developer
For more information on module installation, please visit the detailed CPAN module installation guide.