title: how does a C-like compiler interpret the if statement
body: <p>In C-like languages, we are used to having if statements similar to the following:</p>
  
  <pre><code>if(x == 5) {
      //do something
  }
  else if(x == 7) {
      //do something else
  }
  else if(x == 9) {
      //do something else
  } else {
      //do something else
  }
  </code></pre>
  
  <p>My question is, does the compiler see that if statement that way, or does it end up being interpreted like:</p>
  
  <pre><code>if(x == 5) {
      //do something
  }
  else {
      if(x == 7) {
          //do something
      }
      else {
          if(x == 9) {
              //do something
          }
          else {
              //do something else
          }
      }
  }
  </code></pre>
  
  <p>EDIT: I realized that while the question made sense in my head, it probably sounded rather stupid to the rest of the general populace. I was more referring to how the AST would look and if there was any special AST cases for 'else-if' statements or if it would be compiled as a cascading if/else block.</p>