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

Method UNICODE

output/java8/1.4.13/STLexer.java:443–475  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

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