Skip to main content Accessibility help
×
Hostname: page-component-7bb8b95d7b-2h6rp Total loading time: 0 Render date: 2024-10-03T00:23:44.508Z Has data issue: false hasContentIssue false

3 - COMPONENTS

Published online by Cambridge University Press:  14 January 2010

Get access

Summary

This chapter defines most of the basic components of C. Their syntax is defined using a pictorial notation. Characters, names and constants (the simple building blocks) are defined first. Important principles of the language are next explained; these include the concept of scalar ‘types’, the precedence and associativity of ‘operators’, the concepts of ‘coercion’ and ‘promotion’ in expressions of mixed type.

The operators are summarized on a single page for ease or reference.

The syntax of expressions and statements is defined in this chapter. Declarations are discussed, but their syntax is not defined because it involves the concept of pointers and dynamic storage. These topics are left to later chapters.

NOTATION

For a precise definition of the syntax of ANSI C, see the definitions in NSI X 3.159. These are expressed in BNF (Backus Naur Form).

To appreciate the syntactical form of an entity the practical programmer needs something different; BNF is not a self evident notation. Some books employ railway track diagrams, potentially easier to comprehend than BNF, but the tracks grow too complicated for defining structures in C. So I have devised a pictorial notation from which a programmer should be able to appreciate syntactical forms at a glance. The notation is fairly rigorous but needs a little help from notes here and there.

Type
Chapter
Information
Illustrating C , pp. 27 - 50
Publisher: Cambridge University Press
Print publication year: 1994

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.

  • COMPONENTS
  • Donald G. Alcock
  • Book: Illustrating C
  • Online publication: 14 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511624179.004
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.

  • COMPONENTS
  • Donald G. Alcock
  • Book: Illustrating C
  • Online publication: 14 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511624179.004
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.

  • COMPONENTS
  • Donald G. Alcock
  • Book: Illustrating C
  • Online publication: 14 January 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511624179.004
Available formats
×