line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Compiler::Lexer::Token; |
2
|
19
|
|
|
19
|
|
129
|
use strict; |
|
19
|
|
|
|
|
37
|
|
|
19
|
|
|
|
|
678
|
|
3
|
19
|
|
|
19
|
|
96
|
use warnings; |
|
19
|
|
|
|
|
38
|
|
|
19
|
|
|
|
|
930
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my $FIELDS = [qw/ |
6
|
|
|
|
|
|
|
stype |
7
|
|
|
|
|
|
|
type |
8
|
|
|
|
|
|
|
kind |
9
|
|
|
|
|
|
|
line |
10
|
|
|
|
|
|
|
name |
11
|
|
|
|
|
|
|
data |
12
|
|
|
|
|
|
|
has_warnings |
13
|
|
|
|
|
|
|
/]; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
{ |
16
|
19
|
|
|
19
|
|
117
|
no strict 'refs'; |
|
19
|
|
|
|
|
42
|
|
|
19
|
|
|
|
|
2458
|
|
17
|
|
|
|
|
|
|
foreach my $field (@$FIELDS) { |
18
|
|
|
|
|
|
|
*{__PACKAGE__ . '::' . $field} = sub { |
19
|
56
|
|
|
56
|
|
387
|
my ($self, $value) = @_; |
20
|
56
|
50
|
|
|
|
234
|
return $self->{$field} unless defined $value; |
21
|
0
|
|
|
|
|
|
$self->{$field} = $value; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding utf-8 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=for stopwords stype |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Compiler::Lexer::Token |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Compiler::Lexer::Token includes the following members. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=over |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item stype |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
constant of Compiler::Lexer::SyntaxType |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item type |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
constant of Compiler::Lexer::TokenType |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item kind |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
constant of Compiler::Lexer::Kind |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item name |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
name of Compiler::Lexer::TokenType |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item data |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
raw data |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item has_warnings |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
flag of whether unknown keyword or not |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 METHODS |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
support simple get/set accessors like Class::Accessor::Fast |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
example: |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
my $type = $token->type; # get accessor |
76
|
|
|
|
|
|
|
$token->type(Compiler::Lexer::TokenType::T_RegExp); # set accessor |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 AUTHOR |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Masaaki Goshima (goccy) E<lt>goccy(at)cpan.orgE<gt> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Copyright (c) 2013, Masaaki Goshima (goccy). All rights reserved. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
87
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |