()
| 454 | } |
| 455 | |
| 456 | Token UNICODE() { |
| 457 | consume(); |
| 458 | char[] chars = new char[4]; |
| 459 | if ( !isUnicodeLetter(c) ) { |
| 460 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 461 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", |
| 462 | templateToken, |
| 463 | e); |
| 464 | } |
| 465 | chars[0] = c; |
| 466 | consume(); |
| 467 | if ( !isUnicodeLetter(c) ) { |
| 468 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 469 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", |
| 470 | templateToken, |
| 471 | e); |
| 472 | } |
| 473 | chars[1] = c; |
| 474 | consume(); |
| 475 | if ( !isUnicodeLetter(c) ) { |
| 476 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 477 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", |
| 478 | templateToken, |
| 479 | e); |
| 480 | } |
| 481 | chars[2] = c; |
| 482 | consume(); |
| 483 | if ( !isUnicodeLetter(c) ) { |
| 484 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 485 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", |
| 486 | templateToken, |
| 487 | e); |
| 488 | } |
| 489 | chars[3] = c; |
| 490 | // ESCAPE kills > |
| 491 | char uc = (char)Integer.parseInt(new String(chars), 16); |
| 492 | Token t = newToken(TEXT, String.valueOf(uc), input.getCharPositionInLine()-6); |
| 493 | consume(); |
| 494 | match(delimiterStopChar); |
| 495 | return t; |
| 496 | } |
| 497 | |
| 498 | Token mTEXT() { |
| 499 | boolean modifiedText = false; |
no test coverage detected