Recent questions in Compilers

No documents found, press Enter to search
mohammad-alali-2-avatar
about 2 years ago

مریه Q1: A worm gear reducer is driven by a 1200 rpm motor. The worm has 18 threads with gear ratio of (GR 0.9), the maximum lead angle is 0.785 rad. Gear and worm diameters are

Example String name "Mohammed Ali Mahmoud Find the second occurrence of letter h Find the middle name Find the thud name Find the last character
5
Bibouille-avatar
over 2 years ago

J'ai des difficultés

Je voulais savoir en quoi consiste les analyses de situations ?
3
yu-zj-avatar
about 3 years ago

HW 3: Intermediate Code

  1. Suppose we change the Tiger language to use Ada’s copy-in-copy-out parameter passing mechanism. If a parameter is declared with the keywords ‘in out’, it uses copy-in-copy-out. Otherwise, we use call-by-value as before. With copy-in-copy-out, the argument is copied into the parameter variable on entering the function. On function exit, the parameter is copied back out into the argument variable. Describe in detail which changes (if any) are necessary to semantic analysis, escape analysis, activation records, and the intermediate representation.
  2. Draw the intermediate code trees for questions 7.1(f), 7.1(h), 7.2(g), 7.2(j) on p. 160.
    • [7.1] Suppose a certain compiler translates all expressions and subexpressions into Tree.Exp trees, and does not use the Nx and Cx constructors to represent expressions in different ways. Draw a picture of the IR tree that results from each of the following expressions. Assume all variables are nonescaping unless specified otherwise.
      1. a<b, which should be implemented by making an ESEQ whose left-hand side moves a 1 or 0 into some newly defined temporary, and whose right-hand side is the temporary.
      2. if a then b else c, where a is an integer variable (true if  ≠ 0); this should also be translated using an ESEQ.
      3. N/A
      4. if a<b then c:=a else c:=b, translated using the a<b tree from part (e) above; the whole statement will therefore be rather clumsy and inefficient.
    • [7.2] Translate each of these expressions into IR trees, but using the Ex, Nx, and Cx constructors as appropriate. In each case, just draw pictures of the trees; an Ex tree will be a Tree Exp, an Nx tree will be a Tree Stm, and a Cx tree will be a Stm with holes labeled true and false into which labels can later be placed.
      1. if a then b else c, where a is an integer variable (true if  ≠ 0).
      2. N/A
      3. N/A
      4. if a<b then c:=a else c:=b
1
yu-zj-avatar
about 3 years ago

HW 3: Intermediate Code

  1. Suppose we change the Tiger language to use Ada’s copy-in-copy-out parameter passing mechanism. If a parameter is declared with the keywords ‘in out’, it uses copy-in-copy-out. Otherwise, we use call-by-value as before. With copy-in-copy-out, the argument is copied into the parameter variable on entering the function. On function exit, the parameter is copied back out into the argument variable. Describe in detail which changes (if any) are necessary to semantic analysis, escape analysis, activation records, and the intermediate representation.
  2. Draw the intermediate code trees for questions 7.1(f), 7.1(h), 7.2(g), 7.2(j) on p. 160.
    • [7.1] Suppose a certain compiler translates all expressions and subexpressions into Tree.Exp trees, and does not use the Nx and Cx constructors to represent expressions in different ways. Draw a picture of the IR tree that results from each of the following expressions. Assume all variables are nonescaping unless specified otherwise.
      1. a<b, which should be implemented by making an ESEQ whose left-hand side moves a 1 or 0 into some newly defined temporary, and whose right-hand side is the temporary.
      2. if a then b else c, where a is an integer variable (true if  ≠ 0); this should also be translated using an ESEQ.
      3. N/A
      4. if a<b then c:=a else c:=b, translated using the a<b tree from part (e) above; the whole statement will therefore be rather clumsy and inefficient.
    • [7.2] Translate each of these expressions into IR trees, but using the Ex, Nx, and Cx constructors as appropriate. In each case, just draw pictures of the trees; an Ex tree will be a Tree Exp, an Nx tree will be a Tree Stm, and a Cx tree will be a Stm with holes labeled true and false into which labels can later be placed.
      1. if a then b else c, where a is an integer variable (true if  ≠ 0).
      2. N/A
      3. N/A
      4. if a<b then c:=a else c:=b
1
mohammad-alali-2-avatar
about 2 years ago

مریه Q1: A worm gear reducer is driven by a 1200 rpm motor. The worm has 18 threads with gear ratio of (GR 0.9), the maximum lead angle is 0.785 rad. Gear and worm diameters are

Example String name "Mohammed Ali Mahmoud Find the second occurrence of letter h Find the middle name Find the thud name Find the last character
5
Bibouille-avatar
over 2 years ago

J'ai des difficultés

Je voulais savoir en quoi consiste les analyses de situations ?
3
Compilers