E
E
Ernest Farukshin2019-04-18 00:11:31
Programming
Ernest Farukshin, 2019-04-18 00:11:31

How does semantic analysis work?

Hello, can you help with the compiler device. I figured out how the lexer, parser works, but somehow I can’t understand how semantic analysis works. Can you please explain or throw off the resources where it is written about it with examples.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2019-04-18
@Rsa97

Semantic analysis checks for conditions that cannot be described in a COP grammar. Examples:
- redefining a variable in the same visibility block;
- the correct number of function parameters and their types;
- correctness of value types in operations;
- the admissibility of the left side in the assignment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question