zoukankan      html  css  js  c++  java
  • 各种编程语言的注释符

    Comment comparison

    There is a wide variety of syntax styles for declaring comments in source code. BlockComment in italics is used here to indicate block comment style. InlineComment in italics is used here to indicate inline comment style.

    LanguageIn-line commentBlock comment
    AdaEiffelEuphoriaOccamSPARK, ANSI SQLToolBook OpenScript, and VHDL -- InlineComment  
    ALGOL 60   comment BlockComment;
    ALGOL 68   ¢ BlockComment ¢

    comment BlockComment comment
    co BlockComment co
    BlockComment #
    £ BlockComment £

    AppleScript -- InlineComment (* BlockComment *)
    Assembly language (varies) InlineComment   one example (most assembly languages use line comments only)  
    AutoHotkey InlineComment /* BlockComment */
    AWKBashBourne shellC shellMaplePythonRTcl, and Windows PowerShell InlineComment <# BlockComment #>
    BASIC (various dialects): 'InlineComment (not all dialects)

    REM InlineComment

     
    C (K&R, ANSI/C89/C90), CHILLPL/I, and REXX   /* BlockComment */
    C (C99)C++Go, and JavaScript // InlineComment /* BlockComment */
    C# // InlineComment
    /// InlineComment (XML documentation comment)
    /* BlockComment */
    /** BlockComment */ (XML documentation comment)
    Cobol InlineComment (when * is in column 7)  
    Curl || InlineComment |# BlockComment #|

    |foo# BlockComment #|

    Cobra InlineComment /# BlockComment #/ (nestable)
    D // InlineComment
    /// Documentation InlineComment (ddoc comments)
    /* BlockComment */
    /** Documentation BlockComment */ (ddoc comments)

    /+ BlockComment +/ (nestable)
    /++ Documentation BlockComment +/ (nestable, ddoc comments)

    DCL $! InlineComment  
    ECMAScript (JavaScriptActionScript, etc.) // InlineComment /* BlockComment */
    Forth  InlineComment BlockComment ) (single line only)

    before -- after ) stack comment convention

    FORTRAN 66/77 InlineComment (the letter 'C' in the first column makes the entire line a comment).  
    Fortran 90 InlineComment (all characters on the line, from the exclamation mark onwards, are comments)  
    Haskell -- InlineComment {- BlockComment -}
    Java // InlineComment /* BlockComment */

    /** BlockComment */ (Javadoc documentation comment)

    Lisp and Scheme InlineComment #| BlockComment |#
    Lua -- InlineComment --[==[ BlockComment]==] (variable number of = signs)
    Maple InlineComment (* BlockComment *)
    Mathematica   % (* BlockComment *)
    Matlab InlineComment %{
    BlockComment (nestable)
    %}

    Note: Both percent–bracket symbols must be the only non-whitespace characters on their respective lines.
    Object Pascal (Delphi) // InlineComment (* BlockComment *)
    BlockComment }
    OCaml   (* BlockComment (* nestable *) *)
    PascalModula-2Modula-3Oberon, and ML:   (* BlockComment *) (OCaml comments are nestable)
    Perl and Ruby InlineComment =begin
    BlockComment
    =cut
     (POD documentation comment)

    __END__
    Comments after end of code

    PHP InlineComment
    // InlineComment
    /* BlockComment */
    /** Documentation BlockComment */ (PHP Doc comments)
    PILOT R:InlineComment  
    PL/SQL and TSQL -- InlineComment /* BlockComment */
    REALbasic InlineComment
    // InlineComment
    rem InlineComment
     
    SAS   BlockComment;
    /* BlockComment */
    Seed7 InlineComment (* BlockComment *)
    Simula   comment BlockComment;
    BlockComment;
    Smalltalk   "BlockComment"
    Smarty   {* BlockComment *}
    Standard ML   (* BlockComment *)
    TeXLaTeXPostScriptErlang, and S-Lang InlineComment  
    Texinfo @c InlineComment

    @comment InlineComment

     
    TUTOR InlineComment
    command $$ InlineComment
     
    Visual Basic InlineComment
    Rem InlineComment
     
    Visual Basic .NET InlineComment

    ''' InlineComment (XML documentation comment)
    Rem InlineComment

     
    Visual Prolog InlineComment /* BlockComment */

    参考推荐:

    Comparison of programming languages (syntax)  (wiki)

  • 相关阅读:
    作业 第四 张垚
    软件测试课堂练习 张垚
    增删改查
    计算器 作业
    activity 张垚
    第四作业 张垚
    第六周作业
    jsp第四周作业
    jsp求1-100之间的素数和
    JSP第一次测试
  • 原文地址:https://www.cnblogs.com/shangdawei/p/4769621.html
Copyright © 2011-2022 走看看