GATE CS Lexical Analysis questions
Practise Lexical Analysis questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
Consider the following C statements: char *str1 = "Hello; /* Statement S1 */ char *str2 = "Hello;"; /* Statement S2 */ int *str3 = "Hello"; /* Statement S3 */ Which of the following options is/are correct?
A lexical analyzer uses the following token definitions For the string given below, …
Which ONE of the following statements is FALSE regarding the symbol table?
Consider the following two sets: …
Consider the following statements regarding the front-end and back-end of a compiler. S1: The front-end includes phases that are independent of the target hardware. S2: The back-end includes phases that are specific to the target hardware. S3: The back-end includes phases that are specific to the programming language used in the source code. Identify the …
Consider the following program: int main () { Integer x; return 0; } Which one of the following phases in a seven-phase compiler will throw an error?
A lexical analyzer uses the following patterns to recognize three tokens , and over the alphabet . Note that ‘’ means or occurrence of the symbol Note also that the analyzer outputs the token that matches the …
Which one of the following statements is FALSE?
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it: …
Match the following: …
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?
In a compiler, keywords of a language are recognized during
Which data structure in a compiler is used for managing information about variables and their attributes?
Match all items in Group 1 with the correct options from those given in Group 2. …
The number of tokens in the following C statement is printf("i=%d, &i=%x", i, &i);
The conditional expansion facility of macro processor is provided to
Which of the following macros can put a macro assembler into an infinite loop? .MACRO M1, X .IF EQ, X ;if X=0 then M1 X + 1 .ENDC .IF NE, X ;if X ≠ O then .WORD X ;address (X) is stored here .ENDC .ENDM .MACRO M2, X .IF EQ, X M2 X .ENDC .IF NE, X .WORD X + 1 .ENDC .ENDM
The pass numbers for each of the following activities object code generation literals added to literal table listing printed address resolution of local symbols that occur in a two pass assembler respectively are
What are and in the following macro definition? macro Add x, y Load y Mul x Store y end macro
State whether the following statements are True or False with reasons for your answer A symbol declared as ‘external’ in an assembly language program is assigned an address outside the program by the assembler itself.
