#!/bin/sh
cat <<EOF
/* Soot - a J*va Optimization Framework
 * Copyright (C) 2003 Ondrej Lhotak
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

/* THIS FILE IS AUTOMATICALLY GENERATED USING soot/make_singletons. DO NOT EDIT! */

package soot;
EOF

echo
echo '/** A class to group together all the global variables in Soot. */'
echo 'public class Singletons {'
echo '    public final class Global {'
echo '        private Global() {}'
echo '    }'
echo '    private Global g = new Global();'
echo

for class in `cat singletons.list`; do
    undottedClass="`echo $class | tr . _`"
    instanceName="instance_$undottedClass"
    echo "    private $class $instanceName;"
    echo "    public $class $undottedClass() {"
    echo "        if( $instanceName == null ) $instanceName = new $class( g );"
    echo "        return $instanceName;"
    echo "    }"
    echo
done

echo }

