CS 342 Lecture -*- Outline -*- * Pseudo-code Language Improvements ** Symbolic labels *** statement labels makes changing program much easier adding location need operation to define labels *** Variable labels need operation to declare variables (and type: array vs. float) *** Binding declaration binds label to location (program or data) Binding time: when the binding takes place; it is load time in our pseudo-code. ** Implementation of symbolic labels (Symbol tables) 1. scan program listing for label 2. build a table that translates labels to absolute locations -can check that labels are defined only once (security) -can check that referenced labels are defined (security) (and conversely) one pass: initialize table to "undefined" if encounter reference before definition, change value to "referenced" when process definition, change value to "defined" at end of "loading", look for "referenced" values. ** Format (syntax) *** Using characters a ``mere'' change in syntax. *** Fixed fixed columns easier to parse, *** Free (variable) ignoring whitespace (looking for words) *** Implementation loader translates characters into old internal format, using symbol table for operations, variables, and labels the old syntax is now an "internal form" *** comparision to compilers same basics: name lookup and storage allocation.