13. Program Construction Flashcards

1
Q

What happens in lexical analysis

A

When a compiler receives source code, it parses it and decides whether each line contains keywords, variables, constants or anything else accepted by the language. It converts the source code into a token stream and comments/whitespaces are removed.

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

What happens in syntax analysis?

A

Once tokens have been assigned to the code elements, the compiler checks that the tokens are in correct order and they follow the rules of the programming language, if they don’t a syntax error appears.

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

What is semantic analysis?

A

Semantic analysis tries to imply meaning to the code that has been read in during syntax analysis. One of the most important elements of semantic analysis to determine type checks and any inconsistencies that may occur.

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