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

Method ESCAPE

output/java8/1.4.17/STLexer.java:420–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

418 }
419
420 Token ESCAPE() {
421 startCharIndex = input.index();
422 startCharPositionInLine = input.getCharPositionInLine();
423 consume(); // kill \\
424 if ( c=='u' ) return UNICODE();
425 String text;
426 switch (c) {
427 case '\\':
428 LINEBREAK();
429 return SKIP;
430 case 'n':
431 text = "\n";
432 break;
433 case 't':
434 text = "\t";
435 break;
436 case ' ':
437 text = " ";
438 break;
439 default:
440 NoViableAltException e = new NoViableAltException("", 0, 0, input);
441 errMgr.lexerError(input.getSourceName(),
442 "invalid escaped char: '" +str(c)+"'",
443 templateToken,
444 e);
445 consume();
446 match(delimiterStopChar);
447 return SKIP;
448 }
449 consume();
450 Token t = newToken(TEXT, text, input.getCharPositionInLine() -2);
451 match(delimiterStopChar);
452 return t;
453 }
454
455 Token UNICODE() {
456 consume();

Callers 1

outsideMethod · 0.95

Calls 10

consumeMethod · 0.95
UNICODEMethod · 0.95
LINEBREAKMethod · 0.95
strMethod · 0.95
matchMethod · 0.95
newTokenMethod · 0.95
getCharPositionInLineMethod · 0.80
indexMethod · 0.65
lexerErrorMethod · 0.45
getSourceNameMethod · 0.45

Tested by

no test coverage detected