Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Errors
Mrityudoot
asked
in
Compiler Design
Nov 12, 2023
edited
Nov 14, 2023
by
Mrityudoot
232
views
1
vote
1
vote
How to differentiate between Lexical, semantic and syntax error from a given code snippet.
Why is this lexical error and not syntax error?
$ y = 0x5i; $
compiler-design
lexical-analysis
made-easy-test-series
Mrityudoot
asked
in
Compiler Design
Nov 12, 2023
edited
Nov 14, 2023
by
Mrityudoot
by
Mrityudoot
232
views
answer
comment
Follow
share this
share
1 comment
by
Hira Thakur
commented
Dec 7, 2023
reply
Follow
share this
ref here:
How is this lexical error
1
1
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
1
vote
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.
Sagar2900
answered
Nov 13, 2023
by
Sagar2900
comment
Follow
share this
1 comment
by
Mrityudoot
commented
Nov 14, 2023
reply
Follow
share this
0x denotes hexadecimal, so the number is not octal. Anyways I have changed variable name to avoid confusion.
0
0
Please
log in
or
register
to add a comment.
← Previous
Next →
← Previous in category
Next in category →
Related questions
0
votes
0
votes
1
answer
1
Prasad Budithi
asked
in
Compiler Design
Jan 16, 2019
3,875
views
compiler design Lexical Errors (Applied Gate mock -3 )
Which of the following error will not come under Lexical error (Compiler Design - 1Mark) Spelling error Exceeding length of an identifier or numeric constants Appearance of illegal characters Missing semicolon A. I only B. II only C. III ... whiel, instead of keyword it would be recognized as variable ... Can any one explain what is true...
Prasad Budithi
asked
in
Compiler Design
Jan 16, 2019
by
Prasad Budithi
3.9k
views
compiler-design
lexical-analysis
applied-gate-test-series
3
votes
3
votes
1
answer
2
radha gogia
asked
in
Compiler Design
Mar 11, 2018
4,273
views
In which phase of the compiler below errors are detected ?
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 for this ,because in between the square brackets we can have an identifier ... the identifier is too long , then is this any type of error ?If Yes , then in which phase is this detected ?
radha gogia
asked
in
Compiler Design
Mar 11, 2018
by
radha gogia
4.3k
views
compiler-design
lexical-analysis
descriptive
5
votes
5
votes
2
answers
3
nakshatra
asked
in
Compiler Design
Dec 11, 2015
3,780
views
syntax and semantic errors
What is the difference in between lexical, syntax and semantic errors? Please give appropriate example also.
nakshatra
asked
in
Compiler Design
Dec 11, 2015
by
nakshatra
3.8k
views
compiler-design
lexical-analysis
4
votes
4
votes
2
answers
4
jatin khachane 1
asked
in
Compiler Design
Nov 23, 2018
1,283
views
MadeEasy Test Series: Compiler Design - Lexical Analysis
int main() { int a,b; a=10; b=15; printf("a=%d,b=%d",a++,b--); } The number of tokens in the above C program is_________. I am getting 30 The answer given is 29
jatin khachane 1
asked
in
Compiler Design
Nov 23, 2018
by
jatin khachane 1
1.3k
views
compiler-design
lexical-analysis
made-easy-test-series
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
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
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy