MCPcopy Index your code
hub / github.com/antlr/codebuff / UNICODE

Method UNICODE

output/java8/1.4.15/STLexer.java:455–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

ESCAPEMethod · 0.95

Calls 9

consumeMethod · 0.95
isUnicodeLetterMethod · 0.95
strMethod · 0.95
newTokenMethod · 0.95
matchMethod · 0.95
getCharPositionInLineMethod · 0.80
lexerErrorMethod · 0.45
getSourceNameMethod · 0.45
valueOfMethod · 0.45

Tested by

no test coverage detected