6 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
8 ###############################################################################
12 TmplTokenType.pm - Types of TmplToken objects
16 This is a Java-style "safe enum" singleton class for types of TmplToken objects.
17 The predefined constants are
21 ###############################################################################
38 ###############################################################################
40 use vars qw( $_text $_text_parametrized $_cdata
41 $_tag $_decl $_pi $_directive $_comment $_null $_unknown );
45 my $this = 'TmplTokenType';#shift;
46 my $class = ref($this) || $this;
49 ($self->{'id'}, $self->{'name'}, $self->{'desc'}) = @_;
52 $_text = &$new(0, 'TEXT');
53 $_text_parametrized = &$new(8, 'TEXT-PARAMETRIZED');
54 $_cdata = &$new(1, 'CDATA');
55 $_tag = &$new(2, 'TAG');
56 $_decl = &$new(3, 'DECL');
57 $_pi = &$new(4, 'PI');
58 $_directive = &$new(5, 'DIRECTIVE');
59 $_comment = &$new(6, 'COMMENT');
60 $_unknown = &$new(7, 'UNKNOWN');
65 return $this->{'name'}
68 sub TEXT () { $_text }
69 sub TEXT_PARAMETRIZED () { $_text_parametrized }
70 sub CDATA () { $_cdata }
72 sub DECL () { $_decl }
74 sub DIRECTIVE () { $_directive }
75 sub COMMENT () { $_comment }
76 sub UNKNOWN () { $_unknown }
78 ###############################################################################
84 normal text (#text in the DTD)
86 =item TEXT_PARAMETRIZED
88 parametrized normal text
89 (result of simple recognition of text interspersed with <TMPL_VAR> directives;
90 this has to be explicitly enabled in the scanner)
94 normal text (CDATA in the DTD)
98 something that has the form of an HTML tag
102 something that has the form of an SGML declaration
106 something that has the form of an SGML processing instruction
110 a HTML::Template directive (whether or not embedded in an SGML comment)
114 something that has the form of an HTML comment
115 (and is not recognized as an HTML::Template directive)
119 something that is not recognized at all by the scanner
123 Note that end of file is currently represented by undef,
124 instead of a constant predefined by this module.