1 votes 1 votes consider this c code: wheil(1){ printf("hi"); } will this code fragment gives lexical error or not. If not then who is responsible for this error. Compiler Design compiler-design lexical-analysis + – The Technical Guy asked Mar 16, 2018 retagged Jul 2, 2022 by Lakshman Bhaiya The Technical Guy 735 views answer comment Share Follow See 1 comment See all 1 1 comment reply Mk Utkarsh commented Mar 16, 2018 i edited by Mk Utkarsh Mar 16, 2018 reply Follow Share No lexical error https://gateoverflow.in/201833/lexical-syntax-and-semantic-error check this answer for understanding lexical error 1 votes 1 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes NO lexical error . whiel will be treated as a function name ,hence a token is generated.so there is no lexical error . it is a semantic error becz we are colling a function which is not defined. https://gateoverflow.in/165048/lexical-error abhishekmehta4u answered Mar 16, 2018 selected Mar 17, 2018 by The Technical Guy abhishekmehta4u comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes No it is not lexical error. There will be no Syntax error as well, but there will be a semantic error because it does not recognize wheil. Rahul Ranjan 1 answered Mar 17, 2018 Rahul Ranjan 1 comment Share Follow See all 0 reply Please log in or register to add a comment.