1 package C4
::TmplTokenType
;
4 #use warnings; FIXME - Bug 2505
7 use vars
qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
9 ###############################################################################
13 C4::TmplTokenType.pm - Types of TmplToken objects
17 This is a Java-style "safe enum" singleton class for types of TmplToken objects.
18 The predefined constants are
22 ###############################################################################
39 ###############################################################################
41 use vars
qw( $_text $_text_parametrized $_cdata
42 $_tag $_decl $_pi $_directive $_comment $_null $_unknown );
46 my $this = 'C4::TmplTokenType';#shift;
47 my $class = ref($this) || $this;
50 ($self->{'id'}, $self->{'name'}, $self->{'desc'}) = @_;
53 $_text = &$new(0, 'TEXT');
54 $_text_parametrized = &$new(8, 'TEXT-PARAMETRIZED');
55 $_cdata = &$new(1, 'CDATA');
56 $_tag = &$new(2, 'TAG');
57 $_decl = &$new(3, 'DECL');
58 $_pi = &$new(4, 'PI');
59 $_directive = &$new(5, 'DIRECTIVE');
60 $_comment = &$new(6, 'COMMENT');
61 $_unknown = &$new(7, 'UNKNOWN');
66 return $this->{'name'}
69 sub TEXT () { $_text }
70 sub TEXT_PARAMETRIZED () { $_text_parametrized }
71 sub CDATA () { $_cdata }
73 sub DECL () { $_decl }
75 sub DIRECTIVE () { $_directive }
76 sub COMMENT () { $_comment }
77 sub UNKNOWN () { $_unknown }
79 ###############################################################################
85 normal text (#text in the DTD)
87 =item TEXT_PARAMETRIZED
89 parametrized normal text
90 (result of simple recognition of text interspersed with <TMPL_VAR> directives;
91 this has to be explicitly enabled in the scanner)
95 normal text (CDATA in the DTD)
99 something that has the form of an HTML tag
103 something that has the form of an SGML declaration
107 something that has the form of an SGML processing instruction
111 a Template Toolkit directive
115 something that has the form of an HTML comment
116 (and is not recognized as an HTML::Template directive)
120 something that is not recognized at all by the scanner
124 Note that end of file is currently represented by undef,
125 instead of a constant predefined by this module.