title: Extracting all variable names from Variable declarations using Eclipse JDT
body: <p>I have been working on analyzing source code using Eclipse JDT. 
  Currently, I have a program that is able to get some code, convert it to an AST and then make some annotations.</p>
  
  <p>Now, what I want to do is, for each variable declaration, get all the variables involved. For example:</p>
  
  <pre><code>int  a = 10;
  </code></pre>
  
  <p>Its easy, just variable <code>a</code></p>
  
  <p>But in the following case : </p>
  
  <pre><code>int a = b +c ;
  </code></pre>
  
  <p>I need to analyze the right part and extract each variable.
  What I have until now is this :</p>
  
  <p>For each variable declaration: </p>
  
  <pre><code>//get the fragment                                   
  List&lt;VariableDeclarationFragment&gt; ff = vds_p.fragments();
  
  //foreach fragment, get the name of the variable and the value associated
  for(VariableDeclarationFragment f_p : ff){
     SimpleName name = f_p.getName();
     Expression exp  =  f_p.getInitializer();
     ChildPropertyDescriptor exp_prop = f_p.getInitializerProperty();
  
     System.out.println("name: "+name);
     System.out.println("expression: "+exp);
  }                                                                       
  </code></pre>
  
  <p>So, Im able to get the name of the variable and the expression which is assigned to it. 
  Now, here is my question:</p>
  
  <p>How can I analyze using JDT the expression being assigned to the variable, For example in</p>
  
  <pre><code>int a = b + c ;
  </code></pre>
  
  <p>I want to get <code>b</code> and <code>c</code>. 
  I know that  I can get the  "b+c" string and apply a manual parsing based on the operator, but Im wondering if there is a more automated way using JDT</p>
  
  <p>Thanks!  </p>