parseAsBNF("tinyDSL_parsing.cwp", project, "tinyDSL_spec.txt");
function getCppType(theType : node) {
local sType;
if theType.isObject set sType = theType.name + '*';
else {
switch(theType.name) {
case "double": set sType = "double";break;
case "string": set sType = "std::string";break;
}
}
if theType.isArray set sType = "std::vector<" + sType + '>';
return sType;
}
function getCppReturnType(theType : node) {
local sType = getCppType(theType);
if theType.isArray || theType.name == "string" set sType = "const " + sType + '&';
return sType;
}
foreach i in project.classes {
generate("tinyDSL_headerCpp.cwt", i, "framework/" + i.name + ".h");
generate("tinyDSL_bodyCpp.cwt", i, "framework/" + i.name + ".cpp");
}
Generated by CodeWorker v3.10.4 from CWscript2HTML.cwp.