X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=src%2FHaskellDemo.hs;h=eaac568b5d68dfe9287bcf079f094639dc0f320f;hp=7b545e60146d8f501a1022efa50c2c78d0a30d76;hb=972303162555284f8066047d3caead8df139afd4;hpb=4aadad134578c7f1f450f426c3717bc20adcd8ea diff --git a/src/HaskellDemo.hs b/src/HaskellDemo.hs index 7b545e6..eaac568 100644 --- a/src/HaskellDemo.hs +++ b/src/HaskellDemo.hs @@ -1,48 +1,7 @@ --- This is written in Haskell. -{-- -JVM-Bridge -- bridge from FP languages and others to the Java VM -Copyright (C) 2001 Ashley Yakeley - -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 ---} - module Main where - { - import Header_Java; - import Class_edu_berkeley_sbp_misc_HaskellHelper; - import Class_java_lang_Object; - import Class_java_lang_Class; - import Class_java_lang_String; - - import Class_edu_berkeley_sbp_Tree; - - import JVM_edu_berkeley_sbp_misc_HaskellHelper; - import TypedString; - import JVMBridge; - import JavaText; - - main :: IO (); - main = runWithClasspath ["edu.berkeley.sbp.jar"] - ((do - class_JHaskellHelper - s1 <- new_JString_ArrayJchar $ toJavaString "tests/meta.g" - s2 <- new_JString_ArrayJchar $ toJavaString "tests/testcase.g" - tree <- main_JHaskellHelper_JString_JString (s1, s2) - strx <- toString_JObject ((castTLRef tree) :: Jjava_lang_Object) () - str <- getStringUTF strx - callIO $ putStrLn $ showUTF8 str - return () - ) :: JVM ()) - } + import SBP; + main = do x <- SBP.parseFile ["edu.berkeley.sbp.jar"] "tests/meta.g" "tests/testcase.g" + putStr "\n" + putStr $ show x + putStr "\n" + putStr "\n"