title: How does compiler know scope variables
body: <p>I want to implement a scope variable like compiler in c# knows where the variable is definition.
  I mean, like</p>
  
  <pre><code>int a = 5;
  for (int i = 0; i &lt; a; i++)
  {  
     // Here you can use a variable after instantiating it, "a" can still be used
     int b = 10;
  }
  // b cannot be used here.
  </code></pre>
  
  <p>I want to do it by xml file. like</p>
  
  <pre><code>&lt;block&gt;
     &lt;if&gt; 
        &lt;eq&gt;
           &lt;makevar var='var1'&gt;somevalue&lt;/makevar&gt;
           &lt;makevar var='var2'&gt;somevalue&lt;/makevar&gt;
        &lt;/eq&gt;
      &lt;/if&gt;
      &lt;get var ='var1' /&gt;
  &lt;/block&gt;
  </code></pre>
  
  <p>This command <code>&lt;get var='var1' /&gt;</code> can't be used because it isn't in the scope which it assigned in.</p>
  
  <p>How can I implement this?</p>