()
| 441 | } |
| 442 | |
| 443 | Token UNICODE() { |
| 444 | consume(); |
| 445 | char[] chars = new char[4]; |
| 446 | if ( !isUnicodeLetter(c) ) { |
| 447 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 448 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", templateToken, e); |
| 449 | } |
| 450 | chars[0] = c; |
| 451 | consume(); |
| 452 | if ( !isUnicodeLetter(c) ) { |
| 453 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 454 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", templateToken, e); |
| 455 | } |
| 456 | chars[1] = c; |
| 457 | consume(); |
| 458 | if ( !isUnicodeLetter(c) ) { |
| 459 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 460 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", templateToken, e); |
| 461 | } |
| 462 | chars[2] = c; |
| 463 | consume(); |
| 464 | if ( !isUnicodeLetter(c) ) { |
| 465 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 466 | errMgr.lexerError(input.getSourceName(), "invalid unicode char: '"+str(c)+"'", templateToken, e); |
| 467 | } |
| 468 | chars[3] = c; |
| 469 | // ESCAPE kills > |
| 470 | char uc = (char)Integer.parseInt(new String(chars), 16); |
| 471 | Token t = newToken(TEXT, String.valueOf(uc), input.getCharPositionInLine() -6); |
| 472 | consume(); |
| 473 | match(delimiterStopChar); |
| 474 | return t; |
| 475 | } |
| 476 | |
| 477 | Token mTEXT() { |
| 478 | boolean modifiedText = false; |
no test coverage detected