function list for Java

function list for Java

5
NewbieNewbie
5

    Sep 16, 2005#1

    1)function with default access modifier.
    void someMethod1(int anArg, Object anotherArg, String yetAnotherArg,
    Object andStillAnother) {
    ...
    }

    2)function whose return type is an array.
    private byte[] someMethod2(int anArg,Object anotherArg) {
    ...
    }

    The ultraedit would not show the function list properly,any suggestions?

    XS

    6,681583
    Grand MasterGrand Master
    6,681583

      Sep 18, 2005#2

      I don't have any Java file and I don't have experience in Java programming. You also don't have written, which Java wordfile you use. So I guess, you use that one from standard wordfile.txt. However here is the solution for your 2 examples.

      Open wordfile.txt in UltraEdit directory directly or better via Advanced - Configuration - Syntax Highlighting - button Open. Then go to the function strings for Java (language 4) and add this line:

      /Function String 2 = "%[ ^t]++void[ ^t]+^(*(*)^)*{$"

      And modify the first function string to following:

      /Function String = "%[ ^t]++[ps][a-z]+ [a-z0-9^[^]]+ ^(*(*)^)*{$"
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        Sep 18, 2005#3

        Danke, Mofi. My two examples work well now with your wordfile.

        Just one more issue regarding the example #1 in my original post:
        1)function with default access modifier.
        void someMethod1(int anArg, Object anotherArg, String yetAnotherArg,
        Object andStillAnother) {
        ...
        }

        If I change the 'void' into 'int' or something else, the method will not be displayed properly.any comments?

        Mit freundlichem Gruss,
        XS

          Sep 18, 2005#4

          Actually the following looks better...
          /Function String 2 = "%[ ^t]++[a-z]+^(*(*)^)*{$"

          XS

          44
          Basic UserBasic User
          44

            Oct 14, 2005#5

            Mm... but I find that none of these function strings pick up this still:

            void someMethod1(int anArg, Object anotherArg, String yetAnotherArg,
            Object andStillAnother) {
            ...
            }

            6,681583
            Grand MasterGrand Master
            6,681583

              Oct 15, 2005#6

              StaticGhost wrote:Mm... but I find that none of these function strings pick up this still:}
              Function string 2 does it, but only at following conditions:

              a) The function name is written in a single line.

              Working:

              Code: Select all

              void someMethod1(int anArg, Object anotherArg, String yetAnotherArg, Object andStillAnother) {
              Not Working:

              Code: Select all

              void someMethod1(int anArg, Object anotherArg, String yetAnotherArg,
              Object andStillAnother) {
              b) No trailing spaces exist after {.


              This modified function string will solve the problem with trailing spaces.

              /Function String 2 = "%[ ^t]++[a-z]+^(*(*)^)*{[ ^t]++$"
              Best regards from an UC/UE/UES for Windows user from Austria

              44
              Basic UserBasic User
              44

                Sep 13, 2010#7

                This regex will find Java function Strings with multiple newline characters in them:

                Code: Select all

                %[ ^t]++[ps][a-z]+ [a-z0-9]+ ^(*([ ^t^pa-zA-Z0-9-_,]++)^)[ ^t]++$
                It now finds:

                Code: Select all

                void someMethod1(int anArg, Object anotherArg, String yetAnotherArg,
                Object andStillAnother) {
                or..

                Code: Select all

                void someMethod1(int anArg, 
                                       Object anotherArg, 
                                       String yetAnotherArg,
                                       Object andStillAnother) {
                Much better.

                Rob
                :)
                UltraEdit - licensed for life!

                http://robertmarkbramprogrammer.blogspot.com