Application Generation

Cards (18)

  • Application software - Any program that is designed to enable the end user to perform a task
  • Assembler - A program which translates low level assembly code into machine code. Each mnemonic is translated into a machine code instruction.
  • Closed Source Software - Software owned by a company where the source code is no made available to the public and is protected by copyright
  • Code Generation - stage in compilation that produces object code
  • Compilation - the process of translating high-level source code into machine code a computer can execute
  • Compiler - program translator that translates high-level source code into object code or machine code
  • Interpreter - translates and executes a program one statement at a time
  • Lexical Analysis - First stage in compilation which puts each statement in a suitable form for syntax analysis
    • Completed by what is called a lexer
    • Whitespaces and comments are removed
    • Identifiers, keywords, and operators (called lexemes) are replaced by tokens
    • Lexemes checked against token classes to see if they are a valid token
    • A symbol table is created, this stores the addresses of all variables, labels and subroutines used in the program
  • Libraries - A collection of pre-written, pre-compiled routines which can be incorporated into a program
  • Loader - an operating system routine that copies a program held on secondary storage into memory ready for execution
  • Open Source Software - software for which the source code is freely available to the public and may be redistributed or modified
  • Optimisation - The stage of compilation that ensures the executable program is optimised at least as much as the compiler can predict
  • Source Code - code written by the programmer
  • Syntax analysis - The stage of compilation where language statements are checked against the rules of the language. Errors are reported if a statement is not valid
    • The tokens are checked to see if they follow the syntax, this is called parsing
    • If a syntax error occurs, then an error message is displayed and compilation stops
    • Main output of this phase is to create an abstract syntax tree from the input token stream
    • When an identifier is added to the syntax tree, the symbol table is checked to see if it exists, the information from the tree can be used to update the data type of identifiers
  • Code generation - Abstract syntax tree is converted into object code, means all source code is translated into object code
    Code optimisation attempts to reduce execution time of the program by:
    • Spotting redundant instructions and producing object code that achieves the same effect but with different means
    • Removing subroutines that are never called
    • Removing variables and constants that are never referenced
    This can happen before or after code generation, depending on the compiler
  • Linker - Used after the source code has been converted to object code, linker is used to link any references that the program has made to libraries, loading those references into the program and producing the programs executable code
  • Static linkers - link and load various library code into the program's finished machine code to produce the program's executable file. If lots of libraries have been used, this will result in large programs which take a long time to compile, result in large executable files
  • Dynamic linkers - link up library code on runtime, this means compiled versions of the required libraries are needed on the host computer and the Operating System links the required code from the library as the program is running. This reduces the size of the executable file