@ /* "CodeWorker": a scripting language for parsing and generating text. Copyright (C) 1996-1997, 1999-2002 Cédric Lemaire This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA To contact the author: codeworker@free.fr */ if getMarkupKey() == "EXECUTABLE_VERSION" { local sExecutableVersion = getProtectedArea("EXECUTABLE_VERSION"); if project.listOfVersions#front != "current" { set sExecutableVersion = "#define EXECUTABLE_VERSION\t\"" + project.listOfVersions#front + "\"" + endl(); } populateProtectedArea("EXECUTABLE_VERSION", sExecutableVersion); } else if getMarkupKey() == "functions and procedures" { foreach i in this.procedureList if !findElement("info", i.modifierList) { @SEQUENCE_INTERRUPTION_LIST CGRuntime::@i.name@(@ local bTree = ""; if findElement("visibility", i.modifierList) { @DtaScriptVariable& visibility@ if !isEmpty(i.parameterList) { @, @ } } foreach j in i.parameterList { if !j.first() { @, @ } if !isBasicType(j.type) set bTree = "true"; @@getCppParameterType(j.type)@ @getCppVariable(j.name, j.type)@@ } @) { @ setProtectedArea(i.name); @} @ if bTree { @SEQUENCE_INTERRUPTION_LIST CGRuntime::@i.name@(@ foreach j in i.parameterList { if first(j) { } else { @, @ } if isBasicType(j.type) { @@getCppParameterType(j.type)@ @getCppVariable(j.name, j.type)@@ } else if j.type == "stringref" || j.type == "stringlist" || j.type == "doubleref" || j.type == "boolref" { @CppParsingTree_var @getCppVariable(j.name, "tree")@@ } else if j.type == "treexpr" { @CppParsingTree_varexpr& @getCppVariable(j.name, j.type)@@ } else { @CppParsingTree_var @getCppVariable(j.name, j.type)@@ } } @) { @ foreach j in i.parameterList { if j.type == "stringref" { @ std::string @getCppVariable(j.name, "string")@; const char* t@getCppVariable(j.name, "string")@ = @getCppVariable(j.name, "tree")@.getValue(); if (t@getCppVariable(j.name, "string")@ != NULL) t@getCppVariable(j.name, "string")@ = @getCppVariable(j.name, "string")@; @ } else if j.type == "stringlist" { @ @getCppType(j.type)@ @getCppVariable(j.name, "stringlist")@; @ } else if j.type == "doubleref" { @ double @getCppVariable(j.name, "double")@ = @getCppVariable(j.name, "tree")@.getDoubleValue(); @ } else if j.type == "boolref" { @ bool @getCppVariable(j.name, "bool")@ = @getCppVariable(j.name, "tree")@.getBooleanValue(); @ } } @ SEQUENCE_INTERRUPTION_LIST result = @i.name@(@ foreach j in i.parameterList { if !first(j) { @, @ } if isBasicType(j.type) { @@getCppVariable(j.name, j.type)@@ } else if j.type == "stringref" { @@getCppVariable(j.name, "string")@@ } else if j.type == "doubleref" { @@getCppVariable(j.name, "double")@@ } else if j.type == "boolref" { @@getCppVariable(j.name, "bool")@@ } else if j.type == "stringlist" { @@getCppVariable(j.name, "stringlist")@@ } else if j.type == "treexpr" { @@getCppVariable(j.name, j.type)@.getVariableExpression()@ } else { @@getCppVariable(j.name, j.type)@._pInternalNode@ } } @); @ foreach j in i.parameterList { if j.type == "stringref" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "string")@); @ } else if j.type == "stringlist" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "stringlist")@); @ } else if j.type == "doubleref" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "double")@); @ } else if j.type == "boolref" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "bool")@); @ } } @ return result; } @ } } foreach i in this.functionList if !findElement("info", i.modifierList) && !findElement("user", i.modifierList) { @@getCppType(i.return_type)@ CGRuntime::@i.name@(@ local bTree = ""; foreach j in i.parameterList { if !first(j) { @, @ } if !isBasicType(j.type) set bTree = "true"; @@getCppParameterType(j.type)@ @getCppVariable(j.name, j.type)@@ } @) { @ setProtectedArea(i.name); @} @ if bTree { @@getCppType(i.return_type)@ CGRuntime::@i.name@(@ foreach j in i.parameterList { if !first(j) { @, @ } if isBasicType(j.type) { @@getCppParameterType(j.type)@ @getCppVariable(j.name, j.type)@@ } else if j.type == "stringref" || j.type == "stringlist" || j.type == "doubleref" || j.type == "boolref" { @CppParsingTree_var @getCppVariable(j.name, "tree")@@ } else if j.type == "treexpr" { @CppParsingTree_varexpr& @getCppVariable(j.name, j.type)@@ } else { @CppParsingTree_var @getCppVariable(j.name, j.type)@@ } } @) { @ foreach j in i.parameterList { if j.type == "stringref" { @ std::string @getCppVariable(j.name, "string")@ = @getCppVariable(j.name, "tree")@.getValue(); @ } else if j.type == "stringlist" { @ @getCppType(j.type)@ @getCppVariable(j.name, "stringlist")@; @ } else if j.type == "doubleref" { @ double @getCppVariable(j.name, "double")@ = @getCppVariable(j.name, "tree")@.getDoubleValue(); @ } else if j.type == "boolref" { @ bool @getCppVariable(j.name, "bool")@ = @getCppVariable(j.name, "tree")@.getBooleanValue(); @ } } @ @getCppType(i.return_type)@ result = @i.name@(@ foreach j in i.parameterList { if !first(j) { @, @ } if isBasicType(j.type) { @@getCppVariable(j.name, j.type)@@ } else if j.type == "stringref" { @@getCppVariable(j.name, "string")@@ } else if j.type == "doubleref" { @@getCppVariable(j.name, "double")@@ } else if j.type == "boolref" { @@getCppVariable(j.name, "bool")@@ } else if j.type == "stringlist" { @@getCppVariable(j.name, "stringlist")@@ } else if j.type == "treexpr" { @@getCppVariable(j.name, j.type)@.getVariableExpression()@ } else { @@getCppVariable(j.name, j.type)@._pInternalNode@ } } @); @ foreach j in i.parameterList { if j.type == "stringref" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "string")@); @ } else if j.type == "stringlist" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "stringlist")@); @ } else if j.type == "doubleref" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "double")@); @ } else if j.type == "boolref" { @ @getCppVariable(j.name, "tree")@.setValue(@getCppVariable(j.name, "bool")@); @ } } @ return result; } @ } } }