+1 vote
114 views

Given Solution: It is given that Program 4 will cause Lexical error as ..09 is octal and assigned to int

-- But Lexical analyzer just treat 09 as constant ..So program 4 will give Semantic error than lexical

Correct me if i am wrong

edited | 114 views
+1

4th program should doesn't produce lexical error... don't worry about the answer given by them !

Moreover it is duplicate of https://gateoverflow.in/242058/compiler

0

$\underline{\text{Please } \color{red}{add}\text{ test-series name in } \color{red}{title}}.$

Your answer is correct. There are two programs with Lexical errors. They are 1 (@ is not identified) and 3 (non ending comment is not identified). Rest are fine with the lexer.
by Junior (649 points)