KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > text > syntax > DTDTokenContext


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xml.text.syntax;
20
21 import org.netbeans.editor.BaseTokenCategory;
22 import org.netbeans.editor.BaseTokenID;
23 import org.netbeans.editor.TokenContext;
24 import org.netbeans.editor.TokenContextPath;
25
26 import org.netbeans.modules.xml.text.syntax.javacc.lib.*;
27
28 /**
29  * Token-ids and token-categories for DTD
30  *
31  * @author Miloslav Metelka
32  * @author Petr Kuzel
33  * @version 1.0
34  */

35 public class DTDTokenContext extends TokenContext {
36
37     public static final int COMMENT_ID = 1;
38     public static final int ERROR_ID = 2;
39     public static final int KW_ID = 3;
40     public static final int PLAIN_ID = 4;
41     public static final int REF_ID = 5;
42     public static final int STRING_ID = 6;
43     public static final int SYMBOL_ID = 7;
44     public static final int TARGET_ID = 8;
45     public static final int EOL_ID = 9;
46
47
48     public static final JJTokenID COMMENT = new JJTokenID("comment", COMMENT_ID); // NOI18N
49
public static final JJTokenID ERROR = new JJTokenID("error", ERROR_ID, true); // NOI18N
50

51     // <!declatarion + "SYSTEM"/"PUBLIC" // NOI18N
52
public static final JJTokenID KW = new JJTokenID("keyword", KW_ID); // NOI18N
53
public static final JJTokenID PLAIN = new JJTokenID("plain", PLAIN_ID); // NOI18N
54
// &aref; &#x000;
55
public static final JJTokenID REF = new JJTokenID("ref", REF_ID); // NOI18N
56
// <home id="attrvalue" > // NOI18N
57
public static final JJTokenID STRING = new JJTokenID("string", STRING_ID); // NOI18N
58
// <>!
59
public static final JJTokenID SYMBOL = new JJTokenID("symbol", SYMBOL_ID); // NOI18N
60
// <? target ...>
61
public static final JJTokenID TARGET = new JJTokenID("target", TARGET_ID); // NOI18N
62
public static final JJTokenID EOL = new JJTokenID("eol", EOL_ID); // NOI18N
63

64     // Context instance declaration
65
public static final DTDTokenContext context = new DTDTokenContext();
66
67     public static final TokenContextPath contextPath = context.getContextPath();
68
69     private DTDTokenContext() {
70         super("dtd-"); // NOI18N
71

72         try {
73             addDeclaredTokenIDs();
74         } catch (Exception JavaDoc e) {
75             if (Boolean.getBoolean("netbeans.debug.exceptions")) { // NOI18N
76
e.printStackTrace();
77             }
78         }
79
80     }
81
82
83 }
84
Popular Tags