1 1 vote 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 1.1k views answer comment Share Follow Print See 1 comment 1 1 comment reply Mk Utkarsh commented Mar 16, 2018 i edited by Mk Utkarsh Mar 16, 2018 reply Follow flag No lexical error https://gateoverflow.in/201833/lexical-syntax-and-semantic-error check this answer for understanding lexical error 1 1 replyShare Please log in or register to add a comment.
Best answer 5 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 0 reply Please log in or register to add a comment.
1 1 vote 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 0 reply Please log in or register to add a comment.