Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-gvh9x Total loading time: 0 Render date: 2024-07-24T10:21:47.368Z Has data issue: false hasContentIssue false

9 - Structured declarations

Published online by Cambridge University Press:  05 August 2012

Hans Hüttel
Affiliation:
Aalborg University, Denmark
Get access

Summary

In this chapter we give a general treatment of structured declarations. This allows us to give an account of language constructs such as structs in C-like languages and objects in object-oriented languages.

In Section 9.2, we describe a big-step semantics of Bur. Then, in Section 9.3, we consider Coat, a small object-oriented language with classes and dynamically generated objects.

Records

In this chapter, we will use the term record to stand for a structured declaration. We shall allow record declarations inside records. Moreover, records may contain both variables and procedures; this is in contrast to languages such as C and Pascal that allow only the declaration of variables in structured declarations. By allowing procedure declarations as part of a record, we can now view a record as an object. Variables then correspond to the local variables of an object and procedures correspond to object methods. Later, in Section 9.3, we extend this understanding so that we can speak of objects that are dynamically generated instances of classes.

In Figure 9.1 we see an example of a program that has nested record declarations. The program consists of a block which has a record r1 that contains the declaration of a variable x, a procedure p and a record r2. The record r2 contains the declaration of two variables, y and z.

Type
Chapter
Information
Transitions and Trees
An Introduction to Structural Operational Semantics
, pp. 134 - 153
Publisher: Cambridge University Press
Print publication year: 2010

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Structured declarations
  • Hans Hüttel, Aalborg University, Denmark
  • Book: Transitions and Trees
  • Online publication: 05 August 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511840449.010
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Structured declarations
  • Hans Hüttel, Aalborg University, Denmark
  • Book: Transitions and Trees
  • Online publication: 05 August 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511840449.010
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Structured declarations
  • Hans Hüttel, Aalborg University, Denmark
  • Book: Transitions and Trees
  • Online publication: 05 August 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511840449.010
Available formats
×