Latest Update killed function list in c_cplusplus

Latest Update killed function list in c_cplusplus

2
NewbieNewbie
2

    Nov 06, 2013#1

    I have just update to UltraEdit v20.00.0.1052 and I like the new features. However, it seems the function lists were changed again and now I have less and less use of the function list. only basic c++ functions are displayed.

    I've determined that one of the problems is that it doesn't allow for any white space prior to the start of the function declaration. There are other areas I have identified. Rather than getting help with each one I would rather just figure out what the perl regular expression that is being used does so I can modify that directy.

    Here's what is currently in the deafult c_plusplus.uew file

    /TGBegin "Functions"
    /TGFindStr = "^(?!if\b|else\b|while\b|[\s\*])(?:[\w\*~_&]*?\s+){0,6}([\w:\*~_&]+\s*)\([^\);]*\)[^\{;]*\{"
    /TGBegin "Parameters"

    I was able to add to and modify the function lists in the past prior to the move to perl regular expressions. I am unfamiliar with them now. Any help on what the TFFindStr line syntax actually breaks down to mean would help greatly.

    10210
    Power UserPower User
    10210

      Nov 07, 2013#2

      I'm having problems as well with the latest version of the syntax highlighting file for C/C++.

      As an example, from a piece of source code I work on, it declares:

      SMCID() /* macro to insert copyright notice into generated code */

      and then has the following functions (ignoring the parms the functions take)

      extern int FN_WTO_MULTILINE()

      extern int FN_TEST_MSGLVL_MULTILINE()

      However the function list window only displays

      FN_TEST_MSGLVL_MULTILINE
      SMCID

      This is both for UES 14.00.0.1005 and UE 20.00.0.1054, running on a Win7 Pro X64 system.

      I'm sure that earlier versions of the C/C++ wordfile did work correctly to display all the functions in the code.

      Any help appreciated.

      Thanks...

      Frank

      6,606548
      Grand MasterGrand Master
      6,606548

        Nov 07, 2013#3

        On upgrade from UE < v20.00 to UE v20.00 the wordfiles in %APPDATA%\IDMComp\UltraEdit\wordfiles\ (and only in this directory) are updated automatically and unfortunately silently. But the previous wordfiles directory is kept with appending the date on making this update. Same is most likely done on upgrade from UES < 14.00 to UES v14.00. (I have not yet installed UES because too busy to do so with checking additionally what changes on the upgrade.)

        So if you were happy with previous version of c_cplusplus.uew and you are not happy with the new version, open %APPDATA%\IDMComp\UltraEdit\ in your file manager (Windows Explorer, ...), open the wordfiles subdirectory with date in name (the latest one if you have already several such wordfile directories), and copy c_cplusplus.uew from this directory into the wordfiles directory without a date in name.

        I will later look on the Perl regular expression not supporting function definitions which do not start at column 1 as it is usual for function definitions because of preceding spaces/tabs. mtetterton, please, would you post some examples of such function definitions using the BBCode tags for code examples. I would like to see the function definition line(s) with the lines containing { and } of the function. The function body itself is not needed. That would be a help on improving the Perl regular expression search strings which I finally need to sent to IDM when the new ones are working.


        fgeurts, your examples are obviously not complete as the first one SMCID() is a macro according to comment and should be therefore start with #define. And the other two are most likely function declarations and not function definitions because of keyword extern at beginning although the semicolon at end is missing.
        Best regards from an UC/UE/UES for Windows user from Austria

        10210
        Power UserPower User
        10210

          Nov 07, 2013#4

          Mofi, thanks for your comments. I've reverted to the previous version of the c/c++ word file and it correctly displays the names of both functions contained in the file I used in my example, and no longer displays the name for the SMCID macro. As you indicated, in my previous post my examples were incomplete. SMCID() is a macro call within each of our modules to insert the copyright notice in the code. The macro itself is defined in a global header file which is included in each module, and the macro looks like this, where each of the uppercase place holders are in themselves #defined values.

          Code: Select all

          #define MODID() \
          static const struct MODEYECATCH moduleID = \
          { \
              PRODUCT_COMPONENT_NAME , \
              ' ', \
              ELS_RELEASE_NUMBER, \
              PRODUCT_NUMBER, \
              "S" MAKE_STRING(PRODUCT_FMID), \
              C_SRC_NAME_STRING " ", \
              MAKE_STRING(SMCPTF), \
              MAKE_STRING(SMCISSUE), \
              __DATE__, \
              __TIME__, \
              COPYRIGHT_FLAG\
          };\
          static const char                    moduleCopyright[] = COPYRIGHT;\
          
          #define SMCID() \
                  MODID()
          
          The other 2 examples I gave were the actual function names contained withing the module, only one of which was being displayed in the function list. To give a clearer indication here is what the full declaration of one of them looks like:

          Code: Select all

          #undef  CURR_FUNC
          #define CURR_FUNC FN_WTO_MULTILINE
          extern int FN_WTO_MULTILINE(struct SMCPCE *pSmcpce,
                                      char          *pLine,
                                      int            lineLength,
                                      char           mcsFlag1,
                                      char           mcsFlag2,
                                      char           descCode1,
                                      char           descCode2,
                                      char           routeCode1,
                                      char           routeCode2,
                                      int           *pConnectId,
                                      char           multilineFlag)
          {
               // actual function code from here //
          }
          
          Thanks as always for your prompt response and help.

          Cheers...

          Frank

          6,606548
          Grand MasterGrand Master
          6,606548

            Nov 08, 2013#5

            Frank, thanks for your complete examples. That might help on improving the Perl regular expressions for function string searches. With seeing complete code of the function definitions I understand now why keyword extern is present here to explicitly declare the function as being public although this is unusual as all functions not starting with keyword static are by default public functions with a hidden extern.

            I don't know who contributed the expressions in currently installed standard c_cplusplus.uew, but the single expression for function strings is definitely not good for many C/C++ functions. I'm using still my own wordfile for C/C++ with my function strings and therefore I have not seen until now that the regular expressions in standard c_cplusplus.uew do not make a good job on many of my C/C++ files. Operator overloading functions for example in C++ files are completely ignored and also other C++ function definitions. In my C files for embedded controllers also many functions are not found and I can see in function list also "functions" which are not really functions. It looks like I have to take some hours and completely rework the expressions for function string searches in Perl syntax.
            Best regards from an UC/UE/UES for Windows user from Austria

            2
            NewbieNewbie
            2

              Nov 20, 2013#6

              As you mentioned, the single perl function line for C++ is missing a lot of nuances. Here's an example of another one:

              Code: Select all

              namespace Event
              {
                  AlarmEvent EventBuilder::buildAlarmEvent(unsigned int Controller, unsigned int alarm_code)
                  {
                       // 
                   }
              }
              
              It's not picking up any functions inside the namespace.