#!/bin/sh
#
# $Id$
#
# Copyright 1989-2016 MINES ParisTech
#
# This file is part of PIPS.
#
# PIPS is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PIPS.  If not, see <http://www.gnu.org/licenses/>.
#

# petit filtre pour afficher les Use-Def d'un workspace $1 
# et d'une procedure $2
# Pour plus de clarete sont filtres les noms des procedures et les effects Read-Write
# Sont affiches les noms des commons et des variables pour lesquelles il y a dependance

sort -u $1.database/$2/$2.dg |
sed '/^\([0-9]*\) \1 /d;/IO_EFFECTS/d;s/[RW] [RW]/O N/;s/<\([^:]*\):\([^:]*\):\([^:>]*\)>/<\1:\3>/g' |
sort -u |
dg2dv.pl > dg_$1_$2.daVinci