1 /** 2 * Copyright (c) 2011, University of Konstanz, Distributed Systems Group 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * * Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * * Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * * Neither the name of the University of Konstanz nor the 13 * names of its contributors may be used to endorse or promote products 14 * derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY 20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28 package org.treetank.service.xml.xpath.parser; 29 30 public enum TokenType { 31 /** Invalid type. */ 32 INVALID(""), 33 /** Text type. */ 34 TEXT(""), 35 /** Name type. */ 36 NAME(""), 37 /** Value type. */ 38 VALUE(""), 39 /** Token type that represents a '/' . */ 40 SLASH("/"), 41 /** Token type that represents a descendant step. */ 42 DESC_STEP("//"), 43 /** Token type that represents a left parenthesis. */ 44 OPEN_BR("("), 45 /** Token type that represents a right parenthesis. */ 46 CLOSE_BR(")"), 47 /** Token type that represents a comparison. */ 48 COMP("="), 49 /** Token type that represents an equality comparison. */ 50 EQ("="), 51 /** Token type that represents a diversity comparison. */ 52 N_EQ("!="), 53 /** Token type that represents an opening squared bracket. */ 54 OPEN_SQP("["), 55 /** Token type that represents a closing squared bracket. */ 56 CLOSE_SQP("]"), 57 /** Token type that represents the @ symbol. */ 58 AT("@"), 59 /** Token type that represents the point. */ 60 POINT("."), 61 /** Token type that represents a colon : . */ 62 COLON(":"), 63 /** Token type that represents a normal quote : " . */ 64 DBL_QUOTE("\'"), 65 /** Token type that represents a single quote : ' . */ 66 SINGLE_QUOTE("'"), 67 /** Token type that represents the dollar sign : $ . */ 68 DOLLAR("$"), 69 /** Token type that represents a plus. */ 70 PLUS("+"), 71 /** Token type that represents a minus. */ 72 MINUS("-"), 73 /** Token type that represents a interrogation mark: ? */ 74 INTERROGATION("?"), 75 /** Token type that represents a star. */ 76 STAR("*"), 77 /** Token type that represents a left shift: << . */ 78 L_SHIFT("<<"), 79 /** Token type that represents a right shift: >> . */ 80 R_SHIFT(">>"), 81 /** Token type that represents a shortcut for the parent: .. . */ 82 PARENT(".."), 83 /** Token type that represents a comma. . */ 84 COMMA(","), 85 /** Token type that represents the or sign: | . */ 86 OR("|"), 87 /** Token type that represents a comment (: ...... :) */ 88 COMMENT(""), 89 /** Token type that represents a whitespace. */ 90 SPACE(""), 91 /** 92 * Token type that represents an 'E' or an 'e' that is part of a double 93 * value. 94 */ 95 E_NUMBER(""), 96 /** Token type for the end of the string to parse. */ 97 END(""); 98 99 public final String mContent; 100 101 TokenType(final String paramContent) { 102 this.mContent = paramContent; 103 } 104 }