1 | // Copyright (C) 2005 Google Inc. |
2 | // |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | // you may not use this file except in compliance with the License. |
5 | // You may obtain a copy of the License at |
6 | // |
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
8 | // |
9 | // Unless required by applicable law or agreed to in writing, software |
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | // See the License for the specific language governing permissions and |
13 | // limitations under the License. |
14 | |
15 | package com.google.caja.lexer; |
16 | |
17 | /** |
18 | * Types of html tokens. |
19 | * |
20 | * @author mikesamuel@gmail.com |
21 | */ |
22 | public enum HtmlTokenType implements TokenType { |
23 | /** |
24 | * An html or xml attribute name consisting of characters other than |
25 | * whitespace, =, or specials. |
26 | */ |
27 | ATTRNAME, |
28 | /** An html value, possibly a quoted string. */ |
29 | ATTRVALUE, |
30 | /** An html or xml style comment, <tt><!-- for example --></tt>. */ |
31 | COMMENT, |
32 | /** A cdata block, <tt><![CDATA[ for example ]]></tt>. */ |
33 | CDATA, |
34 | /** |
35 | * A directive such as the DTD declaration or |
36 | * <tt><?xml version=1.0?></tt> or an XML processing instruction. |
37 | */ |
38 | DIRECTIVE, |
39 | /** Unescaped tag, for instance, inside a script, or xmp tag. */ |
40 | UNESCAPED, |
41 | /** |
42 | * A quoted string. Should not show up in well formed html, but may where |
43 | * there is an attribute value without a corresponding name. |
44 | */ |
45 | QSTRING, |
46 | /** |
47 | * The beginning of a tag -- not to be confused with a start tag. |
48 | * Valid tag beginnings include <tt><a</tt> and <tt></a</tt>. The |
49 | * rest of the tag is a series of attribute names, values, and the tag end. |
50 | */ |
51 | TAGBEGIN, |
52 | /** The end of a tag. Either <tt>></tt> or <tt>/></tt>. */ |
53 | TAGEND, |
54 | /** A block of text, either inside a tag, or as element content. */ |
55 | TEXT, |
56 | /** Ignorable whitespace nodes. */ |
57 | IGNORABLE, |
58 | /** A server side script block a la php or jsp. */ |
59 | SERVERCODE, |
60 | ; |
61 | } |