1 votes 1 votes int 7=10; It is a semantic error or syntax error? My thinking is that it can be tokenized as id id = id ;….So it is valid statement...so it must be semantic error? Correct me if I am wrong. Compiler Design compiler-design + – samarpita asked Dec 10, 2021 samarpita 271 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply raja11sep commented Dec 10, 2021 reply Follow Share First of all 7 and 10 these are not identifier these are constant. And int is not an identifier it’s a keyword.During tokenization in lexical analyzer phase there will be no error as all are valid lexeme. int constant=constant; syntactically it’s correct because it is just a assignment. But semantically it is wrong. Because you LHS of an assignment statement can not be constant. Correct me if I am wrong. 0 votes 0 votes samarpita commented Dec 10, 2021 reply Follow Share I am thinking that only...that it would should be semantic error...bcz all are valid tokens and this is valid according to syntax analyzer 0 votes 0 votes Please log in or register to add a comment.