Function string for C function with inline comments

Function string for C function with inline comments

2
NewbieNewbie
2

    Feb 16, 2005#1

    Hello

    can anyone help me to build up a function string which let this function type appear in the function list

    extern void LibM_CmpdAddTextRec (
    LOGHANDLE hLog, /**< comment */
    const char *pcText, /**< comment */
    WORD PabID, /**< comment */
    COLOR_VALUE cvColor, /**< comment */
    Lib_OdsRec **ppOdsRec ) /**< comment */



    thank you

    20
    Basic UserBasic User
    20

      Jan 30, 2006#2

      Well im guessing that the function list works in the same way as the class viewer so it would be pretty easy to just edit the source of cTags, recompile and use that instead of the default version that you download from the web.
      A source of incoherent bullshit since 1986

      6,675585
      Grand MasterGrand Master
      6,675585

        Jan 30, 2006#3

        The first one uses void as anchor for the function name:

        /Function String 1 = "void[ ^t]+[ ^t^*]++^([0-9A-Za-z_^-]+^)[ ^t]++([~);]+)[~;]"

        Explanation: Find a string with

        a) starts with word "void"

        b) [ ^t]+ ... followed by 1 or more spaces and/or tabs

        c) [ ^t^*]++ ... followed by 0 or more asterisk and/or spaces and/or tabs

        d) ^([0-9A-Za-z_^-]+^) ... followed by a string which contains only numbers, characters, underscores and hyphens. This string is the function name which should be displayed in the function list.

        e) [ ^t]++ ... followed by 0 or more spaces and/or tabs

        f) ([~);]+) ... followed by a round bracket and a string which does not contain ) or ; (this includes also line endings CRLF!) and a closing round bracket

        g) and last with a character that is not a semicolon immediatelly after the closing ).


        The second one is for general usage and similar to first one. To avoid something like if ( var=15 ) to be identified as function, after opening ( only white spaces are allowed til first line ending and the function definition must be a multi-line definition.

        /Function String 2 = "[ ^t^*]++^([0-9A-Za-z_^-]+^)[ ^t]++([ ^t]++^p[~);]+)[~;]"


        The problem with the regular expression for multi-line function definitions is to securely detect the function definitions and not conditions and function calls. The hit rate for correct function names found can be improved by adjusting the regular expression as much as possible to your personal programming style. For example if you always add comments to a multi-line function definition with /* */ in the second line it would be helpful to add this to the regular expression to increase the positive hit rate. But I don't know your programming style.
        Best regards from an UC/UE/UES for Windows user from Austria

        2
        NewbieNewbie
        2

          Jan 31, 2006#4

          thank you
          the explanations helped me to build up the right function strings