init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
99
Tools/CodeGeneration/Templates/Common/PascalUtil.tdl
Normal file
99
Tools/CodeGeneration/Templates/Common/PascalUtil.tdl
Normal file
|
@ -0,0 +1,99 @@
|
|||
//***************************************************************************//
|
||||
// Visszaadja egy művelet paraméterlistáját ay Object Pascal nyelv //
|
||||
// szintaktikájának és a saját jelölésbeli konvencióinknak megfelelően. //
|
||||
//***************************************************************************//
|
||||
proc GetPascalOperationParameters(MOperation as OPERATION)
|
||||
local ops;
|
||||
[ops] = "";
|
||||
loop (OPERATION -> OpPara as PARAMETER; setDelim(""); setDelim("; "))
|
||||
[ops] = [ops] delim() ToLower([PARAMETER.name]) ": " GetPascalType([PARAMETER.type]);
|
||||
end loop
|
||||
return [ops];
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Pascal kommentet gyárt egy karakterláncból. //
|
||||
//***************************************************************************//
|
||||
template ConvertDescriptionToPascalComment(description)
|
||||
[if ([description] == "")]
|
||||
{
|
||||
nincs megjegyzés
|
||||
}
|
||||
[else]
|
||||
{
|
||||
[replace([description], "", "\n ")]
|
||||
}
|
||||
[end if]
|
||||
end template
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Pascal kommentet gyárt egy karakterláncból. //
|
||||
//***************************************************************************//
|
||||
template ConvertDescriptionToPascalSummary(description)
|
||||
[if ([description] == "")]
|
||||
(*
|
||||
* Nincs megjegyzés
|
||||
*)
|
||||
[else]
|
||||
(*
|
||||
* [replace([description], "", "\n * ")]
|
||||
*)
|
||||
[end if]
|
||||
end template
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Visszadja a megadott típushoz tartozó pascal tipust. //
|
||||
//***************************************************************************//
|
||||
proc GetPascalType(type)
|
||||
switch(ToLower([type]))
|
||||
case "integer": return "integer";
|
||||
case "string": return "string";
|
||||
case "boolean": return "boolean";
|
||||
case "float": return "double";
|
||||
case "char": return "char";
|
||||
case "datetime": return "TDateTime";
|
||||
case "id": return "integer";
|
||||
case "binary": return "TBase64String";
|
||||
case "dictionaryitem": return "integer";
|
||||
case "dataset": return "string";
|
||||
case "object": return "TXMLString";
|
||||
case "longstring": return "string";
|
||||
end switch
|
||||
return "TObject { ERROR Ismeretlen tipus: " [type] " }";
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Visszaadja a megadott típus alapértelmezett (kezdeti) értékét a pascal //
|
||||
// nyelv szintaktikájának megfelelően. //
|
||||
//***************************************************************************//
|
||||
proc GetPascalDefaultValueOfType(type)
|
||||
switch(ToLower([type]))
|
||||
case "integer": return "-1";
|
||||
case "string": return "''";
|
||||
case "boolean": return "false";
|
||||
case "float": return "0";
|
||||
case "char": return "''";
|
||||
case "datetime": return "Now";
|
||||
case "id": return "-1";
|
||||
case "binary": return "''";
|
||||
case "dictionaryitem": return "-1";
|
||||
case "dataset": return "''";
|
||||
case "object": return "''";
|
||||
case "longstring": return "''";
|
||||
end switch
|
||||
return "nil { ERROR Ismeretlen tipus: " [type] " }";
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Osztály nevéből pascal unit nevet generál a konvencióinknak megfelelően. //
|
||||
//***************************************************************************//
|
||||
proc GenerateUnitName(classname)
|
||||
return "u" [classname];
|
||||
end proc
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue