Skip to main content

Control Structure

  • Chapter
  • First Online:
Programming Languages: Principles and Paradigms

Part of the book series: Undergraduate Topics in Computer Science ((UTICS))

  • 8083 Accesses

Abstract

In this chapter, we will tackle the problem of managing sequence control, an important part in defining the execution of program instructions in a generic abstract machine’s interpreter. In low-level languages, sequence control is implemented in a very simple way, just by updating the value of the PC (Program Counter) register. In high-level languages, however, there are special language-specific constructs which permit the structuring of control and the implementation of mechanisms that are much more abstract than those available on the physical machine. One thinks, for example, of the simple evaluation of an arithmetic expression, even if we find them obvious and natural, operations of this kind requires the use of control mechanisms that specify the order in which operands are evaluated, and operator precedence, and so on. In this chapter, we will consider the constructs used in programming languages for the explicit or implicit specification of sequence control. We will first consider expressions, spending some time on the syntactic aspects of the usual notation for representing expressions, as well as the semantic aspects of their evaluation. We will then move on to commands and, after discussing the concepts of variable and assignment, we will see the main commands for sequence control present in modern languages, showing the difference between structured and unstructured control and briefly illustrating the principles of structured programming. We will finally examine some aspects that are significant to recursion and clarify an important terminological distinction between imperative and declarative languages.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.95
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. H. Abelson and G. J. Sussman. Structure and Interpretation of Computer Programs. MIT Press, Cambridge, 1996.

    MATH  Google Scholar 

  2. P. Aczel. An introduction to inductive definitions. In J. Barwise, editor, Handbook of Mathematical Logic, pages 739–782. North-Holland, Amsterdam, 1977.

    Chapter  Google Scholar 

  3. M. Aiello, A. Albano, G. Attardi, and U. Montanari. Teoria della Computabilità, Logica, Teoria dei Linguaggi Formali. ETS, Pisa, 1976 (in Italian).

    Google Scholar 

  4. C. Böhm and G. Jacopini. Flow diagrams, Turing machines and languages with only two formation rules. Commun. ACM, 9(5):366–371, 1966.

    Article  MATH  Google Scholar 

  5. E. Dijkstra. Go to statement considered harmful. Communications of the ACM, 11(3):147–148, 1968.

    Article  MathSciNet  Google Scholar 

  6. B. Liskov and J. Guttag. Abstraction and Specification in Program Development. MIT Electrical Engineering and Computer Science Series. MIT Press, Cambridge, 1986.

    MATH  Google Scholar 

  7. T. Pratt and M. Zelkowitz. Programming Languages: Design and Implementation. Prentice-Hall, New York, 2001 (quarta edizione).

    Google Scholar 

  8. M. L. Scott. Programming Language Pragmatics. Morgan Kaufmann, San Mateo, 2000.

    Google Scholar 

  9. G. Winskel. The Formal Semantics of Programming Languages. MIT Press, Cambridge, 1993.

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Maurizio Gabbrielli .

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag London

About this chapter

Cite this chapter

Gabbrielli, M., Martini, S. (2010). Control Structure. In: Programming Languages: Principles and Paradigms. Undergraduate Topics in Computer Science. Springer, London. https://doi.org/10.1007/978-1-84882-914-5_6

Download citation

  • DOI: https://doi.org/10.1007/978-1-84882-914-5_6

  • Published:

  • Publisher Name: Springer, London

  • Print ISBN: 978-1-84882-913-8

  • Online ISBN: 978-1-84882-914-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics