line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lox::TokenType; |
2
|
2
|
|
|
2
|
|
62732
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
50
|
|
3
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
66
|
|
4
|
2
|
|
|
2
|
|
8
|
use Exporter 'import'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
375
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my @tokens = qw( |
7
|
|
|
|
|
|
|
LEFT_PAREN RIGHT_PAREN LEFT_BRACE RIGHT_BRACE |
8
|
|
|
|
|
|
|
COMMA DOT MINUS PLUS SEMICOLON SLASH STAR |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BANG BANG_EQUAL |
11
|
|
|
|
|
|
|
EQUAL EQUAL_EQUAL |
12
|
|
|
|
|
|
|
GREATER GREATER_EQUAL |
13
|
|
|
|
|
|
|
LESS LESS_EQUAL |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
IDENTIFIER STRING NUMBER |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
AND BREAK CLASS ELSE FALSE FUN FOR IF NIL OR |
18
|
|
|
|
|
|
|
PRINT RETURN SUPER THIS TRUE VAR WHILE |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
ERROR |
21
|
|
|
|
|
|
|
EOF |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my %token_values = map { $tokens[$_] => $_ } 0..$#tokens; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
require constant; |
27
|
|
|
|
|
|
|
constant->import(\%token_values); |
28
|
|
|
|
|
|
|
our @EXPORT = (@tokens, 'type'); |
29
|
|
|
|
|
|
|
our $VERSION = 0.02; |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
0
|
566
|
sub type { $tokens[shift] } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |