1 61 62 package org.jaxen.saxpath.base; 63 64 import org.jaxen.JaxenRuntimeException; 65 66 67 68 class TokenTypes 69 { 70 static final int EOF = -1; 71 static final int SKIP = -2; 72 static final int ERROR = -3; 73 74 static final int EQUALS = 1; 75 static final int NOT_EQUALS = 2; 76 77 static final int LESS_THAN_SIGN = 3; 78 static final int LESS_THAN_OR_EQUALS_SIGN = 4; 79 static final int GREATER_THAN_SIGN = 5; 80 static final int GREATER_THAN_OR_EQUALS_SIGN = 6; 81 82 static final int PLUS = 7; 83 static final int MINUS = 8; 84 static final int STAR = 9; 85 static final int MOD = 10; 86 static final int DIV = 11; 87 88 static final int SLASH = 12; 89 static final int DOUBLE_SLASH = 13; 90 static final int DOT = 14; 91 static final int DOT_DOT = 15; 92 93 static final int IDENTIFIER = 16; 94 95 static final int AT = 17; 96 static final int PIPE = 18; 97 static final int COLON = 19; 98 static final int DOUBLE_COLON = 20; 99 100 static final int LEFT_BRACKET = 21; 101 static final int RIGHT_BRACKET = 22; 102 static final int LEFT_PAREN = 23; 103 static final int RIGHT_PAREN = 24; 104 105 static final int NOT = 25; 106 static final int DOLLAR = 26; 107 static final int LITERAL = 27; 108 static final int AND = 28; 109 static final int OR = 29; 110 111 static final int INTEGER = 30; 112 static final int DOUBLE = 31; 113 114 static final int COMMA = 32; 115 116 static String getTokenText( int tokenType ) 117 { 118 switch( tokenType ) 119 { 120 case ERROR: 121 return "(error)"; 122 case EQUALS: 123 return "="; 124 case NOT_EQUALS: 125 return "!="; 126 case LESS_THAN_SIGN: 127 return "<"; 128 case LESS_THAN_OR_EQUALS_SIGN: 129 return "<="; 130 case GREATER_THAN_SIGN: 131 return ">"; 132 case GREATER_THAN_OR_EQUALS_SIGN: 133 return ">="; 134 case PLUS: 135 return "+"; 136 case MINUS: 137 return "-"; 138 case STAR: 139 return "*"; 140 case DIV: 141 return "div"; 142 case MOD: 143 return "mod"; 144 case SLASH: 145 return "/"; 146 case DOUBLE_SLASH: 147 return "//"; 148 case DOT: 149 return "."; 150 case DOT_DOT: 151 return ".."; 152 case IDENTIFIER: 153 return "(identifier)"; 154 case AT: 155 return "@"; 156 case PIPE: 157 return "|"; 158 case COLON: 159 return ":"; 160 case DOUBLE_COLON: 161 return "::"; 162 case LEFT_BRACKET: 163 return "["; 164 case RIGHT_BRACKET: 165 return "]"; 166 case LEFT_PAREN: 167 return "("; 168 case RIGHT_PAREN: 169 return ")"; 170 case NOT: 171 return "!"; 172 case DOLLAR: 173 return "$"; 174 case LITERAL: 175 return "(literal)"; 176 case AND: 177 return "and"; 178 case OR: 179 return "or"; 180 case INTEGER: 181 return "(integer)"; 182 case DOUBLE: 183 return "(double)"; 184 case COMMA: 185 return ","; 186 default: 187 throw new JaxenRuntimeException("Unrecognized token type: " + tokenType); 188 } 189 } 190 } 191 | Popular Tags |