| 1 | #=============================================== | ||||||||||||||||||||||||
| 2 | package XML::Pastor; | ||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||
| 4 | 10 | ▶ | use utf8; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 5 | 10 | ▶ | use strict; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 6 | 10 | ▶ | use warnings; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 7 | 10 | ▶ | no warnings qw(uninitialized); | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||
| 9 | 10 | require 5.008; | |||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||
| 12 | 10 | ▶ | use XML::Pastor::Builtin; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 13 | 10 | ▶ | use XML::Pastor::ComplexType; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 14 | 10 | ▶ | use XML::Pastor::Element; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 15 | 10 | ▶ | use XML::Pastor::Generator; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 16 | 10 | ▶ | use XML::Pastor::Meta; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 17 | 10 | ▶ | use XML::Pastor::NodeArray; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 18 | 10 | ▶ | use XML::Pastor::Schema; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 19 | 10 | ▶ | use XML::Pastor::SimpleType; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 20 | 10 | ▶ | use XML::Pastor::Stack; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 21 | 10 | ▶ | use XML::Pastor::Util; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||
| 24 | 10 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 25 | 10 | $VERSION = '1.0.4'; | |||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||
| 27 | #------------------------------------------------------------ | ||||||||||||||||||||||||
| 28 | 9 | ▶ | sub new { | ||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||||||||||||||||
| 29 | 9 | my $proto = shift; | |||||||||||||||||||||||
| 30 | 9 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||||||
| 31 | 9 | my $self = {@_}; | |||||||||||||||||||||||
| 32 | 9 | return bless $self, $class; | |||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||
| 35 | #-------------------------------------------------------- | ||||||||||||||||||||||||
| 36 | 25 | ▶ | sub version { | ||||||||||||||||||||||
|
Subroutine
version: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 37 | 25 | return $XML::Pastor::VERSION; | |||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||
| 40 | #-------------------------------------------------------- | ||||||||||||||||||||||||
| 41 | 9 | ▶ | sub generate { | ||||||||||||||||||||||
|
Subroutine
generate: called CC=6 SCAR=18.9
Pod
documented
| |||||||||||||||||||||||||
| 42 | 9 | my $self = shift; | |||||||||||||||||||||||
| 43 | 9 | my $args = {@_}; | |||||||||||||||||||||||
| 44 | 9 | ▶ | my $verbose = $args->{verbose} || $self->{verbose} || 0; | ||||||||||||||||||||||
|
Condition40%2/5
$args->{'verbose'} || $self->{'verbose'} || 0
$args->{"verbose"} or $self->{"verbose"}
MC/DC0%0/2
$args->{'verbose'} || $self->{'verbose'} || 0
$args->{"verbose"}
$self->{"verbose"}
Truth table33%1/3
A or B
A= $args->{"verbose"}B= $self->{"verbose"}
| |||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||
| 46 | 9 | my $parser =XML::Pastor::Schema::Parser->new(verbose => $verbose); | |||||||||||||||||||||||
| 47 | 9 | my $model = $parser->parse(@_, verbose=>$verbose); | |||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||
| 49 | 9 | ▶ | print STDERR "\n========= AFTER PARSE =============\n". $model->dump() . "\n\n" if ($verbose >= 8); | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||
| 51 | 9 | $model->resolve(@_, verbose=>$verbose); | |||||||||||||||||||||||
| 52 | 9 | ▶ | print STDERR "\n========= AFTER RESOLVE =============\n". $model->dump() . "\n\n" if ($verbose >= 8); | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||
| 54 | 9 | my $generator = XML::Pastor::Generator->new(verbose=>$verbose); | |||||||||||||||||||||||
| 55 | 9 | my $result = $generator->generate(@_, model=>$model, verbose=>$verbose); | |||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||
| 57 | 9 | ▶ | print STDERR "\n========= AFTER GENERATE =============\n". $model->dump() . "\n\n" if ($verbose >= 8); | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||
| 59 | 9 | return $result; | |||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||
| 62 | 10 | 1; | |||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||
| 64 | __END__ | ||||||||||||||||||||||||