| 1 | # AtteanX::Parser::Turtle::Constants | ||
| 2 | # ----------------------------------------------------------------------------- | ||
| 3 | |||
| 4 | =head1 NAME | ||
| 5 | |||
| 6 | AtteanX::Parser::Turtle::Constants - Constant definitions for use in parsing Turtle, TriG, and N-Triples | ||
| 7 | |||
| 8 | =head1 VERSION | ||
| 9 | |||
| 10 | This document describes AtteanX::Parser::Turtle::Constants version 0.040 | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | use AtteanX::Parser::Turtle::Constants; | ||
| 15 | |||
| 16 | =head1 METHODS | ||
| 17 | |||
| 18 | =over 4 | ||
| 19 | |||
| 20 | =cut | ||
| 21 | |||
| 22 | 50 | package AtteanX::Parser::Turtle::Constants 0.040 { | |
| 23 | 50 | ▶ | use v5.14; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | 50 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | |||
| 26 | 50 | our @EXPORT; | |
| 27 | 50 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 28 | 50 | @EXPORT = qw( | |
| 29 | A | ||
| 30 | ANON | ||
| 31 | BASE | ||
| 32 | BNODE | ||
| 33 | BOOLEAN | ||
| 34 | COMMA | ||
| 35 | COMMENT | ||
| 36 | DECIMAL | ||
| 37 | DOT | ||
| 38 | DOUBLE | ||
| 39 | EQUALS | ||
| 40 | HATHAT | ||
| 41 | INTEGER | ||
| 42 | IRI | ||
| 43 | LANG | ||
| 44 | LBRACE | ||
| 45 | LBRACKET | ||
| 46 | LPAREN | ||
| 47 | GRAPH | ||
| 48 | PREFIX | ||
| 49 | PREFIXNAME | ||
| 50 | RBRACE | ||
| 51 | RBRACKET | ||
| 52 | RPAREN | ||
| 53 | SEMICOLON | ||
| 54 | STRING1D | ||
| 55 | STRING1S | ||
| 56 | STRING3D | ||
| 57 | STRING3S | ||
| 58 | TURTLEBASE | ||
| 59 | TURTLEPREFIX | ||
| 60 | TURTLEVERSION | ||
| 61 | GTGT | ||
| 62 | PGTGT | ||
| 63 | LTLT | ||
| 64 | LTLTP | ||
| 65 | LANNOT | ||
| 66 | RANNOT | ||
| 67 | TILDE | ||
| 68 | VERSION | ||
| 69 | WS | ||
| 70 | decrypt_constant | ||
| 71 | ) | ||
| 72 | }; | ||
| 73 | 50 | ▶ | use base 'Exporter'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 74 | |||
| 75 | { | ||
| 76 | 50 | my %mapping; | |
| 77 | 50 | my %reverse; | |
| 78 | 50 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=2 SCAR=6.9
| |||
| 79 | 50 | my $cx = 0; | |
| 80 | 50 | foreach my $name (grep { $_ ne 'decrypt_constant' } @EXPORT) { | |
| 81 | 2050 | my $value = ++$cx; | |
| 82 | 2050 | $reverse{ $value } = $name; | |
| 83 | 2050 | $mapping{ $name } = $value; | |
| 84 | } | ||
| 85 | } | ||
| 86 | 50 | ▶ | use constant +{ %mapping }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 87 | |||
| 88 | =item C<< decrypt_constant ( $type ) >> | ||
| 89 | |||
| 90 | Returns the token name for the given token type. | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | 875 | ▶ | sub decrypt_constant { my $num = +shift; $reverse{$num} } |
|
Subroutine
decrypt_constant: called CC=1 SCAR=0.0
Pod
documented
| |||
| 95 | } | ||
| 96 | 50 | } | |
| 97 | |||
| 98 | 50 | 1; | |
| 99 | |||
| 100 | __END__ | ||