001: /*
002: * The contents of this file are subject to the Mozilla Public License
003: * Version 1.1 (the "License"); you may not use this file except in
004: * compliance with the License. You may obtain a copy of the License at
005: * http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
009: * License for the specific language governing rights and limitations
010: * under the License.
011: *
012: * The Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
013: *
014: * The Initial Developer of the Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
015: * Portions created by Mark A. Kobold are Copyright (C) 2000-2007. All Rights Reserved.
016: *
017: * Contributor(s):
018: * Mark A. Kobold [mkobold <at> isqlviewer <dot> com].
019: *
020: * If you didn't download this code from the following link, you should check
021: * if you aren't using an obsolete version: http://www.isqlviewer.com
022: */
023: package org.isqlviewer.sql.processor;
024:
025: /**
026: * Enumeration of Token Types that can processed within the SQL Processor.
027: * <p>
028: *
029: * @author Mark A. Kobold <mkobold at isqlviewer dot com>
030: * @version 1.0
031: */
032: public enum TokenType {
033: /**
034: *
035: */
036: UNRECOGNIZED,
037: /**
038: *
039: */
040: WHITESPACE,
041: /**
042: *
043: */
044: WORD,
045: /**
046: *
047: */
048: NUMBER,
049: /**
050: *
051: */
052: PUNCTUATION,
053: /**
054: *
055: */
056: COMMENT,
057: /**
058: *
059: */
060: START_COMMENT,
061: /**
062: *
063: */
064: MID_COMMENT,
065: /**
066: *
067: */
068: END_COMMENT,
069: /**
070: *
071: */
072: TAG,
073: /**
074: *
075: */
076: END_TAG,
077: /**
078: *
079: */
080: KEYWORD,
081: /**
082: *
083: */
084: FUNCTION,
085: /**
086: *
087: */
088: IDENTIFIER,
089: /**
090: *
091: */
092: LITERAL,
093: /**
094: *
095: */
096: STRING,
097: /**
098: *
099: */
100: CHARACTER,
101: /**
102: *
103: */
104: OPERATOR,
105: /**
106: *
107: */
108: BRACKET,
109: /**
110: *
111: */
112: SEPARATOR,
113: /**
114: *
115: */
116: URL,
117: /**
118: *
119: */
120: START_VARIABLE,
121: /**
122: *
123: */
124: VARIABLE,
125: /**
126: *
127: */
128: TABLE_NAME;
129:
130: public static TokenType forByte(byte index) {
131:
132: if (index < 0) {
133: return UNRECOGNIZED;
134: }
135: return values()[index];
136: }
137: }
|