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

add setting output options for a project,

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