The Gateway to Computer Science Excellence
+2 votes

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 

in Compiler Design by
edited by | 213 views

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

Moreover it is duplicate of




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


1 Answer

+1 vote
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.
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
52,345 questions
60,521 answers
95,368 users