Recent questions tagged compiler-tokenization

1 1 vote
2 2 answers
2.3k
2.3k views
How will the compiler detect whether "if" is a keyword or an identifier?Please tell me the concept behind this.
1 1 vote
3 3 answers
5.4k
5.4k views
Consider the following statements$S_{1}:$ The set of string described by a rule is called pattern associated with the token.$S_{2}:$ A lexeme is a sequence of character i...
0 0 votes
1 1 answer
554
554 views
The number of tokens in the fortran statements DO 10 I = 1.3 is ?
0 0 votes
0 0 answers
810
810 views
Which of the following is not a token of c -program?A. 1.02e + 2B. # defineC. 123.33D. MAXplease explain why?
0 0 votes
1 1 answer
7.2k
7.2k views
Question:Find the number of tokens in the following C code using lexical analyzer of the compiler.
1 1 vote
1 1 answer
7.5k
7.5k views
Find no of tokens in below program.#include<stdio.h>main(){ int I; int *pi = &I; //parent pointer scanf("%d",pi); printf("%d\n", I+5);}
1 1 vote
0 0 answers
4.9k
4.9k views
Whether a given pattern constitutes a token or not(a) depends on the source language(b) depends on the target language(c) depends on the compiler(d) none of the above com...
0 0 votes
1 1 answer
1.3k
1.3k views
1 1 vote
1 1 answer
1.0k
1.0k views
No of token?$a b c d + y{^3}+(2-5+x$ $6/2$$ ;$Please suggest how to count token in this type of questions?
0 0 votes
4 4 answers
4.5k
4.5k views
In this question we will take n-=n1 as n=n-n1 as 5 tokens or n-=n1 as 4 tokens ????The number of tokens in the following C-code$\qquad$ . int main(){int m=10;int n, n1;...
0 0 votes
1 1 answer
370
370 views
Consider the following statement while ( $\mathrm{i} \ll \mathrm{j}++$ ) func1(4);Number of tokens present in the above statement are $\qquad$ .
6 6 votes
1 answers 1 answer
21.4k
21.4k views
What is the difference between lexeme and tokens?
1 1 vote
1 answers 1 answer
5.9k
5.9k views
void main() { int total-value, Num=2,sum=5,var1; 5=Num; var1=2; sum=num*1; if(sum=var1) { sum=sum+1 } }Here, is $\text{"total-value"}$ a lexical error?
3 3 votes
4 answers 4 answers
1.9k
1.9k views
Number of tokens in $\text{int a[5];}$
1 1 vote
1 1 answer
1.3k
1.3k views
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?
1 1 vote
0 0 answers
755
755 views
# DEFINE M 100 int main() { // declare variables int n = 2020; return n%M; }The number of tokens in this program?
1 1 vote
1 1 answer
1.9k
1.9k views
Find no of tokens in following code:#define square(x) x*x int main(){ int a=square(2); printf("%d", a); return 0; }Does macro expansion effect the tokens count??
5 5 votes
1 1 answer
3.7k
3.7k views
How many tokens are there?1) int a /*b2) printf ("%
6 6 votes
1 1 answer
1.8k
1.8k views
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...
1 1 vote
2 answers 2 answers
1.7k
1.7k views
1 1 vote
1 1 answer
694
694 views
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...
2 2 votes
1 answers 1 answer
1.4k
1.4k views
A lexeme is an identifier for a token?True or False
2 2 votes
2 2 answers
1.2k
1.2k views
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...
1 1 vote
1 1 answer
2.9k
2.9k views
Which of the following not a token of C program?a)1.02e+2b)#definec)MAXd)123.33
6 6 votes
4 4 answers
10.4k
10.4k views
There are 40 tokens in this question.But I have doubt that what should be the wording of the question "The number of LEXEMES generated by the Lexical Analyzer in the abov...
7 7 votes
4 4 answers
4.6k
4.6k views
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...
4 4 votes
2 answers 2 answers
4.4k
4.4k views
Q. 13 How many tokens are generated by the lexical analyzer, if the following program has no lexical error?main()\{int $x, y$;$\mathrm{fl} / *$ gate oat z ;$x=/^{*}$ exam...
5 5 votes
1 answers 1 answer
6.9k
6.9k views
void main(){i/*nt*/a=10;return;}Number of tokens in above code:?
4 4 votes
1 1 answer
1.1k
1.1k views
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...