1 /*
2  * This file is part of the Alliance CAD System
3  * Copyright (C) Laboratoire LIP6 - D�partement ASIM
4  * Universite Pierre et Marie Curie
5  *
6  * Home page          : http://www-asim.lip6.fr/alliance/
7  * E-mail             : mailto:alliance-users@asim.lip6.fr
8  *
9  * This library is free software; you  can redistribute it and/or modify it
10  * under the terms  of the GNU Library General Public  License as published
11  * by the Free Software Foundation; either version 2 of the License, or (at
12  * your option) any later version.
13  *
14  * Alliance VLSI  CAD System  is distributed  in the hope  that it  will be
15  * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details.
18  *
19  * You should have received a copy  of the GNU General Public License along
20  * with the GNU C Library; see the  file COPYING. If not, write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 /* ###--------------------------------------------------------------### */
25 /* file		: beh_rplstable.c					*/
26 /* date		: Dec  2 1999						*/
27 /* version	: v111							*/
28 /* authors	: Pirouz BAZARGAN SABET					*/
29 /* content	: low-level function					*/
30 /* ###--------------------------------------------------------------### */
31 
32 #include <stdio.h>
33 #include "mut.h"
34 #include "log.h"
35 #include "beh.h"
36 
37 /* ###--------------------------------------------------------------### */
38 /* function	: beh_rplstable						*/
39 /* description	: replace STABLE attribute by DELAYED in an expression	*/
40 /* called func.	: none							*/
41 /* ###--------------------------------------------------------------### */
42 
beh_rplstable(pt_abl)43 struct chain *beh_rplstable (pt_abl)
44 
45 struct chain *pt_abl;
46 
47   {
48   struct chain *opr_lst;
49   char         *sig_nam;
50   struct chain *new_abl;
51   unsigned long  opera  ;
52 
53   if (pt_abl->NEXT != NULL)
54     {
55     opera = (unsigned long) ((struct chain *) pt_abl->DATA)->DATA;
56     if (opera == STABLE)
57       {
58       sig_nam = (char *) ((struct chain *) pt_abl->NEXT->DATA)->DATA;
59       new_abl = beh_expstable (sig_nam);
60       freeExpr (pt_abl);
61       pt_abl  = new_abl;
62       }
63     else
64       {
65       opr_lst = pt_abl->NEXT;
66       while (opr_lst != NULL)
67         {
68         opr_lst->DATA = beh_rplstable (opr_lst->DATA);
69         opr_lst       = opr_lst->NEXT;
70         }
71       }
72     }
73 
74   return (pt_abl);
75   }
76