码迷,mamicode.com
首页 > 编程语言 > 详细

Java文法(4)—comments

时间:2015-01-22 23:07:33      阅读:345      评论:0      收藏:0      [点我收藏+]

标签:

------------------------------------------------------------------------------------------------------
说明:
    There are two kinds of comments.
    • /* text */
        A traditional comment: all the text from the ASCII characters /* to the ASCII characters */ is ignored (as in C and C++).
    • // text
        An end-of-line comment: all the text from the ASCII characters // to the end of the line is ignored (as in C++).
-------------------------------------------------------------------------------------------------------
文法:        
    Comment: 
        TraditionalComment 
        EndOfLineComment
    TraditionalComment: 
        / * CommentTail
    EndOfLineComment:
        // CharactersInLine opt
    CommentTail:
        * CommentTailStar
        NotStar CommentTail
    CommentTailStar: 
        /
        * CommentTailStar 
        NotStarNotSlash CommentTail
    NotStar:
        InputCharacter but not * LineTerminator
    NotStarNotSlash: 
        InputCharacter but not * or / 
        LineTerminator
    CharactersInLine:
        InputCharacter
        CharactersInLine InputCharacter
    说明:
        These productions imply all of the following properties:
        • Comments do not nest.
        • /* and */ have no special meaning in comments that begin with //.
        • // has no special meaning in comments that begin with /* or /**.
        As a result, the text:
            /* this comment /* // /** ends here: */
        is a single complete comment.
        The lexical grammar implies that comments do not occur within character literals (§3.10.4) or string literals (§3.10.5).

 

Java文法(4)—comments

标签:

原文地址:http://www.cnblogs.com/xyhr/p/4242898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!