Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged lexical-analysis
1
votes
2
answers
61
compiler
consider this c code: wheil(1){ printf("hi"); } will this code fragment gives lexical error or not. If not then who is responsible for this error.
consider this c code:wheil(1){ printf("hi"); }will this code fragment gives lexical error or not. If not then who is responsible for this error.
The Technical Guy
760
views
The Technical Guy
asked
Mar 16, 2018
Compiler Design
compiler-design
lexical-analysis
+
–
3
votes
1
answer
62
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 ?
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 ...
radha gogia
4.4k
views
radha gogia
asked
Mar 11, 2018
Compiler Design
compiler-design
lexical-analysis
descriptive
+
–
51
votes
7
answers
63
GATE CSE 2018 | Question: 37
A lexical analyzer uses the following patterns to recognize three tokens $T_1, T_2$, and $T_3$ over the alphabet $\{a, b, c\}$. $T_1: a?(b \mid c)^\ast a$ $T_2: b?(a \mid c)^\ast b$ ... the string $bbaacabc$ is processed by the analyzer, which one of the following is the sequence of tokens it outputs? $T_1T_2T_3$ $T_1T_1T_3$ $T_2T_1T_3$ $T_3T_3$
A lexical analyzer uses the following patterns to recognize three tokens $T_1, T_2$, and $T_3$ over the alphabet $\{a, b, c\}$.$T_1: a?(b \mid c)^\ast a$$T_2: b?(a \mid c...
gatecse
21.4k
views
gatecse
asked
Feb 14, 2018
Compiler Design
gatecse-2018
compiler-design
lexical-analysis
normal
2-marks
+
–
1
votes
1
answer
64
cd lexical analysis token
1. macros are not considered as tokens in tokenizing. 2.#include considered as single token 2.stdio.h considered as single token. Are the above statements true?
1. macros are not considered as tokens in tokenizing.2.#include considered as single token2.stdio.h considered as single token. Are the above statements true?
ankit_thawal
750
views
ankit_thawal
asked
Feb 1, 2018
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
true-false
+
–
12
votes
5
answers
65
Lexical, Syntax and Semantic error
int main() { int 1a, b; Printf("\nGate 2018"); Printf("%d",x); } How many types of error are there in this code?
int main() { int 1a, b; Printf("\nGate 2018"); Printf("%d",x); }How many types of error are there in this code?
Shubhanshu
7.2k
views
Shubhanshu
asked
Jan 31, 2018
Compiler Design
compiler-design
lexical-analysis
+
–
3
votes
0
answers
66
Compiler Doubt
what type of error is caused if function name is same as a keyword name?
what type of error is caused if function name is same as a keyword name?
Kiran Karwa
380
views
Kiran Karwa
asked
Jan 20, 2018
Compiler Design
compiler-design
lexical-analysis
descriptive
+
–
6
votes
1
answer
67
Lexical error or No of tokens
Is this line a/*b successfully generating the token's or it give lexical error ? if it is given the lexical error then why so ? I think it will give lexical error because we don't find */ here
Is this line a/*b successfully generating the token's or it give lexical error ? if it is given the lexical error then why so ?I think it will give lexical error because...
junaid ahmad
1.3k
views
junaid ahmad
asked
Jan 12, 2018
Compiler Design
compiler-tokenization
lexical-analysis
+
–
1
votes
2
answers
68
number of tokens
1) 8 2) 9 3) 12 4) 10
1) 82) 93) 124) 10
set2018
705
views
set2018
asked
Jan 7, 2018
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
+
–
2
votes
1
answer
69
me test number of tokens
here i got 44(i count &x and *x as one one) tokens but nas is 53 doubt ----> in general we count 1. *x is one token or two? 2. &x is one token? please tell me i m right or wrong . for this q i think & x are two tokens bcs there is space?
here i got 44(i count &x and *x as one one) tokens but nas is 53 doubt in general we count1. *x is one token or two?2. &x is one token? please tell me i m rig...
mohitbawankar
386
views
mohitbawankar
asked
Jan 6, 2018
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
numerical-answers
made-easy-test-series
+
–
2
votes
2
answers
70
Lexical Analysis
What are different set of characters which are taken as single token in lexical analysis in compiler design? For eg. Charaters under double quotes are taken as single token, post-increment and pre-increment is taken as single token etc.
What are different set of characters which are taken as single token in lexical analysis in compiler design?For eg. Charaters under double quotes are taken as single toke...
Shubham Kumar Gupta
839
views
Shubham Kumar Gupta
asked
Dec 27, 2017
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
+
–
1
votes
1
answer
71
#CD Doubt
What is the diffrence between Lexical error , Syntax error and semantic error..? Please explain with this example void main() { int total-value, Num=2,sum=5,var1; 5=Num; var1=2; sum=num*1; if(sum=var1) { sum=sum+1 } }
What is the diffrence between Lexical error , Syntax error and semantic error..?Please explain with this examplevoid main(){int total-value, Num=2,sum=5,var1;5=Num;var1=2...
Sahil1994
624
views
Sahil1994
asked
Dec 12, 2017
Compiler Design
compiler-design
lexical-analysis
descriptive
+
–
1
votes
1
answer
72
MadeEasy Subject Test: Compiler Design - Lexical Analysis
in c programming which of the following is not used as a token seprator during lexical analysis? a)white space b)comment c)semicolon d)none of these token seprator means??
in c programming which of the following is not used as a token seprator during lexical analysis?a)white spaceb)commentc)semicolond)none of thesetoken seprator means??
aaru14
1.5k
views
aaru14
asked
Nov 21, 2017
Compiler Design
made-easy-test-series
compiler-design
lexical-analysis
+
–
7
votes
4
answers
73
lexical error
if there is miss spelling in some keyword in a program then this misspelled keyword will be treated as lexical errors or it will be treated as a new identifier and accepted as a token ?? ex - whiel (1) ; here while is misspelled as whiel
if there is miss spelling in some keyword in a program then this misspelled keyword will be treated as lexical errors or it will be treated as a new identifier and accept...
itsvkp1
3.3k
views
itsvkp1
asked
Nov 1, 2017
Compiler Design
lexical-analysis
compiler-design
compiler-tokenization
+
–
4
votes
2
answers
74
no of tokens
Imarati Gupta
2.6k
views
Imarati Gupta
asked
Oct 21, 2017
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
numerical-answers
test-series
+
–
9
votes
2
answers
75
# Error
Q) For each of the following C statements state whether they contain lexical error, syntax error, semantic error or no error(along with reason) - i) inta radius =5; ii) x=127b + z; iii) printf("%d=%d\n", x); iv) int p[10]; x=25 + p;
Q) For each of the following C statements state whether they contain lexical error, syntax error, semantic error or no error(along with reason) -i) inta radius =5;ii) x=1...
Kaifi7
827
views
Kaifi7
asked
Oct 12, 2017
Compiler Design
compiler-design
lexical-analysis
+
–
4
votes
1
answer
76
Compiler Lexical analyzer
int main() { print("%d",a); return 0; } If i execute,i will get error as:- prog.c:112:17: error: 'a' undeclared (first use in this function) printf("%d",a); Now as this is the semantic error,so how ... analyzer can give the row number and column number of error as it tokenize the entire program but is this also possible in sematic analyzer?
int main(){ print("%d",a); return 0;}If i execute,i will get error as:- prog.c:112:17: error: 'a' undeclared (first use in this function) printf("%d",a);Now as this...
rahul sharma 5
725
views
rahul sharma 5
asked
Oct 9, 2017
Compiler Design
lexical-analysis
compiler-design
compiler-tokenization
+
–
5
votes
1
answer
77
#Lexical_Analysis
Marcos & prepocessor directive (#define, #include) are handle by which phase of compiler ?? Or it is not input to compiler,it is alredy handled in preprocessor??? Please explain in detail..
Marcos & prepocessor directive (#define, #include) are handle by which phase of compiler ?? Or it is not input to compiler,it is alredy handled in preprocessor???Please e...
Harsh Mehta
749
views
Harsh Mehta
asked
Oct 7, 2017
Compiler Design
compiler-design
lexical-analysis
+
–
2
votes
1
answer
78
compiler-design -tokens
rajoramanoj
1.3k
views
rajoramanoj
asked
Oct 6, 2017
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
numerical-answers
made-easy-test-series
+
–
1
votes
0
answers
79
self doubt can anyone explain me this meaning !!!!
Once the parser makes the list of legitimate tokens available to the error recovery routine then this routine can decide whether a remaining input’s prefix matches one of these tokens closely enough to be treated as that token. This helps the lexical analyzer.
Once the parser makes the list of legitimate tokens available to the error recovery routine then this routine can decide whether a remaining input’s prefix matches one ...
Venkat Sai
375
views
Venkat Sai
asked
Oct 6, 2017
Compiler Design
lexical-analysis
+
–
3
votes
1
answer
80
self doubt
How are constants recogonized by the lexical analyser like interger 1234 floating point 1234.56789 and what happens when we have -1234 and -1234.56789 how many tokens are generated in this case(each of this case) ? is "-" considered seperately ?
How are constants recogonized by the lexical analyser like interger 1234 floating point 1234.56789and what happens when we have -1234 and -1234.56789 how many token...
Venkat Sai
693
views
Venkat Sai
asked
Oct 6, 2017
Compiler Design
lexical-analysis
+
–
10
votes
3
answers
81
Lexical analyser, Tokens
When do we count ++(post increment or pre increment) as 1 or 2 token ?
When do we count ++(post increment or pre increment) as 1 or 2 token ?
junaid ahmad
3.9k
views
junaid ahmad
asked
Sep 28, 2017
Compiler Design
compiler-tokenization
lexical-analysis
+
–
2
votes
1
answer
82
Compilers: Lexical Error
This screenshot is token from the book Ullman, How can following be a lexical error? because "elipseSize" should have a token recorded as an identifier.
This screenshot is token from the book Ullman,How can following be a lexical error? because "elipseSize" should have a token recorded as an identifier.
Manu Thakur
1.6k
views
Manu Thakur
asked
Sep 26, 2017
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
+
–
3
votes
1
answer
83
Compiler Design
The action of parsing the source program into the proper syntactic classes is known as 1. Lexical Analysis 2. Syntax Analysis 3. Interpretation Analysis 4. Parsing
The action of parsing the source program into the proper syntactic classes is known as1. Lexical Analysis2. Syntax Analysis3. Interpretation Analysis4. Parsing
nishant279
2.6k
views
nishant279
asked
Aug 31, 2017
Compiler Design
compiler-design
lexical-analysis
+
–
9
votes
2
answers
84
general doubt
MISSPELLING OF KEYWORDS CAUSE WHICH TYPE OF ERROR- SYNTAX ERROR OR LEXICAL ERROR?? printf("%d") without any integer argument will cause which type of error??
MISSPELLING OF KEYWORDS CAUSE WHICH TYPE OF ERROR- SYNTAX ERROR OR LEXICAL ERROR??printf("%d") without any integer argument will cause which type of error??
sushmita
3.8k
views
sushmita
asked
Aug 27, 2017
Compiler Design
compiler-design
lexical-analysis
+
–
9
votes
2
answers
85
classification of lexical and syntactic errors in complier phases
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 lexical analyzer cannot tell whether fi is a misspelling ... token. but this says it is streams of valid tokens 6.int d=10.10.10 lexical error as invalid num token.
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...
reena_kandari
2.3k
views
reena_kandari
asked
Aug 14, 2017
Compiler Design
lexical-analysis
compiler-tokenization
+
–
1
votes
1
answer
86
Compiler Design
Which language is used to describe the semantics and syntax of c? 1. attribute grammar. 2 syntax tree 3. none
Which language is used to describe the semantics and syntax of c?1. attribute grammar.2 syntax tree3. none
Vasu_gate2017
294
views
Vasu_gate2017
asked
May 14, 2017
Compiler Design
compiler-design
lexical-analysis
+
–
5
votes
1
answer
87
Test by Bikram | Mock GATE | Test 4 | Question: 43
Consider the $C$ program given below: #include <stdio.h> main () { printf("This is GO mock exam\n" ); } The total number of tokens generated when this program is passed to lexical analyzer is :______.
Consider the $C$ program given below:#include <stdio.h main () { printf("This is GO mock exam\n" ); }The total number of tokens generated when this program is passed to l...
Bikram
598
views
Bikram
asked
May 14, 2017
Compiler Design
tbb-mockgate-4
numerical-answers
lexical-analysis
compiler-design
+
–
14
votes
4
answers
88
ISRO 2017-79
The output of a lexical analyzer is A parse tree Intermediate code Machine code A stream of tokens
The output of a lexical analyzer isA parse treeIntermediate codeMachine codeA stream of tokens
sh!va
6.2k
views
sh!va
asked
May 7, 2017
Compiler Design
isro2017
compiler-design
lexical-analysis
+
–
2
votes
4
answers
89
Compilers Principles Techniques and Tool Ch-3 Lexical Analysis
What will be the tokens formed for ',' and '{' ?
What will be the tokens formed for ',' and '{' ?
tanyagt99
949
views
tanyagt99
asked
Mar 26, 2017
Compiler Design
compiler-design
lexical-analysis
compiler-tokenization
+
–
2
votes
2
answers
90
Lexical Analysis
printf("Hello); In the statement given above,is there any lexical error or not ?
printf("Hello);In the statement given above,is there any lexical error or not ?
Purvi Agrawal
1.2k
views
Purvi Agrawal
asked
Mar 10, 2017
Compiler Design
compiler-design
lexical-analysis
descriptive
+
–
Page:
« prev
1
2
3
4
5
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register