This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSci 5106: Programming Languages Syntax Descriptions Gopalan Nadathur Department of Computer Science and Engineering University of Minnesota Lectures in Fall 2010 Gopalan Nadathur Syntax Descriptions Formal Specifications of Programming Languages Clear and complete descriptions of programming languages are needed for a variety of reasons: as precursors to implementations to ensure consistency between different implementations to examine and understand the implications of design decisions to communicate with language users Such descriptions must treat two aspects: syntax and semantics Gopalan Nadathur Syntax Descriptions Role of Syntax and Semantics Syntax descriptions serve two purposes they identify the well-formed expressions of the language they analyze these expressions into their meaningful components and their interrelationships E.g., consider the difference between accepting 2 + 3 * 4 and attributing a structure to the expression Semantics clarifies the meaning of well-formed expressions E.g., we still need to know what to evaluate the expression 2 + 3 * 4 to even after it has been assigned a structure Syntax is important even for semantics: compositional semantics is based on syntactic structure Gopalan Nadathur Syntax Descriptions General Comments About Semantics Some issues that need to be considered in describing semantics Who is the description meant for? for users of the language for implementors for people building verifiers and reasoners What methodology should be used for the description? Some approaches that have been used denotational semantics (see Tennent’s paper) axiomatic semantics (see Hoare’s and Floyd’s papers) operational semantics informal descriptions accompanying syntax descriptions A rich area of research: designing new methods and extending old ones to cover new requirements Gopalan Nadathur Syntax Descriptions General Comments About Syntax We will think of syntax as more about describing structure than simply circumscribing language In particular, the following kinds of questions will be important: What grammar is used to analyze expressions? How easily does the analysis lead to an abstract rendition of syntax? In this course, we will look at syntax treatments systematically, but not at semantics treatments We will, however, talk of semantics sporadically For those interested: Chapter 13 has some discussion of semantics methods Gopalan Nadathur Syntax Descriptions Abstract Syntax This is a view of syntax that gives importance to identifying the meanigful components of an expression their interrelationships in the expression For example consider the English sentences John likes Jane and John is liked by Jane In this view of syntax, both correspond to like john jane or like(john,jane) i.e. , to a relationship between the operator like and the operands john and jane Note that this is still about syntax and not about semantics However, it is about an abstract view of syntax and hence called abstract syntax Gopalan Nadathur...
View Full Document
This document was uploaded on 05/06/2011.
- Fall '09
- Computer Science