2,071 views
10 10 votes
a = 1+1+1+ 1+1+1 1+1;

as far as i think, it will pass the lexical phase.. it should b syntax error.. correct ??

2 Answers

Best answer
13 13 votes

Yes, It will pass the lexical phase. 

There is a specific rule in "integer constant creation" that you can not have a blank space between a number.

In the above line after 5th 1, "1 1", cause an error.  This error is a grammatical error. Hence It will be not pass syntax analysis. Hence syntax error will be generated and reported at compile time. 

• selected by
2 2 votes
Yes , this error will be generated at the time of syntax analyzer . you cant make a parse tree for this
Position:
Show:

Related questions

1 1 vote
3 3 answers
1.1k
1.1k views
VJ2793 asked Feb 12, 2019
1,141 views
fro(int I=0; I <5;I++);what kind of compilation error is this ?
1 1 vote
1 1 answer
651
651 views
vaishali jhalani asked Nov 23, 2016
651 views
Consider the following C program : # includemain()Iint }x=10,y=12char * a;a=&x;x=1xab;printf("%d %d",x, * a);I Which of the following type of error (earliest phase) i...
1 1 vote
1 1 answer
2.1k
2.1k views
rahul sharma 5 asked Apr 28, 2018
2,128 views
int a = b+*/c;Which phase will give the error?Lexical or syntax?
0 0 votes
1 answers 1 answer
540
540 views
Riya Roy(Arayana) asked Jan 4, 2016
540 views
The given statement has what type of error ?in /* declare variable */ x;