Application generation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

4 stages of compilation

A

1) Lexical analysis
2) Syntax analysis
3) Code generation
4) Code optimisation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

lexical analysis

A
  • comments + whitespace removed
  • tokens are created out of lexemes (keywords)
  • tokens are assembled into a symbol table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

token examples

A
  • id
  • number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

syntax analysis

A
  • An abstract syntax tree is built
  • using the symbol table from lexical analysis
  • checks for errors and reports them
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

code generation

A
  • machine code is created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

code optimization

A
  • removes variables/subroutines that were never called
  • used to improve efficiency
  • reduces execution time
  • makes the program use fewer resources/less memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

compilation stage symbol table is created

A

lexical analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

library

A

pre-written, compiled, tested, and checked pieces of code
Written by other authors / already written
Containing useful routines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

benefits of libraries

A
  • Save time…
    …because no need to rewrite the code
  • Use the expertise of others…
  • …to complete tasks that require specialist
    knowledge
  • Has already been tested/the programmer doesn’t
    have to test it themselves
  • Making debugging easier/saving time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

drawback of libraries

A
  • Not written by the programmer
    …so introduces uncertainty
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly