//command: -I Scripts/Tutorial -path .
//command: -define DESIGN_FILE=GettingStarted/SolarSystem0.sml
//command: -script GettingStarted/LeaderScript4.cws
//hide:
setProperty("DESIGN_FILE", "GettingStarted/SolarSystem0.sml");
if !getProperty("DESIGN_FILE")
	error("'-define DESIGN_FILE=file' expected on the command line");
traceLine("'Simple Modeling' design file to parse = \""
		  + getProperty("DESIGN_FILE") + "\"");
//hide:
clearVariable(project.listOfClasses);
parseAsBNF("GettingStarted/SimpleML-parsing.cwp",
		   project, getProperty("DESIGN_FILE"));
#include "TreeDecoration.cws"

#include "SharedFunctions.cws"
foreach myClass in project.listOfClasses {
	traceLine("generating class '" + myClass.name + "' ...");
	generate("GettingStarted/CppObjectHeader.cwt", myClass, getWorkingPath() + "Scripts/Tutorial/GettingStarted/Cpp/" + myClass.name + ".h");
	generate("GettingStarted/CppObjectBody.cwt", myClass, getWorkingPath() + "Scripts/Tutorial/GettingStarted/Cpp/" + myClass.name + ".cpp");
	generate("GettingStarted/JAVAObject.cwt", myClass, getWorkingPath() + "Scripts/Tutorial/GettingStarted/JAVA/solarsystem/" + myClass.name + ".java");
}

local myDocumentationContext;
insert myDocumentationContext.language = "C++";
traceLine("generating the HTML documentation...");
setCommentBegin("<!--");
setCommentEnd("-->");
//note: the procedure \samp{expand()} will allow populating \textit{"SolarSystem1.html"} with the characteristics of the
//note: project,
expand("GettingStarted/HTMLDocumentation.cwt",
		myDocumentationContext, getWorkingPath()
		+ "Scripts/Tutorial/GettingStarted/SolarSystem1.html");
//highlight:
//note: a context of execution (\samp{project} here) is given as a \samp{this} variable,
//note: although no parsing will be processed: reading and writing only, no data to keep,
translate("GettingStarted/HTML2LaTeX.cwp", project, "GettingStarted/SolarSystem1.html", getWorkingPath() + "Scripts/Tutorial/GettingStarted/SolarSystem.tex");
//normal:
