1 package C4
::TmplTokenType
;
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
21 #use warnings; FIXME - Bug 2505
24 use vars
qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
26 ###############################################################################
30 C4::TmplTokenType.pm - Types of TmplToken objects
34 This is a Java-style "safe enum" singleton class for types of TmplToken objects.
35 The predefined constants are
39 ###############################################################################
41 $VERSION = 3.07.00.049;
56 ###############################################################################
58 use vars
qw( $_text $_text_parametrized $_cdata
59 $_tag $_decl $_pi $_directive $_comment $_null $_unknown );
63 my $this = 'C4::TmplTokenType';#shift;
64 my $class = ref($this) || $this;
67 ($self->{'id'}, $self->{'name'}, $self->{'desc'}) = @_;
70 $_text = &$new(0, 'TEXT');
71 $_text_parametrized = &$new(8, 'TEXT-PARAMETRIZED');
72 $_cdata = &$new(1, 'CDATA');
73 $_tag = &$new(2, 'TAG');
74 $_decl = &$new(3, 'DECL');
75 $_pi = &$new(4, 'PI');
76 $_directive = &$new(5, 'DIRECTIVE');
77 $_comment = &$new(6, 'COMMENT');
78 $_unknown = &$new(7, 'UNKNOWN');
83 return $this->{'name'}
86 sub TEXT () { $_text }
87 sub TEXT_PARAMETRIZED () { $_text_parametrized }
88 sub CDATA () { $_cdata }
90 sub DECL () { $_decl }
92 sub DIRECTIVE () { $_directive }
93 sub COMMENT () { $_comment }
94 sub UNKNOWN () { $_unknown }
96 ###############################################################################
102 normal text (#text in the DTD)
104 =item TEXT_PARAMETRIZED
106 parametrized normal text
107 (result of simple recognition of text interspersed with <TMPL_VAR> directives;
108 this has to be explicitly enabled in the scanner)
112 normal text (CDATA in the DTD)
116 something that has the form of an HTML tag
120 something that has the form of an SGML declaration
124 something that has the form of an SGML processing instruction
128 a Template Toolkit directive
132 something that has the form of an HTML comment
133 (and is not recognized as an HTML::Template directive)
137 something that is not recognized at all by the scanner
141 Note that end of file is currently represented by undef,
142 instead of a constant predefined by this module.