skipped 37 lines 38 38 throw new ParseException(String.format("Cannot mix operators %s, %s. Please use parenthesis to remove ambiguity.", op.getLabel(), other.getLabel())); 39 39 } 40 40 41 - final public ASTExpression Filter() throws ParseException { try { 42 - ASTExpression ex; 43 - ex = Expression(false); 44 - jj_consume_token(0); 41 + final public ASTExpression Filter() throws ParseException {ASTExpression ex ; 42 + ex = Expression(false); 43 + jj_consume_token(0); 45 44 {if ("" != null) return ex;} 46 45 throw new Error("Missing return statement in function"); 47 - } finally { 48 - trace_return("Filter"); 49 - } 50 46 } 51 47 52 - final public ASTExpression Expression(boolean inverse) throws ParseException { try { 53 - /*@bgen(jjtree) Expression */ 48 + final public ASTExpression Expression(boolean inverse) throws ParseException {/ * @ bgen ( jjtree ) Expression * / 54 49 ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION); 55 50 boolean jjtc000 = true; 56 51 jjtree.openNodeScope(jjtn000);BooleanOperator op = null; 57 - try { 58 - ExpressionInner(); 59 - if (jj_2_1(2)) { 60 - op = ExpressionCompounding(); 61 - } else { 62 - ; 63 - } 52 + try { 53 + ExpressionInner(); 54 + if (jj_2_1(2)) { 55 + op = ExpressionCompounding(); 56 + } else { 57 + ; 58 + } 64 59 jjtree.closeNodeScope(jjtn000, true); 65 60 jjtc000 = false; 66 61 jjtn000.op = op; 67 62 jjtn000.inverse = inverse; 68 63 {if ("" != null) return jjtn000;} 69 - } catch (Throwable jjte000) { 64 + } catch (Throwable jjte000) { 70 65 if (jjtc000) { 71 66 jjtree.clearNodeScope(jjtn000); 72 67 jjtc000 = false; skipped 7 lines 80 75 {if (true) throw (ParseException)jjte000;} 81 76 } 82 77 {if (true) throw (Error)jjte000;} 83 - } finally { 78 + } finally { 84 79 if (jjtc000) { 85 80 jjtree.closeNodeScope(jjtn000, true); 86 81 } 87 - } 88 - throw new Error("Missing return statement in function"); 89 - } finally { 90 - trace_return("Expression"); 91 82 } 83 + throw new Error("Missing return statement in function"); 92 84 } 93 85 94 - final public void WrappedCompoundExpression() throws ParseException { try { 95 - boolean inverse=false; 96 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 97 - case INVERSE:{ 98 - inverse = Inverse(); 99 - break; 100 - } 101 - default: 102 - jj_la1[0] = jj_gen; 103 - ; 86 + final public void WrappedCompoundExpression() throws ParseException {boolean inverse = false ; 87 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 88 + case INVERSE:{ 89 + inverse = Inverse(); 90 + break; 91 + } 92 + default: 93 + jj_la1[0] = jj_gen; 94 + ; 95 + } 96 + jj_consume_token(LPAREN); 97 + Expression(inverse); 98 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 99 + case RPAREN:{ 100 + jj_consume_token(RPAREN); 101 + break; 104 102 } 105 - jj_consume_token(LPAREN); 106 - Expression(inverse); 107 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 108 - case RPAREN:{ 109 - jj_consume_token(RPAREN); 110 - break; 111 - } 112 - default: 113 - jj_la1[1] = jj_gen; 103 + default: 104 + jj_la1[1] = jj_gen; 114 105 {if (true) throw new ParseException("Unbalanced brackets.");} 115 - } 116 - } finally { 117 - trace_return("WrappedCompoundExpression"); 118 106 } 119 107 } 120 108 121 - final public void ExpressionInner() throws ParseException { try { 122 - 123 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 124 - case LPAREN: 125 - case INVERSE:{ 126 - WrappedCompoundExpression(); 127 - break; 128 - } 129 - default: 130 - jj_la1[2] = jj_gen; 131 - Statement(); 109 + final public void ExpressionInner() throws ParseException { 110 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 111 + case LPAREN: 112 + case INVERSE:{ 113 + WrappedCompoundExpression(); 114 + break; 132 115 } 133 - } finally { 134 - trace_return("ExpressionInner"); 116 + default: 117 + jj_la1[2] = jj_gen; 118 + Statement(); 135 119 } 136 120 } 137 121 138 - final public void Statement() throws ParseException { try { 139 - 140 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 141 - case ALIAS_SYMBOL:{ 142 - Alias(); 143 - break; 144 - } 145 - default: 146 - jj_la1[3] = jj_gen; 147 - Comparison(); 122 + final public void Statement() throws ParseException { 123 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 124 + case ALIAS_SYMBOL:{ 125 + Alias(); 126 + break; 148 127 } 149 - } finally { 150 - trace_return("Statement"); 128 + default: 129 + jj_la1[3] = jj_gen; 130 + Comparison(); 151 131 } 152 132 } 153 133 154 - final public BooleanOperator ExpressionCompounding() throws ParseException { try { 155 - BooleanOperator op; 134 + final public BooleanOperator ExpressionCompounding() throws ParseException {BooleanOperator op ; 156 135 BooleanOperator nextOp; 136 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 137 + case AND:{ 138 + op = And(); 139 + break; 140 + } 141 + case OR:{ 142 + op = Or(); 143 + break; 144 + } 145 + case XOR:{ 146 + op = Xor(); 147 + break; 148 + } 149 + default: 150 + jj_la1[4] = jj_gen; 151 + jj_consume_token(-1); 152 + throw new ParseException(); 153 + } 154 + ExpressionInner(); 155 + label_1: 156 + while (true) { 157 + if (jj_2_2(2)) { 158 + ; 159 + } else { 160 + break label_1; 161 + } 157 162 switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 158 163 case AND:{ 159 - op = And(); 164 + nextOp = And(); 160 165 break; 161 166 } 162 167 case OR:{ 163 - op = Or(); 168 + nextOp = Or(); 164 169 break; 165 170 } 166 171 case XOR:{ 167 - op = Xor(); 172 + nextOp = Xor(); 168 173 break; 169 174 } 170 175 default: 171 - jj_la1[4 ] = jj_gen; 176 + jj_la1[5 ] = jj_gen; 172 177 jj_consume_token(-1); 173 178 throw new ParseException(); 174 179 } 175 - ExpressionInner(); 176 - label_1: 177 - while (true) { 178 - if (jj_2_2(2)) { 179 - ; 180 - } else { 181 - break label_1; 182 - } 183 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 184 - case AND:{ 185 - nextOp = And(); 186 - break; 187 - } 188 - case OR:{ 189 - nextOp = Or(); 190 - break; 191 - } 192 - case XOR:{ 193 - nextOp = Xor(); 194 - break; 195 - } 196 - default: 197 - jj_la1[5] = jj_gen; 198 - jj_consume_token(-1); 199 - throw new ParseException(); 200 - } 201 180 //Subsequent compoundings must be same operator. Otherwise, throw exception. 202 181 if(op != nextOp) throwOperatorAmbiguityException(op,nextOp); 203 - ExpressionInner(); 204 - } 182 + ExpressionInner(); 183 + } 205 184 {if ("" != null) return op;} 206 185 throw new Error("Missing return statement in function"); 207 - } finally { 208 - trace_return("ExpressionCompounding"); 209 - } 210 186 } 211 187 212 188 //Comparisons can take two forms (Value) or (value operation value). 213 189 //To make interpretation easier, we convert (Value) to (Value operation value) by means of (Value EQUALS TRUE) 214 - final public void Comparison() throws ParseException { try { 215 - /*@bgen(jjtree) Comparison */ 190 + final public void Comparison() throws ParseException {/ * @ bgen ( jjtree ) Comparison * / 216 191 ASTComparison jjtn000 = new ASTComparison(JJTCOMPARISON); 217 192 boolean jjtc000 = true; 218 193 jjtree.openNodeScope(jjtn000);Operator op = Operator.EQUAL; 219 194 Object left, right = true; 220 - try { 195 + try { 196 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 197 + case IDENTIFIER:{ 198 + left = Identifier(); 199 + break; 200 + } 201 + default: 202 + jj_la1[6] = jj_gen; 203 + {if (true) throw new ParseException("The left side of a comparison must be a field identifier.");} 204 + } 205 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 206 + case EQ: 207 + case NEQ:{ 208 + op = EqualityOperator(); 221 209 switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 222 - case IDENTIFIER:{ 223 - left = Identifier(); 210 + case BOOLEAN: 211 + case NUMBER: 212 + case REGEXLITERAL_IN_FORWARD_SLASHES: 213 + case REGEX_IN_FORWARD_SLASHES: 214 + case INVERSE: 215 + case IDENTIFIER: 216 + case OPEN_SINGLE_QUOTE_STRING: 217 + case OPEN_DOUBLE_QUOTE_STRING:{ 218 + right = Value(); 224 219 break; 225 220 } 226 221 default: 227 - jj_la1[6 ] = jj_gen; 228 - {if (true) throw new ParseException("The left side of a comparison must be a field identifier.");} 229 - } 230 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 231 - case EQ: 232 - case NEQ:{ 233 - op = EqualityOperator(); 234 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 235 - case BOOLEAN: 236 - case NUMBER: 237 - case REGEXLITERAL_IN_FORWARD_SLASHES: 238 - case REGEX_IN_FORWARD_SLASHES: 239 - case INVERSE: 240 - case IDENTIFIER: 241 - case OPEN_SINGLE_QUOTE_STRING: 242 - case OPEN_DOUBLE_QUOTE_STRING:{ 243 - right = Value(); 244 - break; 245 - } 246 - default: 247 - jj_la1[7] = jj_gen; 222 + jj_la1[7 ] = jj_gen; 248 223 {if (true) throw new ParseException("Invalid right hand value for comparison \"" + op + "\"");} 249 - } 224 + } 250 225 if(right instanceof Pattern && !String.class.isAssignableFrom(((LogEntryField) left).getType())){ 251 226 {if (true) throw new ParseException(String.format("Regex patterns can only be used on fields which can be converted to a string. Field \"%s\" of type \"%s\" cannot be converted.", left, ((LogEntryField) left).getType()));} 252 227 } 253 - break; 254 - } 255 - case GT: 256 - case LT: 257 - case GEQ: 258 - case LEQ:{ 259 - op = NumericOperator(); 228 + break; 229 + } 230 + case GT: 231 + case LT: 232 + case GEQ: 233 + case LEQ:{ 234 + op = NumericOperator(); 260 235 if(!Number.class.isAssignableFrom(((LogEntryField) left).getType())){ 261 236 {if (true) throw new ParseException(String.format("Numeric operators cannot be used for field \"%s\" of type \"%s\"", left, ((LogEntryField) left).getType()));} 262 237 } 263 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 264 - case NUMBER:{ 265 - right = Number(); 266 - break; 267 - } 268 - case IDENTIFIER:{ 269 - right = Identifier(); 238 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 239 + case NUMBER:{ 240 + right = Number(); 241 + break; 242 + } 243 + case IDENTIFIER:{ 244 + right = Identifier(); 270 245 if(!Number.class.isAssignableFrom(((LogEntryField) right).getType())){ 271 246 {if (true) throw new ParseException(String.format("Numeric operators cannot be used for field \"%s\" of type \"%s\"", right, ((LogEntryField) right).getType()));} 272 247 } 273 - break; 274 - } 275 - default: 276 - jj_la1[8] = jj_gen; 248 + break; 249 + } 250 + default: 251 + jj_la1[8] = jj_gen; 277 252 {if (true) throw new ParseException("Invalid right hand value for comparison \"" + op + "\"");} 253 + } 254 + break; 255 + } 256 + case CONTAINS:{ 257 + op = ContainsOperator(); 258 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 259 + case OPEN_SINGLE_QUOTE_STRING: 260 + case OPEN_DOUBLE_QUOTE_STRING:{ 261 + right = String(); 262 + break; 278 263 } 264 + case NUMBER:{ 265 + right = Number(); 266 + break; 267 + } 268 + case IDENTIFIER:{ 269 + right = Identifier(); 279 270 break; 280 271 } 281 - case CONTAINS:{ 282 - op = ContainsOperator(); 283 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 284 - case OPEN_SINGLE_QUOTE_STRING: 285 - case OPEN_DOUBLE_QUOTE_STRING:{ 286 - right = String(); 287 - break; 288 - } 289 - case NUMBER:{ 290 - right = Number(); 291 - break; 292 - } 293 - case IDENTIFIER:{ 294 - right = Identifier(); 295 - break; 296 - } 297 - default: 298 - jj_la1[9] = jj_gen; 272 + default: 273 + jj_la1[9] = jj_gen; 299 274 {if (true) throw new ParseException("The contains operator can only be used on string and numeric values and identifiers.");} 300 - } 275 + } 276 + break; 277 + } 278 + case IN:{ 279 + op = InOperator(); 280 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 281 + case ARRAY_START:{ 282 + right = Array(); 301 283 break; 302 284 } 303 - case IN:{ 304 - op = InOperator(); 305 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 306 - case ARRAY_START:{ 307 - right = Array(); 308 - break; 309 - } 310 - default: 311 - jj_la1[10] = jj_gen; 285 + default: 286 + jj_la1[10] = jj_gen; 312 287 {if (true) throw new ParseException("The in operator must be used on an array. E.g. \"Response.status IN [200, 302, 500]\"");} 313 - } 288 + } 289 + break; 290 + } 291 + case MATCHES:{ 292 + op = MatchesOperator(); 293 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 294 + case OPEN_SINGLE_QUOTE_STRING: 295 + case OPEN_DOUBLE_QUOTE_STRING:{ 296 + right = RegexInString(); 314 297 break; 315 298 } 316 - case MATCHES:{ 317 - op = MatchesOperator(); 318 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 319 - case OPEN_SINGLE_QUOTE_STRING: 320 - case OPEN_DOUBLE_QUOTE_STRING:{ 321 - right = RegexInString(); 322 - break; 323 - } 324 - case REGEXLITERAL_IN_FORWARD_SLASHES: 325 - case REGEX_IN_FORWARD_SLASHES:{ 326 - right = RegexInForwardSlashes(); 327 - break; 328 - } 329 - default: 330 - jj_la1[11] = jj_gen; 331 - {if (true) throw new ParseException("The matches operator must have a pattern as its right hand value.");} 332 - } 299 + case REGEXLITERAL_IN_FORWARD_SLASHES: 300 + case REGEX_IN_FORWARD_SLASHES:{ 301 + right = RegexInForwardSlashes(); 333 302 break; 334 303 } 335 304 default: 336 - jj_la1[12 ] = jj_gen; 305 + jj_la1[11 ] = jj_gen; 306 + {if (true) throw new ParseException("The matches operator must have a pattern as its right hand value.");} 307 + } 308 + break; 309 + } 310 + default: 311 + jj_la1[12] = jj_gen; 337 312 if(!(left instanceof Boolean || (left instanceof LogEntryField && ((LogEntryField) left).getType().isAssignableFrom(Boolean.class)))){ 338 313 //If left isn't a boolean value or field with boolean type 339 314 {if (true) throw new ParseException(left + " cannot be evaluated as a boolean.");} 340 315 } 341 - } 316 + } 342 317 jjtree.closeNodeScope(jjtn000, true); 343 318 jjtc000 = false; 344 319 jjtn000.left = left; 345 320 jjtn000.right = right; 346 321 jjtn000.operator = op; 347 - } catch (Throwable jjte000) { 322 + } catch (Throwable jjte000) { 348 323 if (jjtc000) { 349 324 jjtree.clearNodeScope(jjtn000); 350 325 jjtc000 = false; skipped 7 lines 358 333 {if (true) throw (ParseException)jjte000;} 359 334 } 360 335 {if (true) throw (Error)jjte000;} 361 - } finally { 336 + } finally { 362 337 if (jjtc000) { 363 338 jjtree.closeNodeScope(jjtn000, true); 364 339 } 365 - } 366 - } finally { 367 - trace_return("Comparison"); 368 340 } 369 341 } 370 342 371 - final public void Alias() throws ParseException { try { 372 - /*@bgen(jjtree) Alias */ 343 + final public void Alias() throws ParseException {/ * @ bgen ( jjtree ) Alias * / 373 344 ASTAlias jjtn000 = new ASTAlias(JJTALIAS); 374 345 boolean jjtc000 = true; 375 346 jjtree.openNodeScope(jjtn000);Token identifier; 376 - try { 377 - jj_consume_token(ALIAS_SYMBOL); 378 - identifier = jj_consume_token(IDENTIFIER); 347 + try { 348 + jj_consume_token(ALIAS_SYMBOL); 349 + identifier = jj_consume_token(IDENTIFIER); 379 350 jjtree.closeNodeScope(jjtn000, true); 380 351 jjtc000 = false; 381 352 jjtn000.identifier = identifier.image; 382 - } finally { 353 + } finally { 383 354 if (jjtc000) { 384 355 jjtree.closeNodeScope(jjtn000, true); 385 356 } 386 - } 387 - } finally { 388 - trace_return("Alias"); 389 357 } 390 358 } 391 359 392 - final public Object Value() throws ParseException { try { 393 - Object v; 394 - if (jj_2_3(2)) { 395 - v = Identifier(); 396 - } else { 397 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 398 - case NUMBER:{ 399 - v = Number(); 400 - break; 401 - } 402 - case BOOLEAN: 403 - case INVERSE:{ 404 - v = Boolean(); 405 - break; 406 - } 407 - case OPEN_SINGLE_QUOTE_STRING: 408 - case OPEN_DOUBLE_QUOTE_STRING:{ 409 - v = String(); 410 - break; 411 - } 412 - case REGEXLITERAL_IN_FORWARD_SLASHES: 413 - case REGEX_IN_FORWARD_SLASHES:{ 414 - v = RegexInForwardSlashes(); 415 - break; 416 - } 417 - default: 418 - jj_la1[13] = jj_gen; 419 - jj_consume_token(-1); 420 - throw new ParseException(); 360 + final public Object Value() throws ParseException {Object v ; 361 + if (jj_2_3(2)) { 362 + v = Identifier(); 363 + } else { 364 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 365 + case NUMBER:{ 366 + v = Number(); 367 + break; 368 + } 369 + case BOOLEAN: 370 + case INVERSE:{ 371 + v = Boolean(); 372 + break; 373 + } 374 + case OPEN_SINGLE_QUOTE_STRING: 375 + case OPEN_DOUBLE_QUOTE_STRING:{ 376 + v = String(); 377 + break; 378 + } 379 + case REGEXLITERAL_IN_FORWARD_SLASHES: 380 + case REGEX_IN_FORWARD_SLASHES:{ 381 + v = RegexInForwardSlashes(); 382 + break; 421 383 } 384 + default: 385 + jj_la1[13] = jj_gen; 386 + jj_consume_token(-1); 387 + throw new ParseException(); 422 388 } 389 + } 423 390 {if ("" != null) return v;} 424 391 throw new Error("Missing return statement in function"); 425 - } finally { 426 - trace_return("Value"); 427 - } 428 392 } 429 393 430 - final public Set Array() throws ParseException { try { 431 - Set<Object> items = new LinkedHashSet(); 394 + final public Set Array() throws ParseException {Set < Object > items = new LinkedHashSet ( ) ; 432 395 Object initial, subsequent; 433 - jj_consume_token(ARRAY_START); 396 + jj_consume_token(ARRAY_START); 397 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 398 + case OPEN_SINGLE_QUOTE_STRING: 399 + case OPEN_DOUBLE_QUOTE_STRING:{ 400 + initial = String(); 401 + break; 402 + } 403 + case NUMBER:{ 404 + initial = Number(); 405 + break; 406 + } 407 + default: 408 + jj_la1[14] = jj_gen; 409 + jj_consume_token(-1); 410 + throw new ParseException(); 411 + } 412 + items.add(initial); 413 + label_2: 414 + while (true) { 415 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 416 + case ARRAY_SEPARATOR:{ 417 + ; 418 + break; 419 + } 420 + default: 421 + jj_la1[15] = jj_gen; 422 + break label_2; 423 + } 424 + jj_consume_token(ARRAY_SEPARATOR); 434 425 switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 435 426 case OPEN_SINGLE_QUOTE_STRING: 436 427 case OPEN_DOUBLE_QUOTE_STRING:{ 437 - initial = String(); 428 + subsequent = String(); 438 429 break; 439 430 } 440 431 case NUMBER:{ 441 - initial = Number(); 432 + subsequent = Number(); 442 433 break; 443 434 } 444 435 default: 445 - jj_la1[14 ] = jj_gen; 436 + jj_la1[16 ] = jj_gen; 446 437 jj_consume_token(-1); 447 438 throw new ParseException(); 448 439 } 449 - items.add(initial); 450 - label_2: 451 - while (true) { 452 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 453 - case ARRAY_SEPARATOR:{ 454 - ; 455 - break; 456 - } 457 - default: 458 - jj_la1[15] = jj_gen; 459 - break label_2; 460 - } 461 - jj_consume_token(ARRAY_SEPARATOR); 462 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 463 - case OPEN_SINGLE_QUOTE_STRING: 464 - case OPEN_DOUBLE_QUOTE_STRING:{ 465 - subsequent = String(); 466 - break; 467 - } 468 - case NUMBER:{ 469 - subsequent = Number(); 470 - break; 471 - } 472 - default: 473 - jj_la1[16] = jj_gen; 474 - jj_consume_token(-1); 475 - throw new ParseException(); 476 - } 477 440 if(!initial.getClass().isAssignableFrom(subsequent.getClass())){ 478 441 {if (true) throw new ParseException("Array elements must all be of the same type.");} 479 442 } 480 443 items.add(subsequent); 481 - } 482 - jj_consume_token(ARRAY_END); 444 + } 445 + jj_consume_token(ARRAY_END); 483 446 {if ("" != null) return items;} 484 447 throw new Error("Missing return statement in function"); 485 - } finally { 486 - trace_return("Array"); 487 - } 488 448 } 489 449 490 450 //IDENTIFIERS 491 - final public LogEntryField Identifier() throws ParseException { try { 492 - Token group, identifier; 451 + final public LogEntryField Identifier() throws ParseException {Token group , identifier ; 493 452 FieldGroup fieldGroup; 494 453 LogEntryField field; 495 - group = jj_consume_token(IDENTIFIER); 454 + group = jj_consume_token(IDENTIFIER); 496 455 fieldGroup = FieldGroup.findByLabel(group.image); 497 456 if(fieldGroup == null) 498 457 {if (true) throw new ParseException(String.format("Invalid field group \"%s\". Valid groups are:\n%s", group.image, Arrays.toString(FieldGroup.values())));} 499 - jj_consume_token(DOT); 500 - identifier = jj_consume_token(IDENTIFIER); 458 + jj_consume_token(DOT); 459 + identifier = jj_consume_token(IDENTIFIER); 501 460 field = LogEntryField.getByLabel(fieldGroup, identifier.image); 502 461 if(field == null){ 503 462 StringBuilder fieldMessage = new StringBuilder(); 504 - ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(FieldGroup . REQUEST )); 463 + ArrayList<LogEntryField> fields = new ArrayList<LogEntryField>(getFieldsInGroup(fieldGroup )); 505 464 for (int i = 0; i < fields.size(); i++) { 465 + if(fields.get(i) == LogEntryField.NUMBER) continue; 506 466 fieldMessage.append(fields.get(i).getDescriptiveMessage()); 507 467 if(i != fields.size()-1) 508 468 fieldMessage.append("\n\n"); skipped 4 lines 513 473 {if (true) throw new ParseException("Field " + LogEntryField.NUMBER + " is ephemeral and cannot be used in filters.");} 514 474 {if ("" != null) return field;} 515 475 throw new Error("Missing return statement in function"); 516 - } finally { 517 - trace_return("Identifier"); 518 - } 519 476 } 520 477 521 478 //END IDENTIFIERS skipped 1 lines 523 480 524 481 //TYPES 525 482 final public 526 - BigDecimal Number() throws ParseException { try { 527 - Token t; 528 - t = jj_consume_token(NUMBER); 483 + BigDecimal Number() throws ParseException {Token t ; 484 + t = jj_consume_token(NUMBER); 529 485 {if ("" != null) return new BigDecimal(t.image);} 530 486 throw new Error("Missing return statement in function"); 531 - } finally { 532 - trace_return("Number"); 533 - } 534 487 } 535 488 536 - final public String String() throws ParseException { try { 537 - Token t = null; 489 + final public String String() throws ParseException {Token t = null ; 490 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 491 + case OPEN_SINGLE_QUOTE_STRING:{ 492 + jj_consume_token(OPEN_SINGLE_QUOTE_STRING); 538 493 switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 539 - case OPEN_SINGLE_QUOTE_STRING:{ 540 - jj_consume_token(OPEN_SINGLE_QUOTE_STRING); 541 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 542 - case SINGLE_STRING_BODY:{ 543 - t = jj_consume_token(SINGLE_STRING_BODY); 544 - break; 545 - } 546 - default: 547 - jj_la1[17] = jj_gen; 548 - ; 494 + case SINGLE_STRING_BODY:{ 495 + t = jj_consume_token(SINGLE_STRING_BODY); 496 + break; 549 497 } 550 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 551 - case CLOSE_SINGLE_QUOTE_STRING:{ 552 - jj_consume_token(CLOSE_SINGLE_QUOTE_STRING); 553 - break; 554 - } 555 - default: 556 - jj_la1[18] = jj_gen; 557 - {if (true) throw new ParseException("Missing closing quote for string.");} 558 - } 498 + default: 499 + jj_la1[17] = jj_gen; 500 + ; 501 + } 502 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 503 + case CLOSE_SINGLE_QUOTE_STRING:{ 504 + jj_consume_token(CLOSE_SINGLE_QUOTE_STRING); 559 505 break; 560 506 } 561 - case OPEN_DOUBLE_QUOTE_STRING:{ 562 - jj_consume_token(OPEN_DOUBLE_QUOTE_STRING); 563 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 564 - case DOUBLE_STRING_BODY:{ 565 - t = jj_consume_token(DOUBLE_STRING_BODY); 566 - break; 567 - } 568 - default: 569 - jj_la1[19] = jj_gen; 570 - ; 571 - } 572 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 573 - case CLOSE_DOUBLE_QUOTE_STRING:{ 574 - jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING); 575 - break; 576 - } 577 - default: 578 - jj_la1[20] = jj_gen; 507 + default: 508 + jj_la1[18] = jj_gen; 579 509 {if (true) throw new ParseException("Missing closing quote for string.");} 510 + } 511 + break; 512 + } 513 + case OPEN_DOUBLE_QUOTE_STRING:{ 514 + jj_consume_token(OPEN_DOUBLE_QUOTE_STRING); 515 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 516 + case DOUBLE_STRING_BODY:{ 517 + t = jj_consume_token(DOUBLE_STRING_BODY); 518 + break; 580 519 } 520 + default: 521 + jj_la1[19] = jj_gen; 522 + ; 523 + } 524 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 525 + case CLOSE_DOUBLE_QUOTE_STRING:{ 526 + jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING); 581 527 break; 582 528 } 583 529 default: 584 - jj_la1[21 ] = jj_gen; 585 - jj_consume_token(-1); 586 - throw new ParseException(); 530 + jj_la1[20 ] = jj_gen; 531 + {if (true) throw new ParseException("Missing closing quote for string.");} 587 532 } 533 + break; 534 + } 535 + default: 536 + jj_la1[21] = jj_gen; 537 + jj_consume_token(-1); 538 + throw new ParseException(); 539 + } 588 540 if(t == null) {if ("" != null) return "";} 589 541 else {if ("" != null) return org.apache.commons.text.StringEscapeUtils.unescapeJava(t.image);} 590 542 throw new Error("Missing return statement in function"); 591 - } finally { 592 - trace_return("String"); 593 - } 594 543 } 595 544 596 - final public Pattern RegexInString() throws ParseException { try { 597 - Token t; 545 + final public Pattern RegexInString() throws ParseException {Token t ; 546 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 547 + case OPEN_SINGLE_QUOTE_STRING:{ 548 + jj_consume_token(OPEN_SINGLE_QUOTE_STRING); 549 + t = jj_consume_token(SINGLE_STRING_BODY); 598 550 switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 599 - case OPEN_SINGLE_QUOTE_STRING:{ 600 - jj_consume_token(OPEN_SINGLE_QUOTE_STRING); 601 - t = jj_consume_token(SINGLE_STRING_BODY); 602 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 603 - case CLOSE_SINGLE_QUOTE_STRING:{ 604 - jj_consume_token(CLOSE_SINGLE_QUOTE_STRING); 605 - break; 606 - } 607 - default: 608 - jj_la1[22] = jj_gen; 609 - {if (true) throw new ParseException("Missing closing quote for regex string.");} 610 - } 551 + case CLOSE_SINGLE_QUOTE_STRING:{ 552 + jj_consume_token(CLOSE_SINGLE_QUOTE_STRING); 611 553 break; 612 554 } 613 - case OPEN_DOUBLE_QUOTE_STRING:{ 614 - jj_consume_token(OPEN_DOUBLE_QUOTE_STRING); 615 - t = jj_consume_token(DOUBLE_STRING_BODY); 616 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 617 - case CLOSE_DOUBLE_QUOTE_STRING:{ 618 - jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING); 619 - break; 620 - } 621 - default: 622 - jj_la1[23] = jj_gen; 555 + default: 556 + jj_la1[22] = jj_gen; 623 557 {if (true) throw new ParseException("Missing closing quote for regex string.");} 624 - } 558 + } 559 + break; 560 + } 561 + case OPEN_DOUBLE_QUOTE_STRING:{ 562 + jj_consume_token(OPEN_DOUBLE_QUOTE_STRING); 563 + t = jj_consume_token(DOUBLE_STRING_BODY); 564 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 565 + case CLOSE_DOUBLE_QUOTE_STRING:{ 566 + jj_consume_token(CLOSE_DOUBLE_QUOTE_STRING); 625 567 break; 626 568 } 627 569 default: 628 - jj_la1[24 ] = jj_gen; 629 - jj_consume_token(-1); 630 - throw new ParseException(); 570 + jj_la1[23 ] = jj_gen; 571 + {if (true) throw new ParseException("Missing closing quote for regex string.");} 631 572 } 573 + break; 574 + } 575 + default: 576 + jj_la1[24] = jj_gen; 577 + jj_consume_token(-1); 578 + throw new ParseException(); 579 + } 632 580 {if ("" != null) return Pattern.compile(t.image, Pattern.CASE_INSENSITIVE);} 633 581 throw new Error("Missing return statement in function"); 634 - } finally { 635 - trace_return("RegexInString"); 636 - } 637 582 } 638 583 639 - final public Pattern RegexInForwardSlashes() throws ParseException { try { 640 - Token t; 641 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 642 - case REGEXLITERAL_IN_FORWARD_SLASHES: { 643 - t = jj_consume_token(REGEXLITERAL_IN_FORWARD_SLASHES); 644 - break; 645 - } 646 - case REGEX_IN_FORWARD_SLASHES: { 647 - t = jj_consume_token(REGEX_IN_FORWARD_SLASHES); 648 - break; 649 - } 650 - default: 651 - jj_la1[25] = jj_gen; 652 - jj_consume_token(-1); 653 - throw new ParseException(); 584 + final public Pattern RegexInForwardSlashes() throws ParseException {Token t ; 585 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 586 + case REGEXLITERAL_IN_FORWARD_SLASHES:{ 587 + t = jj_consume_token ( REGEXLITERAL_IN_FORWARD_SLASHES) ; 588 + break; 589 + } 590 + case REGEX_IN_FORWARD_SLASHES:{ 591 + t = jj_consume_token ( REGEX_IN_FORWARD_SLASHES) ; 592 + break; 654 593 } 594 + default: 595 + jj_la1[25] = jj_gen; 596 + jj_consume_token(-1); 597 + throw new ParseException(); 598 + } 655 599 {if ("" != null) return Pattern.compile(t.image.substring(1,t.image.length()-1), Pattern.CASE_INSENSITIVE);} 656 600 throw new Error("Missing return statement in function"); 657 - } finally { 658 - trace_return("RegexInForwardSlashes"); 659 - } 660 601 } 661 602 662 - final public Boolean Boolean() throws ParseException { try { 663 - Token t, inverse=null; 664 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 665 - case INVERSE:{ 666 - inverse = jj_consume_token(INVERSE); 667 - break; 668 - } 669 - default: 670 - jj_la1[26] = jj_gen; 671 - ; 603 + final public Boolean Boolean() throws ParseException {Token t , inverse = null ; 604 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 605 + case INVERSE:{ 606 + inverse = jj_consume_token(INVERSE); 607 + break; 672 608 } 673 - t = jj_consume_token(BOOLEAN); 609 + default: 610 + jj_la1[26] = jj_gen; 611 + ; 612 + } 613 + t = jj_consume_token(BOOLEAN); 674 614 {if ("" != null) return (inverse != null ^ Boolean.parseBoolean(t.image));} 675 615 throw new Error("Missing return statement in function"); 676 - } finally { 677 - trace_return("Boolean"); 678 - } 679 616 } 680 617 681 618 //END TYPES skipped 1 lines 683 620 684 621 //BASIC OPERATORS 685 622 final public 686 - Operator EqualityOperator() throws ParseException { try { 687 - 688 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 689 - case EQ:{ 690 - jj_consume_token(EQ); 623 + Operator EqualityOperator() throws ParseException { 624 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 625 + case EQ:{ 626 + jj_consume_token(EQ); 691 627 {if ("" != null) return Operator.EQUAL;} 692 - break; 693 - } 694 - case NEQ:{ 695 - jj_consume_token(NEQ); 628 + break; 629 + } 630 + case NEQ:{ 631 + jj_consume_token(NEQ); 696 632 {if ("" != null) return Operator.NOT_EQUAL;} 697 - break; 698 - } 699 - default: 700 - jj_la1[27] = jj_gen; 701 - jj_consume_token(-1); 702 - throw new ParseException(); 633 + break; 703 634 } 704 - throw new Error("Missing return statement in function"); 705 - } finally { 706 - trace_return("EqualityOperator"); 635 + default: 636 + jj_la1[27] = jj_gen; 637 + jj_consume_token(-1); 638 + throw new ParseException(); 707 639 } 640 + throw new Error("Missing return statement in function"); 708 641 } 709 642 710 - final public Operator NumericOperator() throws ParseException { try { 711 - 712 - switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 713 - case GT:{ 714 - jj_consume_token(GT); 643 + final public Operator NumericOperator() throws ParseException { 644 + switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) { 645 + case GT:{ 646 + jj_consume_token(GT); 715 647 {if ("" != null) return Operator.GREATER_THAN;} 716 - break; 717 - } 718 - case LT:{ 719 - jj_consume_token(LT); 648 + break; 649 + } 650 + case LT:{ 651 + jj_consume_token(LT); 720 652 {if ("" != null) return Operator.LESS_THAN;} 721 - break; 722 - } 723 - case GEQ:{ 724 - jj_consume_token(GEQ); 653 + break; 654 + } 655 + case GEQ:{ 656 + jj_consume_token(GEQ); 725 657 {if ("" != null) return Operator.GREATER_THAN_EQUAL;} 726 - break; 727 - } 728 - case LEQ:{ 729 - jj_consume_token(LEQ); 658 + break; 659 + } 660 + case LEQ:{ 661 + jj_consume_token(LEQ); 730 662 {if ("" != null) return Operator.LESS_THAN_EQUAL;} 731 - break; 732 - } 733 - default: 734 - jj_la1[28] = jj_gen; 735 - jj_consume_token(-1); 736 - throw new ParseException(); 663 + break; 737 664 } 665 + default: 666 + jj_la1[28] = jj_gen; 667 + jj_consume_token(-1); 668 + throw new ParseException(); 669 + } 738 670 throw new Error("Missing return statement in function"); 739 - } finally { 740 - trace_return("NumericOperator"); 741 - } 742 671 } 743 672 744 - final public Operator ContainsOperator() throws ParseException { try { 745 - 746 - jj_consume_token(CONTAINS); 673 + final public Operator ContainsOperator() throws ParseException { 674 + jj_consume_token(CONTAINS); 747 675 {if ("" != null) return Operator.CONTAINS;} 748 676 throw new Error("Missing return statement in function"); 749 - } finally { 750 - trace_return("ContainsOperator"); 751 - } 752 677 } 753 678 754 - final public Operator MatchesOperator() throws ParseException { try { 755 - 756 - jj_consume_token(MATCHES); 679 + final public Operator MatchesOperator() throws ParseException { 680 + jj_consume_token(MATCHES); 757 681 {if ("" != null) return Operator.MATCHES;} 758 682 throw new Error("Missing return statement in function"); 759 - } finally { 760 - trace_return("MatchesOperator"); 761 - } 762 683 } 763 684 764 - final public Operator InOperator() throws ParseException { try { 765 - 766 - jj_consume_token(IN); 685 + final public Operator InOperator() throws ParseException { 686 + jj_consume_token(IN); 767 687 {if ("" != null) return Operator.IN;} 768 688 throw new Error("Missing return statement in function"); 769 - } finally { 770 - trace_return("InOperator"); 771 - } 772 689 } 773 690 774 - final public boolean Inverse() throws ParseException { try { 775 - 776 - jj_consume_token(INVERSE); 691 + final public boolean Inverse() throws ParseException { 692 + jj_consume_token(INVERSE); 777 693 {if ("" != null) return true;} 778 694 throw new Error("Missing return statement in function"); 779 - } finally { 780 - trace_return("Inverse"); 781 - } 782 695 } 783 696 784 - final public BooleanOperator And() throws ParseException { try { 785 - 786 - jj_consume_token(AND); 697 + final public BooleanOperator And() throws ParseException { 698 + jj_consume_token(AND); 787 699 {if ("" != null) return BooleanOperator.AND;} 788 700 throw new Error("Missing return statement in function"); 789 - } finally { 790 - trace_return("And"); 791 - } 792 701 } 793 702 794 - final public BooleanOperator Or() throws ParseException { try { 795 - 796 - jj_consume_token(OR); 703 + final public BooleanOperator Or() throws ParseException { 704 + jj_consume_token(OR); 797 705 {if ("" != null) return BooleanOperator.OR;} 798 706 throw new Error("Missing return statement in function"); 799 - } finally { 800 - trace_return("Or"); 801 - } 802 707 } 803 708 804 - final public BooleanOperator Xor() throws ParseException { try { 805 - 806 - jj_consume_token(XOR); 709 + final public BooleanOperator Xor() throws ParseException { 710 + jj_consume_token(XOR); 807 711 {if ("" != null) return BooleanOperator.XOR;} 808 712 throw new Error("Missing return statement in function"); 809 - } finally { 810 - trace_return("Xor"); 811 - } 812 713 } 813 714 814 715 private boolean jj_2_1(int xla) skipped 26 lines 841 742 return false; 842 743 } 843 744 844 - private boolean jj_3R_27 () 745 + private boolean jj_3R_12 () 845 746 { 846 - if (jj_3R_33 ()) return true; 747 + if (jj_scan_token (AND )) return true; 847 748 return false; 848 749 } 849 750 850 - private boolean jj_3R_12 () 751 + private boolean jj_3R_27 () 851 752 { 852 - if (jj_scan_token (AND )) return true; 753 + if (jj_3R_33 ()) return true; 853 754 return false; 854 755 } 855 756 skipped 9 lines 865 766 return false; 866 767 } 867 768 868 - private boolean jj_3R_25 () 769 + private boolean jj_3R_22 () 869 770 { 870 - if (jj_3R_8 ()) return true; 771 + if (jj_scan_token (INVERSE )) return true; 871 772 return false; 872 773 } 873 774 874 - private boolean jj_3R_22 () 775 + private boolean jj_3R_25 () 875 776 { 876 - if (jj_scan_token (INVERSE )) return true; 777 + if (jj_3R_8 ()) return true; 877 778 return false; 878 779 } 879 780 skipped 61 lines 941 842 return false; 942 843 } 943 844 944 - private boolean jj_3R_23 () 845 + private boolean jj_3R_35 () 945 846 { 946 - if (jj_scan_token(ALIAS_SYMBOL )) return true; 847 + if (jj_scan_token(CONTAINS )) return true; 947 848 return false; 948 849 } 949 850 950 - private boolean jj_3R_35 () 851 + private boolean jj_3R_23 () 951 852 { 952 - if (jj_scan_token(CONTAINS )) return true; 853 + if (jj_scan_token(ALIAS_SYMBOL )) return true; 953 854 return false; 954 855 } 955 856 skipped 24 lines 980 881 return false; 981 882 } 982 883 884 + private boolean jj_3R_43() 885 + { 886 + if (jj_scan_token(LEQ)) return true; 887 + return false; 888 + } 889 + 983 890 private boolean jj_3R_3() 984 891 { 985 892 Token xsp; skipped 6 lines 992 899 } 993 900 } 994 901 if (jj_3R_7()) return true; 995 - return false; 996 - } 997 - 998 - private boolean jj_3R_43() 999 - { 1000 - if (jj_scan_token(LEQ)) return true; 1001 902 return false; 1002 903 } 1003 904 skipped 32 lines 1036 937 return false; 1037 938 } 1038 939 940 + private boolean jj_3R_39() 941 + { 942 + if (jj_scan_token(NEQ)) return true; 943 + return false; 944 + } 945 + 1039 946 private boolean jj_3R_18() 1040 947 { 1041 948 Token xsp; skipped 8 lines 1050 957 private boolean jj_3R_20() 1051 958 { 1052 959 if (jj_3R_23()) return true; 1053 - return false; 1054 - } 1055 - 1056 - private boolean jj_3R_39() 1057 - { 1058 - if (jj_scan_token(NEQ)) return true; 1059 960 return false; 1060 961 } 1061 962 skipped 133 lines 1195 1096 private boolean jj_rescan = false; 1196 1097 private int jj_gc = 0; 1197 1098 1198 - { 1199 - enable_tracing(); 1200 - } 1201 1099 /** Constructor with InputStream. */ 1202 1100 public FilterParser(java.io.InputStream stream) { 1203 1101 this(stream, null); skipped 94 lines 1298 1196 } 1299 1197 } 1300 1198 } 1301 - trace_token(token, ""); 1302 1199 return token; 1303 1200 } 1304 1201 token = oldToken; skipped 32 lines 1337 1234 else token = token.next = token_source.getNextToken(); 1338 1235 jj_ntk = -1; 1339 1236 jj_gen++; 1340 - trace_token(token, " (in getNextToken)"); 1341 1237 return token; 1342 1238 } 1343 1239 skipped 103 lines 1447 1343 return trace_enabled; 1448 1344 } 1449 1345 1450 - /** Enable tracing. */ 1346 + /** Enable tracing. */1451 1347 final public void enable_tracing() { 1452 - trace_enabled = true; 1453 1348 } 1454 1349 1455 - /** Disable tracing. */ 1350 + /** Disable tracing. */1456 1351 final public void disable_tracing() { 1457 - trace_enabled = false; 1458 - } 1459 - 1460 - protected void trace_call(String s) { 1461 - if (trace_enabled) { 1462 - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); } 1463 - System.out.println("Call: " + s); 1464 - } 1465 - trace_indent = trace_indent + 2; 1466 - } 1467 - 1468 - protected void trace_return(String s) { 1469 - trace_indent = trace_indent - 2; 1470 - if (trace_enabled) { 1471 - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); } 1472 - System.out.println("Return: " + s); 1473 - } 1474 - } 1475 - 1476 - protected void trace_token(Token t, String where) { 1477 - if (trace_enabled) { 1478 - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); } 1479 - System.out.print("Consumed token: <" + tokenImage[t.kind]); 1480 - if (t.kind != 0 && !tokenImage[t.kind].equals("\"" + t.image + "\"")) { 1481 - System.out.print(": \"" + TokenMgrError.addEscapes(t.image) + "\""); 1482 - } 1483 - System.out.println(" at line " + t.beginLine + " column " + t.beginColumn + ">" + where); 1484 - } 1485 - } 1486 - 1487 - protected void trace_scan(Token t1, int t2) { 1488 - if (trace_enabled) { 1489 - for (int i = 0; i < trace_indent; i++) { System.out.print(" "); } 1490 - System.out.print("Visited token: <" + tokenImage[t1.kind]); 1491 - if (t1.kind != 0 && !tokenImage[t1.kind].equals("\"" + t1.image + "\"")) { 1492 - System.out.print(": \"" + TokenMgrError.addEscapes(t1.image) + "\""); 1493 - } 1494 - System.out.println(" at line " + t1.beginLine + " column " + t1.beginColumn + ">; Expected token: <" + tokenImage[t2] + ">"); 1495 - } 1496 1352 } 1497 1353 1498 1354 private void jj_rescan_token() { skipped 43 lines