10.12.2012 Views

The Java Language Specification, Third Edition

The Java Language Specification, Third Edition

The Java Language Specification, Third Edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

LEXICAL STRUCTURE Identifiers 3.8<br />

EndOfLineComment:<br />

/ / CharactersInLine opt<br />

CommentTail:<br />

* CommentTailStar<br />

NotStar CommentTail<br />

CommentTailStar:<br />

/<br />

* CommentTailStar<br />

NotStarNotSlash CommentTail<br />

NotStar:<br />

InputCharacter but not *<br />

LineTerminator<br />

NotStarNotSlash:<br />

InputCharacter but not * or /<br />

LineTerminator<br />

CharactersInLine:<br />

InputCharacter<br />

CharactersInLine InputCharacter<br />

<strong>The</strong>se productions imply all of the following properties:<br />

• Comments do not nest.<br />

• /* and */ have no special meaning in comments that begin with //.<br />

• // has no special meaning in comments that begin with /* or /**.<br />

As a result, the text:<br />

/* this comment /* // /** ends here: */<br />

is a single complete comment.<br />

<strong>The</strong> lexical grammar implies that comments do not occur within character literals<br />

(§3.10.4) or string literals (§3.10.5).<br />

3.8 Identifiers<br />

DRAFT<br />

An identifier is an unlimited-length sequence of <strong>Java</strong> letters and <strong>Java</strong> digits, the<br />

first of which must be a <strong>Java</strong> letter. An identifier cannot have the same spelling<br />

(Unicode character sequence) as a keyword (§3.9), boolean literal (§3.10.3), or<br />

the null literal (§3.10.7).<br />

19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!