Commit 3ea6c340 authored by Michael Hanus 's avatar Michael Hanus
Browse files

tools and libs updated

parent 27be6f11
currytools @ 9e0a8b50
Subproject commit c02a4e7b67af5acc3ab18fef351eaa4f3982d53b
Subproject commit 9e0a8b507f658fccdafecced5a31a969f0189ca7
......@@ -303,30 +303,30 @@ printed on the standard error stream.
\index{FlatCurry}
To support meta-programming, i.e., the manipulation of Curry programs
in Curry, there are system modules \code{AbstractCurry.Types}
and \code{FlatCurry} %(stored in the directory \ccode{\cyshome/lib/meta})
and \code{FlatCurry.Types}
which define datatypes for the representation
of Curry programs.
\code{AbstractCurry.Types} is a more direct representation of a Curry program,
whereas \code{FlatCurry} is a simplified representation
whereas \code{FlatCurry.Types} is a simplified representation
where local function definitions are replaced by global definitions
(i.e., lambda lifting has been performed) and pattern matching
is translated into explicit case/or expressions.
Thus, \code{FlatCurry} can be used for more back-end oriented
Thus, \code{FlatCurry.Types} can be used for more back-end oriented
program manipulations (or, for writing new back ends for Curry),
whereas \code{AbstractCurry.Types} is intended for manipulations of
programs that are more oriented towards the source program.
There are predefined I/O actions to read AbstractCurry and
FlatCurry programs: \code{AbstractCurry.Files.readCurry}\pindex{readCurry})
and \code{FlatCurry.readFlatCurry}\pindex{readFlatCurry}).
and \code{FlatCurry.Files.readFlatCurry}\pindex{readFlatCurry}).
These actions parse the corresponding source program and return
a data term representing this program (according to the definitions
in the modules \code{AbstractCurry.Types} and \code{FlatCurry}).
in the modules \code{AbstractCurry.Types} and \code{FlatCurry.Types}).
Since all datatypes are explained in detail in these modules,
we refer to the online documentation\footnote{%
\url{http://www.informatik.uni-kiel.de/~pakcs/lib/CDOC/FlatCurry.html} and
\url{http://www.informatik.uni-kiel.de/~pakcs/lib/CDOC/AbstractCurry.Types.html}}
\url{http://www.informatik.uni-kiel.de/~pakcs/lib/FlatCurry.Types.html} and
\url{http://www.informatik.uni-kiel.de/~pakcs/lib/AbstractCurry.Types.html}}
of these modules.
As an example, consider a program file \ccode{test.curry}
......@@ -335,7 +335,7 @@ containing the following two lines:
rev [] = []
rev (x:xs) = (rev xs) ++ [x]
\end{curry}
Then the I/O action \code{(FlatCurry.readFlatCurry "test")} returns the
Then the I/O action \code{(FlatCurry.Files.readFlatCurry "test")} returns the
following term:
\begin{curry}
(Prog "test"
......@@ -473,16 +473,19 @@ following term:
\input{lib/AbstractCurry.Select}
\input{lib/AbstractCurry.Build}
\input{lib/AbstractCurry.Pretty}
\input{lib/AnnotatedFlatCurry}
\input{lib/AnnotatedFlatCurryGoodies}
\input{lib/CompactFlatCurry}
\input{lib/FlatCurry.Types}
\input{lib/FlatCurry.Files}
\input{lib/FlatCurry.Goodies}
\input{lib/FlatCurry.Pretty}
\input{lib/FlatCurry.Read}
\input{lib/FlatCurry.Show}
\input{lib/FlatCurry.XML}
\input{lib/FlatCurry.FlexRigid}
\input{lib/FlatCurry.Compact}
\input{lib/FlatCurry.Annotated.Types}
\input{lib/FlatCurry.Annotated.Pretty}
\input{lib/FlatCurry.Annotated.Goodies}
\input{lib/CurryStringClassifier}
\input{lib/FlatCurry}
\input{lib/FlatCurryGoodies}
\input{lib/FlatCurryRead}
\input{lib/FlatCurryShow}
\input{lib/FlatCurryXML}
\input{lib/FlexRigid}
} % end setlength parindent
......
lib-trunk @ 30c7bcbc
Subproject commit 5d54dc8f48033063d05ecc104db9a676a7ff0319
Subproject commit 30c7bcbc01c79cf44033f61858e5c5d5b8a4d738
......@@ -8,7 +8,8 @@
module Flat2Fcy(writeFCY,flc2fcy) where
import Flat
import qualified FlatCurry as FCY
import qualified FlatCurry.Types as FCY
import qualified FlatCurry.Files
import ReadShowTerm
import Unsafe(trace)
......@@ -34,7 +35,7 @@ flc2fcy (Prog modname imports types funcs ops transtable) = do
--- Read function arities of a module:
readModArities modname = do
(FCY.Prog _ _ _ funcs _) <- FCY.readFlatCurryInt modname
(FCY.Prog _ _ _ funcs _) <- FlatCurry.Files.readFlatCurryInt modname
return $ map (\(FCY.Func name ar _ _ _) -> (name,ar)) funcs
flc2fcyVis pubnames name =
......
......@@ -3,9 +3,10 @@
-- XML representation (the corresponding DTD can be found in
-- http://www.informatik.uni-kiel.de/~curry/flatcurry.dtd)
--
-- Michael Hanus, March 2001
-- Michael Hanus, October 2015
------------------------------------------------------------------------------
import Distribution(stripCurrySuffix)
import Flat
import FlatTools
import FlatXML
......@@ -13,7 +14,7 @@ import Flat2Fcy
import XML
import List
import System
import FlatCurry(flatCurryFileName)
import FlatCurry.Files(flatCurryFileName)
-- Check arguments and call main function:
main = do
......@@ -33,11 +34,6 @@ printArgError args = putStrLn $
"-print: print only on standard out instead of writing into file\n"
stripCurrySuffix n = let rn = reverse n in
if take 6 rn == "yrruc." then reverse (drop 6 rn) else
if take 7 rn == "yrrucl." then reverse (drop 7 rn) else n
-- translate Curry program into XML/FlatCurry and print this on stdout:
curry2xml :: String -> IO ()
curry2xml progname =
......
......@@ -8,7 +8,7 @@
module Flat2Fcy(writeFCY,flc2fcy) where
import Flat
import qualified FlatCurry as FCY
import qualified FlatCurry.Types as FCY
import ReadShowTerm
--- Writes a FlatCurry program (old format) into a file in .fcy format.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment