Compiler (3a) Flashcards

1
Q

What is in a realistic model of a compiler?

A

Preprocessor –> Compiler –> Assembler –> Linker

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

How does CLion build a project?

A

Uses CMake as a build tool

Generates make files –> calls make

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

Preprocessor

A
Role:
Deletes Comments
Expands Macros
Replaces includes and constants
Errors:
Not using macros or defining constants
Template instantiation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Compiler

A
Role:
Takes code and produces architecture dependent assembly code
Errors:
Type errors
Syntax errors
Grammer errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Assembler

A

Role:
Takes assembler code and changes it into machine code
Errors: N/A

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

Linker

A
Role:
Takes object code and libraries and links it together 
Creates final artifact
Errors:
Symbol missing
Output file errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly