Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question