0 votes 0 votes float a =10 is not a semantic error but in the semantic phase int a =10.0 will be a semantic error or not bcz compiler cannot do explicit type conversion..so it must be an error...but when I am running this program this is showing no error... Compiler Design compiler-design + – samarpita asked Dec 10, 2021 samarpita 273 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply raja11sep commented Dec 10, 2021 reply Follow Share Assuming you have semicolon after every statement. Now, int a =10.0 it will be converted to int a =(int)10.0 by compiler which is know as implicit type conversion. 0 votes 0 votes samarpita commented Dec 10, 2021 reply Follow Share But there will be loss of data..if i Consider.. int a=10.2;..by doing int a=(int)10.2; we are losing that .2 0 votes 0 votes raja11sep commented Dec 10, 2021 reply Follow Share Yes.And also sizeof int is smaller than size of float. Good programmer will take care of this. 0 votes 0 votes samarpita commented Dec 10, 2021 reply Follow Share in semantic phase we do type checking by using the symbol and do type conversion any other work in semantic analyzer... Syntax analyzer we just check whether the tokens are syntactically correct or not...So here what's the use of symbol table? In lexical analyzer we convert the lexemes into tokens and adds information into symbol table 0 votes 0 votes Please log in or register to add a comment.