Remove left recursion from following grammar A → Ac | Aad | bd | ε
[3 marks]Consider a grammar S → aa | aSa, How a top down backtracking parser can generate six occurrences of a?
[4 marks]Construct an LL(1) parsing table for the following grammar. S → aBDh B → cC C → bC | ε D → EF E → g | ε F → f | ε
[7 marks]If the string a9b had been identified as identifier, but if in the further use 9ab is written, which phase of compiler would identify as an error? How?
[3 marks]How a lexical analyzer recognizes unsigned numbers such as 12,12.3,12.3E4?
[4 marks]Consider the assembly program fragment START 200 READ A LOOP MOVER AREG,A SUB AREG,=’1’ BC GT,LOOP STOP A DS 1 What will be the intermediate code for the above program fragment? What does START directive do? What will be the difference if ORIGIN directive is used in place of START?
[7 marks]Consider the assembly program fragment, MOVER CREG, B ADD CREG, =’1’ BC ANY,NEXT LTORG =’5’ =’1’ SUB AREG,=’1’ END =’1’
[7 marks]Explain LTORG directive.1 (ii) Explain the entries in mnemonic opcodes table as per above code fragement. (iii) How table of literals will be manipulated?
[ marks]Which type of gap makes the software buggy or unreliable? Which methods can be used to overcome this situation?
[3 marks]How the use of programming language can help in making the software reliable?
[4 marks]Write Macro definition with following and explain.
[7 marks]Macro using expansion time loop (ii) Macro with REPT statment
[ marks]Write Macro definition for adding two numbers that uses positional and keyword parameters.
[3 marks]Write a macro definition for adding two numbers 10 times. Use nested macro call to increment numbers by 1 every time in iterations.
[10 marks]Consider the following grammar for expressions E → EAE | (E) | -E | id A → + | - | * | / | ^ where ^ represents exponent. Generate operator precedence relation matrix and show how id * id ^ id will be parsed?
[7 marks]Justify “Postfix string is a popular intermediate code in non optimizing compilers”
[3 marks]Which are the methods used for identifying free memory area?
[4 marks]Define program relocation. How address is corrected in address sensitive instructions in case of program relocation.
[7 marks]Aprogram computes i*5 for 10 times. What type of optimization can be applied?
[3 marks]What is the structure of LEX program?
[4 marks]Explain common sub expression elimination using value numbers.
[7 marks]What is ambiguity in grammatic specification?
[3 marks]Describe the facilities for dynamic debugging.
[4 marks]Write a code fragment to find out whether number is odd or even. Draw control flow graph. Perform control flow analysis.
[7 marks]Describe three components of the interpreter.
[3 marks]Define linking. How external reference is resolved in linking?
[4 marks]What is memory binding? Explain dynamic memory allocation using extended stack model.
[7 marks]