home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adaptor.zip / adapt.zip / adaptor / src / adaptvar.c < prev    next >
Text File  |  1994-01-03  |  30KB  |  1,335 lines

  1. # include "Vars.h"
  2. # include "yyAVars.w"
  3. # include <stdio.h>
  4. # if defined __STDC__ | defined __cplusplus
  5. #  include <stdlib.h>
  6. # else
  7.    extern void exit ();
  8. # endif
  9. # include "Tree.h"
  10. # include "Definiti.h"
  11.  
  12. # ifndef NULL
  13. # define NULL 0L
  14. # endif
  15. # ifndef false
  16. # define false 0
  17. # endif
  18. # ifndef true
  19. # define true 1
  20. # endif
  21.  
  22. # ifdef yyInline
  23. # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) \
  24.   if ((ptr = (tree) free) >= (tree) max) ptr = alloc (); \
  25.   free += nodesize [kind]; \
  26.   ptr->yyHead.yyMark = 0; \
  27.   ptr->Kind = kind;
  28. # else
  29. # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) ptr = make (kind);
  30. # endif
  31.  
  32. # define yyWrite(s) (void) fputs (s, yyf)
  33. # define yyWriteNl (void) fputc ('\n', yyf)
  34.  
  35. # line 43 "AdaptVars.puma"
  36.  
  37. # include <stdio.h>
  38. # include "Idents.h"
  39. # include "StringMe.h"
  40.  
  41. # include "protocol.h"
  42.  
  43. # include "Types.h"             /* VarSize, VarRank, ...         */
  44. # include "Transfor.h"         /* IsHost, CombineACF, ....      */
  45. # include "Dalib.h"             /* MakeVarDecl, ...              */
  46.  
  47. # include "Expressi.h"       /* AddConstant, MakeConstant     */
  48.  
  49. # include "MakeStAa.h"  /* InsertStaticDecls, MakeInitialStatic */
  50.  
  51. tIdent GlobalId;                /* used to generate name_low, name_high */
  52.  
  53. tTree NewDefines;  /* stmts for a_low, a_high, a_os */
  54.  
  55.  
  56.  
  57. static FILE * yyf = stdout;
  58.  
  59. static void yyAbort
  60. # ifdef __cplusplus
  61.  (char * yyFunction)
  62. # else
  63.  (yyFunction) char * yyFunction;
  64. # endif
  65. {
  66.  (void) fprintf (stderr, "Error: module AdaptVars, routine %s failed\n", yyFunction);
  67.  exit (1);
  68. }
  69.  
  70. tTree AdaptVarDecl ARGS((tTree t, int dist, bool IsMain));
  71. tTree AdaptParamDecl ARGS((tTree t, int dist));
  72. static void SetUpOverlap ARGS((tTree t));
  73. static void ChangeArraySpecification ARGS((tTree v, tDefinitions Obj, bool IsMain));
  74. static void MakeStaticDistributedStmts ARGS((tTree var, tDefinitions obj, bool IsMain));
  75. static void StaticDistributedVarStmts ARGS((tTree v, tTree dist_index));
  76. static tTree MakeNewDummyRange ARGS((tTree val, tIdent name));
  77. static tTree MakeNewLocalRange ARGS((tTree val));
  78. static int GetMaxSize ARGS((tTree index));
  79. tTree AdaptCommonVarDecl ARGS((tTree t, int dist));
  80. static tTree InsertRangeDecls ARGS((tTree decls, tIdent A));
  81. static tTree InsertSpecDecls ARGS((tTree decls, tIdent A, tTree type));
  82. tTree AdaptAllocate ARGS((tTree t, bool IsMain));
  83. static void OverlapAllocate ARGS((tTree t));
  84. static void OverlapAllocateBounds ARGS((tTree actuals, tTree formals));
  85. static tTree OverlapSlice ARGS((tTree slice, int left_ovlp, int right_ovlp));
  86. tTree AdaptDeallocate ARGS((tTree t, bool IsMain));
  87. static tTree GenAllocExtensions ARGS((tIdent id));
  88. static tTree GenAllocStmt ARGS((tTree t));
  89. static tTree GenDeallocStmt ARGS((tTree t));
  90. static tTree MakeRangeParameters ARGS((tTree range_list, tTree end_params));
  91.  
  92. tTree AdaptVarDecl
  93. # if defined __STDC__ | defined __cplusplus
  94. (register tTree t, register int dist, register bool IsMain)
  95. # else
  96. (t, dist, IsMain)
  97.  register tTree t;
  98.  register int dist;
  99.  register bool IsMain;
  100. # endif
  101. {
  102. # line 72 "AdaptVars.puma"
  103.  
  104. tTree newdecl, int4;
  105. tObject Obj;
  106.  
  107.   if (t->Kind == kVAR_DECL) {
  108.   if (equalint (dist, 0)) {
  109. # line 77 "AdaptVars.puma"
  110.   {
  111. # line 78 "AdaptVars.puma"
  112.    SetUpOverlap (t->VAR_DECL.VAL);
  113.   }
  114.    return t;
  115.  
  116.   }
  117.   if (equalint (dist, - 1)) {
  118. # line 92 "AdaptVars.puma"
  119.   {
  120. # line 94 "AdaptVars.puma"
  121.    if (! ((IsHost == true))) goto yyL2;
  122.   {
  123. # line 96 "AdaptVars.puma"
  124.    SetUpOverlap (t->VAR_DECL.VAL);
  125.   }
  126.   }
  127.    return t;
  128. yyL2:;
  129.  
  130.   }
  131.   if (equalint (dist, - 1)) {
  132. # line 110 "AdaptVars.puma"
  133.    return NoTree;
  134.  
  135.   }
  136.   if (equalint (dist, 1)) {
  137. # line 125 "AdaptVars.puma"
  138.   {
  139. # line 127 "AdaptVars.puma"
  140.    if (! ((IsHost == true))) goto yyL4;
  141.   }
  142.    return NoTree;
  143. yyL4:;
  144.  
  145.   }
  146.  {
  147.   bool is_static;
  148.   if (equalint (dist, 1)) {
  149. # line 143 "AdaptVars.puma"
  150.   {
  151. # line 147 "AdaptVars.puma"
  152.  
  153. # line 149 "AdaptVars.puma"
  154.  Obj = GetLocalDecl (t->VAR_DECL.Name);
  155.  
  156.      int4 = mINTEGER_TYPE (4);
  157.  
  158.      newdecl = mDECL_LIST (t, NoTree);
  159.  
  160.      is_static = ((!IsVarAllocatable(Obj)) && (!IsVarDummy(Obj)));
  161.  
  162.      if (is_static)
  163.         newdecl = InsertStaticDecls (t->VAR_DECL.Name, 1, int4, newdecl);
  164.  
  165.  
  166.  
  167.      newdecl = InsertRangeDecls (newdecl, t->VAR_DECL.Name);
  168.  
  169.  
  170.  
  171.      newdecl = InsertSpecDecls (newdecl, t->VAR_DECL.Name, int4);
  172.  
  173.  
  174.  
  175.      MakeStaticDistributedStmts (t, Obj, IsMain);
  176.  
  177.      ChangeArraySpecification (t, Obj, IsMain);
  178.  
  179.  
  180.   }
  181.   {
  182.    return newdecl;
  183.   }
  184.  
  185.   }
  186.  }
  187.   }
  188. # line 179 "AdaptVars.puma"
  189.   {
  190. # line 180 "AdaptVars.puma"
  191.    printf ("Can not adapt Variable Declaration\n");
  192. # line 181 "AdaptVars.puma"
  193.    FileUnparse (stdout, t);
  194. # line 182 "AdaptVars.puma"
  195.    WriteTree (stdout, t);
  196.   }
  197.    return t;
  198.  
  199. }
  200.  
  201. tTree AdaptParamDecl
  202. # if defined __STDC__ | defined __cplusplus
  203. (register tTree t, register int dist)
  204. # else
  205. (t, dist)
  206.  register tTree t;
  207.  register int dist;
  208. # endif
  209. {
  210.   if (t->Kind == kVAR_PARAM_DECL) {
  211.   if (equalint (dist, 0)) {
  212. # line 194 "AdaptVars.puma"
  213.    return t;
  214.  
  215.   }
  216.   if (equalint (dist, - 1)) {
  217. # line 198 "AdaptVars.puma"
  218.   {
  219. # line 199 "AdaptVars.puma"
  220.    if (! ((IsHost == true))) goto yyL2;
  221.   }
  222.    return t;
  223. yyL2:;
  224.  
  225.   }
  226.   if (equalint (dist, - 1)) {
  227. # line 203 "AdaptVars.puma"
  228.    return NoTree;
  229.  
  230.   }
  231.   if (equalint (dist, 1)) {
  232. # line 216 "AdaptVars.puma"
  233.   {
  234. # line 219 "AdaptVars.puma"
  235.    if (! ((IsHost == true))) goto yyL4;
  236.   }
  237.    return NoTree;
  238. yyL4:;
  239.  
  240.   }
  241.  {
  242.   tTree newdecl;
  243.   if (equalint (dist, 1)) {
  244. # line 235 "AdaptVars.puma"
  245.   {
  246. # line 237 "AdaptVars.puma"
  247.  
  248. # line 240 "AdaptVars.puma"
  249.  newdecl = NoTree;
  250.        newdecl = mDECL_LIST (MakeVarParamDeclA (t->VAR_PARAM_DECL.Name, "_HIGH"), newdecl);
  251.        newdecl = mDECL_LIST (MakeVarParamDeclA (t->VAR_PARAM_DECL.Name, "_LOW"),  newdecl);
  252.        newdecl = mDECL_LIST (t, newdecl);
  253.  
  254.   }
  255.   {
  256.    return newdecl;
  257.   }
  258.  
  259.   }
  260.  }
  261.   }
  262. # line 248 "AdaptVars.puma"
  263.   {
  264. # line 249 "AdaptVars.puma"
  265.    printf ("AdaptParamDecl fails, Distribution = %d\n", dist);
  266. # line 250 "AdaptVars.puma"
  267.    FileUnparse (stdout, t);
  268. # line 251 "AdaptVars.puma"
  269.    WriteTree (stdout, t);
  270. # line 252 "AdaptVars.puma"
  271.    exit (- 1);
  272.   }
  273.    return t;
  274.  
  275. }
  276.  
  277. static void SetUpOverlap
  278. # if defined __STDC__ | defined __cplusplus
  279. (register tTree t)
  280. # else
  281. (t)
  282.  register tTree t;
  283. # endif
  284. {
  285.   if (t == NoTree) return;
  286.   if (t->Kind == kARRAY_TYPE) {
  287. # line 267 "AdaptVars.puma"
  288.   {
  289. # line 268 "AdaptVars.puma"
  290.    SetUpOverlap (t->ARRAY_TYPE.ARRAY_INDEX_TYPES);
  291.   }
  292.    return;
  293.  
  294.   }
  295.   if (t->Kind == kTYPE_LIST) {
  296. # line 271 "AdaptVars.puma"
  297.   {
  298. # line 272 "AdaptVars.puma"
  299.    SetUpOverlap (t->TYPE_LIST.Elem);
  300. # line 273 "AdaptVars.puma"
  301.    SetUpOverlap (t->TYPE_LIST.Next);
  302.   }
  303.    return;
  304.  
  305.   }
  306.   if (t->Kind == kTYPE_EMPTY) {
  307. # line 276 "AdaptVars.puma"
  308.    return;
  309.  
  310.   }
  311.   if (t->Kind == kDYNAMIC) {
  312. # line 279 "AdaptVars.puma"
  313.    return;
  314.  
  315.   }
  316.   if (t->Kind == kINDEX_TYPE) {
  317. # line 282 "AdaptVars.puma"
  318.   {
  319. # line 284 "AdaptVars.puma"
  320.  t->INDEX_TYPE.LOWER = AddConstant (t->INDEX_TYPE.LOWER, -t->INDEX_TYPE.left_overlap);
  321.       t->INDEX_TYPE.UPPER  = AddConstant (t->INDEX_TYPE.UPPER,  t->INDEX_TYPE.right_overlap);
  322.  
  323.   }
  324.    return;
  325.  
  326.   }
  327. ;
  328. }
  329.  
  330. static void ChangeArraySpecification
  331. # if defined __STDC__ | defined __cplusplus
  332. (register tTree v, register tDefinitions Obj, register bool IsMain)
  333. # else
  334. (v, Obj, IsMain)
  335.  register tTree v;
  336.  register tDefinitions Obj;
  337.  register bool IsMain;
  338. # endif
  339. {
  340.   if (v == NoTree) return;
  341.   if (Obj == NoDefinitions) return;
  342.   if (v->Kind == kVAR_DECL) {
  343.   if (Obj->Kind == kVarObject) {
  344.   if (Obj->VarObject.decl->Kind == kVAR_PARAM_DECL) {
  345. # line 314 "AdaptVars.puma"
  346.   {
  347. # line 317 "AdaptVars.puma"
  348.  v->VAR_DECL.VAL = MakeNewDummyRange (v->VAR_DECL.VAL, v->VAR_DECL.Name);
  349.   }
  350.    return;
  351.  
  352.   }
  353.   }
  354.   if (v->VAR_DECL.VAL->Kind == kARRAY_TYPE) {
  355.   if (Obj->Kind == kVarObject) {
  356.   if (Obj->VarObject.decl->Kind == kVAR_DECL) {
  357. # line 329 "AdaptVars.puma"
  358.   {
  359. # line 332 "AdaptVars.puma"
  360.    if (! ((IsVarAllocatable (Obj) != true))) goto yyL2;
  361.   {
  362. # line 336 "AdaptVars.puma"
  363.  v->VAR_DECL.VAL = MakeNewLocalRange (v->VAR_DECL.VAL);
  364.        SetUpOverlap (v->VAR_DECL.VAL);
  365.  
  366.   }
  367.   }
  368.    return;
  369. yyL2:;
  370.  
  371.   }
  372.   }
  373.   }
  374.   }
  375. ;
  376. }
  377.  
  378. static void MakeStaticDistributedStmts
  379. # if defined __STDC__ | defined __cplusplus
  380. (register tTree var, register tDefinitions obj, register bool IsMain)
  381. # else
  382. (var, obj, IsMain)
  383.  register tTree var;
  384.  register tDefinitions obj;
  385.  register bool IsMain;
  386. # endif
  387. {
  388.   if (var == NoTree) return;
  389.   if (obj == NoDefinitions) return;
  390.   if (var->Kind == kVAR_DECL) {
  391.   if (var->VAR_DECL.VAL->Kind == kARRAY_TYPE) {
  392.   if (obj->Kind == kVarObject) {
  393.   if (obj->VarObject.decl->Kind == kVAR_DECL) {
  394. # line 352 "AdaptVars.puma"
  395.   {
  396. # line 357 "AdaptVars.puma"
  397.    if (! ((! IsVarAllocatable (obj)))) goto yyL1;
  398.   {
  399. # line 358 "AdaptVars.puma"
  400.    if (! (((! IsVarCommon (obj)) || IsMain))) goto yyL1;
  401.   {
  402. # line 360 "AdaptVars.puma"
  403.    StaticDistributedVarStmts (var, LastIndex (var->VAR_DECL.VAL->ARRAY_TYPE.ARRAY_INDEX_TYPES));
  404.   }
  405.   }
  406.   }
  407.    return;
  408. yyL1:;
  409.  
  410.   }
  411.   }
  412.   }
  413.   }
  414. ;
  415. }
  416.  
  417. static void StaticDistributedVarStmts
  418. # if defined __STDC__ | defined __cplusplus
  419. (register tTree v, register tTree dist_index)
  420. # else
  421. (v, dist_index)
  422.  register tTree v;
  423.  register tTree dist_index;
  424. # endif
  425. {
  426.   if (v == NoTree) return;
  427.   if (dist_index == NoTree) return;
  428.   if (v->Kind == kVAR_DECL) {
  429. # line 371 "AdaptVars.puma"
  430.   {
  431. # line 372 "AdaptVars.puma"
  432.    if (! ((IsHost == true))) goto yyL1;
  433.   }
  434.    return;
  435. yyL1:;
  436.  
  437.   if (v->VAR_DECL.VAL->Kind == kARRAY_TYPE) {
  438.   if (dist_index->Kind == kINDEX_TYPE) {
  439. # line 384 "AdaptVars.puma"
  440.  {
  441.   tTree stmts;
  442.   tTree lb;
  443.   tTree ub;
  444.   {
  445. # line 387 "AdaptVars.puma"
  446.  
  447. # line 388 "AdaptVars.puma"
  448.  
  449. # line 389 "AdaptVars.puma"
  450.  
  451. # line 391 "AdaptVars.puma"
  452.  lb = mVAR_EXP (MakeUsedVarA (v->VAR_DECL.Name, "_LOW"));
  453.      ub = mVAR_EXP (MakeUsedVarA (v->VAR_DECL.Name, "_HIGH"));
  454.      stmts = MakeInitialStatic (v->VAR_DECL.Name, lb, ub, dist_index->INDEX_TYPE.left_overlap + dist_index->INDEX_TYPE.right_overlap);
  455.  
  456.      stmts      = mACF_LIST (GenAllocExtensions (v->VAR_DECL.Name), stmts);
  457.      NewDefines = CombineACF (NewDefines, stmts);
  458.  
  459.   }
  460.    return;
  461.  }
  462.  
  463.   }
  464.   }
  465.   }
  466. ;
  467. }
  468.  
  469. static tTree MakeNewDummyRange
  470. # if defined __STDC__ | defined __cplusplus
  471. (register tTree val, register tIdent name)
  472. # else
  473. (val, name)
  474.  register tTree val;
  475.  register tIdent name;
  476. # endif
  477. {
  478.   if (val->Kind == kARRAY_TYPE) {
  479. # line 410 "AdaptVars.puma"
  480.    return mARRAY_TYPE (MakeNewDummyRange (val->ARRAY_TYPE.ARRAY_INDEX_TYPES, name), val->ARRAY_TYPE.ARRAY_COMP_TYPE);
  481.  
  482.   }
  483.   if (val->Kind == kTYPE_LIST) {
  484.   if (val->TYPE_LIST.Elem->Kind == kINDEX_TYPE) {
  485.   if (val->TYPE_LIST.Next->Kind == kTYPE_EMPTY) {
  486. # line 414 "AdaptVars.puma"
  487.  {
  488.   tTree new;
  489.   {
  490. # line 420 "AdaptVars.puma"
  491.  
  492. # line 422 "AdaptVars.puma"
  493.  new = mINDEX_TYPE (mVAR_EXP (MakeUsedVarA (name,"_LOW")),
  494.                           mVAR_EXP (MakeUsedVarA (name,"_HIGH")));
  495.  
  496.   }
  497.   {
  498.    return mTYPE_LIST (new, mTYPE_EMPTY ());
  499.   }
  500.  }
  501.  
  502.   }
  503.   }
  504. # line 428 "AdaptVars.puma"
  505.    return mTYPE_LIST (val->TYPE_LIST.Elem, MakeNewDummyRange (val->TYPE_LIST.Next, name));
  506.  
  507.   }
  508. # line 432 "AdaptVars.puma"
  509.   {
  510. # line 433 "AdaptVars.puma"
  511.    printf ("Error in MakeNewDummyRange\n");
  512. # line 434 "AdaptVars.puma"
  513.    FileUnparse (stdout, val);
  514. # line 435 "AdaptVars.puma"
  515.    WriteTree (stdout, val);
  516.   }
  517.    return NoTree;
  518.  
  519. }
  520.  
  521. static tTree MakeNewLocalRange
  522. # if defined __STDC__ | defined __cplusplus
  523. (register tTree val)
  524. # else
  525. (val)
  526.  register tTree val;
  527. # endif
  528. {
  529.   if (val->Kind == kARRAY_TYPE) {
  530. # line 447 "AdaptVars.puma"
  531.    return mARRAY_TYPE (MakeNewLocalRange (val->ARRAY_TYPE.ARRAY_INDEX_TYPES), val->ARRAY_TYPE.ARRAY_COMP_TYPE);
  532.  
  533.   }
  534.   if (val->Kind == kTYPE_LIST) {
  535.   if (val->TYPE_LIST.Elem->Kind == kINDEX_TYPE) {
  536.   if (val->TYPE_LIST.Next->Kind == kTYPE_EMPTY) {
  537. # line 451 "AdaptVars.puma"
  538.  {
  539.   tTree new;
  540.   {
  541. # line 459 "AdaptVars.puma"
  542.  
  543. # line 461 "AdaptVars.puma"
  544.  new = mINDEX_TYPE (MakeConstant (1),
  545.                          MakeConstant (GetMaxSize (val->TYPE_LIST.Elem)));
  546.       new->INDEX_TYPE.left_overlap = val->TYPE_LIST.Elem->INDEX_TYPE.left_overlap;
  547.       new->INDEX_TYPE.right_overlap = val->TYPE_LIST.Elem->INDEX_TYPE.right_overlap;
  548.  
  549.   }
  550.   {
  551.    return mTYPE_LIST (new, mTYPE_EMPTY ());
  552.   }
  553.  }
  554.  
  555.   }
  556.   }
  557. # line 470 "AdaptVars.puma"
  558.    return mTYPE_LIST (val->TYPE_LIST.Elem, MakeNewLocalRange (val->TYPE_LIST.Next));
  559.  
  560.   }
  561. # line 474 "AdaptVars.puma"
  562.   {
  563. # line 475 "AdaptVars.puma"
  564.    printf ("Error in MakeNewLocalRange\n");
  565. # line 476 "AdaptVars.puma"
  566.    FileUnparse (stdout, val);
  567. # line 477 "AdaptVars.puma"
  568.    WriteTree (stdout, val);
  569.   }
  570.    return NoTree;
  571.  
  572. }
  573.  
  574. static int GetMaxSize
  575. # if defined __STDC__ | defined __cplusplus
  576. (register tTree index)
  577. # else
  578. (index)
  579.  register tTree index;
  580. # endif
  581. {
  582.   if (index->Kind == kINDEX_TYPE) {
  583. # line 489 "AdaptVars.puma"
  584.  {
  585.   int val;
  586.   int val1;
  587.   bool found;
  588.   {
  589. # line 491 "AdaptVars.puma"
  590.  
  591. # line 492 "AdaptVars.puma"
  592.  
  593. # line 493 "AdaptVars.puma"
  594.  
  595. # line 495 "AdaptVars.puma"
  596.  GetIntConstValue (index->INDEX_TYPE.LOWER, &found, &val);
  597.      if (!found)
  598.        { printf ("AdaptVars: GetMaxSize has not found lower bound\n");
  599.          WriteTree (stdout, index);
  600.          exit (-1);
  601.        }
  602.      GetIntConstValue (index->INDEX_TYPE.UPPER, &found, &val1);
  603.      if (!found)
  604.        { printf ("AdaptVars: GetMaxSize has not found upper bound\n");
  605.          WriteTree (stdout, index);
  606.          exit (-1);
  607.        }
  608.      val = val1 - val + 1;
  609.      val = (val + MinProc - 1) / MinProc;
  610.  
  611.  
  612.   }
  613.   {
  614.    return val;
  615.   }
  616.  }
  617.  
  618.   }
  619.  yyAbort ("GetMaxSize");
  620. }
  621.  
  622. tTree AdaptCommonVarDecl
  623. # if defined __STDC__ | defined __cplusplus
  624. (register tTree t, register int dist)
  625. # else
  626. (t, dist)
  627.  register tTree t;
  628.  register int dist;
  629. # endif
  630. {
  631.   if (t->Kind == kVAR_DECL) {
  632.   if (equalint (dist, 0)) {
  633. # line 532 "AdaptVars.puma"
  634.    return t;
  635.  
  636.   }
  637.   if (equalint (dist, 1)) {
  638. # line 550 "AdaptVars.puma"
  639.   {
  640. # line 552 "AdaptVars.puma"
  641.    if (! ((IsHost == true))) goto yyL4;
  642.   }
  643.    return NoTree;
  644. yyL4:;
  645.  
  646.   }
  647.  {
  648.   tTree newdecl;
  649.   tTree dummy;
  650.   if (equalint (dist, 1)) {
  651. # line 556 "AdaptVars.puma"
  652.   {
  653. # line 558 "AdaptVars.puma"
  654.  
  655. # line 559 "AdaptVars.puma"
  656.  
  657. # line 561 "AdaptVars.puma"
  658.    dummy = mDUMMY_TYPE ();
  659. # line 563 "AdaptVars.puma"
  660.  
  661.        newdecl = InsertStaticDecls (t->VAR_DECL.Name, 1, dummy, NoTree);
  662.        newdecl = InsertSpecDecls (newdecl, t->VAR_DECL.Name, dummy);
  663.        newdecl = mDECL_LIST (t, newdecl);
  664.  
  665.   }
  666.   {
  667.    return newdecl;
  668.   }
  669.  
  670.   }
  671.  }
  672.   }
  673.   if (t->Kind == kVAR_PARAM_DECL) {
  674.   if (equalint (dist, - 1)) {
  675. # line 539 "AdaptVars.puma"
  676.   {
  677. # line 541 "AdaptVars.puma"
  678.    if (! ((IsHost == true))) goto yyL2;
  679.   }
  680.    return t;
  681. yyL2:;
  682.  
  683.   }
  684.   if (equalint (dist, - 1)) {
  685. # line 545 "AdaptVars.puma"
  686.    return NoTree;
  687.  
  688.   }
  689.   }
  690.  yyAbort ("AdaptCommonVarDecl");
  691. }
  692.  
  693. static tTree InsertRangeDecls
  694. # if defined __STDC__ | defined __cplusplus
  695. (register tTree decls, register tIdent A)
  696. # else
  697. (decls, A)
  698.  register tTree decls;
  699.  register tIdent A;
  700. # endif
  701. {
  702. # line 585 "AdaptVars.puma"
  703.  {
  704.   tTree new;
  705.   tTree int4;
  706.   {
  707. # line 587 "AdaptVars.puma"
  708.  
  709. # line 588 "AdaptVars.puma"
  710.  
  711. # line 590 "AdaptVars.puma"
  712.    int4 = mINTEGER_TYPE (4);
  713. # line 591 "AdaptVars.puma"
  714.    new = mDECL_LIST (MakeVarDeclA (A, "_INC", int4), decls);
  715. # line 592 "AdaptVars.puma"
  716.    new = mDECL_LIST (MakeVarDeclA (A, "_STOP", int4), new);
  717. # line 593 "AdaptVars.puma"
  718.    new = mDECL_LIST (MakeVarDeclA (A, "_START", int4), new);
  719.   }
  720.   {
  721.    return new;
  722.   }
  723.  }
  724.  
  725. }
  726.  
  727. static tTree InsertSpecDecls
  728. # if defined __STDC__ | defined __cplusplus
  729. (register tTree decls, register tIdent A, register tTree type)
  730. # else
  731. (decls, A, type)
  732.  register tTree decls;
  733.  register tIdent A;
  734.  register tTree type;
  735. # endif
  736. {
  737. # line 606 "AdaptVars.puma"
  738.   {
  739. # line 607 "AdaptVars.puma"
  740.    if (! ((IsHost == true))) goto yyL1;
  741.   }
  742.    return decls;
  743. yyL1:;
  744.  
  745. # line 617 "AdaptVars.puma"
  746.  {
  747.   tTree newdecl;
  748.   {
  749. # line 619 "AdaptVars.puma"
  750.  
  751. # line 621 "AdaptVars.puma"
  752.  newdecl = mDECL_LIST (MakeVarDeclA (A, "_HIGH", type), decls);
  753.      newdecl = mDECL_LIST (MakeVarDeclA (A, "_LOW",  type), newdecl);
  754.  
  755.   }
  756.   {
  757.    return newdecl;
  758.   }
  759.  }
  760.  
  761. }
  762.  
  763. tTree AdaptAllocate
  764. # if defined __STDC__ | defined __cplusplus
  765. (register tTree t, register bool IsMain)
  766. # else
  767. (t, IsMain)
  768.  register tTree t;
  769.  register bool IsMain;
  770. # endif
  771. {
  772. # line 635 "AdaptVars.puma"
  773.  
  774. tTree hdef, defines;
  775. int dist;
  776.  
  777.   if (t->Kind == kBTP_LIST) {
  778.   if (t->BTP_LIST.Elem->Kind == kVAR_PARAM) {
  779. # line 642 "AdaptVars.puma"
  780.   {
  781. # line 643 "AdaptVars.puma"
  782.  dist = TreeDistribution (t->BTP_LIST.Elem->VAR_PARAM.V);
  783.        if (dist == 0)
  784.           {
  785.             hdef = mBTP_LIST (t->BTP_LIST.Elem, mBTP_EMPTY());
  786.             defines = mACF_BASIC (mALLOCATE_STMT (hdef, mDUMMY_VAR()));
  787.             OverlapAllocate (defines);
  788.           }
  789.         else if (dist == -1)
  790.           { if (IsHost)
  791.              {
  792.                hdef = mBTP_LIST (t->BTP_LIST.Elem, mBTP_EMPTY());
  793.                defines = mACF_BASIC (mALLOCATE_STMT (hdef, mDUMMY_VAR()));
  794.                OverlapAllocate (defines);
  795.              }
  796.             else defines = NoTree;
  797.           }
  798.         else if (dist == 1)
  799.           { defines = AdaptAllocate (t->BTP_LIST.Elem->VAR_PARAM.V, IsMain);  }
  800.         else { printf ("Illegal distribution in allocate statement\n");
  801.                defines = NoTree;
  802.              }
  803.  
  804. # line 665 "AdaptVars.puma"
  805.    defines = CombineACF (defines, AdaptAllocate (t->BTP_LIST.Next, IsMain));
  806.   }
  807.    return defines;
  808.  
  809.   }
  810.   }
  811.   if (t->Kind == kBTP_EMPTY) {
  812. # line 669 "AdaptVars.puma"
  813.    return NoTree;
  814.  
  815.   }
  816.   if (t->Kind == kINDEXED_VAR) {
  817.   if (t->INDEXED_VAR.IND_VAR->Kind == kUSED_VAR) {
  818. # line 673 "AdaptVars.puma"
  819.   {
  820. # line 674 "AdaptVars.puma"
  821.    if (! ( t->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Object->VarObject.Kind->Kind  == kVarCommon)) goto yyL3;
  822.   {
  823. # line 675 "AdaptVars.puma"
  824.    if (! (IsMain == false)) goto yyL3;
  825.   }
  826.   }
  827.    return NoTree;
  828. yyL3:;
  829.  
  830.   if (Definitions_IsType (t->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Object, kObject)) {
  831. # line 679 "AdaptVars.puma"
  832.   {
  833. # line 680 "AdaptVars.puma"
  834.  if (!IsHost)
  835.         {
  836.           defines = mACF_LIST (GenAllocStmt (t), NoTree);
  837.  
  838.           defines = mACF_LIST (GenAllocExtensions (t->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Ident), defines);
  839.         }
  840.        else defines = NoTree;
  841.  
  842.   }
  843.    return defines;
  844.  
  845.   }
  846.   }
  847.   }
  848. # line 691 "AdaptVars.puma"
  849.   {
  850. # line 692 "AdaptVars.puma"
  851.    printf ("Illegal Construct in GenAllocate\n");
  852. # line 693 "AdaptVars.puma"
  853.    FileUnparse (stdout, t);
  854.   }
  855.    return t;
  856.  
  857. }
  858.  
  859. static void OverlapAllocate
  860. # if defined __STDC__ | defined __cplusplus
  861. (register tTree t)
  862. # else
  863. (t)
  864.  register tTree t;
  865. # endif
  866. {
  867.   if (t == NoTree) return;
  868.   if (t->Kind == kACF_BASIC) {
  869. # line 707 "AdaptVars.puma"
  870.   {
  871. # line 708 "AdaptVars.puma"
  872.    OverlapAllocate (t->ACF_BASIC.BASIC_STMT);
  873.   }
  874.    return;
  875.  
  876.   }
  877.   if (t->Kind == kALLOCATE_STMT) {
  878. # line 711 "AdaptVars.puma"
  879.   {
  880. # line 712 "AdaptVars.puma"
  881.    OverlapAllocate (t->ALLOCATE_STMT.PARAMS);
  882.   }
  883.    return;
  884.  
  885.   }
  886.   if (t->Kind == kBTP_LIST) {
  887.   if (t->BTP_LIST.Elem->Kind == kVAR_PARAM) {
  888. # line 715 "AdaptVars.puma"
  889.   {
  890. # line 716 "AdaptVars.puma"
  891.    OverlapAllocate (t->BTP_LIST.Elem->VAR_PARAM.V);
  892. # line 717 "AdaptVars.puma"
  893.    OverlapAllocate (t->BTP_LIST.Next);
  894.   }
  895.    return;
  896.  
  897.   }
  898.   }
  899.   if (t->Kind == kBTP_EMPTY) {
  900. # line 720 "AdaptVars.puma"
  901.    return;
  902.  
  903.   }
  904.   if (t->Kind == kINDEXED_VAR) {
  905.   if (t->INDEXED_VAR.IND_VAR->Kind == kUSED_VAR) {
  906. # line 723 "AdaptVars.puma"
  907.   {
  908. # line 724 "AdaptVars.puma"
  909.    OverlapAllocateBounds (t->INDEXED_VAR.IND_EXPS, ArrayFormals (t->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Object));
  910.   }
  911.    return;
  912.  
  913.   }
  914.   }
  915. ;
  916. }
  917.  
  918. static void OverlapAllocateBounds
  919. # if defined __STDC__ | defined __cplusplus
  920. (register tTree actuals, register tTree formals)
  921. # else
  922. (actuals, formals)
  923.  register tTree actuals;
  924.  register tTree formals;
  925. # endif
  926. {
  927.   if (actuals == NoTree) return;
  928.   if (formals == NoTree) return;
  929.   if (actuals->Kind == kBTE_LIST) {
  930.   if (formals->Kind == kTYPE_LIST) {
  931.   if (formals->TYPE_LIST.Elem->Kind == kDYNAMIC) {
  932. # line 735 "AdaptVars.puma"
  933.   {
  934. # line 737 "AdaptVars.puma"
  935.  actuals->BTE_LIST.Elem = OverlapSlice (actuals->BTE_LIST.Elem, formals->TYPE_LIST.Elem->DYNAMIC.left_overlap, formals->TYPE_LIST.Elem->DYNAMIC.right_overlap);
  936. # line 738 "AdaptVars.puma"
  937.    OverlapAllocateBounds (actuals->BTE_LIST.Next, formals->TYPE_LIST.Next);
  938.   }
  939.    return;
  940.  
  941.   }
  942.   }
  943.   }
  944.   if (actuals->Kind == kBTE_EMPTY) {
  945.   if (formals->Kind == kTYPE_EMPTY) {
  946. # line 741 "AdaptVars.puma"
  947.    return;
  948.  
  949.   }
  950.   }
  951. # line 744 "AdaptVars.puma"
  952.   {
  953. # line 745 "AdaptVars.puma"
  954.    printf ("OverlapAllocateBounds failed\n");
  955. # line 746 "AdaptVars.puma"
  956.    WriteTree (stdout, actuals);
  957. # line 747 "AdaptVars.puma"
  958.    WriteTree (stdout, formals);
  959. # line 748 "AdaptVars.puma"
  960.    kill_in_protocol ();
  961.   }
  962.    return;
  963.  
  964. ;
  965. }
  966.  
  967. static tTree OverlapSlice
  968. # if defined __STDC__ | defined __cplusplus
  969. (register tTree slice, register int left_ovlp, register int right_ovlp)
  970. # else
  971. (slice, left_ovlp, right_ovlp)
  972.  register tTree slice;
  973.  register int left_ovlp;
  974.  register int right_ovlp;
  975. # endif
  976. {
  977.   if (slice->Kind == kSLICE_EXP) {
  978. # line 761 "AdaptVars.puma"
  979.    return mSLICE_EXP (AddConstant (slice->SLICE_EXP.START, - left_ovlp), AddConstant (slice->SLICE_EXP.STOP, right_ovlp), slice->SLICE_EXP.INC);
  980.  
  981.   }
  982.  yyAbort ("OverlapSlice");
  983. }
  984.  
  985. tTree AdaptDeallocate
  986. # if defined __STDC__ | defined __cplusplus
  987. (register tTree t, register bool IsMain)
  988. # else
  989. (t, IsMain)
  990.  register tTree t;
  991.  register bool IsMain;
  992. # endif
  993. {
  994. # line 775 "AdaptVars.puma"
  995.  
  996. tTree hdef, defines;
  997. int dist;
  998.  
  999.   if (t->Kind == kBTP_LIST) {
  1000.   if (t->BTP_LIST.Elem->Kind == kVAR_PARAM) {
  1001. # line 782 "AdaptVars.puma"
  1002.   {
  1003. # line 783 "AdaptVars.puma"
  1004.  dist = TreeDistribution (t->BTP_LIST.Elem->VAR_PARAM.V);
  1005.        if (dist == 0)
  1006.           {
  1007.             hdef = mBTP_LIST (t->BTP_LIST.Elem, mBTP_EMPTY());
  1008.             defines = mACF_BASIC (mDEALLOCATE_STMT (hdef, mDUMMY_VAR()));
  1009.           }
  1010.         else if (dist == -1)
  1011.           { if (IsHost)
  1012.              {
  1013.                hdef = mBTP_LIST (t->BTP_LIST.Elem, mBTP_EMPTY());
  1014.                defines = mACF_BASIC (mDEALLOCATE_STMT (hdef, mDUMMY_VAR()));
  1015.              }
  1016.             else defines = NoTree;
  1017.           }
  1018.         else if (dist == 1)
  1019.           { defines = AdaptDeallocate (t->BTP_LIST.Elem->VAR_PARAM.V, IsMain);  }
  1020.         else { printf ("Illegal distribution in deallocate statement\n");
  1021.                defines = NoTree;
  1022.              }
  1023.  
  1024. # line 803 "AdaptVars.puma"
  1025.    defines = CombineACF (defines, AdaptDeallocate (t->BTP_LIST.Next, IsMain));
  1026.   }
  1027.    return defines;
  1028.  
  1029.   }
  1030.   }
  1031.   if (t->Kind == kBTP_EMPTY) {
  1032. # line 807 "AdaptVars.puma"
  1033.    return NoTree;
  1034.  
  1035.   }
  1036.   if (t->Kind == kUSED_VAR) {
  1037. # line 811 "AdaptVars.puma"
  1038.   {
  1039. # line 812 "AdaptVars.puma"
  1040.    if (! ( t->USED_VAR.VARNAME->VAR_OBJ.Object->VarObject.Kind->Kind  == kVarCommon)) goto yyL3;
  1041.   {
  1042. # line 813 "AdaptVars.puma"
  1043.    if (! (IsMain == false)) goto yyL3;
  1044.   }
  1045.   }
  1046.    return NoTree;
  1047. yyL3:;
  1048.  
  1049.   if (Definitions_IsType (t->USED_VAR.VARNAME->VAR_OBJ.Object, kObject)) {
  1050. # line 817 "AdaptVars.puma"
  1051.   {
  1052. # line 818 "AdaptVars.puma"
  1053.  if (!IsHost)
  1054.  
  1055.           defines = GenDeallocStmt (t);
  1056.         else
  1057.           defines = NoTree;
  1058.  
  1059.   }
  1060.    return defines;
  1061.  
  1062.   }
  1063.   }
  1064. # line 827 "AdaptVars.puma"
  1065.   {
  1066. # line 828 "AdaptVars.puma"
  1067.    printf ("Illegal Construct in AdaptDeallocate\n");
  1068. # line 829 "AdaptVars.puma"
  1069.    FileUnparse (stdout, t);
  1070.   }
  1071.    return t;
  1072.  
  1073. }
  1074.  
  1075. static tTree GenAllocExtensions
  1076. # if defined __STDC__ | defined __cplusplus
  1077. (register tIdent id)
  1078. # else
  1079. (id)
  1080.  register tIdent id;
  1081. # endif
  1082. {
  1083. # line 844 "AdaptVars.puma"
  1084.  
  1085. tTree param, paramlist, call;
  1086. tObject Obj;
  1087.  
  1088. # line 849 "AdaptVars.puma"
  1089.   {
  1090. # line 850 "AdaptVars.puma"
  1091.  Obj = GetLocalDecl (id);
  1092.     paramlist = mBTP_EMPTY ();
  1093.     param = mVAR_PARAM (MakeUsedVarA (id, "_HIGH"));
  1094.     paramlist = mBTP_LIST (param, paramlist);
  1095.     param = mVAR_PARAM (MakeUsedVarA (id, "_LOW"));
  1096.     paramlist = mBTP_LIST (param, paramlist);
  1097.     paramlist = DalibLastFormalParam (ArrayFormals (Obj), paramlist);
  1098.     call = mPROC_OBJ (MakeDalibId ("array_pardim"));
  1099.     call = mACF_BASIC (mCALL_STMT (call, paramlist));
  1100.  
  1101.   }
  1102.    return call;
  1103.  
  1104. }
  1105.  
  1106. static tTree GenAllocStmt
  1107. # if defined __STDC__ | defined __cplusplus
  1108. (register tTree t)
  1109. # else
  1110. (t)
  1111.  register tTree t;
  1112. # endif
  1113. {
  1114. # line 873 "AdaptVars.puma"
  1115.  
  1116. tTree param, h;
  1117.  
  1118.   if (t->Kind == kINDEXED_VAR) {
  1119.   if (t->INDEXED_VAR.IND_VAR->Kind == kUSED_VAR) {
  1120. # line 877 "AdaptVars.puma"
  1121.   {
  1122. # line 878 "AdaptVars.puma"
  1123.  GlobalId = t->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Ident;
  1124.       t->INDEXED_VAR.IND_EXPS = GenAllocStmt (t->INDEXED_VAR.IND_EXPS);
  1125.       param = mBTP_LIST (mVAR_PARAM (t), mBTP_EMPTY());
  1126.       h = mACF_BASIC (mALLOCATE_STMT (param, mDUMMY_VAR()));
  1127.       OverlapAllocate (h);
  1128.  
  1129.   }
  1130.    return h;
  1131.  
  1132.   }
  1133.   }
  1134.   if (t->Kind == kBTE_LIST) {
  1135.   if (t->BTE_LIST.Elem->Kind == kSLICE_EXP) {
  1136.   if (t->BTE_LIST.Next->Kind == kBTE_EMPTY) {
  1137. # line 887 "AdaptVars.puma"
  1138.  {
  1139.   tTree newstart;
  1140.   tTree newstop;
  1141.   {
  1142. # line 891 "AdaptVars.puma"
  1143.  
  1144. # line 892 "AdaptVars.puma"
  1145.  
  1146. # line 894 "AdaptVars.puma"
  1147.    newstart = mVAR_EXP (MakeUsedVarA (GlobalId, "_LOW"));
  1148. # line 895 "AdaptVars.puma"
  1149.    newstop = mVAR_EXP (MakeUsedVarA (GlobalId, "_HIGH"));
  1150. # line 896 "AdaptVars.puma"
  1151.    t->BTE_LIST.Elem = mSLICE_EXP (newstart, newstop, t->BTE_LIST.Elem->SLICE_EXP.INC);
  1152.   }
  1153.   {
  1154.    return t;
  1155.   }
  1156.  }
  1157.  
  1158.   }
  1159.   }
  1160.   if (t->BTE_LIST.Next->Kind == kBTE_EMPTY) {
  1161. # line 903 "AdaptVars.puma"
  1162.  {
  1163.   tTree t1;
  1164.   tTree t2;
  1165.   {
  1166. # line 904 "AdaptVars.puma"
  1167.  
  1168. # line 905 "AdaptVars.puma"
  1169.  
  1170. # line 906 "AdaptVars.puma"
  1171.  
  1172.        t1 = mVAR_EXP(MakeUsedVarA (GlobalId, "_LOW"));
  1173.        t2 = mVAR_EXP(MakeUsedVarA (GlobalId, "_HIGH"));
  1174.        t->BTE_LIST.Elem = mSLICE_EXP (t1, t2, mDUMMY_EXP ());
  1175.  
  1176.   }
  1177.   {
  1178.    return t;
  1179.   }
  1180.  }
  1181.  
  1182.   }
  1183. # line 914 "AdaptVars.puma"
  1184.   {
  1185. # line 915 "AdaptVars.puma"
  1186.  t->BTE_LIST.Next = GenAllocStmt (t->BTE_LIST.Next);
  1187.   }
  1188.    return t;
  1189.  
  1190.   }
  1191. # line 919 "AdaptVars.puma"
  1192.   {
  1193. # line 920 "AdaptVars.puma"
  1194.    printf ("Illegal Construct in GenAllocStmt\n");
  1195. # line 921 "AdaptVars.puma"
  1196.    FileUnparse (stdout, t);
  1197.   }
  1198.    return NoTree;
  1199.  
  1200. }
  1201.  
  1202. static tTree GenDeallocStmt
  1203. # if defined __STDC__ | defined __cplusplus
  1204. (register tTree t)
  1205. # else
  1206. (t)
  1207.  register tTree t;
  1208. # endif
  1209. {
  1210. # line 935 "AdaptVars.puma"
  1211.  
  1212. tTree h, param, t1, t2;
  1213.  
  1214.   if (t->Kind == kUSED_VAR) {
  1215. # line 947 "AdaptVars.puma"
  1216.   {
  1217. # line 948 "AdaptVars.puma"
  1218.  param = mBTP_LIST (mVAR_PARAM (t), mBTP_EMPTY());
  1219.       h = mACF_BASIC (mDEALLOCATE_STMT (param, mDUMMY_VAR()));
  1220.  
  1221.   }
  1222.    return h;
  1223.  
  1224.   }
  1225. # line 954 "AdaptVars.puma"
  1226.   {
  1227. # line 955 "AdaptVars.puma"
  1228.    printf ("Illegal Construct in GenDeallocStmt\n");
  1229. # line 956 "AdaptVars.puma"
  1230.    FileUnparse (stdout, t);
  1231.   }
  1232.    return NoTree;
  1233.  
  1234. }
  1235.  
  1236. static tTree MakeRangeParameters
  1237. # if defined __STDC__ | defined __cplusplus
  1238. (register tTree range_list, register tTree end_params)
  1239. # else
  1240. (range_list, end_params)
  1241.  register tTree range_list;
  1242.  register tTree end_params;
  1243. # endif
  1244. {
  1245.   if (range_list->Kind == kBTE_LIST) {
  1246.   if (range_list->BTE_LIST.Elem->Kind == kSLICE_EXP) {
  1247. # line 970 "AdaptVars.puma"
  1248.  {
  1249.   tTree new_paramlist;
  1250.   {
  1251. # line 971 "AdaptVars.puma"
  1252.  
  1253. # line 972 "AdaptVars.puma"
  1254.  new_paramlist = MakeRangeParameters (range_list->BTE_LIST.Next, end_params);
  1255.        new_paramlist = mBTP_LIST (ExpToVarParam (range_list->BTE_LIST.Elem->SLICE_EXP.STOP), new_paramlist);
  1256.        new_paramlist = mBTP_LIST (ExpToVarParam (range_list->BTE_LIST.Elem->SLICE_EXP.START), new_paramlist);
  1257.  
  1258.   }
  1259.   {
  1260.    return new_paramlist;
  1261.   }
  1262.  }
  1263.  
  1264.   }
  1265. # line 979 "AdaptVars.puma"
  1266.  {
  1267.   tTree new_paramlist;
  1268.   {
  1269. # line 980 "AdaptVars.puma"
  1270.  
  1271. # line 981 "AdaptVars.puma"
  1272.  new_paramlist = MakeRangeParameters (range_list->BTE_LIST.Next, end_params);
  1273.        new_paramlist = mBTP_LIST (ExpToVarParam (range_list->BTE_LIST.Elem), new_paramlist);
  1274.        new_paramlist = mBTP_LIST (ExpToVarParam (MakeConstant(1)),
  1275.                                   new_paramlist);
  1276.  
  1277.   }
  1278.   {
  1279.    return new_paramlist;
  1280.   }
  1281.  }
  1282.  
  1283.   }
  1284.   if (range_list->Kind == kBTE_EMPTY) {
  1285. # line 989 "AdaptVars.puma"
  1286.    return end_params;
  1287.  
  1288.   }
  1289.   if (range_list->Kind == kTYPE_LIST) {
  1290.   if (range_list->TYPE_LIST.Elem->Kind == kINDEX_TYPE) {
  1291. # line 993 "AdaptVars.puma"
  1292.  {
  1293.   tTree new_paramlist;
  1294.   {
  1295. # line 994 "AdaptVars.puma"
  1296.  
  1297. # line 995 "AdaptVars.puma"
  1298.  new_paramlist = MakeRangeParameters (range_list->TYPE_LIST.Next, end_params);
  1299.        new_paramlist = mBTP_LIST (ExpToVarParam (range_list->TYPE_LIST.Elem->INDEX_TYPE.UPPER), new_paramlist);
  1300.        new_paramlist = mBTP_LIST (ExpToVarParam (range_list->TYPE_LIST.Elem->INDEX_TYPE.LOWER), new_paramlist);
  1301.  
  1302.   }
  1303.   {
  1304.    return new_paramlist;
  1305.   }
  1306.  }
  1307.  
  1308.   }
  1309.   }
  1310.   if (range_list->Kind == kTYPE_EMPTY) {
  1311. # line 1002 "AdaptVars.puma"
  1312.    return end_params;
  1313.  
  1314.   }
  1315. # line 1006 "AdaptVars.puma"
  1316.   {
  1317. # line 1007 "AdaptVars.puma"
  1318.    printf ("MakeRangeParameters fails\n");
  1319. # line 1008 "AdaptVars.puma"
  1320.    FileUnparse (stdout, range_list);
  1321. # line 1009 "AdaptVars.puma"
  1322.    WriteTree (stdout, range_list);
  1323.   }
  1324.    return mACF_EMPTY ();
  1325.  
  1326. }
  1327.  
  1328. void BeginAdaptVars ()
  1329. {
  1330. }
  1331.  
  1332. void CloseAdaptVars ()
  1333. {
  1334. }
  1335.