<div dir="ltr">By performing a name lookup into appropriate Scope. Scopes are linked in a chain and name lookup traverses them starting from the inner one.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 9, 2015 at 3:09 AM, Eric Lu <span dir="ltr"><<a href="mailto:eirc.lew@gmail.com" target="_blank">eirc.lew@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>In a C for loop like:</div><div>int a[10];</div><div>for(int i = 0; i < 10; i++){</div><div>   a[i] = i + 1;</div><div>}</div><div><br></div><div>The variable "i" is declared in the ForContext in ParseForStatement(), and then when parse body, I.E., the expression "a[i]" later, how does it know that "i" is declared?</div><div><br></div><div>In other words, how does the ForContext affect the later parsing of variable "i" ?</div><span class="HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div>Best Regards!<br>Eric Lew</div>
</div></font></span></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>