The Gateway to Computer Science Excellence
+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 

in Compiler Design by Loyal (7.3k points)
edited by | 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}}.$

 

1 Answer

0 votes
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)
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,479 answers
195,422 comments
100,558 users