Recent questions tagged lexical-analysis

1 1 vote
1 answers 1 answer
1.4k
1.4k views
The same identifier X is used to represent two distinct variables in the same function in a C program, then which of the following statement is / are TRUE?S1: The lexical...
0 0 votes
1 1 answer
1.1k
1.1k views
lexical error is______1.an error produced by LA when illegal character is appear2.an error produced by LA when missing left parenthesis in expression3.an error produced b...
1 1 vote
1 1 answer
651
651 views
Consider the following C program : # includemain()Iint }x=10,y=12char * a;a=&x;x=1xab;printf("%d %d",x, * a);I Which of the following type of error (earliest phase) i...
4 4 votes
3 3 answers
3.0k
3.0k views
The number of tokens in the following expression is?+ * * * < = & { - + + + } ( > ) + & &
0 0 votes
1 answers 1 answer
510
510 views
I think none correct..anybody please check
1 1 vote
2 2 answers
536
536 views
1. The advantage of panic mode of error recovery is thatit is simple to implementit is very effectiveit never gets into infinite loopnone of the above
30 30 votes
3 answers 3 answers
8.3k
8.3k views
Using longer identifiers in a program will necessarily lead to:Somewhat slower compilationA program that is easier to understandAn incorrect programNone of the above
28 28 votes
5 answers 5 answers
9.7k
9.7k views
In a compiler the module that checks every character of the source text is called:The code generator.The code optimiser.The lexical analyser.The syntax analyser.
2 2 votes
1 1 answer
2.2k
2.2k views
I came across few Compiler Design Doubts, Please provide your cent.$Q_1 :$ Can lexical analyser detect some/any type of errors?I think yes, because while scanning to iden...
0 0 votes
3 3 answers
1.7k
1.7k views
Which Phase(s) of compiler produce error(s) in the following program?#include<stdio.h>int main(){ nit a b ; a = 10; b = 20; printf("%d%d",a,b); ret...
1 1 vote
1 answers 1 answer
558
558 views
typechecking is done by :1. lexical analyser2. syntax analyser3. semantic analyser4. ICG
2 2 votes
1 1 answer
901
901 views
CD
checking whether a variable is defined before use is syntax error or semantic error??
2 2 votes
3 3 answers
740
740 views
..
Consider the following C program:int main (void) { in/*this is an example*/z; double/*is it an error?*/y; print( “This is simple” ); return 0; }What is the kind of error ...
1 1 vote
2 2 answers
1.6k
1.6k views
..
Consider the following three statements:S1: The lexical analyzer detects an error when it discovers that an input prefix does not fit the specification of any token class...
1 1 vote
2 2 answers
906
906 views
Consider the following statements:S1: Writing "int main" as "intmain" in a C program shall result in lexical error.S2: Writing "int main" as "intmain" in a C program shal...
0 0 votes
1 1 answer
1.1k
1.1k views
cosider the following normal statement:DO 5 I =1.25also consider the following FORTRAN 90 statement:D0 5 I = 1.25the difference between numbers of tokens in both the stat...
6 6 votes
3 3 answers
9.5k
9.5k views
Which of the following is used for grouping of characters into tokens (in a computer) ?A parserCode optimizerCode generatorScanner
2 2 votes
2 2 answers
1.5k
1.5k views
In a two pass compiler, during the first pass:(A) user defined address symbols are correlated with their binary equivalent(B) the syntax of the statement is checked and m...
0 0 votes
1 1 answer
850
850 views
What is token and how use it?
2 2 votes
2 2 answers
1.1k
1.1k views
Can any one Write A C Program to print "ACCEPT" if the string has the pattern0*1* + 1*0*otherwise "REJECT"
8 8 votes
1 answers 1 answer
5.2k
5.2k views
How many tokens will be generated by the scanner for the following statement ?$x = x ∗ (a + b) - 5$;$12$$11$$10$$07$
0 0 votes
1 1 answer
1.1k
1.1k views
which of following symbols made as token by depending on next symbol?a=b>c<d#
0 0 votes
1 answers 1 answer
1.6k
1.6k views
Compile time error do not include:A. Lexical errorB. Syntactic errorC. Semantic errorD. Logical errorWhat is the answer?What are these errors?please explain with an examp...
0 0 votes
1 answers 1 answer
1.5k
1.5k views
Recognition of basic syntactic constructs through reductions, this task is performed by (A) Lexical analysis (B) Syntax ana...
0 0 votes
1 1 answer
1.2k
1.2k views
A macro definition consists of ...
1 1 vote
1 answers 1 answer
1.3k
1.3k views
1 .Which of these is not a part of Synthesis phase .Please states the reason also Along with your answer.(A) Obtain machine code corresponding to the mnemonic from the ...
1 1 vote
1 1 answer
2.1k
2.1k views
Which of the following statement is true For lexical analysis ?a) Simplify the phasesb) Compiler effeciency improvedc) Portability is encahncedd)compiler work faster
0 0 votes
1 1 answer
752
752 views
ICG
In backpatching , what does the N mean in semantic rule for syntax rule ?1.E1 or NE22.E1 and NE23.Not E1a) It refer to the index of the first statement of second expres...
10 10 votes
2 answers 2 answers
2.1k
2.1k views
a = 1+1+1+ 1+1+1 1+1;as far as i think, it will pass the lexical phase.. it should b syntax error.. correct ??