line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Anarres::Mud::Driver::Compiler; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2385
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
68
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
64
|
|
5
|
2
|
|
|
2
|
|
9
|
use vars qw($VERSION @ISA); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
110
|
|
6
|
2
|
|
|
2
|
|
8
|
use Carp qw(cluck confess); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
174
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require DynaLoader; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$VERSION = 0.10; |
11
|
|
|
|
|
|
|
@ISA = qw(DynaLoader); |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
614
|
use Anarres::Mud::Driver::Compiler::Type; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
94
|
|
14
|
2
|
|
|
2
|
|
1086
|
use Anarres::Mud::Driver::Compiler::Node; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
87
|
|
15
|
2
|
|
|
2
|
|
1476
|
use Anarres::Mud::Driver::Compiler::Dump; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
80
|
|
16
|
2
|
|
|
2
|
|
1618
|
use Anarres::Mud::Driver::Compiler::Check; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
102
|
|
17
|
2
|
|
|
2
|
|
1560
|
use Anarres::Mud::Driver::Compiler::Generate; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
529
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
bootstrap Anarres::Mud::Driver::Compiler; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub compile { |
22
|
0
|
|
|
0
|
0
|
|
my ($self, $path) = @_; |
23
|
0
|
|
|
|
|
|
my $program = new Anarres::Mud::Driver::Program( |
24
|
|
|
|
|
|
|
Path => $path, |
25
|
|
|
|
|
|
|
); |
26
|
0
|
|
|
|
|
|
my $data; |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
|
|
|
local $/ = undef; |
|
0
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
local *FH; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
open(FH, "<$path") or die "Compiler: Cannot open file $path"; |
32
|
0
|
|
|
|
|
|
$data = ; |
33
|
0
|
|
|
|
|
|
close(FH); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
0
|
|
|
local $SIG{__WARN__} = sub { cluck @_; }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
|
|
local $SIG{__DIE__} = sub { confess @_; }; |
|
0
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
$self->parse($program, $data); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return $program |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |