Trending ▼   ResFinder  

UGC NET Compiler Previous questions

2 pages, 0 questions, 0 questions with responses, 0 total responses,    0    0
sapinm
  
+Fave Message
 Home > sapinm >

Formatting page ...

1 COMPILER DESIGN JUNE 2010 1. (a) Parsing is an essential feature of compiler. Parsing is also a feature of Natural Language Recognition system. If the grammar G is in Chomsky Normal Form (CNF), can we parse an arbitrary string w L(G) of length n in 0(n3) time ?Prove. Alternatively, for a given G, as follows (which is in CNF) S AB | b A CB | AA | a B AS | b C BS | c Generate parse table and hence the parse tree for the input c a b a b. (b) What would be the time complexity if G is an unambiguous grammar ? (c) What if G is LR(I) grammar ? 15 DECEMBER 2009 1. Consider the following grammar : S asb|s s|sy|z Determine which of the following strings are ambiguous (i.e. have more than one parse tree) axbxz, azxzbyxz, zxzy, azbxazb 15 JUNE 2009 1. Define phrase structure grammar of type 0, 1, 2 and 3 with an example of each. 5 JUNE 2007 1. 2. Write a parse - tree for the following assignment statement : a=b+c*d+e . (a) Write a recursive descent parser for the following grammar. E E +T|T T T *F|F F (E) |a|b|c (b) Trace the recursive calls for the input a *b+ c 5 40 DECEMBER 2006 1. Construct SLR parser for the following grammar. E E+ T, E T T T *F,T F F id Is the following grammar is LL(1) grammar ? Justify your answer. S AA A-> bA/d JUNE 2006 1. Consider the grammar G (S) with : P: S aAbc|BCf A C|e B Cd|c C df|e 40 2 Construct LR (I) sets of items and construct complete parse table. 20 DECEMBER 2005 1. Consider the following grammar G(S) : S AB A aAb/ab B cBd/cd Find L(G(S)). 2. Describe how a validating parser is different from a non-validating parcer. 5 5 JUNE 2005 1. Describe the function of lexical analyser and identify the tokens in the following C - language statement : Cost = price * quantity : 5 2. (a) Design a predictive parser for the grammer given below : 40 E E+T|T T T *F|F F (E)|a|b|c (b) Show how the parser accepts the input (a + b) * c DECEMBER 2004 1. (a) Show that the following Grammer is LL(1) : S A S / A aA/b (b) Is the following grammer SLR (1) ? Justify the answer. S A S/b A S A/a 8 8

Formatting page ...

 

  Print intermediate debugging step

Show debugging info


 

 


© 2010 - 2026 ResPaper. Terms of ServiceContact Us Advertise with us

 

sapinm chat