function list with c code for this type

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

function list with c code for this type

Postby ivxGilbert » Sun Jul 30, 2006 1:46 am

Hi, everybody:

I can see the function name in the function list if the function is like this:
Code: Select all
void getUIMType (
  uim_rsp_buf_type *rsp_ptr
)

But I can NOT see the function name in the function list if it is like this:
Code: Select all
void getUIMType
(
  uim_rsp_buf_type *rsp_ptr
)


If I want to also see the function name in the function list for the second type, how should I modify my function strings?
My function strings(the default settings of UE32):
[php]
/Function String = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]+([^p*&:, ^t^[^]a-zA-Z_0-9.!]++)[~;]"
/Function String 1 = "%[a-zA-Z_0-9*]*::^([a-zA-Z_0-9^~]+^)[ ^t^p]++([^p*&:, ^t^[^]/*^-'=:&a-zA-Z_0-9./(!]++)[~;]"
/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 3 = "%[a-zA-Z_0-9*&$^[^]*]+[ ^t]+[a-zA-Z_0-9*&$^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 4 = "%[a-z_0-9^[^]*]++ [a-z_0-9*^[^]]+[ ^t]++[a-z_0-9*^[^]]+[ ^t]++^([*a-z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-z_0-9./(!]++)[~;]"
/Function String 5 = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./()!]++)[~;]"
[/php]

Best Regards.
User avatar
ivxGilbert
Newbie
 
Posts: 4
Joined: Fri Jul 28, 2006 11:00 pm

Re: function list with c code for this type

Postby Mofi » Sun Jul 30, 2006 12:32 pm

Replace function string 2 by following regex string where only the ( after the function name is now inside an OR expression. After the function name and optional spaces/tabs now either CRLF followed by ( at next line OR only ( in the current line must follow.

/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++^{^p(^}^{(^}[^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"

Hope this modification has no bad effects elsewhere.

You can use the ^{^p(^}^{(^} expression also for the other strings as replacement for the simple ( after function name. But make sure the function string will not exceed maximum length of 119 characters - see Weird Function String behaviour.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: function list with c code for this type

Postby ivxGilbert » Sun Jul 30, 2006 1:57 pm

It does work! :o
Thank you very much, Mofi.^_^

Best Regards :P
User avatar
ivxGilbert
Newbie
 
Posts: 4
Joined: Fri Jul 28, 2006 11:00 pm

Re: function list with c code for this type

Postby ivxGilbert » Thu Nov 02, 2006 2:24 pm

Dear Mofi:
If the function definition is like :
Code: Select all
int test
 (int a)
{
    a= 0;
}

The parameter line is the second line and some spaces are in front of it.
The function list can not be seen this api.
How should I modify wordfile.txt to see it in function list ?

Besides, I tried to add the second block comment for C.
What I want is :
Code: Select all
#if 0
the codes during the block #if 0 & #endif is comment
#endif


Code: Select all
#if 1
workable codes
#else
the codes during the block #else & #endif is comment
#endif

My modification is like :
Block Comment On Alt = #if 0 Block Comment Off Alt = #endif
But it doesn't work well. How should I modify?
Thank you very much.
User avatar
ivxGilbert
Newbie
 
Posts: 4
Joined: Fri Jul 28, 2006 11:00 pm

Re: function list with c code for this type

Postby Mofi » Fri Nov 03, 2006 5:58 pm

/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++^{^p[ ^t]++(^}^{(^}[^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"

should solve your function list problem.

It's not possible to specify a block comment which contains a space.

Block Comment On Alt = #if 0 Block Comment Off Alt = #endif is interpreted by UE as:

  • Block Comment On Alt = #if
  • 0 = unknown keyword - ignored
  • Block Comment Off Alt = #endif
For a workaround see Comments from "#if 0" to "#endif".

Hint: The forum search does not support search for an exact term in double quotes, but Google does it.
So I entered in Google: site:ultraedit.com "#if 0" and bingo.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting