search
Log In

Recent questions tagged lexical-analysis

1 vote
5 answers
1
0 votes
5 answers
2
1 vote
5 answers
3
Consider the following statements related to compiler construction: Lexical Analysis is specified by context-free grammars and implemented by pushdown automata. Syntax Analysis is specified by regular expressions and implemented by finite-state machine. Which of the above statement(s) is/are correct? Only I Only II Both I and II Neither I nor II
asked Mar 24, 2020 in Compiler Design jothee 614 views
0 votes
0 answers
4
Consult the language reference manuals to determine the sets of characters that form the input alphabet (excluding those that may only appear in character strings or comments), the lexical form of numerical constants, and the lexical form of identifiers, for each of the following languages: C C++ C# Fortran Java Lisp SQL
asked Aug 5, 2019 in Compiler Design Lakshman Patel RJIT 346 views
0 votes
0 answers
5
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-definable set (as in XML). Further, tags can often have parameters. Suggest how to divide the ... you liked that one. <P> into appropriate lexemes. Which lexemes should get associated lexical values,and what should those values be?
asked Jul 27, 2019 in Compiler Design Lakshman Patel RJIT 325 views
0 votes
0 answers
6
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 appropriate lexemes, using the discussion of Section $3.1.2$ as a guide. Which lexemes should get associated lexical values? What should those values be?
asked Jul 27, 2019 in Compiler Design Lakshman Patel RJIT 378 views
3 votes
1 answer
7
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 delimiter, which includes blank symbol, arithmetic, logical operator, left parenthesis, right parenthesis, +, ... ends with a delimiter and + is a valid delimiter and the error in declaration will not be detected at this stage...
asked Jun 9, 2019 in Compiler Design Hirak 726 views
1 vote
2 answers
8
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: plusplus, comma, bracket open, bracket close, single quote ;
asked Jun 5, 2019 in Compiler Design Rhythm 1.6k views
2 votes
4 answers
9
How many tokens in this a>>=1; and a! , Will >>= and a! be treated as a single token ?
asked Jan 21, 2019 in Compiler Design kman30 569 views
3 votes
2 answers
10
In the Lexical Analysis, regular expression can be used to model A) the structures of lexemes with fixed length identifier excluded B) the structure of tokens C) the structure of tokens but not lexemes D) the structure of lexemes with variable length identifier included
asked Dec 27, 2018 in Compiler Design Prince Sindhiya 1k views
2 votes
5 answers
12
What it the number of tokens in the following line? printf("%d numbers.", &x);
asked Nov 11, 2018 in Compiler Design Mizuki 901 views
1 vote
2 answers
13
6 votes
1 answer
14
Consider the following code $x = (y + 5) + (^*z) * 10 - x /3 $ Which of the following correctly identified by lexical analysis after scanning the above code? 5 Identifiers 3 literals 4 Identifiers 6 literals
asked Oct 22, 2018 in Compiler Design Mk Utkarsh 526 views
5 votes
4 answers
15
1 vote
1 answer
16
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); }
asked Sep 21, 2018 in Compiler Design sagar27 1.5k views
0 votes
0 answers
18
1 vote
2 answers
21
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.
asked Mar 16, 2018 in Compiler Design The Technical Guy 365 views
30 votes
7 answers
22
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)^*a$ $T_2$: $b?(a \mid c)^*b$ $T_3$: $c?(b \mid a)^*c$ Note that x?' ... prefix. If 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$
asked Feb 14, 2018 in Compiler Design gatecse 10.9k views
10 votes
5 answers
23
int main() { int 1a, b; Printf("\nGate 2018"); Printf("%d",x); } How many types of error are there in this code?
asked Jan 31, 2018 in Compiler Design Shubhanshu 2.8k views
6 votes
1 answer
24
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
asked Jan 12, 2018 in Compiler Design junaid ahmad 487 views
2 votes
2 answers
25
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.
asked Dec 27, 2017 in Compiler Design Shubham Kumar Gupta 476 views
1 vote
1 answer
26
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??
asked Nov 22, 2017 in Compiler Design aaru14 397 views
6 votes
5 answers
27
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
asked Nov 2, 2017 in Compiler Design itsvkp1 1.5k views
...