JNTU Previous Papers-B Tech-CSE-3rd -year-Language Processors-Set-III-Aug/Sep 2008
JNTU III B.Tech Supplimentary Examinations, Aug/Sep 2008
(Computer Science & Engineering)
1. Explain with one example how LEX program perform lexical analysis for the following PASCAL patterns: identifier, comments, numerical constants, key words, arithmetic operation.
2. (a) Eliminate ambiguity if any from the following grammar for boolean expressions.
bexpr ! bexpr or bterm|bterm
bterm ! bterm and bfactor|bfactor
bfactor ! nst factor|(bexpr)|true|false.
where or, and, not (, ), true, false are terminals in the grammar.
(b) Write a recursion discent parser for the above grammar.
3. (a) Distinguish syntherised and inherited attributes.
(b) Give a syntax-directed translator scheme for converting the statements of the
following grammar into three address code
S!while expr do begin S and
4. (a) What is type expression? Write type expression for the following types.
i. A two dimensional array of integers (i.e. an array of arrays) whose rows
are indexed from 0 to 9 and whose columns are indexed from -10 to 10.
ii. Functions whose domains are functions from integers to pointers to integers and whose ranges are records consisting of an integer and a character.
(b) What is type system. Discuss static and dynamic checking of types.
5. (a) Explain how the symbol table space can be reused. Explain through an example.
(b) Discuss various symbol table organization techniques.
6. (a) What are the various machine dependent code optimization techniques.
(b) Convert the following arithmetic expression into syntax tree and three address code
b* 3 (a+b)
7. (a) Explain the generic issues in the design of code generator.
(b) Write about the various object code forms.
8. (a) Explain the memory requirement for variant I and variant II of intermediate code of an assembler design.
(b) How Declarative state and Assembler directives are processed by an assembler.