~ubuntu-branches/ubuntu/trusty/librdf-trine-perl/trusty

« back to all changes in this revision

Viewing changes to lib/RDF/Trine/Parser/Turtle/Constants.pm

  • Committer: Package Import Robot
  • Author(s): Jonas Smedegaard, Jonas Smedegaard
  • Date: 2012-12-11 04:17:02 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20121211041702-tfqq2grzobwynjpm
Tags: 1.002-1
* New upstream release.
  Highlights:
  + Replaced old Turtle and TriG parsers with new streaming
    implementations.
  + Added RDF::Trine::Node::Literal->canonicalize method.
  + Updated RDF::Trine::Parser::Redland to construct a new parser
    object on each parse (avoiding a bug in redland).
  + Applied partial patch to 'fix interaction with
    HTML::Data::Parser'.
  + Added POD to RDF::Trine and RDF::Trine::Store::DBI.
  + Silenced undefined warnings in RDF::Trine::Parser::Turtle::Lexer.
  + Silenced warning of cartesian joins in
    RDF::Trine::Store::Hexastore.

[ Jonas Smedegaard ]
* Bump debhelper compatibility level to 8.
* Update package relations:
  + (Build-)depend on libmoose-perl and libmoosex-arrayref-perl.
  + Relax to build-depend unversioned on cdbs: Needed version
    satisfied in stable, and oldstable no longer supported.
* Update copyright file:
  + Expand Files section authored by Toby Inkster, and extend
    coverage.
  + Fix use comment and license pseudo-sections to obey silly
    restrictions of copyright format 1.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# RDF::Trine::Parser::Turtle::Constants
 
2
# -----------------------------------------------------------------------------
 
3
 
 
4
=head1 NAME
 
5
 
 
6
RDF::Trine::Parser::Turtle::Constants - Constant definitions for use in parsing Turtle, TriG, and N-Triples
 
7
 
 
8
=head1 VERSION
 
9
 
 
10
This document describes RDF::Trine::Parser::Turtle::Constants version 1.002
 
11
 
 
12
=head1 SYNOPSIS
 
13
 
 
14
 use RDF::Trine::Parser::Constants;
 
15
 
 
16
=head1 METHODS
 
17
 
 
18
=over 4
 
19
 
 
20
=cut
 
21
 
 
22
package RDF::Trine::Parser::Turtle::Constants;
 
23
 
 
24
use strict;
 
25
use warnings;
 
26
use 5.010;
 
27
 
 
28
our @EXPORT;
 
29
BEGIN {
 
30
        @EXPORT = qw(
 
31
                LBRACKET
 
32
                RBRACKET
 
33
                LPAREN
 
34
                RPAREN
 
35
                DOT
 
36
                SEMICOLON
 
37
                COMMA
 
38
                HATHAT
 
39
                A
 
40
                BOOLEAN
 
41
                PREFIXNAME
 
42
                IRI
 
43
                BNODE
 
44
                DOUBLE
 
45
                DECIMAL
 
46
                INTEGER
 
47
                WS
 
48
                COMMENT
 
49
                STRING3D
 
50
                STRING1D
 
51
                BASE
 
52
                PREFIX
 
53
                LANG
 
54
                LBRACE
 
55
                RBRACE
 
56
                EQUALS
 
57
                decrypt_constant
 
58
        )
 
59
};
 
60
use base 'Exporter';
 
61
 
 
62
{
 
63
        my %mapping;
 
64
        my %reverse;
 
65
        BEGIN {
 
66
                my $cx  = 0;
 
67
                foreach my $name (grep { $_ ne 'decrypt_constant' } @EXPORT) {
 
68
                        my $value       = ++$cx;
 
69
                        $reverse{ $value }      = $name;
 
70
                        $mapping{ $name }       = $value;
 
71
                }
 
72
        }
 
73
        use constant +{ %mapping };
 
74
 
 
75
=item C<< decrypt_constant ( $type ) >>
 
76
 
 
77
Returns the token name for the given toke type.
 
78
 
 
79
=cut
 
80
 
 
81
        sub decrypt_constant { my $num  = +shift; $reverse{$num} }
 
82
};
 
83
 
 
84
1;
 
85
 
 
86
__END__
 
87
 
 
88
=back
 
89
 
 
90
=head1 BUGS
 
91
 
 
92
Please report any bugs or feature requests to through the GitHub web interface
 
93
at L<https://github.com/kasei/perlrdf/issues>.
 
94
 
 
95
=head1 AUTHOR
 
96
 
 
97
Toby Inkster C<< <tobyink@cpan.org> >>
 
98
 
 
99
=head1 COPYRIGHT
 
100
 
 
101
Copyright (c) 2012 Toby Inkster. This
 
102
program is free software; you can redistribute it and/or modify it under
 
103
the same terms as Perl itself.
 
104
 
 
105
=cut