A lexical analyzer uses the following token definitions For the string given below, the number of tokens (excluding ws) that will be produced by the lexical analyzer is ________. (answer in integer)
GATE CSE · Compiler Design
Generate GATE-level questions covering tokens, lexemes, regular expressions, finite automata (DFA/NFA), lexical errors, and token recognition. Include conversion and identification problems.
45 questions · 19 PYQs · 1 AI practice · GATE CSE 2027
🎯 These are sample questions
Just sign in to unlock everything. Free for all students.
A lexical analyzer uses the following token definitions For the string given below, the number of tokens (excluding ws) that will be produced by the lexical analyzer is ________. (answer in integer)
Which ONE of the following statements is FALSE regarding the symbol table?
Consider the following statements. I. Symbol table is accessed only during lexical analysis and syntax analysis. II. Compilers for programming languages that support recursion necessarily need heap storage for memory allocation in the run-time environment. III. Errors violating the condition 'any variable must be declared before its use' are detected during syntax analysis. Which of the above statements is/are TRUE?
In a two-pass assembler, resolution of subroutine calls and inclusion of labels in the symbol table is done during
The number of tokens in the following C code segment is switch(inputvalue) { case 1 : b =c*d; break; default : b =b++; break; }
A particular BNF definition for a "word is given by the following rules. < word > :: =< letter > I < letter > < charpair > I < letter >< intpair > < charpair > :: =< letter >< letter > I < charpair >< letter >< letter > < intpair > :: = < integer >< integer > I < intpair >< integer >< integer > < letter > :: = a I b I c I ......I Y I Z < integer > :: = 0 I 1 I 2 I ......I 9 Which of the following lexical entries can be derived from < word >? I. pick II. picks III. c44
A lexical analyzer uses the following patterns to recognize three tokens over the alphabet {a,b,c}. Note that 'x?' means 0 or 1 occurrence of the symbol x. Note also that the analyzer outputs the token that matches the longest possible prefix. If the string bbaacabc is processed by the analyzer, which one of the following is the sequence of tokens it outputs?
The output of a lexical analyzer is
The number of tokens in the following C statement is printf("i=%d, &i=%x", i, &i);
Yacc stands for
Number of comparisons required for an unsuccessful search of an element in a sequential search organized, fixed length, symbol table of length L is
In a compiler, keywords of a language are recognized during
The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?
A symbol table of length 152 is processing 25 entries at any instant. What is occupation density?
Which data structure in a compiler is used for managing information about variables and their attributes?
The number of tokens in the FORTRAN statement DO 10 I = 1.25 is
The pass numbers for each of the following activities i. object code generation ii. literals added to literal table iii. listing printed iv. address resolution of local symbols that occur in a two pass assembler respectively are
A simple two-pass assembler does the following in the first pass:
In a compiler the module that checks every character of the source text is called:
Thompson's construction builds an NFA from a regular expression. Which of the following correctly describes the NFA for the concatenation r·s (r followed by s)?
Want unlimited AI-generated Lexical Analysis questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →