¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

Programming Languages - Chapter 6

M KB Inglés 41 fichas

Fichas del conjunto (41)

  1. 1Data types can be:Unstructured (also called scalar)
    e.g., char, int, double
    Structured
    e.g., array, record
  2. 2String Length OptionsStatic
    Limited Dynamic
    Dynamic
  3. 3Limited Dynamic LengthA special character (null) is used to indicate the end of a string’s characters, rather than maintaining the length
  4. 4Dynamic LengthStrings have varying length with no maximum
  5. 5ArrayAn aggregate of homogeneous data elements in which an individual element is identified by its position in the aggregate, relative to the first element
  6. 6Categories of ArraysStatic
    Fixed Stack-Dynamic
    Fixed Heap-Dynamic
    Heap Dynamic
  7. 7Heap Dynamicsubscript range and storage bindings are dynamic and can change any number of times
  8. 8Fixed Heap-DynamicStorage binding is dynamic but fixed after allocation (i.e., binding is done when requested and storage is allocated from heap, not stack)
  9. 9Fixed Stack-DynamicRange of subscripts is statically bound, but storage is bound at declaration elaboration time
  10. 10StaticRange of subscripts and storage allocation are static
  11. 11Data TypeDefines a collection of data values and a set of predefined operations on those values
  12. 12Primitive Data TypesData types not defined in terms of other data types
  13. 13IntegerSupported directly by the hardware.
    There may be as many as eight different integer types in a language.
  14. 14DecimalFor business applications (money)
    Stored in binary coded decimal (BCD)
    Advantage: accuracy
    Disadvantages: limited range, wastes memory
  15. 15Typical String OperationsAssignment
    Comparison (=, >, etc.)
    Catenation
    Substring reference
    Pattern matching
  16. 16DescriptorThe collection of the attributes of a variable
  17. 17Enumeration TypesOne in which the user enumerates all of the possible values, which are symbolic constants
  18. 18Advantage of Enumeration TypesReadability: no need to code a color as a number
    Reliability: No enumeration variable can be assigned a value outside its defined range
  19. 19IndexingA mapping from array indices to elements
  20. 20Slicesome substructure of an array
    References part of an array as a unit
  21. 21Access Functionmaps subscript expressions to an address in the array
  22. 22Associative Arrayan unordered collection of data elements that are indexed by an equal number of values called keys
  23. 23Recorda possibly heterogeneous aggregate of data elements in which the individual elements are identified by names
  24. 24Uniona type whose variables are allowed to store different type values at different times during execution
    Discriminated unions include a tag to record the current type value
    Free union has no type-checking (bad!)
  25. 25PointerA type in which the variables have a range of values that consist of memory addresses and a special value, nil
  26. 26Two fundamental pointer operations:assignment and dereferencing
  27. 27Assignmentused to set a pointer variable’s value to some useful address
  28. 28Dereferencingyields the value stored at the location represented by the pointer’s value
  29. 29C++ Reference Typeconstant pointers that are implicitly dereferenced.
    Used for parameter passing:
    Advantages of both pass-by-reference and pass-by-value
  30. 30Dangling PointerA pointer points to a heap-dynamic variable that has been deallocated
  31. 31Lost heap-dynamic variablesA heap-dynamic variable that is no longer referenced by any program pointer
  32. 32Solutions to Dangling Pointer problem:Tombstone
    Locks and Keys
  33. 33Tombstoneextra heap cell that is a pointer to the heap-dynamic variable
    The actual pointer variable points only at tombstones.
  34. 34Locks and KeysEvery access to the dereferenced pointer compares the key value of the pointer to the lock value in the heap-dynamic variable. It they match, the access is legal; otherwise, runtime error is generated
  35. 35Two approaches to reclaiming garbage:Reference counters (eager approach)
    mark-sweep (lazy approach)
  36. 36Mark SweepThe run-time system allocates storage cells as requested until the list of available space becomes empty; then a mark-sweep process is begun to gather all the garbage
  37. 37Reference Countermaintain a counter in every cell that stores the number of pointers currently pointing at the cell.
  38. 38Compatible Typeone that is either legal for the operator, or is allowed under language rules to be implicitly converted, by compiler-generated code, to a legal type. This automatic conversion is called a coercion
  39. 39Type Checkingthe activity of ensuring that the operands of an operator are of compatible types.
  40. 40Name Type Compatibilitymeans that two variables have compatible types if they are in either the same declaration or in declarations that use the same type name
  41. 41Structure Type Compatibilitymeans that two variables have compatible types if their types have identical structures

Información

Descripción
Fichas sobre Programming Languages - Chapter 6, creado por M KB el 26/02/2018.
Creado por
M KB
Visitas
0
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?