CpmLogic.dcl 1.91 KB
Newer Older
1 2
definition module CpmLogic

3
// CPM imports
4 5
import AbsSyn

6
// CleanIDE imports
7
from PmProject import :: Project
8

9
// Execute a general CPM action
10
doCpmAction :: String String !CpmAction !*World -> *World
11

12
// Find all project files in the current working directory and build them
13
doMake :: String !String !*World -> *World
14

15
// Execute project-specific actions
16
doProjectAction :: String String String ProjectAction *World -> *World
17

18 19
// Execute path-related project actions
doProjectPathAction :: String String String Project PathAction *World -> *World
20

21
// Execute module-related actions
22
doModuleAction :: String !String !ModuleAction !*World -> *World
23

24 25
// Modify a project
withProject :: !String !String !String (Project -> Project) *World -> *World
26

27
// Collect all project paths in a list with an index prefixed
28
showPaths :: !Project -> [String]
29

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
/*
 Modify the list of paths in a project given a modification function which
 takes a strict list of project paths and returns a strict list of project
 paths.
*/
doModPaths :: !String !String !String !Project ([!String!] -> [!String!]) *World -> *World

// Open a project file
openProject :: !FilePath !FilePath !FilePath !*World -> (!FilePath, !Project, Bool, !*World)

// Save a project back to its project file
saveProject :: !FilePath !FilePath !Project !FilePath !*World -> *World

/*
 Remove an item from a strict list at a given index. Abort execution if the
 index is out of bounds.
*/
47
rmStrictListIdx :: !Int [!a!] -> [!a!]
48

49 50 51 52
/*
 Move a path at a given index up or down the list of paths. Abort execution
 if the index is out of bounds.
*/
53
moveStrictListIdx :: !Int PathDirection [!a!] -> [!a!]
54

55
// Show an error message
56
error :: !String !*World -> *World
57

58
// Show a help message
59 60
help :: !String ![String] !*World -> *World

61 62 63 64
/*
 Given a list of strings, concatenate them to a single string with newlines
 in between, then print that new string to console.
*/
65
showLines :: ![String] !*World -> *World