Compilers Flashcards

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

What do compilers do?

A

They compile one programming language into another; higher to lower level programming language

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

How does CLANG compiler work?

A
  1. Preprocessing (Preprocessor)
  2. Compilation (Compiler)
  3. Assembling (Assembler)
  4. Linking (Linker)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the assembler do?

A

Transforms assembly into machine code

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

What does linking do?

A

Links together a bunch of object files into 1 big file you can execute

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

Explain briefly how a compiler works:

A

converts from language to another; from high to low

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

What are the part of the compiler?

A

Lexer - splits code into tokens

Parser - recognizes patterns of language you wrote the code in - converts to AST (abstract syntax tree)

Generator - converts AST of target language - i.e. Assembly code

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

Example of Koona

A

A simple compiler in Ruby:

converts Koona grammer into C

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