dnl JVM-Bridge -- bridge from FP languages and others to the Java VM dnl Copyright (C) 2001 Ashley Yakeley dnl dnl This library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public dnl License as published by the Free Software Foundation; either dnl version 2.1 of the License, or (at your option) any later version. dnl dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with this library; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl define(`name_short',`patsubst(patsubst(`$1',`^.*\.\([^.]+\)$',`\1'),`\$',`_')')dnl define(`name_long',`patsubst(patsubst(`$1',`_',`__'),`[\.\$]',`_')')dnl define(`id_type_short',`first_J(name_short(`$1'))')dnl define(`first_J',`patsubst(`$1',`[A-Za-z0-9_.]+',`J`'\&')')dnl define(`id_module',`Foreign.JavaVM.Lib.Class_`'name_long(`$1')')dnl define(`id_type_preload',`Preload_`'name_short(`$1')')dnl define(`id_val_preload',`?preload_`'name_long(`$1')')dnl define(`id_class_haspreload',`Has`'id_type_preload(`$1')')dnl define(`id_val_getpreload',`get`'id_type_preload(`$1')')dnl define(`classlist',include(CLASSLIST))dnl -- This is an autogenerated file. -- This is written in Haskell. module MODULENAME where { patsubst(classlist,`^\(.+\)',` import id_module(\1);')dnl import Foreign.JavaVM; type JVM a = ( patsubst(patsubst(classlist,`^\(.+\)',` id_val_preload(\1) :: id_module(\1).id_type_preload(\1)`,''),`, \'',`') ) => VM a; runJVM :: JVM a -> VM a; runJVM foo = do { patsubst(classlist,`^\(.+\)',` preload_`'name_long(\1) <- jvmLoad;')dnl let { patsubst(classlist,`^\(.+\)',` id_val_preload(\1) = preload_`'name_long(\1);')dnl } in foo; } }