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

Method ESCAPE

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

Source from the content-addressed store, hash-verified

409 }
410
411 Token ESCAPE() {
412 startCharIndex = input.index();
413 startCharPositionInLine = input.getCharPositionInLine();
414 consume(); // kill \\
415 if ( c=='u' ) return UNICODE();
416 String text;
417 switch (c) {
418 case '\\' :
419 LINEBREAK();
420 return SKIP;
421 case 'n' :
422 text = "\n";
423 break;
424 case 't' :
425 text = "\t";
426 break;
427 case ' ' :
428 text = " ";
429 break;
430 default:
431 NoViableAltException e = new NoViableAltException("", 0, 0, input);
432 errMgr.lexerError(input.getSourceName(), "invalid escaped char: '"+str(c)+"'", templateToken, e);
433 consume();
434 match(delimiterStopChar);
435 return SKIP;
436 }
437 consume();
438 Token t = newToken(TEXT, text, input.getCharPositionInLine() -2);
439 match(delimiterStopChar);
440 return t;
441 }
442
443 Token UNICODE() {
444 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