Grammar versus semantic analysis

I wonder where the boundary between grammar and semantic analysis is. Which is better: use a detailed description of the grammar or leave details for the semantic phase? For example: imagine an OO language such as C # with an enum type that can be "inferred" from a primitive type

enum X : int { a = 1 }

Now, if the correctness (in this case: primitive or non-primitive type) of the basic enumeration type will be subject to grammar checking or semantic analysis?

+3
source share
1 answer

. , , . . ( ), , .

, . , - , , .

, . , - , - .

+2

Source: https://habr.com/ru/post/1759487/


All Articles