Names, Scopes and Bindings.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Names, Scopes and Bindings.ppt

CS415 - Spring 2005 Names, Scopes and Bindings Aaron Bloomfield CS 415 Fall 2005* Binding A binding is an association between two things, such as a name and the thing it represents Example: int x When this statement is compiled, x is bound to a memory space Binding Time The time at which the association between two items is created There are many different binding times that can be implemented: Language design time Language implementation time Program writing time Compile time Link time Load time Run time Binding Times Language design time These are control flow constructs, primitives, and other semantics Think of reserved words: i.e. if, for, else, while, etc. Language implementation time These include I/O couplings System dependent things such as max heap and stack sizes Think of constants: MAX_INT, etc. In Algol, this included the I/O procedure names Binding Times Program writing time When you the programmer choose data structures and names Compile time The compiler maps high level constructs to machine code Think of the assembly for a compiled procedure Link time Separate compilation means not every part of a program has to be compiled at the same time Libraries are linked to your program and bound Binding Times Load time For primitive operating systems Binds physical addresses Most OSes do this during link time with virtual addresses Run time Very broad term covering the span of execution Values to variable bindings occur here Binding Times Very important to design and implementation of programming languages Early bindings = greater efficiency Later bindings = greater flexibility Scope rules The textual region of the program in which a binding is active is its scope Static scoping is more common in modern programming langauges Found in C, C++, Pascal Static scope All scoping can be determined at compile time Most often this is done with a textual top-to-bottom scan Most basic static scope rule: everything has global scope Fortran Implementation Global sco

文档评论(0)

gshshxx + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档