Group: type declaration

topics > computer science > Group: data

declaration scope
declaration through use
global declarations and variables
local declaration of data
restricted use of global variables
data type
derived data types
declarative vs. procedural representation
default value
descriptive languages
generated variable
initialization of data
notation for declarations
sections of a program
separate a module's interface specification from its implementation
XML data type


Declarations are instructions to the language processor describing data objects used by the program. They modify the grammar recognized by the language processor. In declarative statements, the implementation or semantic definition of a data object is indicated by a data type identifier. The declared type is used for generic selection of functions, for type checking, and for component names. The type along with an optional size declaration is used for storage allocation. The declared scope controls the allocation and deallocation of storage.

A declaration may bind an object to a name or it may bind the object to a value of the name. The latter allows for dynamic creation and modification of data objects. A widespread use of declarations is the data division of Cobol programs. There each file is given a full description including component names, collating sequence, and physical medium. In APT, declarations include the declaration of lines and circles. (cbb 5/80)

Subtopic: separate interface from implementation up

Quote: most Ada declarations can be broken into interface and implementation; e.g., declare a constant without giving its value [»maclBJ_1987]
Quote: a declaration in C announces the properties of a variable, while a definition declares a variable and allocates storage, or defines a function's code [»ritcDM7_1978c]
Quote: Cobol makes clear distinctions between actions, data, and environment [»sammJE_1969]
QuoteRef: kiebRB9_1973 ;;1.1 separates data declarations for data implementation
QuoteRef: bennRK6_1968 ;;3-8 all words typed before use but word definition separated from typing
QuoteRef: kiebRB9_1973 ;;1.2 separates "type declaration from the semantic definition of a type
QuoteRef: simscrip_1971 ;;74 describe routines and variables separately from definition eg how many arguments, storage class etc

Subtopic: type declaration same as parameterization up

Quote: with type-completeness, can define declaration in terms of parameter/argument bindings

Subtopic: type declaration as grammar up

Quote: the declarative statements of a program could define a context-free grammar for its imperative statement [»hanfKV_1973]
QuoteRef: ahoAV_1973 ;;791 declarations are instructions to the book keeping mechanism

Subtopic: type as namespace up

Quote: replace global declarations with a namespace; define a local synonym for the namespace and allow use of common namespaces without explicit name qualification [»stroB_1994]

Subtopic: size of data up

Quote: to allocate an object, need to know its size [»stroB_1991]
Quote: C++ requires recompilation if the size of a class object is changed; for efficiency

Subtopic: literal format as type declaration up

Quote: Proteus included the format of literals as part of a type definition [»solnN_1971, OK]

Subtopic: description of data up

QuoteRef: rossDT3_1957 ;;72 "Declarative or descriptive statements ("say"-type statement) which establish definitions and basic relationships among the things which are to be discussed.
Quote: EMPIRIC declarations create segments with a name, size, access rights, seal, and default descriptor [»wilkMV8_1986]
Quote: Cobol's data division provides physical and logical descriptions of files [»sammJE_1969, OK]

Subtopic: declaration of data up

QuoteRef: moorCH6_1974 ;;507 "n INTEGER word defines 'word' so that the address of its parameter field is placed onto the stack
QuoteRef: simscrip_1971 ;;71 Create entity creates and allocates storage (zeros attributes) for an instance of entity class and returns pointer in global variable of same name (if different name use Create entity Called variable)
QuoteRef: wulfWA4_1974 ;;4 "a form can be instantiated simply by mentioning its name together with any requisite actual parameters" eg decl x: complex
QuoteRef: bennRK6_1968 ;;3-4 declarations (ICL) by list structures eg label (ICL of arg, default value) can be fixed length, variable length of same type, or tree-structured

Group: type declaration up

Topic: declaration scope (16 items)
Topic: declaration through use (7 items)
Topic: global declarations and variables (33 items)
Topic: local declaration of data (11 items)
Topic: restricted use of global variables
(22 items)

Related Topics up

Group: data type   (34 topics, 730 quotes)
Group: derived data types   (9 topics, 119 quotes)
Group: parameters   (10 topics, 145 quotes)
Topic: declarative vs. procedural representation (54 items)
Topic: default value (8 items)
Topic: descriptive languages (22 items)
Topic: generated variable (7 items)
Topic: initialization of data (45 items)
Topic: notation for declarations (20 items)
Topic: sections of a program (9 items)
Topic: separate a module's interface specification from its implementation (86 items)
Topic: XML data type
(22 items)

Updated barberCB 3/05
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.