iorewvg.blogg.se

Dag in compiler design examples
Dag in compiler design examples




Construct LL(1) parse table for the following grammar.ī factor -> not bfactor ->(b exp r) /true /false (b) Explain error recovery in predictive parsing. (b) Write short notes on following terms:ĩ.(a) Write the algorithm for predictive parsing. (b) Write an algorithm for construction of predictive parsing table.ġ.Construct SLR parsing table for the following grammar.ħ.Construct SLR parsing table for following grammar: ConstructįIRST and FOLLOW sets for the following grammar. Grammar generates strings of balanced parentheses.Ħ.a) Give the rules for computation of FIRST(X) and FOLLOW(X). (b) Explain the basic method of LL(1) parsing and hence explain how very simple (a) What is the string generated by the grammar A -> (A)A (b) Construct SLR parsing table for the following grammar.Ĥ.(a) Convert the following grammar into LL(1) grammarī) construct LL(1) parse table for the above grammerĥ. (a) What are the common conicts that can be encountered in shift - reduce (b) What are the limitations of recursive descent parser (a) What are the difficulties in top down parsing? Explain in detail.Ĭonstruct leftmost derivations and parse trees for the following sentences:ģ.(a) Construct predictive parse table for the following grammar. (b) Eliminate ambiguities in the following grammar. (a) Construct recursive descent parser for the following grammar. Write the output at all phases of the compiler for the above `C' code. (a) Consider the following fragment of `C' code:

dag in compiler design examples

Identify the lexemes, that make up thetokens in the following program segment. the set of words having a,e,i,o,u appearing in that order, although notġ4.(a) What is regular expression? Write regular expressions for the following pat-terns: identifiers and float constants. (b) Write regular expressions for the following patterns.

dag in compiler design examples

How the use ofġ2.a) What is LEX? Explain, in detail, different sections of LEX program. (b) Explain how input buffering helps lexical analyzer in compilation processġ1.Explain the input buffer scheme for scanning the source program. (a) Construct an NFA for regular expression R= (aa/b)*ab convert it into anġ0.(a) Explain the bootstrapping process with suitable diagrams. (b) Write short notes on bootstrapping process.ĩ.State the steps to convert a regular expression to NFA. **8.(a) Explain the different phases of a compiler, showing the output of each phase (b) Compare compiler and interpreter with suitable diagrams. Using the example of the following statement: *7.(a) Explain the different phases of a compiler, showing the output of each phase, (b) Write a LEX program for identifying the keywords and identifiers from the Ing patterns in `C': identifier, comments, numerical constants, arithmetic operators.Ħ.(a) Construct an NFA for regular expression R= (aa/b)*ab convert it into an Explain with one example how LEX program perform lexical analysis for the follow. **4.Describe various phases of a compiler? Differentiate a phase and pass? Compare (b) Differentiate Interpreter & Compiler? The set of words having a, e, i, o, u appearing in that order, although not (b) Write short notes on: input buffering.ģ.(a) Write a regular expressions and NFA for the following patterns. Sentinels can improve its performance? Describe in detail. Write the output at all phases of the compiler for the above ‘C’ code.Įxplain the input buffer scheme for scanning the source program. (a) Consider the following fragment of ‘C’ code:

dag in compiler design examples

(b) Describe the lexical errors and various error recovery strategies with suitableĢ. (a) Explain, in detail, lexical analyzer generator.

  • The annotated parse tree is generated and attribute values are computed in top down manner.AS PER JNTU SYLLABUS ALL 8 UNITS IMPORTANT QUESTIONSġ.
  • Construct the SDD using semantic actions.
  • value of inherited attributes are computed by value of parent or sibling nodes.Ī -> BCD Inherited Attributes – These are the attributes which derive their values from their parent or sibling nodes i.e. Then, the production S –> E is applied to reduce E.val = 26 and semantic action associated with it prints the result E.val. Similarly, combination of E 1.val + T.val becomes E.val i.e. Then, for T –> T 1 * F production, the corresponding semantic action is T.val = T 1.val * F.val. Hence, F.val = 4 and since T is parent node of F so, we get T.val = 4 from semantic action T.val = F.val. from semantic action F.val = digit.lexval. The rule F –> digit is used to reduce digit to F and the value of digit is obtained from lexical analyzer which becomes value of F i.e. The annotated parse tree for the input string isįor computation of attributes we start from leftmost bottom node. Let us assume an input string 4 * 5 + 6 for computing synthesized attributes.
  • ISRO CS Syllabus for Scientist/Engineer Exam.
  • ISRO CS Original Papers and Official Keys.
  • dag in compiler design examples

  • GATE CS Original Papers and Official Keys.





  • Dag in compiler design examples