Module Main

The main module of currypp, the Curry Preprocessor

The Curry Preprocessor transforms the source code of Curry programs. Currently, only the translation of foreign code integrated in Curry code is supported (option foreigncode, see module Translator).

Author: Michael Hanus

Version: July 2017

Summary of exported operations:

cppBanner :: String   
parseTarget :: String -> Maybe PPTarget   
initOpts :: PPOpts   
main :: IO ()   
The main function of the Curry Preprocessor.
processOptions :: PPOpts -> [String] -> Maybe PPOpts   
showUsage :: [String] -> IO ()   
usageText :: String   
preprocess :: PPOpts -> String -> String -> String -> String -> IO ()   
callPreprocessors :: PPOpts -> String -> String -> String -> String -> IO String   
pathToModName :: String -> String -> String   
Transforms a file path name for a module back into a hierarchical module since only the file path of a module is passed to the preprocessor.
replaceOptionsLine :: String -> String   
isOptionLine :: String -> Bool   
optionLines :: String -> String   

Exported datatypes:


PPTarget

Preprocessor targets, i.e., kind of entities to be preprocessed:

Constructors:

  • ForeignCode :: PPTarget
  • SequentialRules :: PPTarget
  • DefaultRules :: PPTarget
  • Contracts :: PPTarget

PPOpts

Preprocessor options:

Constructors:

  • PPOpts :: Bool -> Bool -> Int -> [PPTarget] -> String -> [String] -> [String] -> PPOpts

    Fields:

    • optHelp :: Bool
    • optSave :: Bool
    • optVerb :: Int
    • optTgts :: [PPTarget]
    • optModel :: String
    • optDefRules :: [String]
    • optContracts :: [String]

Exported operations:

cppBanner :: String   

parseTarget :: String -> Maybe PPTarget   

initOpts :: PPOpts   

Further infos:
  • solution complete, i.e., able to compute all solutions

main :: IO ()   

The main function of the Curry Preprocessor.

processOptions :: PPOpts -> [String] -> Maybe PPOpts   

showUsage :: [String] -> IO ()   

usageText :: String   

preprocess :: PPOpts -> String -> String -> String -> String -> IO ()   

callPreprocessors :: PPOpts -> String -> String -> String -> String -> IO String   

pathToModName :: String -> String -> String   

Transforms a file path name for a module back into a hierarchical module since only the file path of a module is passed to the preprocessor. This is done only if it is a local file path name, otherwise it is difficult to reconstruct the original module name from the file path.

replaceOptionsLine :: String -> String   

isOptionLine :: String -> Bool   

optionLines :: String -> String