• edited by
756 views

2 Answers

1 1 vote
This number is start with 0 and we know octal no is start with 0 and (0 to 7 numbers are only allowed here) but here x,i written that's why it shown error in Lexical phase. It's not indentifying as Token.
0 0 votes
For a lexical analyzer when it encounters 0x it thinks of the token as a hexadecimal number
But as it scans, it finds "i" and there is no space or delimiter between 0x5 and i.
Maximal Munch thus invalidates the token.

Note : Event though whitespace is removed by lexical analyzer and is not passed to parser it still needs it as a delimiter
Position:
Show:

Related questions

1 1 vote
1 1 answer
5.6k
5.6k views
Prasad Budithi asked Jan 16, 2019
5,553 views
Which of the following error will not come under Lexical error (Compiler Design - 1Mark)Spelling errorExceeding length of an identifier or numeric constantsAppearance of ...
3 3 votes
1 answers 1 answer
5.6k
5.6k views
radha gogia asked Mar 11, 2018
5,555 views
1. Declaring an array with a floating point subscript : e.g int a[2.8] ;In my opinion ,it should be a syntax error :How will the parse tree be generated ...
5 5 votes
2 2 answers
4.9k
4.9k views
nakshatra asked Dec 11, 2015
4,903 views
What is the difference in between lexical, syntax and semantic errors?Please give appropriate example also.
9 9 votes
2 2 answers
4.4k
4.4k views
reena_kandari asked Aug 14, 2017
4,351 views
I am writing down some errors and its type with a reason.If there something wrong please correct it with a valid reason.1.fi(a==10)this is not a lexical error, because le...