how to count unique operator and opernad,functionin and out

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
rami
Forum Contributor
Posts: 217
Joined: Thu Sep 15, 2005 8:55 am

how to count unique operator and opernad,functionin and out

Post by rami »

using reg ex in php i was trying to count
1)unique number of operand used in whole program
2)unique number of operator used in whole program
3)total number of operand used in whole program
4)total number of operator used in whole program

along with it
how can i count
1)fan in
that is number of calls to the function(from others unique functions)
2)fan out
number of calls from the function(to others unique functions)

any ideas

thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I might be wrong but it sounds like the problem is beyond regular expressions and needs a parser for context-free grammars.
If you want to analyze php scripts http://de2.php.net/tokenizer may be of interest.
Post Reply