line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Flowchart::Script; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
9123
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
1347
|
use Text::Flowchart::Script::Lexer; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use Text::Flowchart::Script::Parser; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
|
|
|
|
|
|
bless {}, $_[0]; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub parse { |
15
|
|
|
|
|
|
|
$_[0]->{src} = $_[1]; |
16
|
|
|
|
|
|
|
Feed $_[0]->{src}; |
17
|
|
|
|
|
|
|
my $parser = Text::Flowchart::Script::Parser->new(); |
18
|
|
|
|
|
|
|
$_[0]->{parsed} = $parser->YYParse(yylex => \&Lexer); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub render { |
22
|
|
|
|
|
|
|
my $output; |
23
|
|
|
|
|
|
|
eval $_[0]->{parsed}; |
24
|
|
|
|
|
|
|
die "Rendering error $@\n" if $@; |
25
|
|
|
|
|
|
|
$output; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub debug { $_[0]->{parsed}."\n" } |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |