The Gateway to Computer Science Excellence
+1 vote
269 views

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.

in Compiler Design by (187 points) | 269 views
0

No lexical error

https://gateoverflow.in/201833/lexical-syntax-and-semantic-error 
check this answer for understanding lexical error 

2 Answers

+4 votes
Best answer

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

by Boss (35.7k points)
selected by
+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.
by (129 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,508 answers
195,530 comments
100,962 users