determining function declaration, definition and call
===

I came across a question regarding writing a code to determine unused functions in C++. We can use different data structures to determine unused functions. But before that, we need to parse the code. I have question related to parsing part, how we can differentiate functions declaration and definition and function-calls?

Like, 

     //function declaration without argument
     fun1 ();
    
     //function definition
     fun1 () {
       // code goes here
      }
       
     main () {
       fun1 ();
      }

Above declaration and call is looks same where as definition part is little bit different from declaration and call.

Other than above scenario, there are multiple scenario for calling a function and functions scope, like two classes having function with same name one function get called within member function (i.e. no explicit calling object required) OR function call using object so, need to understand object's type first to determine which function is actually called.

How can parsing implemented efficiently? How many parsing will required in above scenario?
