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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
H. Abelson and G. J. Sussman. Structure and Interpretation of Computer Programs. MIT Press, Cambridge, 1996.
P. Aczel. An introduction to inductive definitions. In J. Barwise, editor, Handbook of Mathematical Logic, pages 739–782. North-Holland, Amsterdam, 1977.
M. Aiello, A. Albano, G. Attardi, and U. Montanari. Teoria della Computabilità, Logica, Teoria dei Linguaggi Formali. ETS, Pisa, 1976 (in Italian).
C. Böhm and G. Jacopini. Flow diagrams, Turing machines and languages with only two formation rules. Commun. ACM, 9(5):366–371, 1966.
E. Dijkstra. Go to statement considered harmful. Communications of the ACM, 11(3):147–148, 1968.
B. Liskov and J. Guttag. Abstraction and Specification in Program Development. MIT Electrical Engineering and Computer Science Series. MIT Press, Cambridge, 1986.
T. Pratt and M. Zelkowitz. Programming Languages: Design and Implementation. Prentice-Hall, New York, 2001 (quarta edizione).
M. L. Scott. Programming Language Pragmatics. Morgan Kaufmann, San Mateo, 2000.
G. Winskel. The Formal Semantics of Programming Languages. MIT Press, Cambridge, 1993.
Author information
Authors and Affiliations
Corresponding author
Rights 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)