Hi Jussi,
The feature to find the next function ( control-down_arrow or control-up_arrow ) is no longer working correctly in C++ files. I'm not sure when it stopped working. It stops at many lines that aren't functions. I believe the problem is that it is stopping at any line which contains a double colon (::). I have a lot on lines in my code that have this structure
class_name::enum_constant_declared_in_class
This needs to be distinguished from a function which looks like this:
void class_name :: function_name( parameters)
Hopefully, this can be fixed because I use to love this feature.
Thanks!
Jack
find next function
In the general section of the document type there is a function regexp that defines what is a function.
All you need to do is create a regexp that defines the lines that are functions.
For example this regexp
will identify lines of code like the following as functions
To add more definitions just use the regep or construct:
Cheers Jussi
All you need to do is create a regexp that defines the lines that are functions.
For example this regexp
Code: Select all
[a-zA-Z0-9_]+::[a-zA-Z0-9_]+\(
Code: Select all
void class_name::function_name( parameters)
Code: Select all
([a-zA-Z0-9_]+::[a-zA-Z0-9_]+\()|(some other regexp search)
Hi Jussi,
Thanks for the feedback, I didn't realize I could configure this. But unfortunately, this just changes the problem. I didn't do a complete job of asking my question. I want to find function definitions for C and C++ of the form
return_type class_name :: function name ( parameters )
return_type class_name :: function name ( parameters,
return_type function name ( parameters )
return_type function name ( parameters
and not find lines which call functions or have similar structures
function( parameter );
function (
if ( result > sizeof(tag) )
class_name::enum_variable
I'm not very good at regular expressions, but I don't see any way to find just the functions.
Thanks!
Jack
Thanks for the feedback, I didn't realize I could configure this. But unfortunately, this just changes the problem. I didn't do a complete job of asking my question. I want to find function definitions for C and C++ of the form
return_type class_name :: function name ( parameters )
return_type class_name :: function name ( parameters,
return_type function name ( parameters )
return_type function name ( parameters
and not find lines which call functions or have similar structures
function( parameter );
function (
if ( result > sizeof(tag) )
class_name::enum_variable
I'm not very good at regular expressions, but I don't see any way to find just the functions.
Thanks!
Jack
Hi Jack,
Try this one:
To test my regular expressions I just use the find dialog in Zeus itself.
Cheers Jussi
Try this one:
Code: Select all
^[_a-z0-9]+[ &*\t]+[_a-z0-9 :\t]*[_a-z0-9]+[ \t]*[(]+.*
In the expression given the ^ represents the start of line, the [...] represent a set of charaters, the + means it must be found, the * means optional and the .* means any characters.I'm not very good at regular expressions
Cheers Jussi
Just change the regexp to be this:It still stops a prototypes of functions which is a very minor issue.
Code: Select all
^[_a-z0-9]+[ &*\t]+[_a-z0-9 :\t]*[_a-z0-9]+[ \t]*[(]+.*[^;]+$
In fact since functions can be written using upper case letters the regexp should be this:
Code: Select all
^[_a-zA-Z0-9]+[ &*\t]+[_a-zA-Z0-9 :\t]*[_a-zA-Z0-9]+[ \t]*[(]+.*[^;]+$