function list for Java

Syntax highlighting, code folding, brace matching, code indenting, and function list

function list for Java

Postby xusooxusoo » Fri Sep 16, 2005 1:49 am

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
User avatar
xusooxusoo
Newbie
 
Posts: 5
Joined: Sat Oct 16, 2004 11:00 pm

Re: function list for Java

Postby Mofi » Sun Sep 18, 2005 9:41 am

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^[^]]+ ^(*(*)^)*{$"
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: function list for Java

Postby xusooxusoo » Sun Sep 18, 2005 11:07 am

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
User avatar
xusooxusoo
Newbie
 
Posts: 5
Joined: Sat Oct 16, 2004 11:00 pm

Re: function list for Java

Postby xusooxusoo » Sun Sep 18, 2005 12:18 pm

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

XS
User avatar
xusooxusoo
Newbie
 
Posts: 5
Joined: Sat Oct 16, 2004 11:00 pm

Re: function list for Java

Postby StaticGhost » Thu Oct 13, 2005 11:04 pm

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

void someMethod1(int anArg, Object anotherArg, String yetAnotherArg,
Object andStillAnother) {
...
}
User avatar
StaticGhost
Basic User
Basic User
 
Posts: 35
Joined: Sun Nov 21, 2004 12:00 am

Re: function list for Java

Postby Mofi » Sat Oct 15, 2005 12:02 pm

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]++$"
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: function list for Java

Postby StaticGhost » Sun Sep 12, 2010 7:58 pm

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
:)
User avatar
StaticGhost
Basic User
Basic User
 
Posts: 35
Joined: Sun Nov 21, 2004 12:00 am


Return to Syntax Highlighting