Commit 919bdc80 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Documentation updated

parent 1d8854ef
{- |
Module : $Header$
Description : Environment containing the module's information
Copyright : (c) 2011, Björn Peemöller
Copyright : (c) 2011 - 2013 Björn Peemöller
License : OtherLicense
Maintainer : bjp@informatik.uni-kiel.de
Stability : experimental
Portability : portable
This module defines an environment for a module containing the information
needed throughout the compilation of the module.
This module defines the compilation environment for a single module,
containing the information needed throughout the compilation process.
-}
module CompilerEnv where
......@@ -38,6 +38,7 @@ data CompilerEnv = CompilerEnv
, opPrecEnv :: OpPrecEnv -- ^ operator precedences
}
-- |Initial 'CompilerEnv'
initCompilerEnv :: ModuleIdent -> CompilerEnv
initCompilerEnv mid = CompilerEnv
{ moduleIdent = mid
......@@ -48,10 +49,12 @@ initCompilerEnv mid = CompilerEnv
, opPrecEnv = initOpPrecEnv
}
-- |Show the 'CompilerEnv'
showCompilerEnv :: CompilerEnv -> String
showCompilerEnv env = show $ vcat
[ header "ModuleIdent " $ textS $ moduleIdent env
, header "Interfaces " $ hcat $ punctuate comma $ map textS $ Map.keys $ interfaceEnv env
, header "Interfaces " $ hcat $ punctuate comma $ map textS
$ Map.keys $ interfaceEnv env
, header "ModuleAliases " $ ppMap $ aliasEnv env
, header "TypeConstructors" $ ppAL $ allLocalBindings $ tyConsEnv env
, header "Values " $ ppAL $ allLocalBindings $ valueEnv env
......@@ -61,9 +64,11 @@ showCompilerEnv env = show $ vcat
header hdr content = hang (text hdr <+> colon) 4 content
textS = text . show
-- |Pretty print a 'Map'
ppMap :: (Show a, Show b) => Map.Map a b -> Doc
ppMap = ppAL . Map.toList
-- |Pretty print an association list
ppAL :: (Show a, Show b) => [(a, b)] -> Doc
ppAL xs = vcat $ map (\(a,b) -> text (pad a keyWidth) <+> equals <+> text b) showXs
where showXs = map (\(a,b) -> (show a, show b)) xs
......
{- |
Module : $Header$
Description : Compiler options
Copyright : (c) 2005, Martin Engelke (men@informatik.uni-kiel.de)
2007, Sebastian Fischer (sebf@informatik.uni-kiel.de)
2011, Björn Peemöller (bjp@informatik.uni-kiel.de)
Copyright : (c) 2005 Martin Engelke
2007 Sebastian Fischer
2011 - 2013 Björn Peemöller
License : OtherLicense
Maintainer : bjp@informatik.uni-kiel.de
Stability : experimental
Portability : portable
This module defines data structures containing options for the
compilation of Curry programs.
This module defines data structures holding options for the
compilation of Curry programs, and utility functions for printing
help information as well as parsing the cmd arguments.
-}
module CompilerOpts
( Options (..), CymakeMode (..), Verbosity (..), TargetType (..)
......@@ -19,11 +20,11 @@ module CompilerOpts
, defaultOptions, getCompilerOpts, usage
) where
import Data.List (intercalate, nub)
import Data.Maybe (isJust)
import Data.List (intercalate, nub)
import Data.Maybe (isJust)
import System.Console.GetOpt
import System.Environment (getArgs, getProgName)
import System.FilePath (splitSearchPath)
import System.Environment (getArgs, getProgName)
import System.FilePath (splitSearchPath)
import Curry.Files.Filenames (currySubdir)
......@@ -68,12 +69,13 @@ defaultOptions = Options
, optDumpRaw = False
}
-- |Modus operand of the program
data CymakeMode
= ModeHelp
| ModeVersion
| ModeNumericVersion
| ModeHtml
| ModeMake
= ModeHelp -- ^ Show help information
| ModeVersion -- ^ Show version
| ModeNumericVersion -- ^ Show only version, suitable for later processing
| ModeHtml -- ^ Create HTML documentation
| ModeMake -- ^ Compile with dependencies
deriving Eq
-- |Type of the target file
......@@ -88,7 +90,7 @@ data TargetType
-- |Data type representing the verbosity level
data Verbosity
= VerbQuiet -- ^ be queit
= VerbQuiet -- ^ be quiet
| VerbStatus -- ^ show status of compilation
| VerbInfo -- ^ show also additional info
deriving (Eq, Ord)
......
{- |
Module : $Header$
Description : Compilation of a single module
Copyright : (c) 1999-2004, Wolfgang Lux
2005, Martin Engelke (men@informatik.uni-kiel.de)
2007, Sebastian Fischer (sebf@informatik.uni-kiel.de)
2011, Björn Peemöller (bjp@informatik.uni-kiel.de)
Copyright : (c) 1999 - 2004 Wolfgang Lux
2005 Martin Engelke
2007 Sebastian Fischer
2011 - 2013 Björn Peemöller
License : OtherLicense
Maintainer : bjp@informatik.uni-kiel.de
......
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