PPT-cs784(TK)

Author : ellena-manuel | Published Date : 2016-12-06

1 Semantics of Procedures and Scopes Kinds of Scope Static or Lexical scope determined by structure of program Scheme C Java and many compiled languages Dynamic

Presentation Embed Code

Download Presentation

Download Presentation The PPT/PDF document "cs784(TK)" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

cs784(TK): Transcript


1 Semantics of Procedures and Scopes Kinds of Scope Static or Lexical scope determined by structure of program Scheme C Java and many compiled languages Dynamic scope determined by path of execution. CS784: Programming Languages. Prabhaker Mateti. Study …. EOPL3 . Chapter 3: 3.1, 3.2. source code: chapter3/let-. lang. /*. 1722 data-. structures.scm. 4415 . drscheme-init.scm. 1450 . environments.scm. Prabhaker. . Mateti. ACK: Assembled from many sources. About Attribute Grammars. Attribute grammars (AGs) add semantic info on parse tree nodes . Used for semantic checking and other compile-time analyses, e.g., type checking in a compiler. Dijkstra’s Predicate Transformer. s. Axiomatic Semantics. gcd. -lcm algorithm w/ invariant. {PRE: (x = n) and (y = m)}. u := x; v := y;. while . {INV: 2*m*n = x*v + y*u}. (x <> y) do. if x > y then. 1. Specification and Implementation of Abstract Data Types. Spec v. Impl. (Functional) Specs should describe behavioral aspects only. Should ignore performance details. A “suitable implementation” requires client specific issues and trade-offs.. More on Evaluations. CS784(pm). 1. Scheme Expressions. Constants: numbers, . booleans. .. Variables: names for values. Created using the special form . define. Special. forms have special rules for evaluation. . Procs. w/. Params. EOPL3 Chapter 4. Expressible vs. Denotable values. Expressible Values . the language can express and compute these. represented in the language's syntax as expressions. Denotable Values . Procs. w/. Params. cs784(tk) . 1. Assignment, LHS := RHS. l-value: left-, location, address, reference, …. r-value: right-, . int. , real, address, …. env. and store allow one to describe the semantics of assignment in a purely functional style. (DENOTATIONAL SEMANTICS). Different Levels of Syntax. Lexical syntax. Basic symbols (names, values, operators, etc.). Concrete syntax. Rules for writing expressions, statements, programs. Input to compilers/interpreters. Abstract syntax. 1. Implementing Recursion. Recap: Goals. Experimenting with PL design alternatives Scoping, parameter passing, arrays, .... Runnable. prototype of reference implementation.. Cf. Informal description of a programming problem with an example executable for reference.. EOPL3 Sections . 3.4 - 3.7. The LETREC Language. All of PROC, plus …. Concrete:. Expression :: = . letrec Identifier (Identifier) = . Expression in Expression. AST:. letrec-exp (proc-name bound-var.

Download Document

Here is the link to download the presentation.
"cs784(TK)"The content belongs to its owner. You may download and print it for personal use, without modification, and keep all copyright notices. By downloading, you agree to these terms.

Related Documents