MCPcopy Create free account
hub / github.com/antlr/codebuff / COMMENT

Method COMMENT

output/java/1.4.13/STLexer.java:599–620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597 }
598
599 Token COMMENT() {
600 match('!');
601 while ( !(c=='!' && input.LA(2)==delimiterStopChar) ) {
602 if ( c==EOF ) {
603 RecognitionException re = new MismatchedTokenException((int)'!', input);
604 re.line = input.getLine();
605 re.charPositionInLine = input.getCharPositionInLine();
606 errMgr.lexerError(input.getSourceName(),
607 "Nonterminated comment starting at " +
608 startLine +":" +
609 startCharPositionInLine +
610 ": '!" +
611 delimiterStopChar +
612 "' missing" , templateToken, re);
613 break;
614 }
615 consume();
616 }
617 consume();
618 consume(); // grab !>
619 return newToken(COMMENT);
620 }
621
622 void LINEBREAK() {
623 match('\\'); // only kill 2nd \ as ESCAPE() kills first one

Callers 1

outsideMethod · 0.95

Calls 7

matchMethod · 0.95
consumeMethod · 0.95
newTokenMethod · 0.95
getCharPositionInLineMethod · 0.80
getLineMethod · 0.45
lexerErrorMethod · 0.45
getSourceNameMethod · 0.45

Tested by

no test coverage detected