Recent questions tagged compiler-tokenization

694
views
1 answers
3 votes
A lexical analyzer uses the following patterns to recognize four tokens $\textsf{T1, T2, T3},$ and $\textsf{T4}$ over the alphabet $ \{a,b,c\}.$Rule1: aa*b*c* { print...
630
views
2 answers
2 votes
The number of tokens in the following C/C++ statement is :printf("i=%d, &i=%xx", i&i);$9$$6$$10$$12$
5.3k
views
3 answers
3 votes
The number of tokens in the following C code segment isswitch(inputvalue) { case 1 : b =c*d; break; default : b =b++; break; }$27$$29$$26$$24$
1.1k
views
0 answers
1 votes
Most languages are case sensitive, so keywords can be written only one way, and the regular expressions describing their lexeme is very simple. However, some languages, l...
1.2k
views
0 answers
3 votes
Consult the language reference manuals to determinethe sets of characters that form the input alphabet (excluding those that may only appear in character strings or comme...
1.1k
views
1 answers
0 votes
Tagged languages like HTML or XML are different from conventional programming languages in that the punctuation (tags) are either very numerous (as in HTML) or a user-def...
1.4k
views
0 answers
0 votes
Divide the following C + + program:float limitedSquare(x) float x { /* returns x-squared, but never more than 100 */ return (x<=-10.0 || x>=10.0)?100:x*x; }into appropria...
2.0k
views
1 answers
3 votes
The above diagram is Transition Diagrams for identifiers. As we can see that the identifier is said to be accepted if it starts with a letter and ends with a valid delimi...
4.4k
views
2 answers
2 votes
which one of the following string can definitely said to be a token without looking at the next input:+(++,+=)return(return a)*(*=)=(==)++ , ( ) ‘ ; option e is: plu...
3.4k
views
2 answers
2 votes
Find the number of tokens in the following C code$:$main() { int x = 10 , *P ; int y = x ++ ; char * q ; P = & x ; q = 'A' ; if(*P>=10) { *P = x + 100; ...
363
views
1 answers
0 votes
The number of tokens in the following $\text{C}$ statement isprintf(“i = %d, j = %f, &i = %x\n”, i, j, &i);$10$$35$$46$$12$
639
views
1 answers
0 votes
int main(){ int a,b; a = 10; b = 11; printf(“%d %d”, a++,b );}The number of tokens is
2.8k
views
4 answers
0 votes
Identify the total number of tokens in the given statementprintf("A%B=",&i);$7$$8$$9$$13$
1.0k
views
0 answers
1 votes
How many tokens are there ? int main(){char name={'A','A','K','A','S','H'};return 0;}Please give any reference if possible, my doubt is about the characters in the braces...
1.9k
views
5 answers
2 votes
What it the number of tokens in the following line?printf("%d numbers.", &x);
658
views
0 answers
0 votes
Q1: Consider G :-$X \rightarrow X + Y | Y$$Y \rightarrow Y*Z|Z$$Z \rightarrow (X)$$Z \rightarrow id$if LR(1) parser is used to parse the above grammar, then total how man...
3.8k
views
2 answers
2 votes
1.2k
views
2 answers
1 votes
How will the compiler detect whether "if" is a keyword or an identifier?Please tell me the concept behind this.
4.3k
views
3 answers
1 votes
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...
304
views
1 answers
0 votes
The number of tokens in the fortran statements DO 10 I = 1.3 is ?
448
views
0 answers
0 votes
Which of the following is not a token of c -program?A. 1.02e + 2B. # defineC. 123.33D. MAXplease explain why?
5.5k
views
1 answers
0 votes
Question:Find the number of tokens in the following C code using lexical analyzer of the compiler.
5.4k
views
1 answers
1 votes
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);}
4.3k
views
0 answers
1 votes
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...
540
views
1 answers
1 votes
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?
2.4k
views
2 answers
0 votes
In this question we will take n-=n1 as n=n-n1 as 5 tokens or n-=n1 as 4 tokens ????