Names, Scopes, and Bindings Names, Scopes, and ... - Lrde - Epita
Names, Scopes, and Bindings Names, Scopes, and ... - Lrde - Epita
Names, Scopes, and Bindings Names, Scopes, and ... - Lrde - Epita
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Bindings</strong><br />
Symbol Tables<br />
Complications<br />
Overloading<br />
Non Local Variables<br />
<strong>Bindings</strong><br />
Symbol Tables<br />
Complications<br />
Overloading<br />
Non Local Variables<br />
Escaping Variables/Arguments<br />
Annotating the ast<br />
Technically escaping means “cannot be stored in a register”.<br />
In C:<br />
Large values (arrays,<br />
structs).<br />
Variables which address is<br />
taken.<br />
Variable arguments.<br />
In Tiger:<br />
variables/arguments from<br />
outer functions<br />
not variables/arguments<br />
from outer scopes.<br />
being non local means having non local uses<br />
obviously non local variables need to be accessible from inner<br />
functions<br />
to simplify the compiler, it is easier to leave them on the stack<br />
hence the translation to intermediate representation needs to<br />
know which variables are non local from their definitions<br />
therefore a preleminary pass should flag non local variables<br />
A. Demaille, R. Levillain <strong>Names</strong>, <strong>Scopes</strong>, <strong>and</strong> <strong>Bindings</strong> 53 / 55<br />
A. Demaille, R. Levillain <strong>Names</strong>, <strong>Scopes</strong>, <strong>and</strong> <strong>Bindings</strong> 54 / 55<br />
<strong>Bindings</strong><br />
Symbol Tables<br />
Complications<br />
Overloading<br />
Non Local Variables<br />
Bibliography I<br />
Andrew W. Appel.<br />
Modern Compiler Implementation in C, Java, ML.<br />
Cambridge University Press, 1998.<br />
Ada Reference Manual, 1983.<br />
Stephen Edwards.<br />
COMS W4115 Programming Languages <strong>and</strong> Translators,<br />
2003.<br />
http://www.cs.columbia.edu/~sedwards/classes/2003/<br />
w4115/.<br />
A. Demaille, R. Levillain <strong>Names</strong>, <strong>Scopes</strong>, <strong>and</strong> <strong>Bindings</strong> 55 / 55