Commit 81d1e8ab authored by John van Groningen's avatar John van Groningen
Browse files

add setting output options for a project,

(written by Mart Lubbers)
parent 99ff9626
definition module AbsSyn definition module AbsSyn
from System.FilePath import :: FilePath from System.FilePath import :: FilePath
from PmTypes import :: Output
/** /**
* Datatypes * Datatypes
...@@ -45,6 +46,7 @@ from System.FilePath import :: FilePath ...@@ -45,6 +46,7 @@ from System.FilePath import :: FilePath
| DescExLOff | DescExLOff
| HeapSize !Int | HeapSize !Int
| StackSize !Int | StackSize !Int
| Output !Output
:: ModuleAction :: ModuleAction
= CreateModule ModuleType = CreateModule ModuleType
......
implementation module AbsSyn implementation module AbsSyn
from System.FilePath import :: FilePath from System.FilePath import :: FilePath
from PmTypes import :: Output
...@@ -163,6 +163,8 @@ where ...@@ -163,6 +163,8 @@ where
= PR_SetApplicationOptions {PR_GetApplicationOptions project & hs = hs} project = PR_SetApplicationOptions {PR_GetApplicationOptions project & hs = hs} project
set_project_option (StackSize ss) project set_project_option (StackSize ss) project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & ss = ss} project = PR_SetApplicationOptions {PR_GetApplicationOptions project & ss = ss} project
set_project_option (Output output) project
= PR_SetApplicationOptions {PR_GetApplicationOptions project & o = output} project
doProjectAction _ _ _ _ world = doProjectAction _ _ _ _ world =
help "cpm project <projectfile> <action>" help "cpm project <projectfile> <action>"
...@@ -182,6 +184,9 @@ doProjectAction _ _ _ _ world = ...@@ -182,6 +184,9 @@ doProjectAction _ _ _ _ world =
, " : -descexl,-descexl" , " : -descexl,-descexl"
, " : Enable or disable descriptor generation and label exporting" , " : Enable or disable descriptor generation and label exporting"
, " : This translates to passing -desc and -exl to cocl" , " : This translates to passing -desc and -exl to cocl"
, " : -b,-nr,-nc,-sc"
, " : Set the output option to BasicValuesOnly, NoReturnType,"
, " : NoConsole or ShowConstructors respectively"
] world ] world
/** /**
......
...@@ -3,6 +3,7 @@ implementation module Parser; ...@@ -3,6 +3,7 @@ implementation module Parser;
import StdEnv; import StdEnv;
import AbsSyn; import AbsSyn;
from PmEnvironment import EnvsFileName; from PmEnvironment import EnvsFileName;
from PmTypes import :: Output(..);
parseCpmLogic :: ![String] -> CpmAction; parseCpmLogic :: ![String] -> CpmAction;
parseCpmLogic [_:args] = parse_CpmLogic args; parseCpmLogic [_:args] = parse_CpmLogic args;
...@@ -101,6 +102,18 @@ parse_Project_options ["-s",stack_size:project_option_args] ...@@ -101,6 +102,18 @@ parse_Project_options ["-s",stack_size:project_option_args]
# stack_size = parseByteSuffix stack_size; # stack_size = parseByteSuffix stack_size;
| stack_size > 0 | stack_size > 0
= (ok,[StackSize stack_size:project_options]); = (ok,[StackSize stack_size:project_options]);
parse_Project_options ["-b":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [Output BasicValuesOnly:project_options]);
parse_Project_options ["-sc":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [Output ShowConstructors:project_options]);
parse_Project_options ["-nr":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [Output NoReturnType:project_options]);
parse_Project_options ["-nc":project_option_args]
# (ok,project_options) = parse_Project_options project_option_args;
= (ok, [Output NoConsole:project_options]);
parse_Project_options [] parse_Project_options []
= (True,[]); = (True,[]);
parse_Project_options _ parse_Project_options _
......
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