DIAG_TYPE
s describe programming language types (e.g.
arrays, structs...). DIAG_TQ
s are qualifiers of DIAG_TYPE
s used for attributes like volatile and const.
FILENAME
s and SOURCEMARK
s describe source
files and locations within them.
DIAG_TAG
s associate integers with DIAG_TYPE
s.
They are used in a similar manner to normal TDF TAG
s,
and are held in a (TDF) linkable unit called a DIAG_TYPE_UNIT
.
DIAG_UNIT
s hold a collection of DIAG_DESCRIPTOR
s,
used for information outside procedure bodies.
DIAG_DESCRIPTOR
s are used to associate names in the source
program with diagnostic items.
src_name: TDFSTRING(k, n) whence: SOURCEMARK found_at: EXP POINTER(al) type: DIAG_TYPE -> DIAG_DESCRIPTORGenerates a descriptor for an identifier (of
DIAG_TYPE
type), whose source name was src_name from source location
whence. The EXP
found_at describes how
to access the value. Note that the EXP
need not be unique
(e.g. FORTRAN EQUIVALENCE might be implemented this way).
src_name: TDFSTRING(k, n) whence: SOURCEMARK new_type: DIAG_TYPE -> DIAG_DESCRIPTORGenerates a descriptor whose source name was src_name. new_type must be either a
DIAG_STRUCT
, DIAG_UNION
or DIAG_ENUM
.This construct is obsolete.
src_name: TDFSTRING(k, n) whence: SOURCEMARK new_type: DIAG_TYPE -> DIAG_DESCRIPTORGenerates a descriptor for a type new_type whose source name was src_name. Note that diag_desc_typedef is used for associating a name with a type, rather than for any name given in the initial description of the type (e.g. in C this is used for typedef, not for struct/union/enum tags).
A DIAG_UNIT
is a TDF unit containing DIAG_DESCRIPTOR
s.
A DIAG_UNIT
is used to contain descriptions of items
outside procedure bodies (e.g. global variables, global type definitions).
no_labels: TDFINT descriptors: SLIST(DIAG_DESCRIPTOR) -> DIAG_UNITCreate a
DIAG_UNIT
containing DIAG_DESCRIPTOR
s.
no_labels is the number of local labels used in descriptors
(for conditionals).
DIAG_TAG
s are used inter alia to break cyclic
diagnostic types. They are (TDF) linkable entities. A DIAG_TAG
is made from a number, and used in use_diag_tag to obtain the
DIAG_TYPE
associated with that number by make_diag_tagdef.
num: TDFINT -> DIAG_TAGCreate a
DIAG_TAG
from num.
DIAG_TAGDEF
s associate DIAG_TAG
s with DIAG_TYPE
s.
tno: TDFINT dtype: DIAG_TYPE -> DIAG_TAGDEFAssociates tag number tno with dtype.
A DIAG_TYPE_UNIT
is a TDF unit containing DIAG_TAGDEF
s.
no_labels: TDFINT tagdefs: SLIST(DIAG_TAGDEF) -> DIAG_TYPEUNITCreate a
DIAG_TYPEUNIT
containing DIAG_TAGDEF
s.
no_labels is the number of local labels used in tagdefs
(for conditionals).
DIAG_TYPE
s are used to provide diagnostic information
about data types.
token_value: TOKEN token_args: BITSTREAM -> DIAG_TYPEThe token is applied to the arguments to give a
DIAG_TYPE
.
If there is a definition for token_value in the CAPSULE
then token_args is a BITSTREAM
encoding of the
SORT
s of its parameters, in the order specified.
element_type: DIAG_TYPE stride: EXP OFFSET(p,p) lower_bound: EXP INTEGER(v) upper_bound: EXP INTEGER(v) index_type: DIAG_TYPE -> DIAG_TYPEAn array of element_type objects. stride is the
OFFSET
between elements of the array (i.e. p is described by element_type).
The bounds are in general not runtime constants, hence the values
are EXP
s (not say SIGNED_NAT
). The VARIETY
v is described by index_type. As in TDF there is no
multi-dimensional array primitive.
type: DIAG_TYPE number_of_bits: NAT -> DIAG_TYPEDescribes number_of_bits, which when extracted will have
DIAG_TYPE
type.
base_type: DIAG_TYPE enum_name: TDFSTRING(k, n) values: LIST(ENUM_VALUES) -> DIAG_TYPEAn enumeration to be stored in an object of type base_type. If enum_name is a string contining zero characters this signifies no source tag.
var: FLOATING_VARIETY -> DIAG_TYPECreates a
DIAG_TYPE
to describe an FLOATING_VARIETY
var.
object: DIAG_TYPE qualifier: DIAG_TQ -> DIAG_TYPERecords the existence of an item of
DIAG_TYPE
object,
qualified by qualifier. diag_loc is used for variables
(which may of course not actually occupy a memory location).
params: LIST(DIAG_TYPE) optional_args: BOOL result_type: DIAG_TYPE -> DIAG_TYPEDescribes a procedure taking n parameters. optional_args is true if and only if the make_proc which this diag_proc describes had vartag present.
object: DIAG_TYPE qualifier: DIAG_TQ -> DIAG_TYPEDescribes a pointer to an object of
DIAG_TYPE
object.
The DIAG_TQ
qualifier qualifier qualifies the
pointer, not the object pointed to.
tdf_shape: SHAPE src_name: TDFSTRING(k, n) fields: LIST(DIAG_FIELD) -> DIAG_TYPEDescribes a structure. If src_name is a string contining zero characters this signifies no source tag for the whole structure. tdf_shape allows the total size to be computed.
-> DIAG_TYPEA null
DIAG_TYPE
.
tdf_shape: SHAPE src_name: TDFSTRING(k, n) fields: LIST(DIAG_FIELD) -> DIAG_TYPEDescribes a union. If src_name is a string contining zero characters this signifies no source tag for the whole union. tdf_shape allows the total size to be computed.
var: VARIETY -> DIAG_TYPECreates a
DIAG_TYPE
to describe an integer VARIETY
var.
dtag: DIAG_TAG -> DIAG_TYPEObtains the
DIAG_TYPE
associated with DIAG_TAG
dtag.
value: EXP sh src_name: TDFSTRING(k, n) -> ENUM_VALUES
ENUM_VALUES
describe elements of an enumerated type.
src_name is the source language name. value evaluates
to a value of SHAPE
sh. Note that all members
of a LIST(ENUM_VALUES
) must have the same sh.
field_name: TDFSTRING(k, n) found_at: EXP OFFSET( ALIGNMENT whole, ALIGNMENT this_field ) field_type: DIAG_TYPE -> DIAG_FIELD
DIAG_FIELD
s describe one field of a structure or union.
field_name is the source language name. found_at is
the OFFSET
between whole (the enclosing structure
or union), and this field (this_field). field_type is
the DIAG_TYPE
of the field.
DIAG_TQ
s are type qualifiers, used to qualify DIAG_TYPE
s. A DIAG_TQ
is constructed from diag_tq_null
and the various add_diag_XXX operations.
qual: DIAG_TQ -> DIAG_TQMarks a
DIAG_TQ
type qualifier as being const
in the ANSI C sense.
qual: DIAG_TQ -> DIAG_TQMarks a
DIAG_TQ
type qualifier as being volatile
in the ANSI C sense.
-> DIAG_TQCreate a null
DIAG_TQ
type qualifier.
FILENAME
record details of source files used in producing
a CAPSULE
. They can be tokenised for abbreviation.
token_value: TOKEN token_args: BITSTREAM -> FILENAMEThe token is applied to the arguments to give a
FILENAME
.
If there is a definition for token_value in the CAPSULE
then token_args is a BITSTREAM
encoding of the
SORT
s of its parameters, in the order specified.
date: NAT machine: TDFSTRING(k1, n1) file: TDFSTRING(k2, n2) -> FILENAMECreate a
FILENAME
for file file, dated date
(a UNIX timestamp; seconds since 1 Jan 1970) on machine machine.
A SOURCEMARK
records a location in the source program.
Present SOURCEMARK
s assume that a location can be described
by one or two numbers within a FILENAME
.
file: FILENAME line_no: NAT char_offset: NAT -> SOURCEMARKCreate a
SOURCEMARK
referencing the char_offset'th
character on line line_no in file file.char_offset is counted from 1, 0 meaning that no character offset is available.
Part of the TenDRA Web.
Crown
Copyright © 1998.