Guided Notes Ch. 5 Basic Semantics Ch. 6 Data Types PHP Fundamentals Lecture Notes from both Louden and Sebesta Review questions.

Slides:



Advertisements
Similar presentations
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
Advertisements

Programming Languages and Paradigms
Names and Bindings.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
CSE 425: Semantic Analysis Semantic Analysis Allows rigorous specification of a program’s meaning –Lets (parts of) programming languages be proven correct.
ISBN Chapter 3 Describing Syntax and Semantics.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics Fall 2005.
Chapter 5 Basic Semantics
Programming Languages Third Edition
Chapter 5K. Louden, Programming Languages1 Chapter 5 Basic Semantics.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Operational Semantics.
HTML Recall that HTML is static in that it describes how a page is to be displayed, but it doesn’t provide for interaction or animation. A page created.
The Concept of Variables
Chapter 9: Subprogram Control
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
Names and Bindings Introduction Names Variables The concept of binding Chapter 5-a.
1 Contents. 2 Run-Time Storage Organization 3 Static Allocation In many early languages, notably assembly and FORTRAN, all storage allocation is static.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Scope.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
Syntax & Semantic Introduction Organization of Language Description Abstract Syntax Formal Syntax The Way of Writing Grammars Formal Semantic.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
5-1 Chapter 5: Names, Bindings, Type Checking, and Scopes Variables The Concept of Binding Type Checking Strong Typing Type Compatibility Scope and Lifetime.
Semantics CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
March 12, ICE 1341 – Programming Languages (Lecture #6) In-Young Ko Programming Languages (ICE 1341) Lecture #6 Programming Languages (ICE 1341)
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Introduction A variable can be characterized by a collection of properties, or attributes, the most important of which is type, a fundamental concept in.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Basic Semantics Associating meaning with language entities.
CSC3315 (Spring 2008)1 CSC 3315 Subprograms Hamid Harroud School of Science and Engineering, Akhawayn University
Programming Languages and Paradigms Imperative Programming.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
CSE 425: Control Abstraction I Functions vs. Procedures It is useful to differentiate functions vs. procedures –Procedures have side effects but usually.
Semantics CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
Programming Languages and Design Lecture 6 Names, Scopes and Binding Instructor: Li Ma Department of Computer Science Texas Southern University, Houston.
1 Programming Languages (CS 550) Lecture 2 Summary Mini Language Interpreter Jeremy R. Johnson.
C H A P T E R T W O Syntax and Semantic. 2 Introduction Who must use language definitions? Other language designers Implementors Programmers (the users.
Overview: Lecture 6: Dolores Zage. What is a program? n Operations that are to be applied to certain data in a certain sequence (definition holds for.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Object Lifetime and Pointers
Describing Syntax and Semantics
Javascript and Dynamic Web Pages: Client Side Processing
Names and Attributes Names are a key programming language feature
CSE 3302 Programming Languages
Semantics CSE 340 – Principles of Programming Languages Spring 2016
Mini Language Interpreter Programming Languages (CS 550)
Final Review In Text: Chapters 1-3, 5-11,
Midterm Review In Text: Chapters 1-3, 5, 15.
CSE 3302 Programming Languages
Scope of Variables.
CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics
Midterm Review In Text: Chapters 1-3, 5-10, 15.
Final Review In Text: Chapters 1-3, 5-12,
Binding Times Binding is an association between two things Examples:
Programming Languages
Dynamic Memory.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Midterm Review In Text: Chapters 1-3, 5-11, 15.
Types and Related Issues
Chapter 3 Discussion Pages
Presentation transcript:

Guided Notes Ch. 5 Basic Semantics Ch. 6 Data Types PHP Fundamentals Lecture Notes from both Louden and Sebesta Review questions

Semantics Semantics – what the language construct actually do Specification methods By a language reference manual (most common) By a defining translator (by experiment or simulation, must execute to discover) By a formal definition (ch.13– operational, denotational, axiomatic semantics)

Attributes, Binding, and Semantic Functions Attributes – properties that determine the meaning of a name. Binding – process of associating attribute to a name (binding time: static and dynamic) Semantic Functions –Environment: Names  locations –Symbol table: Name  attributes –Memory: Names  values

Scope rules Scope of a variable – the range of statements in which the variable is visible Static scoping – determined by the program units spatial relationship before execution Dynamic scoping – based on the calling sequence of subprograms only at running time

In-class Exercise for Scoping A exercise from Sebesta Ch. 5 #9 Goal: to understand static and dynamic scoping rules

Aliases, Dangling references, and garbage Aliases – the same object is bound to two different names at the same time Dangling references – a location that has been deallocated but can still be accessed by a program Garbage – memory that has been allocated in the environment but that has become inaccessible to the program

Data Type Definition 1 – A set of values. Definition 2 – a set of values, together with a set of operations on those values having certain properties. Strongly-typed Weakly-typed Untyped or dynamically typed

The Evolution of PHP 1995, PHP 1.0, reflects the concerns at that time: password-protecting pages, easily creating forms, and accessing form data on subsequent pages – no plan to create a scripting language 1996, PHP 2.0, large project demanded better performance and integration, conditional HTML  tag-replacement becomes a parser and end up writing an entire scripting language.

The Evolution of PHP (cont.) 1998 PHP 3.0 since 1997, one man-project becomes team project with many developers 2000 PHP 4.0 Zend engine – abstracting the layer between the language and the web server, adding thread-safety, adding a more advanced two stage parse/execute tag- parsing system More to see PHP site…PHP site

Review questions Define each of following terms and then give an explanation example: Semantics and its specification methods Binding and binding time (static and dynamic) Semantic functions Scoping (static and dynamic) Aliases and garbage Data type Strongly-typed language