content stringlengths 4 1.04M | lang stringclasses 358
values | score int64 0 5 | repo_name stringlengths 5 114 | repo_path stringlengths 4 229 | repo_licenses listlengths 1 8 |
|---|---|---|---|---|---|
== Words ==
Include 2
img 1
item 3
pre 1
== Links ==
== Images ==
photo.jpg 1
| Creole | 0 | jquorning/ada-wiki | regtests/expect/wiki-collect/template-1.creole | [
"Apache-2.0"
] |
// Coding Rainbow
// Daniel Shiffman
// http://patreon.com/codingtrain
// Code for: https://youtu.be/JcopTKXt8L8
class Tree {
ArrayList<Branch> branches = new ArrayList<Branch>();
ArrayList<Leaf> leaves = new ArrayList<Leaf>();
Tree() {
for (int i = 0; i < 2000; i++) {
leaves.add(new Leaf());
}
Branch root = new Branch(new PVector(0,height/2), new PVector(0, -1));
branches.add(root);
Branch current = new Branch(root);
while (!closeEnough(current)) {
Branch trunk = new Branch(current);
branches.add(trunk);
current = trunk;
}
}
boolean closeEnough(Branch b) {
for (Leaf l : leaves) {
float d = PVector.dist(b.pos, l.pos);
if (d < max_dist) {
return true;
}
}
return false;
}
void grow() {
for (Leaf l : leaves) {
Branch closest = null;
PVector closestDir = null;
float record = -1;
for (Branch b : branches) {
PVector dir = PVector.sub(l.pos, b.pos);
float d = dir.mag();
if (d < min_dist) {
l.reached();
closest = null;
break;
} else if (d > max_dist) {
} else if (closest == null || d < record) {
closest = b;
closestDir = dir;
record = d;
}
}
if (closest != null) {
closestDir.normalize();
closest.dir.add(closestDir);
closest.count++;
}
}
for (int i = leaves.size()-1; i >= 0; i--) {
if (leaves.get(i).reached) {
leaves.remove(i);
}
}
for (int i = branches.size()-1; i >= 0; i--) {
Branch b = branches.get(i);
if (b.count > 0) {
b.dir.div(b.count);
PVector rand = PVector.random2D();
rand.setMag(0.3);
b.dir.add(rand);
b.dir.normalize();
Branch newB = new Branch(b);
branches.add(newB);
b.reset();
}
}
}
void show() {
for (Leaf l : leaves) {
l.show();
}
//for (Branch b : branches) {
for (int i = 0; i < branches.size(); i++) {
Branch b = branches.get(i);
if (b.parent != null) {
float sw = map(i, 0, branches.size(), 6, 0);
strokeWeight(sw);
stroke(255);
line(b.pos.x, b.pos.y, b.pos.z, b.parent.pos.x, b.parent.pos.y, b.parent.pos.z);
}
}
}
} | Processing | 4 | aerinkayne/website | CodingChallenges/CC_018_SpaceColonizer3D/Processing/CC_018_SpaceColonizer3D/Tree.pde | [
"MIT"
] |
#include "debug.eh"
#include "bgen.eh"
#include "econe.eh"
import "bgen"
import "cppHardcoded"
// tocheck: does it make any sense to support eC types specified as untemplated struct template classes?
// class FMFont : struct use to have a link member defined as public LinkElement link;
// it was made LinkElement<FMFont> to work around this problem
// but the link property was generate with a C++ type LinkElement which did not permit
// accessing the impl member of that templated struct class...
// todo:
// /* : src/cpp/genCPP.ec: 5216: */ #define REG_Window_onMultiTouch(m, c) REGVMETHOD(Window, onMultiTouch, c::m, (/*1Ab*/Window & self, /*1Ab*/TouchPointerEvent event, /*1Ab*/Array & infos, /*1Ab*/Modifiers mods), c, (/*4Hm*/(TouchPointerEvent)event, /*4Im*/infos, /*4Hm*/(Modifiers)mods))
// vs
// #define REG_Window_onMultiTouch(m, c) REGVMETHOD(Window, onMultiTouch, c::m, (Window & self, TouchPointerEvent event, TArray<TouchPointerInfo> & infos, Modifiers mods), c, ((TouchPointerEvent)event, infos, (Modifiers)mods))
// and
// VIRTUAL_METHOD_PROTO(onMultiTouch, onMultiTouch, c, Window, \
// bool, c & _ARG, , TouchPointerEvent event _ARG TArray<TouchPointerInfo> & infos _ARG Modifiers mods); \
// also
// inline C(bool) multiTouchMessage(TouchPointerEvent event, TArray<TouchPointerInfo> & infos, Modifiers * mods, bool consequential, bool activate);
// with
/*
struct Window_onMultiTouch_Functor
{
int _[0];
typedef bool (* FunctionType)(Window & , TouchPointerEvent event, TArray<TouchPointerInfo> & infos, Modifiers mods);
inline FunctionType operator= (FunctionType func);
inline bool operator()( TouchPointerEvent event, TArray<TouchPointerInfo> & infos, Modifiers mods);
} onMultiTouch;
*/
// this
/*
struct controller_Prop
{
controller_Prop() { };
int _[0];
inline const WindowController & operator= (const WindowController & v);
inline Window::controller_Prop & operator= (Window::controller_Prop & prop);
// We can't have this... inline operator TIH<WindowController> () const;
inline const WindowController * operator= (const WindowController * v);
// inline TIH<WindowController> operator -> () const;
// We can't have this one... inline operator WindowController () const;
inline operator WindowController* () const;
} controller;
*/
// review
/*
struct parts_Prop
{
parts_Prop() { };
int _[0];
inline const TArray<MeshPart> & operator= (const TArray<MeshPart> & v);
inline typename TMesh<TC, TCO>::parts_Prop & operator= (typename TMesh<TC, TCO>::parts_Prop & prop);
inline operator TIH<TArray<MeshPart>> () const;
inline const TArray<MeshPart> * operator= (const TArray<MeshPart> * v);
inline TIH<TArray<MeshPart>> operator -> () const;
inline operator TArray<MeshPart> () const;
inline operator TArray<MeshPart>* () const;
} parts;
*/
// vs
/*
/-* : src/cpp/genCPP.ec: 6009: *-/ struct parts_Prop
/-* : src/cpp/genCPP.ec: 6015: *-/ {
/-* : src/cpp/genCPP.ec: 6017: *-/ parts_Prop() { };
/-* : src/cpp/genCPP.ec: 6018: *-/ [[no_unique_address]] int _[0];
/-* : src/cpp/genCPP.ec: 6145: *-/ inline /-*0A*-/const TArray<C(MeshPart)> & operator= (/-*0A*-/const TArray<C(MeshPart)> & v);
/-* : src/cpp/genCPP.ec: 6302: *-/ inline typename TMesh<TC, TCO>::parts_Prop & operator= (typename TMesh<TC, TCO>::parts_Prop & prop);
/-* : src/cpp/genCPP.ec: 6431: *-/ inline operator /-*0B*-/TIH<TArray<C(MeshPart)>> () const;
/-* : src/cpp/genCPP.ec: 6145: *-/ inline /-*0C*-/const TArray<C(MeshPart)> * operator= (/-*0C*-/const TArray<C(MeshPart)> * v);
/-* : src/cpp/genCPP.ec: 6431: *-/ inline TIH<TArray<C(MeshPart)>> operator /-*0D*-/-> () const;
/-* : src/cpp/genCPP.ec: 6431: *-/ inline operator /-*0E*-/TArray<C(MeshPart)> () const;
/-* : src/cpp/genCPP.ec: 6431: *-/ inline operator /-*0F*-/TArray<C(MeshPart)>* () const;
/-* : src/cpp/genCPP.ec: 6048: *-/ } parts;
*/
// todo REG_WindowController_*
// /* : src/cpp/genCPP.ec: 5216: */ #define REG_WindowController_onCreate(m, c) REGVMETHOD(WindowController, onCreate, c::m, (/*1Ab*/TP_V v, /*1Ab*/WindowController & self, /*1Ab*/WindowController & controller), c, (/*4Im*/v, /*4Im*/controller))
// vs
// #define REG_WindowController_onCreate(m, c) REGVMETHOD(WindowController, onCreate, c::m, (TP_V v, WindowController & self, TWindowController<TP_V> & controller), c, (v, controller))
// and
// #define WINDOWCONTROLLER_VIRTUAL_METHODS_PROTO(c) \
// TVIRTUAL_METHOD_PROTO(onCreate, onCreate, WindowController, TWindowController, \
// bool, c & _ARG, , uint64 v _ARG TWindowController<TP_V> & controller); \
// and
// #define WINDOWCONTROLLER_VIRTUAL_METHODS(c) \
// TVIRTUAL_METHOD(onCreate, onCreate, WindowController, <TP_V>, template <typename TP_V>, WindowController, \
// bool, c & _ARG, , uint64 v _ARG TWindowController<TP_V> & controller, \
// return (bool)WindowController_onCreate(self ? self->impl : (C(WindowController))null, controller.impl);); \
// also -- we're missing the <TP_V>
// struct WindowController_onCreate_Functor
// {
// int _[0];
// typedef bool (* FunctionType)(TWindowController & , uint64 v, TWindowController<TP_V> & controller);
// inline FunctionType operator= (FunctionType func);
// inline bool operator()( uint64 v, TWindowController<TP_V> & controller);
// } onCreate;
// tweaked funner stuff still has TIH on templates?
/*
struct strings_Prop
{
strings_Prop() { };
int _[0];
inline const TArray<C(String)> & operator= (const TArray<C(String)> & v);
inline DirectoriesBox::strings_Prop & operator= (DirectoriesBox::strings_Prop & prop);
inline operator TIH<TArray<C(String)>> () const;
inline const TArray<C(String)> * operator= (const TArray<C(String)> * v);
inline TIH<TArray<C(String)>> operator -> () const;
inline operator TArray<C(String)> () const;
inline operator TArray<C(String)>* () const;
} strings;
*/
// todo:
// inline void multiSort(TArray<DataFieldSort> & fields);
// vs
// inline void multiSort(/*1Ab*/Array & fields);
static AVLTree<consttstr> skipClasses
{ [
{ "eC", "Window" }, // Dependency on Window
{ "eC", "ClassDesignerBase" }, // Dependency on Window
{ "eC", "DesignerBase" }, // Dependency on Window
{ null, null }
] };
/*
todo:
static AVLTree<String> addClassesToEcere
{ [
"ClassDesignerBase",
"DesignerBase",
null
] };
todo: also move global functions that have these as parameters aka setActiveDesigner
*/
class CPPGen : CGen
{
char * cppFileName;
char * cppFilePath;
char * hppFileName;
char * hppFilePath;
MacroModeBits macroModeBits;
BClass cInstance;
BClass cclass;
lang = CPlusPlus;
//macroModeBits.all = expansion;
cpp_classNameSwaps =
{ [
// eC
{ "AccessMode", "Access_Mode" },
// gnosis3
{ "CRS", "CRS_" },
{ null, null }
] };
cpp_methodNameSwaps =
{ [
{ { "Row", "Query" }, "query_" },
{ { "File", "Eof" }, "eof_" },
{ { "Container", "Delete" }, "delete_" },
{ { "BuiltInContainer", "Delete" }, "delete_" },
{ { "BinaryTree", "Delete" }, "delete_" },
{ { "OldList", "Delete" }, "delete_" },
{ { "Object", "Delete" }, "delete_" },
{ { "Extent", "Union" }, "union_" },
{ { "EditBox", "Delete" }, "delete_" },
{ { "EditBox", "Printf" }, "printf_" },
{ { "ArchiveDir", "Delete" }, "delete_" },
{ { "File", "Printf" }, "printf_" },
{ { "DriverRow", "Delete" }, "delete_" },
{ { "IdList", "Delete" }, "delete_" },
{ { "Row", "Delete" }, "delete_" },
{ { "", "Delete" }, "delete_" },
{ { "", "Union" }, "union_" },
{ { "", "Printf" }, "printf_" },
{ { null, null }, null }
] };
bool init()
{
bool result = false;
if(Gen::init() && readyDir())
{
prepPaths(true);
if(FileExists(cppFilePath))
DeleteFile(cppFilePath);
if(FileExists(hppFilePath))
DeleteFile(hppFilePath);
if(!FileExists(cppFilePath) && !FileExists(hppFilePath))
{
reset();
if(moduleInit())
result = true;
}
}
if(options.expandMacros)
macroModeBits.all = expansion;
return result;
}
void process()
{
{
Class cl = eSystem_FindClass(mod, "Instance");
if(cl == null)
PrintLn("problem");
cInstance = cl;
cclass = cl.base;
}
prepareNamespaces(); // just a test now, remove later
processNamespaces();
bmod.applyDependencies();
for(n : bmod.orderedNamespaces)
n.positionOutput(this);
bmod.sort();
bmod.moveBackwardsDependencies();
for(n : bmod.orderedNamespaces)
n.sort();
}
void prepareNamespaces()
{
IterNamespace ns { module = mod, processFullName = true };
while(ns.next())
{
BNamespace n = (NameSpacePtr)ns.ns;
if(!bmod.root_nspace)
{
bmod.root_nspace = (NameSpacePtr)ns.ns;
}
prepareClasses(n);
bmod.orderedNamespaces.Add(n);
}
ns.cleanup();
}
void prepareClasses(BNamespace n)
{
BClass c; IterClass itc { n.ns, list = options.classList };
while((c = itc.next(all)))
{
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString;
bool template = hasTemplateClass(c.cl);
if(/*g_.lib.ecereCOM && */skipClasses.Find({ g_.lib.bindingName, c.cl.name }))
skip = true;
if(!skip && !template && c.cl.type == normalClass)
//processCppClass(this, c);
{
BClass cBaseNotSkippingTemplatedBase = c.cl.base;
BClass cBase = c.cl.base.templateClass ? c.cl.base.templateClass : c.cl.base;
if(cBaseNotSkippingTemplatedBase.base)
; // warning supression
if(c.isInstance)
{
//cInstance = c;
//cclass = cBase;
// what is this?
if(c == cInstance && c.cl == cInstance.cl && cBase == cclass && cBase.cl == cclass.cl)
;
else
; // PrintLn("dddddd");
}
}
}
}
void processNamespaces()
{
IterNamespace ns { module = mod, processFullName = true };
while(ns.next())
{
BNamespace n = (NameSpacePtr)ns.ns;
/*if(!bmod.root_nspace)
{
bmod.root_nspace = (NameSpacePtr)ns.ns;
}*/
processDefines(n);
//if(lib.ecereCOM && ns.ns->parent == null && ns.ns->name == null)
// manualTypes(n);
processClasses(n);
//processOptionalClasses(n);
processFunctions(n);
}
processTemplatons();
ns.cleanup();
}
void processClasses(BNamespace n)
{
BClass c; IterClass itc { n.ns, list = options.classList };
while((c = itc.next(all)))
{
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString;
bool template = hasTemplateClass(c.cl);
if(/*g_.lib.ecereCOM && */skipClasses.Find({ g_.lib.bindingName, c.cl.name }))
skip = true;
if(c.cl.type == noHeadClass && hasOrBaseHasTemplateAnything(c.cl))
skip = true;
// if(!skip && !template && (c.cl.type == normalClass || c.cl.type == noHeadClass || c.cl.type == structClass))
if(!skip &&
c.cl.type != systemClass &&
c.cl.type != unionClass &&
!template)
{
BClass cBase = c.cl.base;
if(c.cl.type != enumClass || !(cBase && cBase.isBool)) // note: only one level of overriding checked?
processCppClass(this, c, cBase);
}
}
}
void processDefines(BNamespace n)
{
DefinedExpression df; IterDefine def { n.ns, list = options.functionList };
while((df = def.next()))
{
BDefine d = df;
if(!(lib.ecereCOM && d.isNull))
{
Expression exp = ParseExpressionString((char *)df.value);
if(exp.type == instanceExp)
{
const bool debugDefines = false;
BOutput out { vdefine, d = d, z = { allocType = heap } };
BVariant v = d;
BClass cType = eSystem_FindClass(mod, exp.instance._class.name);
char expString[1024];
expString[0] = '\0';
PrintExpression(exp, expString);
if(cType && cType.cl.type == unitClass)
n.splitContents.Add(v);
else
n.implementationsContents.Add(v);
d.out = out;
out.z.concatx(ln);
out.z.concatx(genspc__, "#undef ", d.name);
if(debugDefines)
out.z.concatx(" // ", d.name, "(", exp.type, ")", " -- ", expString);
out.z.concatx(ln);
{
char * val = getNoNamespaceString(df.value, null, false, false);
const char * name = strstr(val, cType.cl.name);
const char * inst = strstr(val, "{");
if(name && inst && name + strlen(cType.cl.name) <= inst)
{
if(cType && cType.cl.type == unitClass)
out.z.concatx(genspc__, "static constexpr ", cType.cpp.name, " ", d.name, " ", inst, ";", ln);
else
out.z.concatx(genspc__, cType.cpp.name, " ", d.name, " = ", val, ";", ln, ln);
}
else
debugBreakpoint();
}
}
FreeExpression(exp);
}
}
}
void processFunctions(BNamespace n)
{
GlobalFunction fn; IterFunction func { n.ns, list = options.functionList };
while((fn = func.next()))
{
BFunction f = fn;
if(!f.skip && !f.isDllExport)
{
BVariant v = f;
BOutput out { vfunction, f = f, z = { allocType = heap } };
// Type t = fn.dataType;
TypeInfo ti { type = fn.dataType, typeString = fn.dataTypeString };
n.splitContents.Add(v);
f.out = out;
out.z.concatx(genspc__, "// function: ", f.oname, ln); // todo: remove line
genGenGlobalFunctionOrMethod(this, null, null, f, ti, v, 0, null, f.oname, false, out);
}
}
}
void generate()
{
File f;
f = FileOpen(hppFilePath, write);
if(f)
{
generateHPP(this, f);
delete f;
}
if(!options.headerOnly)
{
f = FileOpen(cppFilePath, write);
if(f)
{
generateCPP(this, f);
delete f;
}
f = FileOpen(makefilePath, write);
if(f)
{
// hardcoded -- todo -- see if we can generate from dependencies :P
sourceProcessorVars["DEP_FILE_LISTS"] = !lib.ecere ? CopyString("") : CopyString(
"_DEP_OBJECTS = \\\n"
" $(OBJ)eC$(O)\n"
"\n"
"_DEP_SOURCES = \\\n"
" eC.cpp\n"
"\n"
);
sourceProcessorVars["DEP_RULES"] = !lib.ecere ? CopyString("") : CopyString(
"$(OBJ)eC$(O): eC.cpp\n"
" $(CXX) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,$<) -o $(call quote_path,$@)\n"
"\n"
);
// hardcoded -- todo -- this can be generated from dependencies -- do it!
sourceProcessorVars["DEP_LIBS"] = CopyString((lib.ecere || lib.ecereCOM) ? "" :
" $(call _L,ecere) \\\n"
" $(call _L,ecere_c) \\\n"
" $(call _L,ecere_cpp) \\\n"
);
sourceProcessorVars["SPECIFIC_FLAGS"] = CopyString(!lib.ecereCOM ? "" : "PRJ_CFLAGS += -DECERECOM_ONLY\n\n");
// sourceProcessorVars["DEP_INCLUDES"] = CopyString("");
sourceProcessorVars["DEP_INCLUDES"] = CopyString(
"PRJ_CFLAGS += \\\n"
" -I../c \\\n"
);
sourceFileProcessToFile(f, null, ":src/cpp/cpp_makefile.src", sourceProcessorVars, false, false);
delete f;
}
}
{
char * hppFilePathTmp = hppFilePath;
char * cppFilePathTmp = cppFilePath;
char * makefileNameTmp = makefilePath;
hppFilePath = null;
cppFilePath = null;
makefilePath = null;
prepPaths(false);
if(FileExists(hppFilePath))
DeleteFile(hppFilePath);
MoveFile(hppFilePathTmp, hppFilePath);
if(!options.headerOnly)
{
if(FileExists(cppFilePath))
DeleteFile(cppFilePath);
MoveFile(cppFilePathTmp, cppFilePath);
if(FileExists(makefilePath))
DeleteFile(makefilePath);
MoveFile(makefileNameTmp, makefilePath);
}
delete hppFilePathTmp;
delete cppFilePathTmp;
delete makefileNameTmp;
}
}
void printOutputFiles()
{
if(!quiet)
{
PrintLn(lib.verbose > 1 ? " " : "", hppFileName);
if(!options.headerOnly)
{
PrintLn(lib.verbose > 1 ? " " : "", cppFileName);
// PrintLn(lib.verbose > 1 ? " " : "", makefileName);
}
}
}
void prepPaths(bool tmp)
{
int len;
char * name = new char[MAX_LOCATION];
char * path = new char[MAX_LOCATION];
strcpy(path, dir);
len = strlen(path);
strcpy(name, lib.bindingName);
ChangeExtension(name, "hpp", name);
PathCatSlash(path, name);
if(tmp) strcat(path, ".tmp");
delete hppFileName; hppFileName = CopyString(name);
delete hppFilePath; hppFilePath = CopyString(path);
if(!options.headerOnly)
{
path[len] = 0;
ChangeExtension(name, "cpp", name);
PathCatSlash(path, name);
if(tmp) strcat(path, ".tmp");
delete cppFileName; cppFileName = CopyString(name);
delete cppFilePath; cppFilePath = CopyString(path);
path[len] = 0;
name[strlen(lib.bindingName)] = 0;
strcat(name, "_cpp");
ChangeExtension(name, "Makefile", name);
PathCatSlash(path, name);
if(tmp) strcat(path, ".tmp");
delete makefileName; makefileName = CopyString(name);
delete makefilePath; makefilePath = CopyString(path);
}
delete name;
delete path;
}
char * allocMacroSymbolName(const bool noMacro, const MacroType type, const TypeInfo ti, const char * name, const char * name2, int ptr)
{
// this whole thing isn't even used
int x = 0;
int y = 55 / x;
PrintLn(y);
switch(type)
{
case C:
if(noMacro) return CopyString(name);
if((ti.c && ti.c.isBool) ||
(ti.c && ti.c.cl.type == normalClass) ||
(ti.cl && ti.cl.type == normalClass))
return CopyString(name);
return PrintString( "C(" , name, ")");
case CM: return PrintString( "CM(", name, ")");
case CO: return PrintString( "CO(", name, ")");
case SUBCLASS: return PrintString( "subclass(", name, ")");
case THISCLASS: return PrintString("thisclass(", name, ptr ? " *" : "", ")");
case T: return ti.c ? cGetTemplatedClassSymbolName(ti.c, ti.c.cTArgs, macro) : getTemplateClassSymbol(name, false);
case TP: return PrintString( "TP(", name, ", ", name2, ")");
case METHOD: return PrintString( "METHOD(", name, ", ", name2, ")");
case PROPERTY: return PrintString( "PROPERTY(", name, ", ", name2, ")");
case FUNCTION: return PrintString( "FUNCTION(", name, ")");
case M_VTBLID: return PrintString( "M_VTBLID(", name, ", ", name2, ")");
}
return CopyString(name);
}
void reset()
{
ec1terminate();
}
~CPPGen()
{
delete cppFileName;
delete hppFileName;
delete cpp_classNameSwaps;
}
}
static void generateHPP(CPPGen g, File f)
{
BClass c = eSystem_FindClass(g_.mod, "Instance");
BClass cBase = c.cl.base;
cppHeaderStart(g, f);
if(g.lib.ecereCOM)
{
cppHardcodedCorePart1(g, f);
cppUndefProperCaseNameUnitMacros(g, f);
{
BClass c = eSystem_FindClass(g.mod, "Instance");
BVariant v = c;
BClass cBase = c.cl.base;
cppHardcodedCorePart2(g, f, configuration, true, false/*template*/, "INSTANCE", c.name, c, cBase, v);
}
}
else
cppUndefProperCaseNameUnitMacros(g, f);
if(g.lib.ecereCOM)
{
typedefHackClasses(g, f);
prototypeHackClasses(g, f);
}
// typedefClasses(g, f); // temporary
prototypeClasses(g, f);
f.PrintLn(genloc__, "int ", g.lib.bindingName, "_cpp_init(const Module & module);", ln); // todo? back to void returning?
if(g.lib.ecereCOM)
cppHardcodedStructBase(g, f, true, c, cBase);
outputContents(g, f);
if(g.lib.ecereCOM)
cppHardcodedNativeTypeTemplates(g, f);
if(g.lib.ecereCOM)
cppHardcodedStructBase(g, f, false, c, cBase);
outputSplitContents(g, f);
f.PrintLn(ln);
// templateClassThings(g, f);
cppHeaderEnd(g, f);
}
bool typedefHackClasses(CPPGen g, File f)
{
bool contents = false;
for(name : tmpcppececeremesstypedef)
{
f.PrintLn(genloc__, "typedef C(", name, ") ", name, ";");
if(!contents)
contents = true;
}
if(contents)
f.PrintLn("");
return contents;
}
bool typedefClasses(CPPGen g, File f)
{
bool contents = false;
BClass c; IterAllClass itacl { itn.module = g.mod/*module = g.mod*/ };
while((c = itacl.next(all)))
{
if(c.cl.type == enumClass)
{
BClass cBase = c.cl.base;
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString ||
(g.lib.ecereCOM && skipClasses.Find({ g_.lib.bindingName, c.cl.name }))/* temporary: */ || !cBase || !cBase.isBool; // temporary
if(!skip)
{
f.PrintLn(genloc__, "typedef ", "C(", c.name, ") ", c.name, ";");
if(!contents)
contents = true;
}
}
}
if(contents)
f.PrintLn("");
return contents;
}
bool prototypeHackClasses(CPPGen g, File f)
{
bool contents = false;
for(name : tmpcppececeremessclass)
{
f.PrintLn(genloc__, "class ", name, ";");
if(!contents)
contents = true;
}
if(contents)
f.PrintLn("");
return contents;
}
bool prototypeClasses(CPPGen g, File f)
{
bool contents = false;
BClass c; IterAllClass itacl { itn.module = g.mod/*module = g.mod*/ };
while((c = itacl.next(all)))
{
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString;
bool template = hasTemplateClass(c.cl);
if(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox))
; //locprintx("if(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox))");
if(g.lib.ecereCOM && skipClasses.Find({ g_.lib.bindingName, c.cl.name }))
skip = true;
if(!skip && !template)
{
bool hasOutput;
const char * cn = c.cpp.name;
const char * tcn = c.cpp.tname;
f.Print(genloc__);
switch(c.cl.type)
{
case normalClass:
case bitClass:
case unitClass:
case enumClass:
case structClass:
case noHeadClass:
hasOutput = true;
break;
case systemClass:
case unionClass:
default:
hasOutput = false;
break;
}
if(hasOutput)
{
switch(c.cl.type)
{
case enumClass:
f.Print("enum ");
break;
case noHeadClass:
f.Print(cpptemplateNoHeadDef, " ");
break;
default:
break;
}
switch(c.cl.type)
{
case normalClass:
case bitClass:
case unitClass:
case enumClass:
case noHeadClass:
f.Print("class ");
break;
case structClass:
f.Print("struct ");
break;
default:
break;
}
switch(c.cl.type)
{
case normalClass:
case bitClass:
case unitClass:
case enumClass:
case structClass:
f.Print(cn);
break;
case noHeadClass:
f.Print(tcn);
break;
default:
break;
}
if(c.cl.type == enumClass)
{
const char * typeString = tokenTypeString(c.cl.dataType);
f.Print(" : ", typeString); // "std::underlying_type_t<", c.cSymbol, ">"
if(!contents) contents = true;
}
f.Print(";");
// f.Print(" // ", bclassToSimpleClassTypeString(c));
f.Print(ln);
switch(c.cl.type)
{
case normalClass:
if(c.cpp.isTemplate)
f.PrintLn(genloc__, c.cpp.tprototype, " class ", tcn, ";");
break;
case noHeadClass:
f.PrintLn(genloc__, "typedef ", tcn, "<C(", cn, "), &CO(", cn, ")> ", cn, ";");
break;
case structClass:
if(c.cpp.isTemplate)
f.PrintLn(genloc__, c.cpp.tprototype, " class ", tcn, ";");
break;
default:
break;
}
if(!contents) contents = true;
}
}
}
if(contents)
f.PrintLn("");
return contents;
}
bool cppUndefProperCaseNameUnitMacros(CPPGen g, File f)
{
bool contents = false;
BClass c;
IterAllClass itacl { itn.module = g.mod };
while((c = itacl.next(all)))
{
if(!c.skip && c.cl.type == unitClass)
{
Property cn; IterConversion conv { c.cl };
while((cn = conv.next(publicOnly)))
{
BProperty p = cn;
if(p.cConv && p.cConv.cl.type == unitClass && (p.pt.Get || !p.pt.Set))
{
f.PrintLn(genloc__, "#undef ", c.name);
if(!contents)
contents = true;
}
}
}
}
if(contents)
f.PrintLn("");
return contents;
}
#if 0
bool templateClassThings(CPPGen g, File f)
{
bool contents = false;
BClass c;
IterAllClass itacl { itn.module = g.mod };
while((c = itacl.next(all)))
{
// if((c.cl.type == normalClass/* || c.cl.type == structClass*/) && c.cl.templateArgs && !c.cl.templateClass)
if(c.cl.type == normalClass && c.cpp.isTemplate && !c.cl.templateClass)
{
f.PrintLn(genloc__, c.cpp.tprototype/*emplate*/ /* : c.cpp.templatem */, " TCPPClass<", c.cpp.tname, c.cpp.targsb, "> ",
c.cpp.tname, c.cpp.targsb, "::_cpp_class;");
if(!contents)
contents = true;
}
}
if(contents)
f.PrintLn("");
return contents;
}
#endif // 0
static void generateCPP(CPPGen g, File f)
{
Class firstClass = null;
f.PrintLn(genloc__, "#include \"", g.lib.bindingName, ".hpp\"");
/*
f.Print(ln);
f.PrintLn("#ifdef _DEBUG");
f.PrintLn("extern \"C\"");
f.PrintLn("{");
f.PrintLn(" int printf(const char *format, ...);");
f.PrintLn("}");
f.PrintLn("#endif");
*/
f.Print(ln);
{
BClass c; IterAllClass itacl { itn.module = g.mod/*module = g.mod*/ };
while((c = itacl.next(all)))
{
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString;
// bool template = hasTemplateClass(c.cl);
if(/*g_.lib.ecereCOM && */skipClasses.Find({ g_.lib.bindingName, c.cl.name }))
skip = true;
if(!skip/* && !template*/ && c.cl.type == normalClass/* && !c.cl.templateArgs*/ && !c.numTemplateArgsInName)
{
firstClass = c.cl;
f.PrintLn(genloc__, "TCPPClass<", c.cl.name, "> ", c.cl.name, "::_cpp_class;");
}
}
}
f.Print(ln);
f.PrintLn(genloc__, "int ", g.lib.bindingName /*name*/, "_cpp_init(const Module & module)"); // todo? back to void returning?
f.PrintLn(genloc__, "{");
f.PrintLn(genloc__, " if(!", firstClass.name, "::_cpp_class.impl)");
f.PrintLn(genloc__, " {");
f.PrintLn(genloc__, "#ifdef _DEBUG");
f.PrintLn(genloc__, " printf(\"%s_cpp_init\\n\", \"", g.lib.bindingName, "\");");
f.PrintLn(genloc__, "#endif");
f.Print(ln);
{
bool content = false;
BClass c; IterAllClass itacl { itn.module = g.mod/*module = g.mod*/ };
while((c = itacl.next(all)))
{
if(c.cl.type == structClass)
{
f.PrintLn(genloc__, " TStruct<", c.cpp.name, ">::_class = CO(", c.name, ");");
if(!content) content = true;
}
}
if(content)
f.Print(ln);
while((c = itacl.next(all)))
{
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString || c.cl.type == systemClass;
bool template = hasTemplateClass(c.cl);
if(g.lib.ecereCOM && skipClasses.Find({ g_.lib.bindingName, c.cl.name }))
skip = true;
if(!skip && !template && c.cl.type == normalClass)
//f.PrintLn(" REGISTER_CPP_CLASS(", c.cl.name, ", module);");
cppToFileMacroRegisterClassCPP(g, f, g.expansionOrUse, c.cl.templateArgs != null, 1, c.cl.name, "module", 0);
}
}
f.PrintLn(genloc__, " }");
f.PrintLn(genloc__, " return 0;"); // todo? back to void returning?
f.PrintLn(genloc__, "}");
//if(g.lib.ecere) // hardcoded
if(g.lib.ecereCOM) // hardcoded
{
f.Print(ln);
f.PrintLn(genloc__, "// Instance methods depending on libecere");
f.Print(genloc__, "void Instance::class_registration(CPPClass & _cpp_class)\n");
// TONOMACRO
if(g.options.expandMacros)
{
ZString z { allocType = heap };
cppMacroClassRegistration(g, z, expansion, 2, g.cInstance, g.cclass, g.cInstance, null, 0);
f.PrintLn(ln, "{");
if(z._string)
f.Puts(z._string);
f.PrintLn("}");
delete z;
}
else
f.PrintLn(genloc__, "{ Instance_class_registration(Instance); }");
//f.PrintLn("void FontResource::class_registration(CPPClass & _cpp_class) { Instance_class_registration(FontResource); }");
}
f.PrintLn(ln);
outputImplementationsContents(g, f);
}
// TODO: Get rid of this non-sense...
Map<consttstr, const String> methodParamNameSwap { [
// { { "onCompare", "object" }, "o2" },
// { { "onCopy", "newData" }, "src" },
{ { "delete", "i" }, "it" },
{ { "releaseSurface", "this" }, null },
{ { "process", "c" }, null },
{ { "createTemporaryDir", "template" }, null },
{ { "createTemporaryFile", "template" }, null },
{ { null, null }, null }
] };
/*
Map<const String, const String> methodTypedObjectThisNameSwap { [
// { "onCopy", "dest" },
{ null, null }
] };
*/
/*
static AVLTree<consttstr> brokenRegs { [
// { "Window", "M" },
{ null, null }
] };
*/
/*
static AVLTree<consttstr> brokenMethods { [
{ null, null }
] };
*/
/*
static AVLTree<const String> brokenBitMembersConstructor { [
null
] };
*/
static AVLTree<const String> brokenOrderedPublicMembersInitializers { [
// broken members initializing constructors
// broken zero value for MiddleAnchorValue // todo: fixit
"Anchor",
"NameSpace",
// eda
"Detail",
// gis
// "ECCSSEvaluator",
"Point3DFeature",
"CompactModelData",
"CenterLine",
"GeoFeaturePresentation",
"GeoView",
"GraphicalSurface",
"Line3DFeature",
"Models3DFeature",
"PointCloudFeature",
"TilingScheme",
null
] };
/*
static AVLTree<const String> brokenOrderedPublicMembersInitializersTypes { [
// broken members initializing constructors
// broken zero value for MiddleAnchorValue // todo: fixit
"OldList",
null
] };
*/
/*
static AVLTree<consttstr> brokenMembers { [
// { "C", "M" },
{ null, null }
] };
*/
struct BitMemberTypeStringZero
{
BitMember bm;
const String typeString;
const String zero;
};
static void processCppClass(CPPGen g, BClass c, BClass cRealBase)
{
bool skip = false;
if(!skip)
{
bool template = c.cpp.isTemplate; // c.cl.templateArgs != null;
int l, maxLen = 0;
//bool content = false;
//const char * lc = " \\";
bool pfx = (c.cl.type == normalClass || c.cl.type == structClass) && template;
char * cn = PrintString(pfx ? cpptemplatePrefix : "", c.cpp.name); // todo fix this
const char * tcn = c.cpp.tname;
BVariant v = c;
BNamespace n = c.nspace;
BClass cBase = c.cl.base.templateClass ? c.cl.base.templateClass : c.cl.base;
const char * un = c.upper;
MacroMode mode = g.expansionOrUse;
const char * t = template ? mode == expansion ? c.cpp.targsb : c.cpp.targsbm/*"<TPT>"*/ : "";
BOutput o { vclass, c = c, z = { allocType = heap } };
BOutput o2 = null;
BOutput o3 = null;
BOutput oT = null;
BProperty userDataProp = null;
if((c.cl.type == normalClass || c.cl.type == noHeadClass || c.cl.type == structClass || c.cl.type == bitClass || c.cl.type == unitClass || c.cl.type == enumClass) &&
!(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox)))
{
o2 = { vclass, c = c, z = { allocType = heap } };
o3 = { vclass, c = c, z = { allocType = heap } };
oT = template ? o2 : o3;
c.outSplit = o2; // end of hpp file
n.splitContents.Add(v);
c.outImplementation = o3; // cpp file
n.implementationsContents.Add(v);
}
// definitions:
if(!(g.lib.ecere && c.isDataDisplayFlags))
{
// todo tofix tocheck tmp? skip to template class name for derrivation
BMethod m; IterMethod itm { c.isInstance ? cBase.cl : c.cl };
//const char * sn = c.cSymbol;
bool baseIs_class = cBase && cBase.is_class;
bool baseIs_bool = cBase && cBase.isBool;
const char * nhbase = c.cl.type == noHeadClass && baseIs_class ? "TNHInstance" : null;
const char * bn = cBase ? cBase.name : "";
bool hasBase = cBase && cBase.cl.type != systemClass;
bool isBaseString = c.isBaseString;
c.outTypedef = o;
n.contents.Add(v);
if(hasBase)
v.processDependency(g, otypedef, otypedef, cBase.cl);
/*switch(c.cl.type)
{
case normalClass: processNormalClass(g, c, v, n, o); break;
case structClass:
case bitClass:
case unitClass:
case enumClass:
case noHeadClass:
case systemClass:
}*/
if(!c.isInstance) // temporary if
{ // copied from genPython.ec -- have a common function?
bool check1 = false;
IterMethod itm { c.cl };
// debugBreakpoint();
while(itm.next(publicVirtual))
{
if(!itm.md.dataType) ProcessMethodType(itm.md);
if(itm.md.dataType)
{
bool thisClass = itm.md.dataType.thisClass && itm.md.dataType.thisClass.string;
bool anyObject = thisClass && !strcmp(itm.md.dataType.thisClass.string, "class");
if(anyObject)
{
check1 = true; // has a method who's this-type is any_object. ex.: virtual bool any_object::DelayExpired(void);
break;
}
}
}
if(check1)
{
BProperty p; IterProperty itp { c.cl };
while((p = itp.next(publicOnly)))
{
if(p.pt.dataType.kind == pointerType && p.pt.dataType.type.kind == voidType)
{
userDataProp = p; // select the first void * type property
break;
}
}
}
}
while((m = itm.next(publicVirtual))) { m.init(itm.md, c.isInstance ? cBase : c, g); if((l = strlen(m.mname)) > maxLen) maxLen = l;}
if(pfx && c.cpp.isTemplate)
{
bool strct = c.cl.type == structClass;
o.z.concatx(ln);
o.z.concatx(genloc__, strct ? "struct " : "class ", c.cpp.name, strct ? " : Struct" : "", ln);
o.z.concatx(genspc__, "{", ln);
o.z.concatx(genspc__, "public:", ln);
o.z.concatx(genspc__, " static TCPPClass<", c.cpp.name, "> _cpp_class;", ln);
o.z.concatx(genspc__, " static void class_registration(CPPClass & _cpp_class);", ln);
o.z.concatx(genspc__, "};", ln);
}
if(c.isInstance)
{
// int maxLen = c.maxVirtualMethodNameLen + 1;
o.z.concatx(ln);
while((m = itm.next(publicVirtual)))
{
const char * cn = c.name, * bn = cBase.name, * mn = m.mname;
o.z.concatx(genloc__, "#define ", cn, "_", mn, "_vTblID", spaces(maxLen, strlen(mn)), " ", bn, "_", mn, "_vTblID", ln);
}
}
if(c.cl.type == normalClass && !(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox)))
{
// todo?: let's move this inside the REGISTER() aka class_registration method of the class being generated
cppDefineMacroClassRegistration(g, o.z, 0, c, cBase, v, 0);
o.z.concatx(ln);
cppMacroRegVirtualMethods(g, o.z, definition, 0, c, cBase, v, 0);
// if(!g.options.expandMacros)
{
cppDefineMacroClassVirtualMethods(g, o.z, true, template, 0, un, c, cBase, v, 0);
cppDefineMacroClassVirtualMethods(g, o.z, false, template, 0, un, c, cBase, v, 0);
}
}
if(c.isApplication)
{
o.z.concatx(ln);
// o.z.concatx(genloc__, "int eC_cpp_init(const Module & module);", ln); // todo? back to void returning?
o.z.concatx(genloc__, "int ecere_cpp_init(const Module & module);", ln, ln); // todo? back to void returning?
// o.z.concatx(genloc__, "extern ", g.sym.module, " theEcereModule;", ln);
}
if(c.cl.type == noHeadClass)
o.z.concatx(ln, genloc__, cpptemplateNoHeadDef);
else if((c.cl.type == normalClass || c.cl.type == structClass) && c.cpp.isTemplate)
{
o.z.concatx(ln, genloc__, c.cpp.template);
// o.z.concatx(ln, genloc__, '/', '*');
// outTemplateParams(o.z, c);
// o.z.concatx(ln, genloc__, '*', '/');
}
if(false/* todo: comment switch */)
o.z.concatx(ln, genloc__, "// (", bclassToSimpleClassTypeString(c), ":", bclassToSimpleClassTypeString(cBase),
cBase.cl.type == systemClass ? "|" : "", cBase.cl.type == systemClass ? cBase.cl.name : "", ")");
o.z.concatx(ln, genloc__);
if(c.cl.type == enumClass)
o.z.concat("enum ");
if(c.cl.type == structClass && !c.cpp.isTemplate)
o.z.concat("struct ");
else
o.z.concat("class ");
if(c.cl.type == unitClass)
{
// difficult logic of weather a macro exists to clash with C++ class name
// from genC.ec: c.cl.type == unitClass && p.cConv && p.cConv.cl.type == unitClass
// hardcoded list for now:
/*
if(c.cl.type == unitClass && (
!strcmp(c.name, "Centimeters") ||
!strcmp(c.name, "Degrees") ||
!strcmp(c.name, "Radians") ||
false))
o.z.concat("C");
*/
}
// else if(c.cl.type == noHeadClass/* || (c.cl.type == normalClass && c.cpp.isTemplate)*/)
// o.z.concat(cpptemplatePrefix);
o.z.concat(tcn);
if(!(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox)))
{
const char * baseClass = isBaseString ? "Instance" : nhbase ? nhbase : bn;
bool cmi = (c.cpp.isTemplate && c.cl.type != noHeadClass) || (classTypeIsTemplatable(c.cl.base.type) && c.cl.base.templateArgs)/*() || (c.cl.type == noHeadClass && !nhbase)*/;
bool pfx = cBase.cpp.isTemplate || (c.cl.type == noHeadClass && !nhbase);
bool sfx = cBase.cpp.isTemplate;
char * baseClassString = PrintString(pfx ? cpptemplatePrefix : "", baseClass, nhbase ? cpptemplateNoHeadParams : "", sfx ? /*mode == expansion ? */c.cpp.targsb/* : c.cpp.targsbm*/ : ""); // todo: fix this
const char * gbaseClass = isBaseString ? "Instance" : nhbase ? nhbase : bn;
char * gbaseClassString = PrintString(pfx ? cpptemplatePrefix : "", gbaseClass, sfx ? c.cpp.targsb : "");
// todo: fix these warnings, use the right local vars obtain using the correct function(s)
if(strcmp(baseClass, gbaseClassString) && !(!strcmp(c.name, "AVLTree") || !strcmp(c.name, "Array") || !strcmp(c.name, "CustomAVLTree") ||
!strcmp(c.name, "HashMap") || !strcmp(c.name, "HashMapIterator") || !strcmp(c.name, "HashTable") || !strcmp(c.name, "Link") ||
!strcmp(c.name, "LinkList") || !strcmp(c.name, "List") || !strcmp(c.name, "ListItem") || !strcmp(c.name, "Map") || !strcmp(c.name, "MapIterator") ||
!strcmp(c.name, "CompiledDefaultShader") || !strcmp(c.name, "FreeBlockMap") || !strcmp(c.name, "GLMB") || !strcmp(c.name, "Cube") || !strcmp(c.name, "SkyBox") ||
!strcmp(c.name, "Sphere") || !strcmp(c.name, "CMSSExpArray") || !strcmp(c.name, "CMSSExpBrackets") || !strcmp(c.name, "CMSSExpCall") || !strcmp(c.name, "CMSSExpConditional") ||
!strcmp(c.name, "CMSSExpConstant") || !strcmp(c.name, "CMSSExpIdentifier") || !strcmp(c.name, "CMSSExpIndex") || !strcmp(c.name, "CMSSExpInstance") ||
!strcmp(c.name, "CMSSExpList") || !strcmp(c.name, "CMSSExpMember") || !strcmp(c.name, "CMSSExpOperation") || !strcmp(c.name, "CMSSExpString") ||
!strcmp(c.name, "CMSSExpression") || !strcmp(c.name, "CMSSIdentifier") || !strcmp(c.name, "CMSSInstInitList") || !strcmp(c.name, "CMSSInstantiation") ||
!strcmp(c.name, "CMSSList") || !strcmp(c.name, "CMSSMemberInit") || !strcmp(c.name, "CMSSMemberInitList") || !strcmp(c.name, "CMSSNode") || !strcmp(c.name, "CMSSSpecName") ||
!strcmp(c.name, "CompactVectorFeatures") || !strcmp(c.name, "CompiledAtmosphereShader") || !strcmp(c.name, "CompiledButterburShader") || !strcmp(c.name, "CompiledCoverageShader") ||
!strcmp(c.name, "EndOccurrence2") || !strcmp(c.name, "FeatureCollection") || !strcmp(c.name, "GeoSymbolizer") || !strcmp(c.name, "ImageStyle") || !strcmp(c.name, "SelectorList") ||
!strcmp(c.name, "ShapeStyle") || !strcmp(c.name, "StylesList") || !strcmp(c.name, "StylingRuleBlock") || !strcmp(c.name, "StylingRuleBlockList") ||
!strcmp(c.name, "StylingRuleSelector") || !strcmp(c.name, "TextStyle"))) debugBreakpoint();
if(gbaseClassString)
; // warning supression
if(c.cl.type == structClass) // todo: fix templated struct gen? right now they are 'class' in cpp and don't derrive from anything. they should become 'struct' ?
{
bool tt = cmi && c.cpp.isTemplate;
if(tt)
o.z.concatx(" : ", c.cpp.name);
else
o.z.concatx(" : public TStruct<", c.cpp.name, ">");
}
else if(c.cl.type == enumClass)
{
const char * typeString = tokenTypeString(c.cl.dataType);
o.z.concatx(" : ", typeString);
// if(c.cl.base && c.cl.base.type != systemClass)
{
// o.z.concatx(" : std::underlying_type_t<", c.cSymbol, ">");
/*
if(cBase.cl.type != systemClass && !cBase.isBool)
v.processDependency(g, otypedef, otypedef, cBase.cl);
*/
}
}
else if(((cBase && cBase.cl.type != systemClass && !cBase.isBool) || c.cl.type == noHeadClass) && !(c.cl.type == bitClass && cBase.cl.type == enumClass))
{
bool tt = cmi && c.cpp.isTemplate;
o.z.concatx(" : public ", baseClassString, tt ? ", " : "", tt ? "public " : "", tt ? c.cpp.name : "");
if(c.cl.type == structClass && c.cl.templateArgs && !cmi)
o.z.concatx(c.cpp.targsb);
if(cBase.cl.type != systemClass)
v.processDependency(g, otypedef, otypedef, cBase.cl);
}
// o.z.concatx(" // ", bclassToSimpleClassTypeString(c));
o.z.concatx(ln, genloc__, "{");
if(c.cl.type != enumClass)
o.z.concatx(ln, genloc__, "public:", ln);
if(c.cl.type == noHeadClass)
{
// o.z.concatx(c.cl.type == noHeadClass ? cpptemplatePrefix : "", cn, "(TC * _impl) { ", baseClassString, "<TC, TCO>::impl = _impl; }"); // if PRE-CPP11
o.z.concatx(genloc__, indents(1), "using ", baseClassString, "::", nhbase ? nhbase : cBase.cpp.tname, ";", ln);
}
else if(c.cl.type == bitClass)
{
if(!(c.cl.base && c.cl.base.type == bitClass) && !(baseIs_class || baseIs_bool))
Print("");
if(!(c.cl.base && c.cl.base.type == bitClass))
o.z.concatx(genloc__, indents(1), c.cSymbol, " impl;", ln);
if(cBase.is_class || cBase.isBool || cBase.cl.type == enumClass)
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "() : impl(0) { }", ln);
else
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "() : ", cBase.name, "() { }", ln);
// todo enum constructor is enum derrives from this class
{
bool contents = false;
BClass c2; IterAllClass itacl { itn.module = g.mod };
while((c2 = itacl.next(all)))
{
if(c2.cl.type == enumClass && c2.cl.base == c)
{
if(!contents)
o.z.concatx(ln);
if(!(c.cl.base && c.cl.base.type == bitClass))
o.z.concatx(genloc__, indents(1), c.cpp.name, "(", c2.cpp.name, " impl) : impl((", c.cSymbol, ")impl) { }", ln);
else
o.z.concatx(genloc__, indents(1), c.name, "(", c2.cpp.name, " impl) : ", cBase.cpp.name, "((", cBase.cSymbol, ")impl) { }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " & operator =(", c2.cpp.name, " impl) { this->impl = (", c.cSymbol, ")impl; return *this; }", ln);
if(!contents)
contents = true;
}
}
if(contents)
o.z.concatx(ln);
// return contents;
}
if(!(c.cl.base && c.cl.base.type == bitClass))
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "(", c.cSymbol, " impl) : impl(impl) { }", ln);
else
o.z.concatx(genloc__, indents(1), c.cpp.name, "(", c.cSymbol, " impl) : ", cBase.cpp.name, "((", cBase.cSymbol, ")impl) { }", ln);
genBitMembersConstructor(g, c, v, true, o, null);
o.z.concatx(genloc__, indents(1), "operator ", c.cSymbol, "() { return impl; }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " & operator =(", c.cSymbol, " impl) { impl = impl; return *this; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator ==(const ", c.cpp.name, " & value) const { return impl == value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator !=(const ", c.cpp.name, " & value) const { return impl != value.impl; }", ln);
}
else if(c.cl.type == structClass)
{
// if(!(c.cl.base && c.cl.base.type == bitClass))
{
o.z.concatx(genloc__, indents(1), c.cSymbol, " impl;", ln);
o.z.concatx(genloc__, indents(1), "constexpr ", cn, "() : impl({}) { }", ln);
o.z.concatx(genloc__, indents(1), "constexpr ", cn, "(const ", c.cSymbol, " impl) : impl(impl) { }", ln);
}
// else
{
}
}
else if(c.cl.type == unitClass)
{
if(cBase.is_class)
o.z.concatx(genloc__, indents(1), c.cSymbol, " impl;", ln);
genConstructorsOperatorsForUnitClass(c, cBase, o, o2);
}
else if(c.cl.type == enumClass)
cppGenEnumClassValues(g, o, c);
if(c.cl.type == structClass || c.cl.type == bitClass || c.cl.type == unitClass || c.cl.type == enumClass || c.cl.type == noHeadClass || c.cl.type == normalClass)
{
bool ptrThis = c.cl.type == structClass;
// conversions via constructors or operators
genConstructorsOperatorsForClassOwnConversionProperties(g, c, cBase, ptrThis, o, o2);
if(c.cl.type != normalClass)
genConstructorsOperatorsForOtherClassesConversionProperties(g, c, ptrThis, o, o2);
}
if(c.isInstance)
{
cppHardcodedInstancePart1(o);
// note: this is a hard coded cppMacroClassVirtualMethods use
// TONOMACRO
// o.z.concatx(" INSTANCE_VIRTUAL_METHODS(Instance);", ln, ln);
cppMacroClassVirtualMethods(g, o.z, configuration, true, template, false, 1, un, cn, c, cBase, v, 0);
cppHardcodedInstancePart2(o);
}
else if(c.cl.type == normalClass)
{
cppMacroConstructClass(g, o.z, mode, template, 1, c.name, /*baseClass*/gbaseClassString, t, userDataProp, 0);
// if(mode != expansion)
{
if(c.isApplication)
{
o.z.concatx(ln, genloc__, " {", ln);
o.z.concatx(genloc__, " eC_cpp_init(*this);", ln);
o.z.concatx(genloc__, "#if !defined(ECERECOM_ONLY)", ln);
o.z.concatx(genloc__, " ecere_init(impl);", ln);
o.z.concatx(genloc__, " ecere_cpp_init(*this);", ln);
o.z.concatx(genloc__, "#endif", ln);
// if(c.isGuiApplication)
// o.z.concatx(genloc__, " ecere_cpp_init(*this);", ln);
o.z.concatx(genloc__, " INSTANCEL(impl, impl->_class) = this;", ln);
o.z.concatx(genloc__, " mustFree = true;", ln);
o.z.concatx(genloc__, " incref(impl);", ln);
o.z.concatx(genloc__, " vTbl = _cpp_class.vTbl;", ln);
o.z.concatx(genloc__, " __thisModule = impl;", ln);
o.z.concatx(genloc__, " }", ln);
o.z.concatx(genloc__, " ~Application()", ln);
o.z.concatx(genloc__, " {", ln);
o.z.concatx(genloc__, " Instance_decRef(impl);", ln);
o.z.concatx(genloc__, " }", ln);
}
else if(c.isGuiApplication)
{
o.z.concatx(ln, genloc__, indents(1), "{", ln);
// o.z.concatx(genloc__, " { }", ln);
o.z.concatx(genloc__, indents(2), "EVOLVE_APP(GuiApplication, *this);", ln);
o.z.concatx(genloc__, "#ifdef MODULE_NAME", ln);
o.z.concatx(genloc__, indents(2), "loadTranslatedStrings(null, MODULE_NAME);", ln);
o.z.concatx(genloc__, "#endif", ln);
o.z.concatx(genloc__, indents(1), "}", ln);
}
else
o.z.concatx(" { }", ln);
if(c.isContainer)
{
Class clDep = eSystem_FindClass(g_.mod, "IteratorPointer");
o.z.concatx(ln);
cppHardcodedContainer(o, c);
v.processDependency(g, otypedef, otypedef, clDep);
}
}
}
if(c.cl.type == noHeadClass && !nhbase)
o.z.concatx(genloc__, indents(1), "inline operator ", bn, "& () const { return *(", bn, " *)this; }", ln);
if(!c.isInstance && !c.isModule && !hasOrBaseHasTemplateClass(c.cl) && c.cl.type != enumClass)
genMethodCallers(g, c, v, cn, true, o);
if(c.cl.type == normalClass && !c.isInstance)
{
// tclean remove next 2 lines
// note: this is a hardcoded cppMacroClassVirtualMethods use
//o.z.concatx(genloc__, indents(1), un, "_VIRTUAL_METHODS(", c.name, ")", ln);
o.z.concatx(ln);
cppMacroClassVirtualMethods(g, o.z, configuration, true, template, false, 1, un, c.name, c, cBase, v, 0);
}
if(c.cl.type == normalClass && !c.isInstance && !c.isModule)
{
//o.z.concatx(ln, genloc__, indents(0));
//cppMacroClassRegister(g, o.z, mode, 1, 0);
//o.z.concatx(" { }", ln);
/*
if(mode == expansion)
o.z.concatx(ln, genloc__, indents(0));
else o.z.concatx(" ");
o.z.concatx("{");
if(mode == expansion)
o.z.concatx(ln, genloc__, indents(0));
else o.z.concatx(" ");
cppMacroClassRegistration(g, o.z, mode, 1, c, cBase, 0);
if(mode == expansion)
o.z.concatx(ln, genloc__, indents(0));
else o.z.concatx(" ");
o.z.concatx("}", ln);*/
// o.z.concatx(" CONSTRUCT(", cn, ", ", bn, ") { }", ln);
// Class Registration
// o.z.concatx(" REGISTER() { ", cn, "_class_registration(", cn, ");", " }", ln);
cppMacroClassRegister(g, o.z, mode, true/*mode == expansion*/,
c && c.cl.type == normalClass && c.cpp.isTemplate/* && c.numTemplateArgsInName*//*c.cl.templateArgs*/, false, 1, c.cpp.name,
/*c.numTemplateArgsInName ? */mode == expansion ? c.cpp.template : c.cpp.templatem/* : ""*/,
/*c.numTemplateArgsInName ? */mode == expansion ? c.cpp.targsb : c.cpp.targsbm/* : ""*/, 0);
//o.z.concatx(" { ", cn, "_class_registration(", cn, ");", " }", ln);
/*if(mode == expansion)
; // o.z.concatx(genloc__, indents(1), "{", ln);
else
o.z.concat(" { ");*/
//if(!g.options.expandMacros)
// o.z.concatx(genloc__, indents(3), cn, "_class_registration(", cn, ");", ln);
//else
//cppMacroClassRegistration(g, o.z, expansion);
/*if(mode != expansion)
cppMacroClassRegistration(g, o.z, configuration, 2, c, cBase, c, 0);
if(mode == expansion)
; // o.z.concatx(genloc__, indents(1), "}", ln);
else
o.z.concatx("; }", ln);*/
}
if(!c.isContainer && c.cpp.isTemplate && eClass_IsDerived(c.cl, eSystem_FindClass(g.mod, "Container")))
genConstructorsInitializerList(o, c);
if((c.cl.type == structClass || (c.cl.type == normalClass && !c.isInstance && !c.isModule)) && !hasOrBaseHasTemplateClass(c.cl) &&
!brokenOrderedPublicMembersInitializers.Find(c.cl.name) &&
true)
genOrderedPublicMembersInitializers(g, c, v, cn, o, o2);
if(userDataProp)
{
o.z.concatx(ln);
o.z.concatx(genloc__, "private:", ln);
o.z.concatx(genloc__, indents(1), "void * _", userDataProp.name, ";", ln);
o.z.concatx(genloc__, "public:", ln);
}
if(c.cl.type == noHeadClass)
{
String tn = PrintString(tcn, "<TC, TCO>");
processProperties(g, c, null, c.cpp.name, tn, true, o);
processDataMembers(g, c, v, c.cpp.name, true, o);
delete tn;
}
else if(!c.isInstance && !c.isModule && c.cl.type != enumClass)
{
processProperties(g, c, null, c.cpp.name, cn, true, o);
processDataMembers(g, c, v, c.cpp.name, true, o);
}
if(c.cl.type == noHeadClass)
{
o.z.concatx(genloc__, " ~", tcn, "()", ln);
o.z.concatx(genloc__, " {", ln);
o.z.concatx(genloc__, " this->impl = null; // How to know not to delete?", ln);
o.z.concatx(genloc__, " }", ln);
}
o.z.concatx(genloc__, "}");
delete baseClassString;
}
o.z.concatx(";");
o.z.concatx(ln);
if(c.isInstance)
{
o.z.concatx(ln);
cppHardcodedCoreAfterInstancePart(g, o, configuration, true, template, un, c.name, c, cBase, v);
}
}
// implementations:
{
// if(!(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox)))
if((c.cl.type == normalClass || c.cl.type == noHeadClass || c.cl.type == structClass || c.cl.type == bitClass) &&
!(g.lib.ecereCOM && (c.isSurface || /*c.isIOChannel || */c.isWindow || c.isDataBox)))
{
bool template = c && c.cl.type == normalClass && c.cpp.isTemplate/* && c.numTemplateArgsInName*//*c.cl.templateArgs*/;
if(!c.isInstance) // todo: remove this if, keep the next line
o2.z.concatx(ln);
if(c.cl.type == normalClass)
cppMacroClassVirtualMethods(g, o2.z, configuration, false, template, false, 0, un, c.name, c, cBase, v, 0);
if(c.cl.type == normalClass && !c.isInstance && !c.isModule)
{
// if(mode == expansion)
if(template)
{
bool skip = c.isBool || c.isByte || c.isCharPtr || c.isUnInt || c.isUnichar || c.is_class || c.isString;
if(/*g_.lib.ecereCOM && */skipClasses.Find({ g_.lib.bindingName, c.cl.name }))
skip = true;
if(!skip/* && !template*/ && c.cl.type == normalClass/* && !c.cl.templateArgs*/ && !c.numTemplateArgsInName)
{
// o2.z.concatx(genloc__, "TCPPClass<", c.cl.name, "> ", c.cl.name, "::_cpp_class;");
o2.z.concatx(genloc__, mode == expansion ? c.cpp.tprototype : c.cpp.tprototype/*m*/,
" TCPPClass<", c.cpp.tname, mode == expansion ? c.cpp.targsb : c.cpp.targsbm, "> ",
c.cpp.tname, mode == expansion ? c.cpp.targsb : c.cpp.targsbm, "::_cpp_class;", ln, ln);
// template <typename TP_T> TCPPClass<TArray<TP_T>> TArray<TP_T>::_cpp_class;
// debugBreakpoint();
}
cppMacroClassRegister(g, o3.z, mode, false,
false, false, 0, c.cpp.name,
"",
"", 0);
o3.z.concatx(genloc__, "{", ln);
// cppMacroClassRegistration(g, o3.z, configuration, 2, c, cBase, c, 0);
o3.z.concatx(genloc__, "}", ln);
}
{
cppMacroClassRegister(g, oT.z, mode, false,
template, false, 0, c.cpp.name,
template ? mode == expansion ? c.cpp.tprototype : c.cpp.tprototype/*m*/ : "",
template ? mode == expansion ? c.cpp.targsb : c.cpp.targsbm : "", 0);
oT.z.concatx(genloc__, "{", ln);
cppMacroClassRegistration(g, oT.z, configuration, 2, c, cBase, c, userDataProp, 0);
oT.z.concatx(genloc__, "}", ln);
}
}
if(!c.isInstance && !c.isModule && !hasOrBaseHasTemplateClass(c.cl) && c.cl.type != enumClass)
genMethodCallers(g, c, v, cn, false, o2);
if(c.cl.type == bitClass)
genBitMembersConstructor(g, c, v, false, o2, o3);
// todo?: properties and data member for nohead classes
if(c.isInstance)
{
o.z.concatx(ln);
cppHardcodedCoreAfterInstancePart(g, o, configuration, false, template, un, c.name, c, cBase, v);
}
else if(c.cl.type == noHeadClass)
{
String tn = PrintString(tcn, "<TC, TCO>");
processProperties(g, c, userDataProp, c.cpp.name, tn, false, o2);
processDataMembers(g, c, v, c.cpp.name, false, o2);
delete tn;
}
else if(!c.isModule && c.cl.type != enumClass)
{
processProperties(g, c, userDataProp, c.cpp.name, cn, false, o2);
processDataMembers(g, c, v, c.cpp.name, false, o2);
}
}
}
delete cn;
}
}
void genConstructorsInitializerList(BOutput o, BClass c)
{
o.z.concatx(ln);
o.z.concatx(genloc__, " ", c.cpp.tname, c.cpp.targsb, " (std::initializer_list<", c.cpp.templateParamNames[0], "> list) : ", c.cpp.tname, c.cpp.targsb, " ()", ln);
o.z.concatx(genloc__, " {", ln);
o.z.concatx(genloc__, " typename std::initializer_list<", c.cpp.templateParamNames[0], ">::iterator it;", ln);
o.z.concatx(genloc__, " for(it = list.begin(); it != list.end(); ++it)", ln);
o.z.concatx(genloc__, " this->add(*it);", ln);
o.z.concatx(genloc__, " }", ln, ln);
o.z.concatx(genloc__, " ", c.cpp.tname, c.cpp.targsb, " & operator =(std::initializer_list<", c.cpp.templateParamNames[0], "> list)", ln);
o.z.concatx(genloc__, " {", ln);
o.z.concatx(genloc__, " typename std::initializer_list<", c.cpp.templateParamNames[0], ">::iterator it;", ln);
o.z.concatx(genloc__, " for(it = list.begin(); it != list.end(); ++it)", ln);
o.z.concatx(genloc__, " this->add(*it);", ln);
o.z.concatx(genloc__, " return *this;", ln);
o.z.concatx(genloc__, " }", ln);
}
static void genConstructorsOperatorsForUnitClass(BClass c, BClass cBase, BOutput o, BOutput o2)
{
if(cBase.is_class)
{
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "() : impl(0) { }", ln);
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "(", c.cSymbol, " value) : impl(value) { }", ln);
o.z.concatx(genloc__, indents(1), "operator ", c.cSymbol, "() const { return impl; }", ln);
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "(const ", c.cpp.name, " & value) : impl(value.impl) { }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " & operator =(", c.cl.dataTypeString, " value) { impl = value; return *this; }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " & operator +=(", c.cpp.name, " value) { impl += value.impl; return *this; }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " & operator -=(", c.cpp.name, " value) { impl -= value.impl; return *this; }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " operator +(const ", c.cpp.name, " & b) const { return ", c.cpp.name, "(impl + b.impl); }", ln);
o.z.concatx(genloc__, indents(1), c.cpp.name, " operator -(const ", c.cpp.name, " & b) const { return ", c.cpp.name, "(impl - b.impl); }", ln);
}
else
{
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "() : ", cBase.name, "() { }", ln);
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "(const ", cBase.name, " value) : ", cBase.name, "(value) { }", ln);
// todo: missing constructors if unit class derived more than once?
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, "(", c.cl.dataTypeString, " value) : ",
cBase.name, "(", c.upper, "(value)) { }", ln);
o.z.concatx(genloc__, indents(1), "constexpr operator ", c.cl.dataTypeString, "() const { return ", cBase.name, "_in_", c.name, "(impl); }", ln);
o.z.concatx(genloc__, indents(1), "constexpr ", c.cpp.name, " & operator =(", c.cl.dataTypeString, " value) { impl = ", c.upper, "(value); return *this; }", ln);
}
o.z.concatx(genloc__, indents(1), "bool operator ==(const ", c.cpp.name, " & value) const { return impl == value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator !=(const ", c.cpp.name, " & value) const { return impl != value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator <(const ", c.cpp.name, " & value) const { return impl < value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator >(const ", c.cpp.name, " & value) const { return impl > value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator <=(const ", c.cpp.name, " & value) const { return impl <= value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator >=(const ", c.cpp.name, " & value) const { return impl >= value.impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator ==(", c.spec, " value) const { return impl == ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator !=(", c.spec, " value) const { return impl != ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator <(", c.spec, " value) const { return impl < ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator >(", c.spec, " value) const { return impl > ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator <=(", c.spec, " value) const { return impl <= ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator >=(", c.spec, " value) const { return impl >= ", c.cpp.name, "(value).impl; }", ln);
if(!strcmp(c.spec, "double") || !strcmp(c.spec, "float"))
{
o.z.concatx(genloc__, indents(1), "bool operator ==(int value) const { return impl == ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator !=(int value) const { return impl != ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator <(int value) const { return impl < ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator >(int value) const { return impl > ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator <=(int value) const { return impl <= ", c.cpp.name, "(value).impl; }", ln);
o.z.concatx(genloc__, indents(1), "bool operator >=(int value) const { return impl >= ", c.cpp.name, "(value).impl; }", ln);
}
}
static void genConstructorsOperatorsForClassOwnConversionProperties(CPPGen g, BClass c, BClass cBase, bool ptrThis, BOutput o, BOutput o2)
{
Property cn; IterConversion conv { c.cl };
while((cn = conv.next(publicOnly)))
{
BProperty p = cn;
if(p.cConv && (!p.cConv.isString || !strcmp(c.cl.name, "ZString")) && p.cConv.cl && p.cConv.cl != c.cl.base)
{
bool ptrThat = p.cConv.cl.type == structClass;
bool numeric = !ptrThis && !ptrThat && !p.cConv.isString;
const char * constexpr = numeric && !p.cConv.isString ? "constexpr " : "";
const char * typeName = p.cConv.isString ? "constString" : p.cConv.cpp.name;
switch(p.cConv.cl.type)
{
case normalClass:
if(p.cConv.isString) break;
case noHeadClass:
case unionClass:
case systemClass:
continue;
case structClass:
case bitClass:
case unitClass:
case enumClass:
break;
}
o2.z.concatx(genloc__, "// A (", bclassToSimpleClassTypeString(c), ":", bclassToSimpleClassTypeString(p.cConv), ")", ln); // , subType[0] ? "|" : "", subType
if(p.pt.Get)
{
o.z.concatx(genloc__, indents(1), "inline ", constexpr, "operator ", typeName, "() const;", ln);
o2.z.concatx(genloc__, indents(0), "inline ", constexpr, c.cpp.name, "::operator ", typeName, "() const ", "{ ");
if(numeric || p.cConv.isString)
{
o2.z.concat("return ");
if(p.cConv.isString)
o2.z.concat("(constString)");
else
o2.z.concatx(p.cConv.cpp.name, "(");
}
if(!numeric || p.cConv.isString)
{
if(!p.cConv.isString)
o2.z.concatx(typeName, " ", p.cConv.simplestIdentName, ptrThat ? "; " : " = ");
o2.z.concatx(p.fpnGet/*c.name, "_to_", p.cConv.name*/, "(");
}
o2.z.concatx(ptrThis ? "&" : "", "impl");
if(ptrThat)
o2.z.concatx(", ", ptrThat ? "&" : "", p.cConv.simplestIdentName, ".impl");
o2.z.concat(");");
if(!numeric && !p.cConv.isString)
o2.z.concatx(" return ", p.cConv.simplestIdentName, ";");
o2.z.concatx(" }", ln);
}
if(p.pt.Set)
{
bool amp = !p.cConv.isString;
const char * typeName2 = p.cConv.isString ? "char *" : p.cConv.cpp.name;
// const char * implOrBase = numeric && cBase.cl.type == unitClass ? cBase.cpp.name : "impl";
const char * implOrBase = numeric && !cBase.is_class ? cBase.cpp.name : p.cConv.isString ? c.cpp.name: "impl";
o.z.concatx(genloc__, indents(1), "inline ", constexpr, c.cpp.name, "(const ", typeName2, " ", amp ? "& " : "", p.cConv.simplestIdentName, ");", ln);
o2.z.concatx(genloc__, indents(0), "inline ", constexpr, c.cpp.name, "::", c.cpp.name, "(const ", typeName2, " ", amp ? "& " : "", p.cConv.simplestIdentName, ") ");
if(numeric || p.cConv.isString)
o2.z.concat(": ");
else
{
o2.z.concat("{ ");
o2.z.concatx(p.fpnSet/*c.name, "_from_", p.cConv.name*/, "(");
}
// else
// o2.z.concatx(p.cConv.cpp.name, "(");
if(ptrThis || numeric || p.cConv.isString)
o2.z.concatx(ptrThis ? "&" : "", implOrBase, !numeric && !p.cConv.isString ? ", " : "");
if(numeric || p.cConv.isString)
o2.z.concat("(");
if(p.cConv.isString)
o2.z.concatx(")");
else
o2.z.concatx(ptrThat ? "&" : "", p.cConv.simplestIdentName, ".impl)");
if(!numeric && !p.cConv.isString)
o2.z.concat("; ");
else
o2.z.concat(" { ");
if(p.cConv.isString)
o2.z.concatx("impl = ", p.fpnSet, "((const ", p.cConv.cpp.name, ")", p.cConv.simplestIdentName, "); ");
o2.z.concatx("}", ln);
o.z.concatx(genloc__, indents(1), "inline ", constexpr, c.cpp.name, " & operator =(", amp ? "const " : "", typeName, " ", amp ? "& " : "", p.cConv.simplestIdentName, ");", ln);
o2.z.concatx(genloc__, indents(0), "inline ", constexpr, c.cpp.name, " & ", c.cpp.name, "::operator =(", amp ? "const " : "", typeName, " ", amp ? "& " : "", p.cConv.simplestIdentName, ") ", "{ ");
if(!numeric)
o2.z.concatx(p.fpnSet/*c.name, "_from_", p.cConv.name*/, "(");
if(ptrThis || numeric)
o2.z.concatx(ptrThis ? "&" : "", "impl", !numeric ? ", " : "");
if(numeric)
o2.z.concat(" = ");
o2.z.concatx(ptrThat ? "&" : "", p.cConv.isString ? "(const C(String))" : "", p.cConv.simplestIdentName, amp ? ".impl" : "", !numeric ? ")" : "", "; return *this; }", ln);
}
}
else if(false && p.typeConv && !strcmp(c.cl.name, "ZString"))
{
bool charPtr = p.typeConv.kind == pointerType && p.typeConv.type.kind == charType;
bool ptrThat = false;
bool numeric = !ptrThis && !ptrThat;
const char * constexpr = numeric && !charPtr ? "constexpr " : "";
char * typeName = charPtr ? CopyString("constString") : printType(p.typeConv, true, false, true);
if(p.pt.Get)
{
o.z.concatx(genloc__, indents(1), "inline ", constexpr, "operator ", typeName, "() const;", ln);
o2.z.concatx(genloc__, indents(0), "/* inline ", constexpr, c.cpp.name, "::operator ", typeName, "() const ", "{ ");
if(numeric)
{
o2.z.concatx("return ");
o2.z.concatx(typeName, "(");
}
else
{
o2.z.concatx(typeName, " ", "value", ptrThat ? "; " : " = ");
o2.z.concatx(p.fpnGet/*c.name, "_to_", p.name*/, "(");
}
o2.z.concatx(ptrThis ? "&" : "", "impl");
if(ptrThat)
o2.z.concatx(", ", ptrThat ? "&" : "", "value", ".impl");
o2.z.concatx(");");
if(!numeric)
o2.z.concatx(" return ", "value", ";");
o2.z.concatx(" } */", ln);
}
if(p.pt.Set)
{
// const char * implOrBase = numeric && cBase.cl.type == unitClass ? cBase.cpp.name : "impl";
const char * implOrBase = numeric && !cBase.is_class ? cBase.cpp.name : "impl";
o.z.concatx(genloc__, indents(1), "inline ", constexpr, c.cpp.name, "(const ", typeName, " "/*, " & "*/, "value", ");", ln);
o2.z.concatx(genloc__, indents(0), "/* inline ", constexpr, c.cpp.name, "::", c.cpp.name, "(const ", typeName, " "/*, " & "*/, "value", ") ");
if(numeric)
o2.z.concatx(": ");
else
{
o2.z.concatx("{ ");
o2.z.concatx(p.fpnSet/*c.name, "_from_", p.name*/, "(");
}
if(ptrThis || numeric)
o2.z.concatx(ptrThis ? "&" : "", implOrBase, !numeric ? ", " : "");
if(numeric)
o2.z.concatx("(");
o2.z.concatx(ptrThat ? "&" : "", "V", ".impl)");
if(!numeric)
o2.z.concatx("; ");
else
o2.z.concatx(" { ");
o2.z.concatx("} */", ln);
o.z.concatx(genloc__, indents(1), "inline ", constexpr, c.cpp.name, " & operator =(const ", typeName, " "/*, " & "*/, "value", ");", ln);
o2.z.concatx(genloc__, indents(0), "/* inline ", constexpr, c.cpp.name, " & ", c.cpp.name, "::operator =(const ", typeName, " "/*, " & "*/, "value", ") ", "{ ");
if(!numeric)
o2.z.concatx(p.fpnSet/*c.name, "_from_", p.name*/, "(");
if(ptrThis || numeric)
o2.z.concatx(ptrThis ? "&" : "", "impl", !numeric ? ", " : "");
if(numeric)
o2.z.concatx(" = ");
o2.z.concatx(ptrThat ? "&" : "", "value", ".impl", !numeric ? ")" : "", "; return *this; } */", ln);
}
delete typeName;
}
}
}
static void genConstructorsOperatorsForOtherClassesConversionProperties(CPPGen g, BClass c, bool ptrThis, BOutput o, BOutput o2)
{
BClass c2; IterAllClass itacl { itn.module = g.mod };
while((c2 = itacl.next(all)))
{
if(c2 != c)
{
Property cn; IterConversion conv { c2.cl };
while((cn = conv.next(publicOnly)))
{
BProperty p = cn;
if(p.cConv && p.cConv.cl == c.cl)
{
bool ptrThat = c2.cl.type == structClass;
switch(c2.cl.type)
{
case normalClass:
case noHeadClass:
case unionClass:
case systemClass:
case structClass: // tocheck
continue;
case bitClass:
case unitClass:
case enumClass:
break;
}
o2.z.concatx(genloc__, "// B (", bclassToSimpleClassTypeString(c), ":", bclassToSimpleClassTypeString(c2), ")", ln); // , subType[0] ? "|" : "", subType
// todo: see if we can generalize more like genSetConversionOperator which is currently only used once
if(p.pt.Get)
{
o.z.concatx(genloc__, indents(1), "inline ", c.cpp.name, " ", ptrThis ? "& " : "", "operator= (", c2.cpp.name, " value);", ln);
o2.z.concatx(genloc__, indents(0), "inline ", c.cpp.name, " ", ptrThis ? "& " : "", c.cpp.name, "::", "operator= (", c2.cpp.name, " value) ", "{ ");
if(!ptrThis)
o2.z.concatx("return ");
o2.z.concatx(p.fpnGet/*c2.name, "_to_", c.name*/, "(value.impl"); // todo: turn these comments into asserts
if(ptrThis)
o2.z.concatx(", ", ptrThis ? "&" : "", "impl");
o2.z.concatx(");");
if(ptrThis)
o2.z.concatx(" return *this;");
o2.z.concatx(" }", ln);
o.z.concatx(genloc__, indents(1), "inline ", c.cpp.name, "(", c2.cpp.name, " value);", ln);
o2.z.concatx(genloc__, indents(0), "inline ", c.cpp.name, "::", c.cpp.name, "(", c2.cpp.name, " value) ",
"{ ", p.fpnGet/*c2.name, "_to_", c.name*/, "(value.impl"); // (continued) would use a CompareString function similar to PrintString but without all the allocation
if(ptrThis) // int CompareString(const char * str, ...); // typed var args like PrintString
o2.z.concatx(", ", ptrThis ? "&" : "", "impl"); // just compare the varargs to the string -- this use case is primarily for debug assertion
o2.z.concatx("); }", ln);
}
if(p.pt.Set)
{
genSetConversionOperator(p, c, ptrThis, c2, ptrThat, false, o.z, o2.z);
// do we need more here?
}
// C++ doesn't guess conversion chains, so we need explicit conversion from enums who's base class is this c2 bitclass here...
// tocheck: no longer just enum, no longer just bitclass?
{
BClass c3; IterAllClass itacl { itn.module = g.mod };
while((c3 = itacl.next(all)))
{
// bool ptrThat = c3.cl.type == structClass;
if(c3.cl.base == c2.cl)
{
switch(c2.cl.type)
{
case normalClass:
case noHeadClass:
case unionClass:
case systemClass:
case structClass: // tocheck
continue;
case bitClass:
case unitClass:
case enumClass:
break;
}
if(c3.cl.type == bitClass) debugBreakpoint(); // untested
if(c3.cl.type == unitClass) debugBreakpoint(); // untested
// , ":", bclassToSimpleClassTypeString(c2)
o2.z.concatx(genloc__, "// C (", bclassToSimpleClassTypeString(c), ":", bclassToSimpleClassTypeString(c3), ")", ln); // , subType[0] ? "|" : "", subType
if(p.pt.Get)
{
o.z.concatx(genloc__, indents(1), "inline ", c.cpp.name, " ", ptrThis ? "& " : "", "operator= (", c3.cpp.name, " value);", ln);
o2.z.concatx(genloc__, indents(0), "inline ", c.cpp.name, " ", ptrThis ? "& " : "", c.cpp.name, "::", "operator= (", c3.cpp.name, " value) ", "{ ");
if(!ptrThis)
o2.z.concatx("return ");
o2.z.concatx(p.fpnGet/*c2.name, "_to_", c.name*/, "((", c2.cSymbol, ")value");
if(ptrThis)
o2.z.concatx(", ", ptrThis ? "&" : "", "impl");
o2.z.concatx(");");
if(ptrThis)
o2.z.concatx(" return *this;");
o2.z.concatx(" }", ln);
o.z.concatx(genloc__, indents(1), "inline ", c.cpp.name, "(", c3.cpp.name, " value);", ln);
o2.z.concatx(genloc__, indents(0), "inline ", c.cpp.name, "::", c.cpp.name, "(", c3.cpp.name, " value) ",
"{ ", p.fpnGet/*c2.name, "_to_", c.name*/, "((", c2.cSymbol, ")value");
if(ptrThis)
o2.z.concatx(", ", ptrThis ? "&" : "", "impl");
o2.z.concatx("); }", ln);
}
if(p.pt.Set)
{
// do we need more here?
// genSetConversionOperator(p, c3, ptrThis, c2, ptrThat, true, o.z, o2.z);
}
}
}
}
}
}
}
}
}
static void genSetConversionOperator(BProperty p, BClass cFrom, bool indirectFrom, BClass cTo, bool indirectTo, bool commentOut, ZString o, ZString o2)
{
// o: in .hpp inside class / struct definition
// o2: in .hpp after all the class / struct definitions
const char * cmt = commentOut ? "// " : "";
o.concatx(genloc__, indents(1), cmt, "inline operator ", cTo.cpp.name, "() const;", ln);
o2.concatx(genloc__, indents(0), cmt, "inline ", cFrom.cpp.name, "::operator ", cTo.cpp.name, "() const ", "{ ");
if(indirectTo)
o2.concatx(cTo.cpp.name, " ", cTo.simplestIdentName, "; ");
else
o2.concatx("return ");
// todo: move p.fpnSet/*cTo.name, "_from_", cFrom.name*/ out of this genSetConversionOperator; pass function name instead of 'BProperty p' and do assertion outside
// (see comment in genConstructorsOperatorsForOtherClassesConversionProperties above)
o2.concatx(p.fpnSet/*cTo.name, "_from_", cFrom.name*/, "(");
o2.concatx(indirectFrom ? "&" : "", "impl");
if(indirectTo)
o2.concatx(", ", "&", cTo.simplestIdentName, ".impl");
o2.concatx(");");
if(indirectTo)
o2.concatx(" return ", cTo.simplestIdentName, ";");
o2.concatx(" }", ln);
}
static bool cppEnumValueNameClash(const char * name)
{
return
!strcmp(name, "false") ||
!strcmp(name, "true") ||
!strcmp(name, "Pi") ||
!strcmp(name, "not") ||
!strcmp(name, "or") ||
!strcmp(name, "and") ||
false;
}
static void cppGenEnumClassValues(CPPGen g, BOutput o, BClass c)
{
int maxLen = 0;
const char * comma = "";
NamedLink item;
EnumClassData enumeration = (EnumClassData)c.cl.data;
for(item = enumeration.values.first; item; item = item.next)
{
bool clash = cppEnumValueNameClash(item.name);
int len = strlen(item.name) + clash ? 1 : 0;
if(len > maxLen)
maxLen = len;
}
for(item = enumeration.values.first; item; item = item.next)
{
bool clash = cppEnumValueNameClash(item.name);
int len = strlen(item.name) + clash ? 1 : 0;
o.z.concatx(comma, ln, genloc__, indents(1), item.name, clash ? "_" : "", spaces(maxLen, len), " = ", c.name, "_", item.name);
if(comma[0] == '\0')
comma = ",";
}
if(comma[0] == ',')
o.z.concatx(ln);
}
static void genBitMembersConstructor(CPPGen g, BClass c, BVariant v, bool prototype, BOutput hppOut, BOutput cppOut)
{
bool doBitMembers = c.cl.members.count <= 5;
bool split = false;
BOutput o;
Array<BitMemberTypeStringZero> bitMembers = doBitMembers ? { } : null;
if(bitMembers)
{
// bitMember selection
DataMember dm;
IterDataMember dat { c.cl };
while((dm = dat.next(all)))
{
BitMember bm = (BitMember)dm;
if(!dm.dataType)
dm.dataType = resolveDataTypeStringInTemplatesContext(c.cl, dm.dataTypeString, true);
if(bm.type == normalMember) // todo, recurse struct/union? members for bitfields inside structs i.e.: PolygonRing
{
switch(dm.dataType.kind)
{
case charType:
if(!strcmp(dm.dataTypeString, "byte"))
bitMembers.Add({ bm, "unsigned char", " = 0" });
break;
case intType:
bitMembers.Add({ bm, dm.dataTypeString, " = 0" });
break;
case classType:
{
ClassType ct = dm.dataType._class && dm.dataType._class.registered ? dm.dataType._class.registered.type : systemClass;
if(ct == bitClass || ct == enumClass || ct == unitClass)
{
bitMembers.Add({ bm, dm.dataType._class.registered.name/*, " = { }"*/ });
split = true;
}
break;
}
}
}
}
}
o = split && !prototype ? cppOut : hppOut;
if(bitMembers && bitMembers.count > 1 && !(!split && !prototype))
{
bool pt = prototype && split;
int e;
const char * comma;
o.z.concatx(genloc__, indents(1), split && !pt ? c.cpp.name : "", split && !pt ? "::" : "", c.cpp.name, "(");
comma = "";
for(e = 0; e < bitMembers.count; e++)
{
BitMemberTypeStringZero item = bitMembers[e];
ClassType ct = item.bm.dataType.kind == classType ? item.bm.dataType._class.registered.type : systemClass;
bool ref/*shouldUseRefToPreventCompleteTypeDependency*/ = ct == bitClass || ct == structClass || ct == unionClass;
o.z.concatx(comma, item.typeString, ref ? " &" : "", " ", item.bm.name);
if(comma[0] == '\0')
comma = ", ";
}
o.z.concatx(")", pt ? ";" : "", ln);
if(!split || !pt)
{
o.z.concatx(genloc__, indents(1), "{", ln);
o.z.concatx(genloc__, indents(2), "impl = ", c.upper, "(");
comma = "";
for(e : bitMembers)
{
BitMemberTypeStringZero item = e;
o.z.concatx(comma, item.bm.name);
if(comma[0] == '\0')
comma = ", ";
}
o.z.concatx(");", ln);
o.z.concatx(genloc__, indents(1), "}", ln);
}
}
delete bitMembers;
}
static void genMethodCallers(CPPGen g, BClass c, BVariant v, const char * cn, bool prototype, BOutput o)
{
bool content = false;
int l, maxLen = 0;
int lvl;
int ind = prototype ? 1 : 0;
Map<String, int> memberLevel { };
lvl = 0;
for(e : c.cumulationLineage)
{
Class cl = e;
BMethod m; IterMethod itm { cl };
lvl++;
while((m = itm.next(publicNormal)))
{
m.init(itm.md, cl, g);
{
// tofix: this is hackish and duplicated -- see below
const char * mn = m.mname;
char * an = c.memberNames.Find(mn) ? PrintString("_", mn) : null;
const char * mncpp = an ? an : !strcmp(mn, "delete") ? "_delete" : !strcmp(mn, "union") ? "_union" : !strcmp(mn, "printf") ? "_printf" : mn;
char * dmn = null;
if(mncpp)
; // warning supression
if(m.hasTemplateAnything())
continue;
if(!strcmp(mn, "delete") || !strcmp(mn, "union") || !strcmp(mn, "printf"))
mncpp = dmn = PrintString("_", mn);
else
{
BClass c2 = c;
while(c2)
{
Property pt; IterProperty prop { c2 };
while((pt = prop.next(publicOnly)))
{
const char * pn = pt.name; // member name
if(!strcmp(pn, mn))
{
mncpp = dmn = PrintString("_", mn);
break;
}
}
if(!c2.cl.base) break;
c2 = c2.cl.base;
if(c2.isInstance || c2.is_class || c2.is_enum || c2.is_struct) break;
}
}
memberLevel[m.md.name] = lvl;
delete an;
delete dmn;
}
if((l = strlen(m.mname)) > maxLen) maxLen = l;
}
}
lvl = 0;
for(e : c.cumulationLineage)
{
Class cl = e;
BMethod m; IterMethod itm { cl };
lvl++;
while((m = itm.next(publicNormal)))
{
// const char * on = m.name;
// tofix: this is hackish and duplicated -- see above
const char * mn = m.mname;
char * an = c.memberNames.Find(mn) ? PrintString("_", mn) : null;
const char * mncpp = an ? an : !strcmp(mn, "delete") ? "_delete" : !strcmp(mn, "union") ? "_union" : !strcmp(mn, "printf") ? "_printf" : mn;
char * dmn = null;
// Type param;
TypeInfo ti { type = m.md.dataType, typeString = m.md.dataTypeString, cl = c ? c.cl : null };
if(m.hasTemplateAnything())
continue;
if(!strcmp(mn, "delete") || !strcmp(mn, "union") || !strcmp(mn, "printf"))
mncpp = dmn = PrintString("_", mn);
else
{
BClass c2 = c;
while(c2)
{
Property pt; IterProperty prop { c2 };
while((pt = prop.next(publicOnly)))
{
const char * pn = pt.name; // member name
if(!strcmp(pn, mn))
{
mncpp = dmn = PrintString("_", mn);
break;
}
}
if(!c2.cl.base) break;
c2 = c2.cl.base;
if(c2.isInstance || c2.is_class || c2.is_enum || c2.is_struct) break;
}
}
if(memberLevel[m.md.name] != lvl)
continue;
if(!content)
{
o.z.concatx(ln);
content = true;
}
{
BClass c2 = cl;
genGenGlobalFunctionOrMethod(g, c, m, null, ti, v, ind, c2.cpp.name, mncpp, prototype, o);
}
delete an;
delete dmn;
}
}
}
static void genGenGlobalFunctionOrMethod(CPPGen g, BClass c, BMethod m, BFunction f, TypeInfo ti, BVariant v, int ind, const char * cn, const char * xn, bool prototype, BOutput o)
{
bool noHead = c ? c.cl.type == noHeadClass : false;
bool template = c ? c.cpp.isTemplate : false;
Type t = ti.type;
const char * mn = m ? m.mname : f.oname;
// bool byRefTypedThis = false;
bool returnAddress = false;
bool noRet = t.returnType.kind == voidType;
// bool destVsSrc = false; //!strcmp(mn, "onCopy") ? true : false;
// const char * nthis = null;
Type returnType = t.returnType;
char * typeString = /*returnType.kind == classType && returnType.classObjectType == anyObject ? CopyString(g_.sym.instance) : */printType(t.returnType, false, false, true);
Class clRegRT;
BClass cRT;
bool hackRT;
ClassType ctRT = cppGetClassInfoFromType(t.returnType, true, &clRegRT, &cRT, &hackRT, null, null);
TypeInfo argsInfo;
// todo: support preceding arguments?
// Type p1 = t.params.count == 2 ? t.params.first : null;
// Type p2 = t.params.count == 2 ? t.params.last : null;
int ptrX = 0;
Class clRegX;
BClass cX;
BClass cXT; // templated class
bool hackX;
bool isStringX;
bool isConstX;
Type typeX = unwrapPtrTypeGetClassInfo(t.returnType, true, &clRegX, &cX, &cXT, &ptrX, &hackX, &isStringX, &isConstX);
ClassType ctX = clRegX ? clRegX.type : systemClass;
bool castX = (ctX == enumClass || ctX == unitClass || (ctX == bitClass && ptrX));
bool hasStructClassParam = false;
bool varArgs = false;
bool typedVarArgs = false; // t.params.count == 2 && p1.kind == classType && p1.classObjectType == typedObject && p2.kind == ellipsisType;
if(typeX && castX)
;
{
bool prevParamIsTypedObject = false;
Type param;
for(param = t.params.first; param; param = param.next)
{
if(param.kind == ellipsisType)
{
if(prevParamIsTypedObject)
typedVarArgs = true;
else
varArgs = true;
break;
}
prevParamIsTypedObject = param.kind == classType && param.classObjectType == typedObject;
}
}
if(f && (
!strcmp(mn, "setActiveDesigner") || // broken -- missing eC class thing -- DesignerBase
false))
return; // todo: fix new broken brokens
if(cRT && cRT.cl.module && cRT.cl.module.name && skipClasses.Find({ !strcmp(cRT.cl.module.name, "ecereCOM") ? "eC" : cRT.cl.module.name, cRT.cl.name })) return;
subGlobalFunctionOrMethod(g, c, m, f, ti, v, ind, cn, xn, prototype, o,
noHead, template, t, mn, returnAddress, noRet, returnType, typeString, cRT, ctRT,
argsInfo, cXT, varArgs, typedVarArgs, isStringX, isConstX, false, &hasStructClassParam);
if(hasStructClassParam)
{
subGlobalFunctionOrMethod(g, c, m, f, ti, v, ind, cn, xn, prototype, o,
noHead, template, t, mn, returnAddress, noRet, returnType, typeString, cRT, ctRT,
argsInfo, cXT, varArgs, typedVarArgs, isStringX, isConstX, true, null);
}
}
static void subGlobalFunctionOrMethod(CPPGen g, BClass c, BMethod m, BFunction f, TypeInfo ti, BVariant v, int ind, const char * cn, const char * xn, bool prototype, BOutput o,
bool noHead,
bool template,
Type t,
const char * mn,
bool returnAddress,
bool noRet,
Type returnType,
char * typeString,
BClass cRT,
ClassType ctRT,
TypeInfo argsInfo,
BClass cXT,
bool varArgs,
bool typedVarArgs,
bool isString,
bool isConst,
bool forStructClassParamPointerVersion,
bool * hasStructClassParam
)
{
char * params = null;
char * args = null;
const char * first = null;
o.z.concatx(genloc__, indents(ind));
if(!prototype)
o.z.concatx(noHead ? cpptemplateNoHeadDef : template ? c.cpp.tprototype/*emplatem*/ : "", (noHead || template) ? " " : "");
if(varArgs)
o.z.concatx("template<typename... Args> ");
else if(typedVarArgs)
o.z.concatx("template <typename ...Ts> ");
if(t.staticMethod && prototype)
o.z.concat("static ");
o.z.concat("inline ");
if(returnType.kind == templateType)
{
// o.z.concatx("TP(", c.name, ", ", returnType.templateParameter.identifier.string, ")");
if(returnType.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
o.z.concatx("TP_", returnType.templateParameter.identifier.string);
}
else if(cXT && cRT.cpp.isTemplate && cXT.cpp.dataTypeString)
o.z.concat(cXT.cpp.dataTypeString);
else if((ctRT == normalClass || ctRT == noHeadClass))
{
if(ctRT == normalClass && isString && isConst)
o.z.concatx("constString");
else if(ctRT == normalClass)
{
bool cantHaveThat = cRT && cRT.cl.templateArgs/*cRT.cpp.isTemplate*//* && cRT.cl != c.cl && (!cRT.cl.templateClass || cRT.cl.templateClass != c.cl)*/;
// bool instCast = !prototype && cRT.cl.type == normalClass && cRT.cl.templateArgs;
bool special = cRT.cl.type == normalClass && cRT.cl.templateArgs && cantHaveThat;
// const char * tweak = !special && instCast ? "&" : "";
// if(instCast || special || tweak)
// ;
if(cRT.isInstance) // Exception
o.z.concatx(cRT.name, " *");
else if(special) // Exception
o.z.concatx(cRT.name, " *");
#ifdef NORMAL_CLASS_RETURN_METHOD_TIH
else if(!cRT.isString)
o.z.concatx("TIH<", cRT.cpp.name, ">");
#endif
else
o.z.concatx(cXT && cXT.cpp.dataTypeString ? cXT.cpp.dataTypeString : cRT.cpp.name);
}
else if(ctRT == noHeadClass)
o.z.concatx(cRT.cSymbol, " *");
}
else
o.z.concatx(strptrNoNamespace(typeString));
o.z.concatx(" ");
if(c && !prototype)
o.z.concatx(noHead || template ? cpptemplatePrefix : "", c.cpp.name, // todo: fix this
noHead ? cpptemplateNoHeadParams : template ? c.cpp.targsb : "", "::");
o.z.concatx(xn, "(");
if(t.kind == functionType)
{
bool comma = false; //const char * comma = "";
/*
switch(t.classObjectType)
{
case none:
if(!strcmp(cn, "Application"))
o.z.concatx("C(Instance)");
else
o.z.concatx("C(", cn, ")");
nthis = "o_";
o.z.concatx(" ", nthis);
comma = true;
break;
//case classPointer: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
case typedObject:
{
byRefTypedThis = t.byReference;
returnAddress = ctRT == normalClass || ctRT == noHeadClass;
nthis = /-*iMetThisNameSwap.Index(mn, false) ? iMetThisNameSwap.data :*-/ "o_";
o.z.concatx("XClass * _class, C(Instance) ", byRefTypedThis ? "* " : "", nthis);
comma = true;
break;
}
//case anyObject: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
default: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
}
*/
// if(!(t.params.count == 1 && ((Type)t.params.first).kind == voidType))
// {
// bool comma = false;
/*if(typedVarArgs)
o.z.concat("const Ts&... ts");
else*/
{
CPPParamsOutputMode paramListMode = !forStructClassParamPointerVersion ? regMethodCppParamList : regMethodCppParamList2;
argsInfo = { type = t, m = m, md = m ? m.md : null, cl = c ? c.cl : null, c = c, fn = f ? f.fn : null, f = f };
o.z.concatx((params = cppParams(c, argsInfo, paramListMode, v, null, false, comma, null, configuration, &first, null, hasStructClassParam, null, { })));
delete params;
}
// }
}
o.z.concatx(")", prototype ? ";" : "");
if(prototype)
o.z.concatx(/*indents(ind), */" // ", cn, "_", mn);
o.z.concatx(ln);
if(!prototype)
{
// bool hasVarArgs = false;
bool comma = false;
bool cantHaveThat = cRT && cRT.cl.templateArgs/*cRT.cpp.isTemplate*//* && cRT.cl != c.cl && (!cRT.cl.templateClass || cRT.cl.templateClass != c.cl)*/;
// bool instCast = !prototype && cRT.cl.type == normalClass && cRT.cl.templateArgs;
bool special = cantHaveThat && cRT.cl.type == normalClass && cRT.cl.templateArgs;
// const char * tweak = !special && instCast ? "&" : "";
// if(instCast || special || tweak)
// ;
char * fromTA = null;
char * addendum = CopyString("");
if(returnAddress)
Print("");
o.z.concatx(genloc__, indents(ind), "{", ln);
/*
if(typedVarArgs)
{
// todo: support static method?
o.z.concatx(genloc__, indents(ind + 1), "std::apply(", ln);
o.z.concatx(genloc__, indents(ind + 2), "[", c ? "this" : "", "](auto ...args) { ", c ? c.name : "", c ? "_" : "", mn, "(", c ? "impl, " : "", args/-*"args..."*-/, "); },", ln);
o.z.concatx(genloc__, indents(ind + 2), "std::tuple_cat(std::make_tuple(classof(ts), vapass(ts))..., std::make_tuple(null))", ln);
o.z.concatx(genloc__, indents(ind + 1), ");", ln);
}
else
*/
{
CPPParamsOutputMode passingMode = !forStructClassParamPointerVersion ? regMethodArgsPassing2 : regMethodArgsPassing3;
{
bool comma = false;
char * args;
int len;
CPPParamsOutputMode poorPassingMode = !forStructClassParamPointerVersion ? regMethodArgsPoorObjectPassing2 : regMethodArgsPoorObjectPassing3;
// bool ptrI = !t.thisClass || (t.thisClass.string && !strcmp(t.thisClass.string, "class"));
args = cppParams(c, argsInfo, poorPassingMode, /*vClass*/null, cn, /*!ptrI*/false, comma, null, configuration, null, null, null, null/*&hasVarArgs*/, { });
len = strlen(args);
if(len > 1)
{
if(len == 37 && args[0] == '/' && args[1] == '*' && args[len - 2] == '*' && args[len - 1] == '/')
{
delete addendum;
addendum = args; // o.z.concatx(args);
args = null;
}
else
{
if(args[len - 1] == ' ')
args[len - 1] = '\0';
o.z.concat(indents(ind + 1));
o.z.concatx(args, ln);
o.z.concatx(ln);
}
}
delete args;
}
//
/*
if(hasVarArgs)
{
o.z.concatx(genloc__, indents(ind + 1), "va_list args;", ln);
o.z.concatx(genloc__, indents(ind + 1), "va_start(args, format);", ln);
}
*/
o.z.concatx(genloc__, indents(ind + 1), addendum, (noRet || special) ? "" : "return ");
#ifdef NORMAL_CLASS_RETURN_METHOD_TIH
if(ctRT == normalClass && !cRT.isString && !cRT.isInstance)
o.z.concatx("TIH<", cRT.cpp.name, ">(");
#else
if(ctRT == normalClass && !cRT.isString && !cRT.isInstance)
{
if(cXT && cRT.cpp.isTemplate && cXT.cpp.dataTypeString)
o.z.concatx("return ", cXT.cpp.dataTypeString, "(");
else if(special)
o.z.concatx("C(Instance) i = ");
else
o.z.concatx(cXT && cXT.cpp.dataTypeString ? cXT.cpp.dataTypeString : cRT.cpp.name, "(");
}
#endif
if(typedVarArgs)
{
char * args = cppParams(c, argsInfo, regMethodCppParamList, v, null, false, comma, null, configuration, &first, null, hasStructClassParam, null, { inStdApply = true });
// todo: support static method?
o.z.concatx("std::apply(", ln);
o.z.concatx(genloc__, indents(ind + 2), "[", c ? "this" : "", "](", args, ") { "); // , c ? c.name : "", c ? "_" : "", mn, "(", c ? "impl, " : "", args/*"args..."*/, "); },", ln);
delete args;
}
if(c)
{
if(t.returnType.kind == templateType)
{
if(t.returnType.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
fromTA = PrintString("fromTA<TP_", t.returnType.templateParameter.identifier.string, ">(");
}
o.z.concatx(fromTA ? fromTA : "", cn, "_", mn, "(");
}
else if(f)
o.z.concatx("F(", mn, ")(");
if(c)
{
switch(t.classObjectType)
{
case none:
if(!t.staticMethod)
{
if(strcmp(cn, c.cpp.name))
o.z.concatx("(C(", cn, ")*"/*, c.cl.type == structClass ? "&" : ""*/, ")");
if(c.cl.type == noHeadClass)
o.z.concatx("(C(", c.name, ")*)", "this->");
else if(c.cl.type == structClass)
o.z.concat("&");
else if(c.cl.type == normalClass && c.cl.templateArgs)
o.z.concat("this->");
o.z.concat("impl");
comma = true;
}
break;
//case classPointer: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
/*case typedObject:
{
byRefTypedThis = t.byReference;
returnAddress = ctRT == normalClass || ctRT == noHeadClass;
nthis = /-*iMetThisNameSwap.Index(mn, false) ? iMetThisNameSwap.data :*-/ "o_";
o.z.concatx("XClass * _class, C(Instance) ", byRefTypedThis ? "* " : "", nthis);
comma = true;
break;
}*/
//case anyObject: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
default: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
}
}
o.z.concatx((args = cppParams(c, argsInfo, passingMode, v, null, false, comma, null, configuration, null, null, null, null, { })));
o.z.concatx(")");
if(ctRT == normalClass && !cRT.isString && !cRT.isInstance)
{
if(cXT && cRT.cpp.isTemplate && cXT.cpp.dataTypeString)
o.z.concatx(")");
else if(special)
o.z.concatx(";", ln, genloc__, indents(ind + 1), "return BINDINGS_CLASS(i) ? (", cRT.cpp.name, " *)INSTANCEL(i, i->_class) : (", cRT.cpp.name, " *)0;");
else
o.z.concatx(")");
}
if(typedVarArgs)
{
o.z.concatx("; },", ln);
o.z.concatx(genloc__, indents(ind + 2), "std::tuple_cat(std::make_tuple(classof(ts), vapass(ts))..., std::make_tuple(null))", ln);
o.z.concatx(genloc__, indents(ind + 1), ")");
}
o.z.concatx(fromTA ? ")" : "", ";", ln);
/*
if(hasVarArgs)
o.z.concatx(genloc__, indents(ind + 1), "va_end(args);", ln);
*/
delete args;
}
o.z.concatx(genloc__, indents(ind), "}", ln);
delete fromTA;
delete addendum;
}
}
static void genOrderedPublicMembersInitializers(CPPGen g, BClass c, BVariant v, const char * cn, BOutput o, BOutput o2)
{
bool skip;
bool normal = c.cl.type == normalClass;
int count = 0;
int basesCount = 0;
AVLTree<const String> memberNames { };
/*
List<Class> lineage = getFilteredClassLineage(c.cl, structOnly);
if(lineage.count == 0)
lineage.Add(c.cl);
*/
skip = false;
for(e : c.cumulationLineage)
{
Class cl = e;
IterMemberOrPropertyPlus itmpp { cl = cl };
basesCount = count;
while(itmpp.next(publicOnly))
{
Type t;
if(skip || memberNames.Find(itmpp.mp.name))
continue;
if((itmpp.pt && (itmpp.pt.conversion || !itmpp.pt.Set)) || (c.cl.type == structClass && !itmpp.dm))
continue;
if(itmpp.pt && !itmpp.pt.dataType)
itmpp.pt.dataType = resolveDataTypeStringInTemplatesContext(c, itmpp.pt.dataTypeString, true);
else if(itmpp.dm && !itmpp.dm.dataType)
itmpp.dm.dataType = resolveDataTypeStringInTemplatesContext(c, itmpp.dm.dataTypeString, true);
t = itmpp.pt ? itmpp.pt.dataType : itmpp.dm ? itmpp.dm.dataType : null;
if(t.kind == pointerType && t.type.kind == classType &&
t.type._class.registered &&
(t.type._class.registered.type == normalClass ||
t.type._class.registered.type == noHeadClass))
continue;
if(skipPointerToStructClass) continue;
memberNames.Add(itmpp.mp.name);
{
bool isString = false;
Class clDataType = null;
ClassType ct = cppGetClassInfoFromType(t, false, &clDataType, null, null, &isString, null);
// if(brokenOrderedPublicMembersInitializersTypes.Find()) continue;
if(/*(!first && */((ct == normalClass && !isString) || ct == noHeadClass)/*)*/ ||
(clDataType && hasOrBaseHasTemplateClass(clDataType)) || t.kind == templateType)
skip = true;
else if(t.kind != functionType && t.kind != arrayType)
{
count++;
}
}
}
}
memberNames.Free();
if(count)
{
bool first;
const String comma = "";
bool sfx = c.cl.type == normalClass && c.cl.templateArgs;
o.z.concatx(ln, genloc__, indents(1), "inline ", cn, sfx ? c.cpp.targsb : "", "(");
o2.z.concatx(ln, genloc__, indents(0), sfx ? c.cpp.tprototype : "", sfx ? " " : "", "inline ", cn, sfx ? c.cpp.targsb : "", "::", cn, "(");
skip = false;
first = true;
for(e : c.cumulationLineage)
{
Class cl = e;
IterMemberOrPropertyPlus itmpp { cl = cl };
while(itmpp.next(publicOnly))
{
Type t;
if(skip || memberNames.Find(itmpp.mp.name))
continue;
if((itmpp.pt && (itmpp.pt.conversion || !itmpp.pt.Set)) || (c.cl.type == structClass && !itmpp.dm))
continue;
t = itmpp.pt ? itmpp.pt.dataType : itmpp.dm ? itmpp.dm.dataType : null;
if(t.kind == pointerType && t.type.kind == classType &&
t.type._class.registered &&
(t.type._class.registered.type == normalClass ||
t.type._class.registered.type == noHeadClass))
continue;
if(skipPointerToStructClass) continue;
memberNames.Add(itmpp.mp.name);
{
bool isString = false;
const String dataTypeString = itmpp.pt ? itmpp.pt.dataTypeString : itmpp.dm ? itmpp.dm.dataTypeString : null;
Class clDataType = null;
ClassType ct = cppGetClassInfoFromType(t, false, &clDataType, null, null, &isString, null);
if(/*(!first && */((ct == normalClass && !isString) || ct == noHeadClass)/*)*/ ||
(clDataType && hasOrBaseHasTemplateClass(clDataType)) || t.kind == templateType)
skip = true;
else if(t.kind != functionType && t.kind != arrayType) // broken inititializers
{
const char * mn = itmpp.mp.name;
String tz = null;
TypeInfo ti { type = t, typeString = dataTypeString, cl = c.cl };
String tnp2 = null;
String tn = cppTypeName(ti, false/*(*//*ct == normalClass && !isString*//*) || ct == unitClass*/, &tz, &tnp2);
bool ref = (ct == normalClass && !isString) || ct == noHeadClass;
// bool u = ct == unitClass;
o.z.concatx(comma, ref ? "const " : "", tn, ref ? "&" : "", " ", mn, tnp2 ? tnp2 : "");
o2.z.concatx(comma, ref ? "const " : "", tn, ref ? "&" : "", " ", mn, tnp2 ? tnp2 : "");
if(!first && !sfx)
o2.z.concatx(" = ", tz);
if(first)
{
comma = ", ";
first = false;
}
}
}
}
}
memberNames.Free();
o.z.concat(")");
o2.z.concat(")");
if(c.cl.type == structClass && c.cumulationLineage.count > 1 && basesCount > 0)
{
#if 0
BClass cBase = c.cl.base;
IterMemberOrPropertyPlus itmpp { cl = cBase.cl };
o.z.concatx(" : ", cBase.cpp.name, "(");
skip = false;
first = true;
comma = "";
while(itmpp.next(publicOnly))
{
Type t;
if(skip || memberNames.Find(itmpp.mp.name))
continue;
if((itmpp.pt && (itmpp.pt.conversion || !itmpp.pt.Set)) || (c.cl.type == structClass && !itmpp.dm))
continue;
t = itmpp.pt ? itmpp.pt.dataType : itmpp.dm ? itmpp.dm.dataType : null;
if(t.kind == pointerType && t.type.kind == classType &&
t.type._class.registered &&
(t.type._class.registered.type == normalClass ||
t.type._class.registered.type == noHeadClass))
continue;
if(skipPointerToStructClass) continue;
memberNames.Add(itmpp.mp.name);
{
bool isString = false;
Class clDataType = null;
ClassType ct = cppGetClassInfoFromType(t, false, &clDataType, null, null, &isString, null);
if(/*(!first && */((ct == normalClass && !isString) || ct == noHeadClass)/*)*/ ||
(clDataType && hasOrBaseHasTemplateClass(clDataType)) || t.kind == templateType)
skip = true;
else if(t.kind != functionType && t.kind != arrayType) // broken inititializers
{
const char * mn = itmpp.mp.name;
o.z.concatx(comma, mn);
if(first)
{
comma = ", ";
first = false;
}
}
}
}
o.z.concatx(")");
#endif // 0
}
else if(!(c.cl.type == structClass && true/* todo: allMembersInitializedViaOptionalParamsToThisInitializingConstructor() */))
o2.z.concatx(" : ", cn, sfx ? c.cpp.targsb : "", "()");
o.z.concatx(";", ln);
o2.z.concatx(ln);
o2.z.concatx(genloc__, indents(0), "{", ln);
skip = false;
// first = true;
for(e : c.cumulationLineage)
{
Class cl = e;
IterMemberOrPropertyPlus itmpp { cl = cl };
while(itmpp.next(publicOnly))
{
Type t;
if(skip || memberNames.Find(itmpp.mp.name))
continue;
if((itmpp.pt && (itmpp.pt.conversion || !itmpp.pt.Set)) || (c.cl.type == structClass && !itmpp.dm))
continue;
t = itmpp.pt ? itmpp.pt.dataType : itmpp.dm ? itmpp.dm.dataType : null;
if(t.kind == pointerType && t.type.kind == classType &&
t.type._class.registered &&
(t.type._class.registered.type == normalClass ||
t.type._class.registered.type == noHeadClass))
continue;
if(skipPointerToStructClass) continue;
memberNames.Add(itmpp.mp.name);
{
/*
int ptrX = 0;
Class clRegX;
BClass cX;
BClass cXT; // templated class
bool hackX;
bool isStringX;
bool isConstX;
Type typeX = unwrapPtrTypeGetClassInfo(t, true, &clRegX, &cX, &cXT, &ptrX, &hackX, &isStringX, &isConstX);
BClass cXUnit = cX ? cX.clBase : null;
*/
bool isString = false;
BClass cDataType = null;
Class clDataType = null;
ClassType ct = cppGetClassInfoFromType(t, false, &clDataType, &cDataType, null, &isString, null);
if(/*(!first && */((ct == normalClass && !isString) || ct == noHeadClass)/*)*/ ||
(clDataType && hasOrBaseHasTemplateClass(clDataType)) || t.kind == templateType)
skip = true;
else if(t.kind != functionType && t.kind != arrayType)
{
const char * mn = itmpp.mp.name;
bool impl = ct == unitClass || ct == structClass;
ClassType ct2 = t.kind == pointerType && t.type.kind == classType ?
cppGetClassInfoFromType(t.type, false, null/*&clDataType*/, null/*&cDataType*/, null, &isString, null) : ct;
bool cast = !normal && (ct == enumClass/* || (ct2 == unitClass && t.kind == pointerType)*/);
bool ptr = t.kind == pointerType && t.type.kind == classType &&
ct2 == structClass;
// bool unitptrCast = ct2 == unitClass && t.kind == pointerType;
o2.z.concatx(genloc__, indents(1), normal ? "this->" : "impl.", mn, " = ",
cast ? "(" : "", cast ? /*cDataType ? */cDataType.cSymbol/* : cXUnit.cSymbol*/ : ""/*, unitptrCast ? "*" : ""*/, cast ? ")" : "", ptr ? "&" : "", mn,
ptr ? "->" : "", impl ? "." : "", ptr || impl ? "impl" : "", ";", ln);
}
// if(first) first = false;
}
}
}
memberNames.Free();
o2.z.concatx(genloc__, indents(0), "}", ln);
}
delete memberNames;
// delete lineage;
}
static void processProperties(CPPGen g, BClass c, BProperty userDataProp, const char * cn, const char * tcn, bool prototype, BOutput o)
{
bool content = false;
for(e : c.cumulationLineage)
{
BClass c2 = e;
Property pt; IterProperty prop { c2 };
while((pt = prop.next(publicOnly)))
{
const char * mn = pt.name; // member name
Type t = pt.dataType ? pt.dataType : (pt.dataType = resolveDataTypeStringInTemplatesContext(c2, pt.dataTypeString, true));
TypeInfo ti { type = t, typeString = pt.dataTypeString, c = c2, cl = c2.cl, pt = pt, userDataProp = userDataProp };
if(skipPointerToStructClass) continue;
if(!content)
{
o.z.concatx(ln);
content = true;
}
commonMemberHandling(g, c, c2, prototype, c2 != c, cn, c2.cpp.name, tcn, mn, true, pt.Get != null, pt.Set != null, ti, o);
}
}
}
// todo: fix those? broken or unsupported?
define skipPointerToStructClass = t.kind == pointerType && t.type.kind == classType && t.type._class.registered && t.type._class.registered.type == structClass;
const bool printBMK = false;
static void processDataMembers(CPPGen g, BClass c, BVariant v, const char * cn, bool prototype, BOutput o)
{
bool content = false;
for(e : c.cumulationLineage)
{
BClass c2 = e;
DataMember dm; IterDataMemberProper dat { c2 };
while((dm = dat.next(publicOnly)))
{
const char * mn = dm.name; // member name
Type t = dm.dataType ? dm.dataType : (dm.dataType = resolveDataTypeStringInTemplatesContext(c2, dm.dataTypeString, true));
TypeInfo ti { type = t, typeString = dm.dataTypeString, cl = c2.cl };
BitMember bm = (BitMember)dm;
if(mn && strstr(mn, "__ecerePrivateData") == mn) debugBreakpoint();
// todo, recurse struct/union? members for bitfields inside structs i.e.: PolygonRing
// BM1 -- do it
if(bm.type != normalMember) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM1 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; }
// BM2 -- won't hold you to that tonight , you can skip it or make it double * array;
/*
struct C(Matrix)
{
union
{
double array[16];
double m[4][4];
};
};
double (* m)[4]; -- where that 4 is the second one, not the first.
double array[16];
i.e.
double m[4][5]; -> double (* m)[5];
double array[16]; -> double * array;
*/
if(t.kind == arrayType) { /*if(printBMK) dbglocprintxln(" -- broken member kind -- BM2 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); */continue; } // todo: find a way for arrays -- proper fix: proper accessor
// BM3 --
if(t.kind == pointerType && t.type.kind == functionType) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM3 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: fix those? broken or unsupported?
// BM4 --
if(t.kind == pointerType && t.type.kind == pointerType && t.type.type.kind == functionType) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM4 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: fix those? broken or unsupported?
// BM5 --
if(t.kind == subClassType) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM5 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: fix those? broken
// BM6 --
if(t.kind == classType && !t._class.registered && !strcmp(t._class.string, "Type")) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM6 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: what with those?
// BM7 --
if(t.kind == classType && !t._class.registered && !strcmp(t._class.string, "Instantiation")) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM7 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: what with those?
// BM8 --
if(t.kind == classType && !t._class.registered && !strcmp(t._class.string, "ClassDefinition")) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM8 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: what with those?
// BM9 --
if(t.kind == pointerType && t.type.kind == classType && t.type._class.registered && t.type._class.registered.type == structClass) { if(printBMK) dbglocprintxln(" -- broken member kind -- BM9 -- ", g.lib.bindingName, " -- ", c2.name, "::", mn); continue; } // todo: fix those? broken or unsupported?
// Skip members which already have properties of the same name...
if(eClass_FindProperty(c2.cl, mn, c2.cl.module) || strstr(mn, "__ecerePrivateData")) continue;
if(!content)
{
o.z.concatx(ln);
content = true;
}
commonMemberHandling(g, c, c2, prototype, c2 != c, cn, c2.cpp.name, cn, mn, false, false, false, ti, o);
}
}
}
enum PropComponentType { macroPropGet, macroIntPropSet, macroPropSet };
class PropertyComponent
{
public:
PropComponentType type;
const String membername;
String typename;
String tAmp;
String typenamePart2;
String returnType;
// String typename_b;
Array<String> code;
// Array<String> code_b;
bool dontNest;
bool commented;
~PropertyComponent()
{
delete typename;
delete tAmp;
delete typenamePart2;
delete returnType;
if(code) code.Free();
delete code;
// delete typename_b;
// if(code_b) code_b.Free();
// delete code_b;
}
}
// bool prototype, // prototype (true) or implementation
// bool template, // template (true) version for noheads or normal
enum PropertyMacroType { normal, nohead, template };
class PropertyMacroBits
{
public:
bool prototype:1;
PropertyMacroType type:2;
bool pfx:1;
}
Class getTemplateStartBaseClass(Class templateClass)
{
Class cl = templateClass;
for(; cl; cl = cl.base)
{
if(cl.templateClass)
break;
if(!cl.base || !cl.base.base)
break;
}
return cl;
}
List<Class> getTemplateLineage(Class cl, bool * complete)
{
List<Class> lineage { };
Class c;
for(c = cl; c; c = c.templateClass ? c.templateClass : c.base)
{
lineage.Insert(null, c);
if(c.templateClass)
{
bool templateLineageHasFullySpecifiedTemplateArgs;
List<Class> templateClassLineage = getTemplateLineage(c.templateClass, &templateLineageHasFullySpecifiedTemplateArgs);
delete templateClassLineage;
if(templateLineageHasFullySpecifiedTemplateArgs)
{
lineage.Insert(null, c.templateClass);
break;
}
}
/*
if(c.inheritanceAccess == privateAccess)
break;
*/
}
if(complete) *complete = checkTemplateLineageHasFullySpecifiedTemplateArgs(lineage);
return lineage;
}
List<Class> getCorrectLineage(Class cl, Class * templateClass)
{
List<Class> lineage { };
Class c;
Class clTemplate = null;
for(c = cl; c; c = c.base)
{
if(c.templateClass && c != cl && c.templateClass.templateParams.count)
{
if(templateClass && clTemplate == null)
clTemplate = c.templateClass;
c = c.templateClass;
}
lineage.Insert(null, c);
}
if(templateClass)
*templateClass = clTemplate;
return lineage;
}
int countTemplateParamsCorrect(Class cl)
{
int count = 0;
Class c;
PrintLn("countTemplateParamsCorrect -- full -- ", cl.name);
for(c = cl; c; c = c.base)
{
if(c.templateClass) c = c.templateClass;
count += c.templateParams.count;
}
if(count != cl.numParams) debugBreakpoint();
return count;
}
int countTemplateParamsOfSimpleLineage(Class cl)
{
int count = 0;
Class c;
PrintLn("countTemplateParamsOfSimpleLineage -- simple -- ", cl.name);
for(c = cl; c; c = c.base)
count += c.templateParams.count;
return count;
}
int countTemplateParamsOfFullLineage(Class cl)
{
int count = 0;
Class c;
PrintLn("countTemplateParamsOfFullLineage -- full -- ", cl.name);
for(c = cl; c; c = c.templateClass ? c.templateClass : c.base)
count += c.templateParams.count;
return count;
}
bool checkTemplateLineageHasFullySpecifiedTemplateArgs(List<Class> lineage)
{
bool complete = true;
int i = 0;
Class templateClass = lineage.lastIterator.data;
List<Class> baseLineage = getClassLineage(lineage.firstIterator.data.base); // getCorrectClassLineage
int countCorrect = countTemplateParamsCorrect(templateClass);
int countSimple = countTemplateParamsOfSimpleLineage(templateClass);
int countFull = countTemplateParamsOfFullLineage(templateClass);
if(countCorrect && countSimple && countFull)
;
for(_class : baseLineage)
{
Class cl = _class;
i += cl.templateParams.count;
}
for(_class : lineage)
{
Class cl = _class;
if(i >= templateClass.numParams)
{
if(i > templateClass.numParams) debugBreakpoint();
if(cl != templateClass && cl != templateClass.templateClass) debugBreakpoint();
break;
}
if(cl.templateParams.count)
{
ClassTemplateParameter ctp;
for(ctp = cl.templateParams.first; ctp && complete; ctp = ctp.next)
{
switch(ctp.type)
{
case type:
{
ClassTemplateArgument * a = &templateClass.templateArgs[i];
/*
if(!ctp.defaultArg.dataTypeString)
{
if(a->dataTypeClass == null || a->dataTypeString == null)
complete = false;
}
*/
//
if(!(a->dataTypeString && eSystem_FindClass(templateClass.module, a->dataTypeString)))
{
if(!(ctp.defaultArg.dataTypeString && eSystem_FindClass(templateClass.module, ctp.defaultArg.dataTypeString)))
// if(!(ctp.defaultArg.dataTypeString && eSystem_FindClass(templateClass.module, ctp.defaultArg.dataTypeString)))
complete = false;
}
//
break;
}
case expression: break; // expressions are ignored here
case identifier: break; // identifiers are ignored here
default: debugBreakpoint(); break;
}
i++;
}
if(!complete)
break;
}
}
delete baseLineage;
return complete;
}
static bool getSpecifiedTemplateArgsSymbols(Class templateClass, Array<String> cSymbolTArgs, bool cName) // cName -- not used? we vary between C and C++ symbol name based on class type
{
bool complete = true;
int i = 0;
Class templateClassBase = null;
// List<Class> correctLineage = getCorrectLineage(templateClass);
// List<Class> lineage = getTemplateLineage(templateClass, &complete);
// List<Class> lineage = getCorrectLineage(templateClass, null);
List<Class> lineage = getCorrectLineage(templateClass, &templateClassBase);
// bool correctComplete = checkCorrectLineageHasFullySpecifiedTemplateArgs(correctLineage);
complete = checkCorrectLineageHasFullySpecifiedTemplateArgs(lineage, templateClass);
// if(correctComplete)
// ;
if(complete)
{
// Class templateClassBase = null;
// Class templateClassBase = templateClass.base.templateClass ? templateClass.base.templateClass : null;
// Class templateClassBase = templateClass.templateClass ? templateClass.templateClass : null;
// List<Class> baseLineage = getClassLineage(lineage.firstIterator.data.base); // getCorrectClassLineage
// Class startBaseClass = getTemplateStartBaseClass(templateClass.templateParams.count == 0 ? templateClass : templateClass.base);
// Class clStart = startBaseClass;
// startBaseClass = getTemplateStartBaseClass(templateClass.templateParams.count == 0 ? templateClass : templateClass.base);
// if(clStart)
// ;
/*
for(_class : baseLineage)
{
Class cl = _class;
i += cl.templateParams.count;
}
*/
if(templateClass.templateClass)
{
ClassTemplateParameter ctp1;
ClassTemplateParameter ctp2;
if(templateClass.templateParams.count != templateClass.templateClass.templateParams.count) debugBreakpoint();
for(ctp1 = templateClass.templateParams.first, ctp2 = templateClass.templateClass.templateParams.first; ctp1 && ctp2; ctp1 = ctp1.next, ctp2 = ctp2.next)
if(ctp1 != ctp2) debugBreakpoint();
if(!(ctp1 == null && ctp2 == null)) debugBreakpoint();
}
for(_class : lineage)
{
Class cl = _class;
// if(startBaseClass && /*(*/startBaseClass == cl/* || startBaseClass.templateClass == cl)*/)
// startBaseClass = null;
if(i >= templateClass.numParams)
{
if(i > templateClass.numParams) debugBreakpoint();
if(cl != templateClass && cl != templateClass.templateClass && cl != templateClass.templateClass.base) debugBreakpoint();
break;
}
if(cl.templateParams.count)
{
// if(!startBaseClass)
// {
ClassTemplateParameter ctp;
for(ctp = cl.templateParams.first; ctp && complete; ctp = ctp.next)
{
switch(ctp.type)
{
case type:
{
ClassTemplateArgument * a = &templateClass.templateArgs[i];
/*
if(!ctp.defaultArg.dataTypeString)
{
// ClassTemplateArgument * a = &templateClass.templateArgs[i];
// if(!a->dataTypeClass && !a->dataTypeString) debugBreakpoint();
if(a->dataTypeClass)
{
BClass dtc = a->dataTypeClass;
if(a->dataTypeClass.templateClass || a->dataTypeClass.templateParams.count)
{
if(!getSpecifiedTemplateArgsSymbols(a->dataTypeClass, null, cName))
{
complete = false;
break;
}
}
else if(dtc.numTemplateArgsInName) debugBreakpoint();
if(cSymbolTArgs && !templateClassBase)
cSymbolTArgs.Add(cName ? dtc.cSymbol : dtc.cpp.name);
}
else if(a->dataTypeString)
{
Class dtscl = eSystem_FindClass(templateClass.module, a->dataTypeString);
if(dtscl)
{
BClass dtsc = dtscl;
if(cSymbolTArgs && !templateClassBase)
cSymbolTArgs.Add(cName ? dtsc.cSymbol : dtsc.cpp.name);
}
else
complete = false;
}
else
complete = false;
}
*/
Class clType = null;
// if(!ctp.defaultArg.dataTypeString || (a->dataTypeString && strcmp(ctp.defaultArg.dataTypeString, a->dataTypeString)))
// todo: call itself :P
{
if(!(a->dataTypeString && (clType = eSystem_FindClass(templateClass.module, a->dataTypeString))))
{
if(!(ctp.defaultArg.dataTypeString && (clType = eSystem_FindClass(templateClass.module, ctp.defaultArg.dataTypeString))))
// if(!(ctp.defaultArg.dataTypeString && eSystem_FindClass(templateClass.module, ctp.defaultArg.dataTypeString)))
complete = false;
}
if(cSymbolTArgs && clType && !templateClassBase)
{
BClass cType = clType;
cSymbolTArgs.Add((cName && cType.cl.type != structClass) ? cType.cSymbol : cType.cpp.name);
}
}
break;
}
case expression: break; // expressions are ignored here
case identifier: break; // identifiers are ignored here
default: debugBreakpoint(); break;
}
i++;
}
//}
// else
// i += cl.templateParams.count;
}
// if(startBaseClass && startBaseClass.templateClass == cl)
// startBaseClass = null;
if(templateClassBase && templateClassBase == cl)
templateClassBase = null;
}
// delete baseLineage;
}
delete lineage;
return complete;
}
static bool isTemplateClassTypeComplete(Class templateClass, Array<String> cSymbolTArgs, bool cName)
{
bool complete = true;
int i = 0;
List<Class> lineage = getCorrectClassLineage(templateClass); // getClassLineage
Class startBaseClass = getTemplateStartBaseClass(templateClass.templateParams.count == 0 ? templateClass : templateClass.base);
Class clStart = startBaseClass;
startBaseClass = getTemplateStartBaseClass(templateClass.templateParams.count == 0 ? templateClass : templateClass.base);
if(clStart)
;
for(item : lineage)
{
Class cl = item;
if(startBaseClass && /*(*/startBaseClass == cl/* || startBaseClass.templateClass == cl)*/)
startBaseClass = null;
if(cl.templateParams.count)
{
// if(!startBaseClass)
// {
ClassTemplateParameter ctp;
if(cl == templateClass)
{
complete = false;
break;
}
for(ctp = cl.templateParams.first; ctp && complete; ctp = ctp.next)
{
switch(ctp.type)
{
case type:
{
ClassTemplateArgument * a = &templateClass.templateArgs[i];
if(!ctp.defaultArg.dataTypeString)
{
// ClassTemplateArgument * a = &templateClass.templateArgs[i];
if(a->dataTypeClass)
{
BClass dtc = a->dataTypeClass;
if(a->dataTypeClass.templateClass || a->dataTypeClass.templateParams.count)
{
if(!isTemplateClassTypeComplete(a->dataTypeClass, null, cName))
{
complete = false;
break;
}
}
else if(strchr(a->dataTypeClass.name, '<') && strchr(a->dataTypeClass.name, '>')) debugBreakpoint();
if(cSymbolTArgs)
cSymbolTArgs.Add(cName ? dtc.cSymbol : dtc.cpp.name);
}
else if(a->dataTypeString)
{
Class dtscl = eSystem_FindClass(templateClass.module, a->dataTypeString);
if(dtscl)
{
BClass dtsc = dtscl;
if(cSymbolTArgs)
cSymbolTArgs.Add(cName ? dtsc.cSymbol : dtsc.cpp.name);
if(!strcmp(templateClass.name, "List<ecere::net::CallAck>")) debugBreakpoint();
}
else
complete = false;
}
else
complete = false;
}
break;
}
case expression: break; // expressions are ignored here
case identifier: break; // identifiers are ignored here
default: debugBreakpoint(); break;
}
i++;
}
//}
// else
// i += cl.templateParams.count;
}
if(startBaseClass && startBaseClass.templateClass == cl)
startBaseClass = null;
}
delete lineage;
return complete;
}
static void commonMemberHandling(
CPPGen g,
BClass c,
BClass c2,
bool prototype,
bool base, // cn != ocn
const char * cn,
const char * ocn, // class name of class the member originates from
const char * tcn,
const char * mn,
bool isProp,
bool hasGet,
bool hasSet,
TypeInfo ti,
BOutput o)
{
bool singleSet = hasSet && !hasGet;
bool isString = false;
bool genGet = false;
bool genSet = false;
bool different = false;
MacroMode mode = g.expansionOrUse;
const char * lc = mode != expansion ? " \\" : ""; // lc: line continuation
int ind = mode == expansion ? 1 : 4;
PropertyMacroBits opts
{
prototype,
type = (c.cl.type == noHeadClass) ? nohead : c.cpp.isTemplate ? template : normal,
pfx = c.cl.type == structClass && c.cl.templateArgs
};
int ptrX = 0;
Class clRegX;
BClass cX;
BClass cXT; // templated class
bool hackX;
bool isStringX;
bool isConstX;
Type typeX = unwrapPtrTypeGetClassInfo(ti.type, true, &clRegX, &cX, &cXT, &ptrX, &hackX, &isStringX, &isConstX);
ClassType ctX = clRegX ? clRegX.type : systemClass;
bool castX = (ctX == enumClass || ctX == unitClass || (ctX == bitClass && ptrX));
BClass cType;
ClassType ct = cppGetClassInfoFromType(ti.type, true, null, &cType, null, &isString, null);
String tz = null;
String tnp2 = null;
bool bareStyle = (ct == normalClass && !isString) || ct == structClass || (ct == unitClass && !cType.isUnichar) || ct == noHeadClass;
String tn = cppTypeName(ti, bareStyle, &tz, &tnp2);
PropertyComponent component;
Array<PropertyComponent> components { };
String implStringThis;
bool cast = ct == enumClass;
bool cnst = ct == bitClass; // construct
bool newTemplateType = false;
BClass cZ = cXT ? cXT : cX;
bool cantHaveThat = cZ && cZ.cl.templateArgs/*cZ.cpp.isTemplate*/ && cZ.cl != c.cl && (!cZ.cl.templateClass || cZ.cl.templateClass != c.cl);
bool someThisClass = cZ && !strcmp(cZ.cl.name, "LinkElement<thisclass>");
char * toTA = null; // todo: in cleanup, make sure this is properly used in all cases that apply
char * fromTA = null; // todo: in cleanup, make sure this is properly used in all cases that apply
char * fromTA2 = null; // todo: in cleanup, make sure this is properly used in all cases that apply
/*
bool oneOfThese = cX && (
!strcmp(cX.cl.name, "bool") ||
!strcmp(cX.cl.name, "OldList") ||
!strcmp(cX.cl.name, "NameSpace") ||
!strcmp(cX.cl.name, "BTNamedLink") ||
!strcmp(cX.cl.name, "BitMember") ||
!strcmp(cX.cl.name, "AccessMode") ||
!strcmp(cX.cl.name, "Class") ||
!strcmp(cX.cl.name, "DataMemberType") ||
!strcmp(cX.cl.name, "BinaryTree") ||
!strcmp(cX.cl.name, "ClassType") ||
!strcmp(cX.cl.name, "Module") ||
!strcmp(cX.cl.name, "ClassProperty") ||
!strcmp(cX.cl.name, "ClassTemplateParameter") ||
!strcmp(cX.cl.name, "TemplateParameterType") ||
!strcmp(cX.cl.name, "ClassTemplateArgument") ||
!strcmp(cX.cl.name, "DataMember") ||
!strcmp(cX.cl.name, "DefinedExpression") ||
!strcmp(cX.cl.name, "GlobalFunction") ||
!strcmp(cX.cl.name, "IteratorPointer") ||
!strcmp(cX.cl.name, "Map") ||
!strcmp(cX.cl.name, "Method") ||
!strcmp(cX.cl.name, "MethodType") ||
!strcmp(cX.cl.name, "ObjectInfo") ||
!strcmp(cX.cl.name, "Instance") ||
!strcmp(cX.cl.name, "Property") ||
!strcmp(cX.cl.name, "SubModule") ||
!strcmp(cX.cl.name, "BTNode") ||
!strcmp(cX.cl.name, "Item") ||
!strcmp(cX.cl.name, "NamedItem") ||
!strcmp(cX.cl.name, "NamedLink") ||
!strcmp(cX.cl.name, "NamedLink64") ||
!strcmp(cX.cl.name, "OldLink") ||
!strcmp(cX.cl.name, "String") ||
!strcmp(cX.cl.name, "StringBTNode") ||
!strcmp(cX.cl.name, "StringAllocType") ||
!strcmp(cX.cl.name, "NamedItem") ||
!strcmp(cX.cl.name, "NamedLink") ||
!strcmp(cX.cl.name, "NamedLink64") ||
!strcmp(cX.cl.name, "dddd") ||
!strcmp(cX.cl.name, "dddd") ||
false);
if(!cXT && cX && !oneOfThese) debugBreakpoint();*/
if(cXT && cXT.cl.templateArgs)
{
char * x = null;
if(cXT.cl.templateArgs && !cXT.isClassTemplatable/*cXT.completeTemplate*/)
cantHaveThat = false;
if(cXT.cpp.dataTypeString)
x = cXT.cpp.dataTypeString;
if(x)
{
#if 0
if(!strcmp(x, "TArray<C(MeshPart), int, C(MeshPart)>"/*"TArray<C(MeshPart)>"*/)) ;
else if(!strcmp(x, "TArray<C(String), int, C(String)>"/*"TArray<C(String)>"*/)) ;
else if(!strcmp(x, "TArray<C(Window), int, C(Window)>"/*"TArray<C(Window)>"*/)) ;
else if(!strcmp(x, "TArray<C(IdFilter), int, C(IdFilter)>"/*"TArray<C(IdFilter)>"*/)) ;
else if(!strcmp(x, "TArray<C(Grouping), int, C(Grouping)>"/*"TArray<C(Grouping)>"*/)) ;
else if(!strcmp(x, "TArray<C(Class), int, C(Class)>"/*"TArray<C(Class)>"*/)) ;
else if(!strcmp(x, "TArray<C(SQLiteSearchField), int, C(SQLiteSearchField)>"/*"TArray<C(SQLiteSearchField)>"*/)) ;
else if(!strcmp(x, "TArray<C(StringSearchField), int, C(StringSearchField)>"/*"TArray<C(StringSearchField)>"*/)) ;
else if(!strcmp(x, "TArray<C(ListField), int, C(ListField)>"/*"TArray<C(ListField)>"*/)) ;
else if(!strcmp(x, "TArray<C(SQLiteSearchTable), int, C(SQLiteSearchTable)>"/*"TArray<C(SQLiteSearchTable)>"*/)) ;
else if(!strcmp(x, "TArray<C(StringSearchTable), int, C(StringSearchTable)>"/*"TArray<C(StringSearchTable)>"*/)) ;
else if(!strcmp(x, "TArray<C(LookupEditor), int, C(LookupEditor)>"/*"TArray<C(LookupEditor)>"*/)) ;
else if(!strcmp(x, "TArray<C(RecordField), int, C(RecordField)>"/*"TArray<C(RecordField)>"*/)) ;
else if(!strcmp(x, "TArray<double, int, double>"/*"TArray<double>"*/)) ;
else if(!strcmp(x, "TCMSSList<C(CMSSExpression), int, C(CMSSExpression)>"/*"TCMSSList<C(CMSSExpression)>"*/)) ;
else if(!strcmp(x, "TArray<C(ValueColor), int, C(ValueColor)>"/*"TArray<C(ValueColor)>"*/)) ;
else if(!strcmp(x, "TArray<C(ValueOpacity), int, C(ValueOpacity)>"/*"TArray<C(ValueOpacity)>"*/)) ;
else if(!strcmp(x, "TArray<C(GraphicalElement), int, C(GraphicalElement)>"/*"TArray<C(GraphicalElement)>"*/)) ;
else if(!strcmp(x, "TArray<C(ColorKey), int, C(ColorKey)>"/*"TArray<C(ColorKey)>"*/)) ;
else if(!strcmp(x, "TArray<C(GeoData), int, C(GeoData)>"/*"TArray<C(GeoData)>"*/)) ;
else if(!strcmp(x, "TArray<C(GeoJSONFeature), int, C(GeoJSONFeature)>"/*"TArray<C(GeoJSONFeature)>"*/)) ;
else if(!strcmp(x, "TArray<C(GeoJSONSegment), int, C(GeoJSONSegment)>"/*"TArray<C(GeoJSONSegment)>"*/)) ;
else if(!strcmp(x, "TArray<int64, int, int64>"/*"TArray<int64>"*/)) ;
else if(!strcmp(x, "TArray<C(MBGLLayersJSONData), int, C(MBGLLayersJSONData)>"/*"TArray<C(MBGLLayersJSONData)>"*/)) ;
else if(!strcmp(x, "TArray<C(StackFrame), int, C(StackFrame)>"/*"TArray<C(StackFrame)>"*/)) ;
else if(!strcmp(x, "TArray<C(ProcessInvocation), int, C(ProcessInvocation)>"/*"TArray<C(ProcessInvocation)>"*/)) ;
else if(!strcmp(x, "TArray<int, int, int>"/*"TArray<int>"*/)) ;
else if(!strcmp(x, "TArray<C(TSRow), int, C(TSRow)>"/*"TArray<C(TSRow)>"*/)) ;
else if(!strcmp(x, "TArray<C(TSZoomLevel), int, C(TSZoomLevel)>"/*"TArray<C(TSZoomLevel)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3IdentifierAndLinks), int, C(WFS3IdentifierAndLinks)>"/*"TArray<C(WFS3IdentifierAndLinks)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3Link), int, C(WFS3Link)>"/*"TArray<C(WFS3Link)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3Collection), int, C(WFS3Collection)>"/*"TArray<C(WFS3Collection)>"*/)) ;
else if(!strcmp(x, "TArray<T(Array, String), int, T(Array, String)>"/*"TArray<T(Array, String)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3Queryable), int, C(WFS3Queryable)>"/*"TArray<C(WFS3Queryable)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3VariableWidth), int, C(WFS3VariableWidth)>"/*"TArray<C(WFS3VariableWidth)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3TileMatrixSetLimit), int, C(WFS3TileMatrixSetLimit)>"/*"TArray<C(WFS3TileMatrixSetLimit)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3TileMatrixSetLink), int, C(WFS3TileMatrixSetLink)>"/*"TArray<C(WFS3TileMatrixSetLink)>"*/)) ;
else if(!strcmp(x, "TArray<C(WFS3TileMatrix), int, C(WFS3TileMatrix)>"/*"TArray<C(WFS3TileMatrix)>"*/)) ;
else if(!strcmp(x, "TArray<C(glTFAnimationChannel), int, C(glTFAnimationChannel)>"/*"TArray<C(glTFAnimationChannel)>"*/)) ;
else if(!strcmp(x, "TArray<C(glTFPrimitive), int, C(glTFPrimitive)>"/*"TArray<C(glTFPrimitive)>"*/)) ;
else if(!strcmp(x, "TArray<uint, int, uint>"/*"TArray<uint>"*/)) ;
else if(!strcmp(x, "TArray<C(bool), int, C(bool)>"/*"TArray<C(bool)>"*/)) ;
else if(!strcmp(x, "TContainer<C(Field), int, C(Field)>"/*"TContainer<C(Field)>"*/)) ;
else if(!strcmp(x, "TContainer<C(LineString), int, C(LineString)>"/*"TContainer<C(LineString)>"*/)) ;
else if(!strcmp(x, "TContainer<C(GeoPoint), int, C(GeoPoint)>"/*"TContainer<C(GeoPoint)>"*/)) ;
else if(!strcmp(x, "TContainer<C(GraphicalElement), int, C(GraphicalElement)>"/*"TContainer<C(GraphicalElement)>"*/)) ;
else if(!strcmp(x, "TContainer<C(Pointf), int, C(Pointf)>"/*"TContainer<C(Pointf)>"*/)) ;
else if(!strcmp(x, "TContainer<C(Vector3Df), int, C(Vector3Df)>"/*"TContainer<C(Vector3Df)>"*/)) ;
else if(!strcmp(x, "TContainer<C(PolygonContour), int, C(PolygonContour)>"/*"TContainer<C(PolygonContour)>"*/)) ;
else if(!strcmp(x, "TContainer<C(StartEndPair), int, C(StartEndPair)>"/*"TContainer<C(StartEndPair)>"*/)) ;
else if(!strcmp(x, "TContainer<C(Polygon), int, C(Polygon)>"/*"TContainer<C(Polygon)>"*/)) ;
else if(!strcmp(x, "TList<C(CallAck)>")) ;
else if(!strcmp(x, "TList<C(VirtualCallAck)>")) ;
else if(!strcmp(x, /*"TList<C(CMSSNode), int, C(CMSSNode), C(Link), C(CMSSNode)>"*/"TList<C(CMSSNode)>")) ;
else if(!strcmp(x, /*"TList<C(CMSSIdentifier), int, C(CMSSIdentifier), C(Link), C(CMSSIdentifier)>"*/"TList<C(CMSSIdentifier)>")) ;
else if(!strcmp(x, /*"TMap<T(MapNode, String, FieldValue, T = String), C(String), C(FieldValue), T(MapNode, String, FieldValue, T = String), C(String), C(String), C(FieldValue)>"*/"TMap<C(String), C(FieldValue)>")) ;
else if(!strcmp(x, /*"TMap<T(MapNode, String, GeoJSONValue, T = String), C(String), C(GeoJSONValue), T(MapNode, String, GeoJSONValue, T = String), C(String), C(String), C(GeoJSONValue)>"*/"TMap<C(String), C(GeoJSONValue)>")) ;
else if(!strcmp(x, /*"TList<C(GeoLayer), int, C(GeoLayer), C(Link), C(GeoLayer)>"*/"TList<C(GeoLayer)>")) ;
else if(!strcmp(x, /*"TMap<T(MapNode, String, CMSSStyleSheet, T = String), C(String), C(CMSSStyleSheet), T(MapNode, String, CMSSStyleSheet, T = String), C(String), C(String), C(CMSSStyleSheet)>"*/"TMap<C(String), C(CMSSStyleSheet)>")) ;
else if(!strcmp(x, "TList<C(Presentation), int, C(Presentation), C(Link), C(Presentation)>"/*"TList<C(Presentation)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, Color, Array<uint64>, T = Color), C(Color), T(Array, uint64), T(MapNode, Color, Array<uint64>, T = Color), C(Color), C(Color), T(Array, uint64)>"/*"TMap<C(Color), T(Array, uint64)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, MBGLSpriteSymbol, T = String), C(String), C(MBGLSpriteSymbol), T(MapNode, String, MBGLSpriteSymbol, T = String), C(String), C(String), C(MBGLSpriteSymbol)>"/*"TMap<C(String), C(MBGLSpriteSymbol)>"*/)) ;
else if(!strcmp(x, "TList<C(GeoExtent), int, C(GeoExtent), C(Link), C(GeoExtent)>"/*"TList<C(GeoExtent)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, MapboxGLSourceData, T = String), C(String), C(MapboxGLSourceData), T(MapNode, String, MapboxGLSourceData, T = String), C(String), C(String), C(MapboxGLSourceData)>"/*"TMap<C(String), C(MapboxGLSourceData)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFAccessor, T = String), C(String), C(glTFAccessor), T(MapNode, String, glTFAccessor, T = String), C(String), C(String), C(glTFAccessor)>"/*"TMap<C(String), C(glTFAccessor)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFAnimation, T = String), C(String), C(glTFAnimation), T(MapNode, String, glTFAnimation, T = String), C(String), C(String), C(glTFAnimation)>"/*"TMap<C(String), C(glTFAnimation)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFBufferView, T = String), C(String), C(glTFBufferView), T(MapNode, String, glTFBufferView, T = String), C(String), C(String), C(glTFBufferView)>"/*"TMap<C(String), C(glTFBufferView)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFBuffer, T = String), C(String), C(glTFBuffer), T(MapNode, String, glTFBuffer, T = String), C(String), C(String), C(glTFBuffer)>"/*"TMap<C(String), C(glTFBuffer)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFImage, T = String), C(String), C(glTFImage), T(MapNode, String, glTFImage, T = String), C(String), C(String), C(glTFImage)>"/*"TMap<C(String), C(glTFImage)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFMaterial, T = String), C(String), C(glTFMaterial), T(MapNode, String, glTFMaterial, T = String), C(String), C(String), C(glTFMaterial)>"/*"TMap<C(String), C(glTFMaterial)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFMesh, T = String), C(String), C(glTFMesh), T(MapNode, String, glTFMesh, T = String), C(String), C(String), C(glTFMesh)>"/*"TMap<C(String), C(glTFMesh)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFNode, T = String), C(String), C(glTFNode), T(MapNode, String, glTFNode, T = String), C(String), C(String), C(glTFNode)>"/*"TMap<C(String), C(glTFNode)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFProgram, T = String), C(String), C(glTFProgram), T(MapNode, String, glTFProgram, T = String), C(String), C(String), C(glTFProgram)>"/*"TMap<C(String), C(glTFProgram)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFSampler, T = String), C(String), C(glTFSampler), T(MapNode, String, glTFSampler, T = String), C(String), C(String), C(glTFSampler)>"/*"TMap<C(String), C(glTFSampler)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFScene, T = String), C(String), C(glTFScene), T(MapNode, String, glTFScene, T = String), C(String), C(String), C(glTFScene)>"/*"TMap<C(String), C(glTFScene)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFShader, T = String), C(String), C(glTFShader), T(MapNode, String, glTFShader, T = String), C(String), C(String), C(glTFShader)>"/*"TMap<C(String), C(glTFShader)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFSkin, T = String), C(String), C(glTFSkin), T(MapNode, String, glTFSkin, T = String), C(String), C(String), C(glTFSkin)>"/*"TMap<C(String), C(glTFSkin)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFTechnique, T = String), C(String), C(glTFTechnique), T(MapNode, String, glTFTechnique, T = String), C(String), C(String), C(glTFTechnique)>"/*"TMap<C(String), C(glTFTechnique)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFTexture, T = String), C(String), C(glTFTexture), T(MapNode, String, glTFTexture, T = String), C(String), C(String), C(glTFTexture)>"/*"TMap<C(String), C(glTFTexture)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFAnimationSampler, T = String), C(String), C(glTFAnimationSampler), T(MapNode, String, glTFAnimationSampler, T = String), C(String), C(String), C(glTFAnimationSampler)>"/*"TMap<C(String), C(glTFAnimationSampler)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, String, T = String), C(String), C(String), T(MapNode, String, String, T = String), C(String), C(String), C(String)>"/*"TMap<C(String), C(String)>"*/)) ;
else if(!strcmp(x, "TMap<T(MapNode, String, glTFTechniqueParameter, T = String), C(String), C(glTFTechniqueParameter), T(MapNode, String, glTFTechniqueParameter, T = String), C(String), C(String), C(glTFTechniqueParameter)>"/*"TMap<C(String), C(glTFTechniqueParameter)>"*/)) ;
else if(!strcmp(x, "TLinkElement<C(FMFont)>")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else if(!strcmp(x, "")) ;
else
{
PrintLn("template type: ", cXT.cl.name, " -> ", x ? x : "????");
debugBreakpoint();
}
#endif // 0
delete tn;
tn = CopyString(x);
newTemplateType = true;
}
else
{
const char * typeString = ti.type._class.string; // strptrNoNamespace(ti.type._class.string);
if(!strcmp(typeString, "ecere::com::Container<T>")) x = CopyString("TContainer<TP_T>");
else if(!strcmp(typeString, "ecere::com::Iterator<T>")) x = CopyString("TIterator<TP_T>");
else if(!strcmp(typeString, "ecere::com::Container<T, IT>")) x = CopyString("TContainer<TP_T, TP_IT>");
else if(!strcmp(typeString, "ecere::com::HashMap<KT, VT>")) x = CopyString("THashMap<TP_KT, TP_VT>");
else if(!strcmp(typeString, "ecere::com::Map<KT, V>")) x = CopyString("TMap<TP_KT, TP_V>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::gfx3D::MeshPart>")) x = CopyString("TArray<MeshPart>");
// else if(!strcmp(typeString, "ecere::com::Array<String>")) x = CopyString("TArray<String>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::gui::Window>")) x = CopyString("TArray<Window>");
/*
else if(!strcmp(typeString, "ecere::com::List<ecere::net::CallAck>")) x = CopyString("TList<CallAck>");
else if(!strcmp(typeString, "ecere::com::List<ecere::net::VirtualCallAck>")) x = CopyString("TList<TVirtualCallAck>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<const String>")) x = CopyString("TArray<constString>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::IdFilter>")) x = CopyString("TArray<IdFilter>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::Grouping>")) x = CopyString("TArray<Grouping>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::com::Class>")) x = CopyString("TArray<Class>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::SQLiteSearchField>")) x = CopyString("TArray<SQLiteSearchField>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::StringSearchField>")) x = CopyString("TArray<StringSearchField>");
/*
else if(!strcmp(typeString, "ecere::com::Container<eda::Field>")) x = CopyString("TContainer<Field>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<eda::ListField>")) x = CopyString("TArray<ListField>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::StringSearchTable>")) x = CopyString("TArray<StringSearchTable>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::SQLiteSearchTable>")) x = CopyString("TArray<SQLiteSearchTable>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::LookupEditor>")) x = CopyString("TArray<LookupEditor>");
// else if(!strcmp(typeString, "ecere::com::Array<RecordField>")) x = CopyString("TArray<RecordField>");
// else if(!strcmp(typeString, "ecere::com::Array<double>")) x = CopyString("TArray<double>");
/*
else if(!strcmp(typeString, "CMSSList<CMSSExpression>")) x = CopyString("TCMSSList<CMSSExpression>");
else if(!strcmp(typeString, "ecere::com::List<CMSSNode>")) x = CopyString("TList<CMSSNode>");
else if(!strcmp(typeString, "ecere::com::List<CMSSIdentifier>")) x = CopyString("TList<CMSSIdentifier>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<ValueColor>")) x = CopyString("TArray<ValueColor>");
// else if(!strcmp(typeString, "ecere::com::Array<ValueOpacity>)")) x = CopyString("TArray<ValueOpacity>)");
// else if(!strcmp(typeString, "ecere::com::Array<GraphicalElement>")) x = CopyString("TArray<GraphicalElement>");
// else if(!strcmp(typeString, "ecere::com::Array<ValueOpacity>")) x = CopyString("TArray<ValueOpacity>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::gfx::ColorKey>")) x = CopyString("TArray<ColorKey>");
// else if(!strcmp(typeString, "ecere::com::Array<GeoData>")) x = CopyString("TArray<GeoData>");
/*
else if(!strcmp(typeString, "ecere::com::Map<String, eda::FieldValue>")) x = CopyString("TMap<String, FieldValue>");
else if(!strcmp(typeString, "ecere::com::Map<String, GeoJSONValue>")) x = CopyString("TMap<String, GeoJSONValue>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<GeoJSONFeature>")) x = CopyString("TArray<GeoJSONFeature>");
// else if(!strcmp(typeString, "ecere::com::Array<GeoJSONSegment>")) x = CopyString("TArray<GeoJSONSegment>");
/*
else if(!strcmp(typeString, "ecere::com::List<GeoLayer>")) x = CopyString("TList<GeoLayer>");
else if(!strcmp(typeString, "ecere::com::Map<String, CMSSStyleSheet>")) x = CopyString("TMap<String, CMSSStyleSheet>");
else if(!strcmp(typeString, "ecere::com::List<Presentation>")) x = CopyString("TList<Presentation>");
else if(!strcmp(typeString, "ecere::com::Map<ecere::gfx::Color, ecere::com::Array<uint64> >")) x = CopyString("TMap<Color, TArray<uint64>>");
else if(!strcmp(typeString, "ecere::com::Container<LineString>")) x = CopyString("TContainer<LineString>");
else if(!strcmp(typeString, "ecere::com::Container<GeoPoint>")) x = CopyString("TContainer<GeoPoint>");
else if(!strcmp(typeString, "ecere::com::Map<String, MBGLSpriteSymbol>")) x = CopyString("TMap<String, MBGLSpriteSymbol>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<int64>")) x = CopyString("TArray<int64>");
/*
else if(!strcmp(typeString, "ecere::com::List<GeoExtent>")) x = CopyString("TList<GeoExtent>");
else if(!strcmp(typeString, "ecere::com::Map<String, MapboxGLSourceData>")) x = CopyString("TMap<String, MapboxGLSourceData>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<MBGLLayersJSONData>")) x = CopyString("TArray<MBGLLayersJSONData>");
/*
else if(!strcmp(typeString, "ecere::com::Container<GraphicalElement>")) x = CopyString("TContainer<GraphicalElement>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<StackFrame>")) x = CopyString("TArray<StackFrame>");
/*
else if(!strcmp(typeString, "ecere::com::Container<ecere::sys::Pointf>")) x = CopyString("TContainer<Pointf>");
else if(!strcmp(typeString, "ecere::com::Container<ecere::gfx3D::Vector3Df>")) x = CopyString("TContainer<Vector3Df>");
else if(!strcmp(typeString, "ecere::com::Container<PolygonContour>")) x = CopyString("TContainer<PolygonContour>");
else if(!strcmp(typeString, "ecere::com::Container<StartEndPair>")) x = CopyString("TContainer<StartEndPair>");
else if(!strcmp(typeString, "ecere::com::Container<Polygon>")) x = CopyString("TContainer<Polygon>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<ProcessInvocation>")) x = CopyString("TArray<ProcessInvocation>");
// else if(!strcmp(typeString, "ecere::com::Array<int>")) x = CopyString("TArray<int>");
// else if(!strcmp(typeString, "ecere::com::Array<TSRow>")) x = CopyString("TArray<TSRow>");
// else if(!strcmp(typeString, "ecere::com::Array<TSZoomLevel>")) x = CopyString("TArray<TSZoomLevel>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3IdentifierAndLinks>")) x = CopyString("TArray<WFS3IdentifierAndLinks>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3Link>")) x = CopyString("TArray<WFS3Link>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3Collection>")) x = CopyString("TArray<WFS3Collection>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::com::Array<String> >")) x = CopyString("TArray<TArray<String>>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3Queryable>")) x = CopyString("TArray<WFS3Queryable>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3VariableWidth>")) x = CopyString("TArray<WFS3VariableWidth>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3TileMatrixSetLimit>")) x = CopyString("TArray<WFS3TileMatrixSetLimit>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3TileMatrixSetLink>")) x = CopyString("TArray<WFS3TileMatrixSetLink>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3TileMatrix>")) x = CopyString("TArray<WFS3TileMatrix>");
/*
else if(!strcmp(typeString, "ecere::com::Map<String, glTFAccessor>")) x = CopyString("TMap<String, glTFAccessor>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFAnimation>")) x = CopyString("TMap<String, glTFAnimation>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFBufferView>")) x = CopyString("TMap<String, glTFBufferView>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFBuffer>")) x = CopyString("TMap<String, glTFBuffer>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFImage>")) x = CopyString("TMap<String, glTFImage>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFMaterial>")) x = CopyString("TMap<String, glTFMaterial>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFMesh>")) x = CopyString("TMap<String, glTFMesh>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFNode>")) x = CopyString("TMap<String, glTFNode>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFProgram>")) x = CopyString("TMap<String, glTFProgram>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFSampler>")) x = CopyString("TMap<String, glTFSampler>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFScene>")) x = CopyString("TMap<String, glTFScene>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFShader>")) x = CopyString("TMap<String, glTFShader>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFSkin>")) x = CopyString("TMap<String, glTFSkin>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFTechnique>")) x = CopyString("TMap<String, glTFTechnique>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFTexture>")) x = CopyString("TMap<String, glTFTexture>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<glTFAnimationChannel>")) x = CopyString("TArray<glTFAnimationChannel>");
/*
else if(!strcmp(typeString, "ecere::com::Map<String, glTFAnimationSampler>")) x = CopyString("TMap<String, glTFAnimationSampler>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<glTFPrimitive>")) x = CopyString("TArray<glTFPrimitive>");
/*
else if(!strcmp(typeString, "ecere::com::Map<String, String>")) x = CopyString("TMap<String, String>");
*/
// else if(!strcmp(typeString, "ecere::com::Array<uint>")) x = CopyString("TArray<uint>");
// else if(!strcmp(typeString, "ecere::com::Array<bool>")) x = CopyString("TArray<bool>");
/*
else if(!strcmp(typeString, "ecere::com::Map<String, glTFTechniqueParameter>")) x = CopyString("TMap<String, glTFTechniqueParameter>");
else if(!strcmp(typeString, "")) x = CopyString("");
*/
else if(!strcmp(typeString, "ecere::com::LinkElement<thisclass>")) ;
else
{
PrintLn("template type: ", cXT.cl.name, " -> ", x ? x : "????");
debugBreakpoint();
}
delete x;
}
}
// delete tn;
// tn = cppTypeName(ti, bareStyle, &tz, &tnp2);
// todo: fix these warnings, use the right local vars obtain using the correct function(s)
if(typeX)
; // warning supression
/*
if(ctX == normalClass && cX.cl.templateArgs)
{
char * x = PrintString(cpptemplatePrefix, tn);
delete tn;
tn = x;
}
*/
if(ptrX && (ctX == normalClass || ctX == noHeadClass))
{
if(newTemplateType) debugBreakpoint();
delete tn;
tn = PrintString(cX.cSymbol, stars(ptrX, 0));
}
if(!newTemplateType && ti.type.kind == classType && ti.type._class && strchr(ti.type._class.string, '<') && strchr(ti.type._class.string, '>') )
{
bool b = false;
const char * typeString = ti.type._class.string; // strptrNoNamespace(ti.type._class.string);
// /*
BClass cT1 = ti.type._class.registered;
BClass cX2 = ti.type._class.registered.templateClass;
char * x = null;
delete tn;
tn = CopyString(cX2.cpp./*t*/name);
if(strchr(tn, '<') && strchr(tn, '>')) debugBreakpoint();
if(cT1)
;
// */
if(!strcmp(cn, "Elevator") && !strcmp(mn, "machinationExposure")) x = CopyString("HARDCODED STUFF TOFIX TODO BROKEN"), b = true;
else if(!strcmp(cn, "Container") && !strcmp(mn, "firstIterator")) x = CopyString("TIterator<TP_T, TP_D>"), b = true;
else if(!strcmp(cn, "Container") && !strcmp(mn, "lastIterator")) x = CopyString("TIterator<TP_T, TP_D>"), b = true;
else if(c.cl.templateArgs && cType.cl.templateArgs) x = PrintString(cpptemplatePrefix, tn, c.cpp.targsb), b = true;
else if(!strcmp(typeString, "ecere::com::Container<T>")) x = CopyString("TContainer<TP_T>"), b = true;
else if(!strcmp(typeString, "ecere::com::Iterator<T>")) x = CopyString("TIterator<TP_T>"), b = true;
else if(!strcmp(typeString, "ecere::com::Container<T, IT>")) x = CopyString("TContainer<TP_T, TP_IT>"), b = true;
else if(!strcmp(typeString, "ecere::com::HashMap<KT, VT>")) x = CopyString("THashMap<TP_KT, TP_VT>"), b = true;
else if(!strcmp(typeString, "ecere::com::Map<KT, V>")) x = CopyString("TMap<TP_KT, TP_V>"), b = true;
// else if(!strcmp(typeString, "ecere::com::Array<ecere::gfx3D::MeshPart>")) x = CopyString("TArray<MeshPart>");
// else if(!strcmp(typeString, "ecere::com::Array<String>")) x = CopyString("TArray<String>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::gui::Window>")) x = CopyString("TArray<Window>");
else if(!strcmp(typeString, "ecere::com::List<ecere::net::CallAck>")) x = CopyString("TList<CallAck>");
else if(!strcmp(typeString, "ecere::com::List<ecere::net::VirtualCallAck>")) x = CopyString("TList<TVirtualCallAck>");
else if(!strcmp(typeString, "ecere::com::Array<const String>")) x = CopyString("TArray<constString>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::IdFilter>")) x = CopyString("TArray<IdFilter>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::Grouping>")) x = CopyString("TArray<Grouping>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::com::Class>")) x = CopyString("TArray<Class>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::SQLiteSearchField>")) x = CopyString("TArray<SQLiteSearchField>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::StringSearchField>")) x = CopyString("TArray<StringSearchField>");
else if(!strcmp(typeString, "ecere::com::Container<eda::Field>")) x = CopyString("TContainer<Field>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::ListField>")) x = CopyString("TArray<ListField>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::StringSearchTable>")) x = CopyString("TArray<StringSearchTable>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::SQLiteSearchTable>")) x = CopyString("TArray<SQLiteSearchTable>");
// else if(!strcmp(typeString, "ecere::com::Array<eda::LookupEditor>")) x = CopyString("TArray<LookupEditor>");
// else if(!strcmp(typeString, "ecere::com::Array<RecordField>")) x = CopyString("TArray<RecordField>");
// else if(!strcmp(typeString, "ecere::com::Array<double>")) x = CopyString("TArray<double>");
else if(!strcmp(typeString, "CMSSList<CMSSExpression>")) x = CopyString("TCMSSList<CMSSExpression>");
else if(!strcmp(typeString, "ecere::com::List<CMSSNode>")) x = CopyString("TList<CMSSNode>");
else if(!strcmp(typeString, "ecere::com::List<CMSSIdentifier>")) x = CopyString("TList<CMSSIdentifier>");
// else if(!strcmp(typeString, "ecere::com::Array<ValueColor>")) x = CopyString("TArray<ValueColor>");
// else if(!strcmp(typeString, "ecere::com::Array<ValueOpacity>)")) x = CopyString("TArray<ValueOpacity>)");
// else if(!strcmp(typeString, "ecere::com::Array<GraphicalElement>")) x = CopyString("TArray<GraphicalElement>");
// else if(!strcmp(typeString, "ecere::com::Array<ValueOpacity>")) x = CopyString("TArray<ValueOpacity>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::gfx::ColorKey>")) x = CopyString("TArray<ColorKey>");
// else if(!strcmp(typeString, "ecere::com::Array<GeoData>")) x = CopyString("TArray<GeoData>");
else if(!strcmp(typeString, "ecere::com::Map<String, eda::FieldValue>")) x = CopyString("TMap<String, FieldValue>");
else if(!strcmp(typeString, "ecere::com::Map<String, GeoJSONValue>")) x = CopyString("TMap<String, GeoJSONValue>");
// else if(!strcmp(typeString, "ecere::com::Array<GeoJSONFeature>")) x = CopyString("TArray<GeoJSONFeature>");
// else if(!strcmp(typeString, "ecere::com::Array<GeoJSONSegment>")) x = CopyString("TArray<GeoJSONSegment>");
else if(!strcmp(typeString, "ecere::com::List<GeoLayer>")) x = CopyString("TList<GeoLayer>");
else if(!strcmp(typeString, "ecere::com::Map<String, CMSSStyleSheet>")) x = CopyString("TMap<String, CMSSStyleSheet>");
else if(!strcmp(typeString, "ecere::com::List<Presentation>")) x = CopyString("TList<Presentation>");
else if(!strcmp(typeString, "ecere::com::Map<ecere::gfx::Color, ecere::com::Array<uint64> >")) x = CopyString("TMap<Color, TArray<uint64>>");
else if(!strcmp(typeString, "ecere::com::Container<LineString>")) x = CopyString("TContainer<LineString>");
else if(!strcmp(typeString, "ecere::com::Container<GeoPoint>")) x = CopyString("TContainer<GeoPoint>");
else if(!strcmp(typeString, "ecere::com::Map<String, MBGLSpriteSymbol>")) x = CopyString("TMap<String, MBGLSpriteSymbol>");
// else if(!strcmp(typeString, "ecere::com::Array<int64>")) x = CopyString("TArray<int64>");
else if(!strcmp(typeString, "ecere::com::List<GeoExtent>")) x = CopyString("TList<GeoExtent>");
else if(!strcmp(typeString, "ecere::com::Map<String, MapboxGLSourceData>")) x = CopyString("TMap<String, MapboxGLSourceData>");
// else if(!strcmp(typeString, "ecere::com::Array<MBGLLayersJSONData>")) x = CopyString("TArray<MBGLLayersJSONData>");
else if(!strcmp(typeString, "ecere::com::Container<GraphicalElement>")) x = CopyString("TContainer<GraphicalElement>");
// else if(!strcmp(typeString, "ecere::com::Array<StackFrame>")) x = CopyString("TArray<StackFrame>");
else if(!strcmp(typeString, "ecere::com::Container<ecere::sys::Pointf>")) x = CopyString("TContainer<Pointf>");
else if(!strcmp(typeString, "ecere::com::Container<ecere::gfx3D::Vector3Df>")) x = CopyString("TContainer<Vector3Df>");
else if(!strcmp(typeString, "ecere::com::Container<PolygonContour>")) x = CopyString("TContainer<PolygonContour>");
else if(!strcmp(typeString, "ecere::com::Container<StartEndPair>")) x = CopyString("TContainer<StartEndPair>");
else if(!strcmp(typeString, "ecere::com::Container<Polygon>")) x = CopyString("TContainer<Polygon>");
// else if(!strcmp(typeString, "ecere::com::Array<ProcessInvocation>")) x = CopyString("TArray<ProcessInvocation>");
// else if(!strcmp(typeString, "ecere::com::Array<int>")) x = CopyString("TArray<int>");
// else if(!strcmp(typeString, "ecere::com::Array<TSRow>")) x = CopyString("TArray<TSRow>");
// else if(!strcmp(typeString, "ecere::com::Array<TSZoomLevel>")) x = CopyString("TArray<TSZoomLevel>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3IdentifierAndLinks>")) x = CopyString("TArray<WFS3IdentifierAndLinks>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3Link>")) x = CopyString("TArray<WFS3Link>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3Collection>")) x = CopyString("TArray<WFS3Collection>");
// else if(!strcmp(typeString, "ecere::com::Array<ecere::com::Array<String> >")) x = CopyString("TArray<TArray<String>>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3Queryable>")) x = CopyString("TArray<WFS3Queryable>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3VariableWidth>")) x = CopyString("TArray<WFS3VariableWidth>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3TileMatrixSetLimit>")) x = CopyString("TArray<WFS3TileMatrixSetLimit>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3TileMatrixSetLink>")) x = CopyString("TArray<WFS3TileMatrixSetLink>");
// else if(!strcmp(typeString, "ecere::com::Array<WFS3TileMatrix>")) x = CopyString("TArray<WFS3TileMatrix>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFAccessor>")) x = CopyString("TMap<String, glTFAccessor>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFAnimation>")) x = CopyString("TMap<String, glTFAnimation>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFBufferView>")) x = CopyString("TMap<String, glTFBufferView>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFBuffer>")) x = CopyString("TMap<String, glTFBuffer>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFImage>")) x = CopyString("TMap<String, glTFImage>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFMaterial>")) x = CopyString("TMap<String, glTFMaterial>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFMesh>")) x = CopyString("TMap<String, glTFMesh>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFNode>")) x = CopyString("TMap<String, glTFNode>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFProgram>")) x = CopyString("TMap<String, glTFProgram>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFSampler>")) x = CopyString("TMap<String, glTFSampler>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFScene>")) x = CopyString("TMap<String, glTFScene>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFShader>")) x = CopyString("TMap<String, glTFShader>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFSkin>")) x = CopyString("TMap<String, glTFSkin>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFTechnique>")) x = CopyString("TMap<String, glTFTechnique>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFTexture>")) x = CopyString("TMap<String, glTFTexture>");
// else if(!strcmp(typeString, "ecere::com::Array<glTFAnimationChannel>")) x = CopyString("TArray<glTFAnimationChannel>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFAnimationSampler>")) x = CopyString("TMap<String, glTFAnimationSampler>");
// else if(!strcmp(typeString, "ecere::com::Array<glTFPrimitive>")) x = CopyString("TArray<glTFPrimitive>");
else if(!strcmp(typeString, "ecere::com::Map<String, String>")) x = CopyString("TMap<String, String>");
// else if(!strcmp(typeString, "ecere::com::Array<uint>")) x = CopyString("TArray<uint>");
// else if(!strcmp(typeString, "ecere::com::Array<bool>")) x = CopyString("TArray<bool>");
else if(!strcmp(typeString, "ecere::com::Map<String, glTFTechniqueParameter>")) x = CopyString("TMap<String, glTFTechniqueParameter>");
else if(!strcmp(typeString, "ecere::com::LinkElement<thisclass>")) x = CopyString("TLinkElement<thisclass>");
else if(!strcmp(typeString, "")) x = CopyString("");
else { PrintLn(typeString); debugBreakpoint(); }
if(b)
{
delete tn;
tn = x;
}
else if(x)
delete x;
}
/*
if(ti.type.kind == classType && ti.type._class && !strcmp(ti.type._class.string, "ecere::com::Iterator<T>"))
{
// debugBreakpoint();
delete tn;
tn = PrintString("TIterator<TPT>");
}
*/
// if(tn && strstr(tn, "TP(")) debugBreakpoint();
// if(tnp2 && strstr(tnp2, "TP(")) debugBreakpoint();
// char * baseCast = base ? PrintString("(", c2.cSymbol, "*", ")") : null;
implStringThis = PrintString("self ? ", base ? "(" : "", base ? c2.cSymbol : "", base && (c.cl.type == structClass || c.cl.type == normalClass) ? "*" : "", base ? ")" : "", c.cl.type == structClass ? "&" : "", "self->impl : null");
/*if(ct == normalClass && !isString)
{
String t = PrintString(ti.type.constant ? "const " : "", tn, "&");
delete tn;
tn = t;
}*/
/*if(!strcmp(mn, "transform"))
Print("");
if(c.cl.type == noHeadClass)
{
delete tn;
tn = PrintString(cpptemplatePrefix, c.name);
}*/
// if(ti.type.kind == templateType && strcmp(mn, "controlled")) return;
// todo: remove when done solving all the cases
// if(ti.type.kind != templateType) // todo
// ti.type.kind != arrayType) // todo (broken stuff that's not generated)
{
if(isProp)
{
different = (eClass_FindDataMember(c.cl, mn, c.cl.module, null, null) || strstr(mn, "__ecerePrivateData"));
if(hasGet || different)
genGet = true;
genSet = hasSet;
}
else
{
genGet = true;
genSet = true;
}
}
/*
if(ct == normalClass)
v.processDependency(g, otypedef, otypedef, ti.type._class.registered);
*/
// note: this was only for data member and we're keeping this but that surely wrong
/*
if(!isProp && ti.type.kind == arrayType)
{
Type t = ti.type;
char arrayDataType[1024];
arrayDataType[0] = 0;
while(t.kind == arrayType && t.type) t = t.type; // todo: this is buggy, loosing indirection count
PrintType(t, arrayDataType, true, false);
delete tn;
tn = PrintString(arrayDataType, "*"); // see buggy above
}
*/
// this note was in dataMember only aka !isProp
// TODO: Don't output set if const ?
/*
if(prototype && g.expansionOrUse == expansion)
Print("");
*/
if(!prototype && ti.type.kind == templateType)
{
if(ti.type.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
toTA = PrintString("toTA<TP_", ti.type.templateParameter.identifier.string, ">(");
fromTA = PrintString("fromTA<TP_", ti.type.templateParameter.identifier.string, ">(");
fromTA2 = PrintString("fromTA<TP_", ti.type.templateParameter.identifier.string, " *>(");
}
/*if(ti.type.kind == templateType)
{
if(ti.type.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
// o.z.concatx("TP_", ti.type.templateParameter.identifier.string);
// toTA = PrintString("toTA<TP_", ti.type.templateParameter.identifier.string, ">(");
}
else */if(isProp && (ct == normalClass || ti.type.kind == templateType) && !isString)
{
if(hasSet/* && hasGet*/)
{
bool instCast = !prototype && ctX == normalClass && cX.cl.templateArgs;
bool special = instCast && cantHaveThat; // && !strcmp(cn, "Window") && !strcmp(mn, "controller");
const char * tweak = !special && instCast ? "&" : "";
//
//ing(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", addAmp ? "&" : "", toTA ? toTA : "", "v", toTA ? ")" : "", addImpl ? ".impl" : "", ");") ] };
if(special)
{
component = { macroIntPropSet, mn, PrintString(genidx(0, "A"), "const ", tn, " &"), CopyString(ctX == noHeadClass ? " &" : "") /*, commented = !hasGet*/ };
// component.dontNest = true;
if(!prototype)
component.code =
{ [ // PrintString(lc, ln, genloc__, indents(ind), "printf(\"calling ", ocn, "_set_", mn, "(", implStringThis, ", v.impl)", "\\n\");"),
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", instCast ? "((Instance *)&" : ""/*, tweak*/, "v", instCast ? ")->" : ".", "impl);") ] };
components.Add(component);
}
component = { hasGet ? macroPropSet : macroIntPropSet, mn, PrintString(genidx(0, "A"), "const ", tn, " ", special ? "*" : "&"), CopyString(ctX == noHeadClass ? " &" : "")/*, commented = !hasGet*/ };
if(special)
component.dontNest = true;
if(!prototype)
component.code =
{ [ // PrintString(lc, ln, genloc__, indents(ind), "printf(\"calling ", ocn, "_set_", mn, "(", implStringThis, ", v.impl)", "\\n\");"),
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", toTA ? "toTA("/*toTA*/ : "", instCast ? "((Instance *)" : "", tweak, "v", instCast ? ")->" : toTA ? "" : ".", toTA ? ")" : "impl", ");") ] };
components.Add(component);
}
if(hasSet/* && hasGet*/)
{
bool t = cX && cX.cl.type == normalClass && cX.cl.templateArgs != null;
component = { macroIntPropSet, mn, PrintString(genidx(0, "C"), "const ", tn, " *"), CopyString(ctX == noHeadClass ? " &" : "") };
if(!prototype)
component.code =
{ [ // PrintString(lc, ln, genloc__, indents(ind), "printf(\"calling ", ocn, "_set_", mn, "(", implStringThis, ", v ? v->impl : null)", "\\n\");"),
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", toTA ? "toTA("/*toTA*/ : "", toTA ? "" : "v ? ", t && !toTA ? "((Instance *)" : "", "v", t || toTA ? ")" : "", toTA ? "" : "->impl : null", ");") ] };
components.Add(component);
}
if(hasGet && !cantHaveThat)
{
component = { macroPropGet, mn, PrintString(genidx(0, "B"), "TIH<", tn, ">"), CopyString(ctX == noHeadClass ? " &" : "") };
if(!prototype)
{
if(fromTA) // see note on * for following *TIH
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "return *TIH<", tn, ">(", "fromTA<C(Instance)>("/*fromTA*/, ocn, "_get_", mn, "(", implStringThis, ")));") ] };
else
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "C(Instance) i = ", ocn, "_get_", mn, "(", implStringThis, ");"),
PrintString(lc, ln, genloc__, indents(ind), "TIH<", tn, "> cppi(i);"),
PrintString(lc, ln, genloc__, indents(ind), "return *cppi;") ] };
}
components.Add(component);
}
if(hasGet)
{
if(!cantHaveThat)
{
component = { macroPropGet, mn, PrintString(genidx(0, "D"), "->"), CopyString(ctX == noHeadClass ? " &" : ""), returnType = PrintString("TIH<", tn, ">") };
if(!prototype)
{
if(fromTA)
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "return TIH<", tn, ">(", "fromTA<C(Instance)>("/*fromTA*/, ocn, "_get_", mn, "(", implStringThis, ")));") ] }; // note: identical to previous except for * in *TIH
else
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "C(Instance) i = ", ocn, "_get_", mn, "(", implStringThis, ");"),
PrintString(lc, ln, genloc__, indents(ind), "TIH<", tn, "> holder(i);"),
PrintString(lc, ln, genloc__, indents(ind), "return holder;") ] };
}
components.Add(component);
component = { macroPropGet, mn, PrintString(genidx(0, "E"), tn), CopyString(ctX == noHeadClass ? " &" : "") };
if(!prototype)
{
if(fromTA)
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "return ", fromTA, ocn, "_get_", mn, "(", implStringThis, "));") ] };
else
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "C(Instance) i = ", ocn, "_get_", mn, "(", implStringThis, ");"),
PrintString(lc, ln, genloc__, indents(ind), "return ", tn, "(i);") ] };
}
components.Add(component);
}
component = { macroPropGet, mn, PrintString(genidx(0, "F"), tn, "*"), CopyString(ctX == noHeadClass ? " &" : "") };
if(!prototype)
{
if(fromTA)
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "return ", fromTA2, ocn, "_get_", mn, "(", implStringThis, "));") ] };
else
component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "C(Instance) i = ", ocn, "_get_", mn, "(", implStringThis, ");"),
PrintString(lc, ln, genloc__, indents(ind), "return BINDINGS_CLASS(i) ? (", tn, " *)INSTANCEL(i, i->_class) : (", tn, " *)0;") ] };
}
components.Add(component);
}
}
else
{
bool valAmp = cZ && cZ.cl.type == normalClass && !cZ.isString && !ptrX && !cZ.cpp.isTemplate;
bool needAmp = c.cl.type == structClass;
bool addAmp = ct == structClass;
bool addImpl = bareStyle; // ct == normalClass && !isString)/* || ct == structClass*/; // && strcmp(tn, "constString")
bool nc = ct == unitClass || ct == structClass || ct == noHeadClass; // nc: (n)o (c)lass in constructor
bool instCast = !prototype && ctX == normalClass && cX.cl.templateArgs;
bool special = ctX == normalClass && cX.cl.templateArgs && cantHaveThat; // && !strcmp(cn, "Window") && !strcmp(mn, "controller");
const char * tweak = !special && instCast ? "&" : "";
char * baseCast = base ? PrintString("(", c2.cSymbol, needAmp ? "*" : "", ")") : null;
/*
if(isProp)
{
// unmergedPropertyImpl(addAmp, addImpl, hasGet, hasSet, cn, mn, tn, tz, c, ti.type, sd, gd);
if(hasSet && (different || hasGet))
sd.concatx(ocn, "_set_", mn, "(self->impl, ", addAmp ? "&" : "", "v", addImpl ? ".impl" : "", ");");
else if(different)
sd.concatx("IPTR(self->impl, ", cn, ")->", mn, " = v;");
else if(hasSet && !hasGet)
sd.concatx(ocn, "_set_", mn, "(self->impl, ", addAmp ? "&" : "", "v", addImpl ? ".impl" : "", ");");
if(hasGet)
{
if(addAmp)
gd.concatx(tn, " value;", ocn, "_get_", mn, "(self->impl", ", &value","); ","return value;");
else if(addImpl)
gd.concatx(tn, " value(", ocn, "_get_", mn, "(self->impl), ", cn, "::_cpp_class); ", "return value;");
else
gd.concatx("return ", ocn, "_get_", mn, "(self->impl);");
}
else if(different)
{
if(addImpl)
gd.concatx("self ? ", tn, " value(IPTR(self->impl, ", cn, ")->", mn, ", ", cn, "::_cpp_class); ", "return value;", " : ", tz, ";");
else
gd.concatx("return self ? IPTR(self->impl, ", cn, ")->", mn, " : ", tz, ";");
}
}
else
{
// unmergedDataMemberImpl(addAmp, addImpl, cn, mn, tn, tz, c, ti.type, sd, gd);
// broken issue with properties of type arrayType missing a set... also, how do we really get/set? is status quo right? use "CM(" tn ")"?
if(ti.type.kind == arrayType)
gd.concatx ("return self ? ", "(", tn, ")", "IPTR(self->impl, ", cn, ")->", mn, " : ", tz, ";");
else
{
sd.concatx("IPTR(self->impl, ", cn, ")->", mn, " = v", addImpl ? ".impl" : "", ";");
if(addImpl)
gd.concatx(tn, " value(IPTR(self->impl, ", cn, ")->", mn, ", ", cn, "::_cpp_class); ", "return value;");
else
gd.concatx("return self ? IPTR(self->impl, ", cn, ")->", mn, " : ", tz, ";");
}
}
*/
if(genSet && singleSet)
{
component = { macroIntPropSet, mn, PrintString(genidx(0, "G"), tn, valAmp ? " &" : ""), CopyString(ctX == noHeadClass ? " &" : ""), tnp2 ? CopyString(tnp2) : null };
if(!prototype)
{
if(different)
{
if(hasSet)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", v);") ] };
else if(c.cl.type == normalClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = v;") ] };
else if(c.cl.type == noHeadClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)self->impl)->", mn, " = v;") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)&self->impl)->", mn, " = v;") ] };
}
else
{
component.code = { [
// PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", v);") ] };
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", needAmp ? "&" : "", "self->impl, ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", addAmp ? "&" : "", "v", addImpl ? ".impl" : "", ");") ] };
}
}
components.Add(component);
}
else if(genSet)
{
#if 0
if(special)
{
if(isProp) debugBreakpoint();
if(c.cl.type != normalClass) debugBreakpoint();
}
#endif // 0
if(someThisClass)
special = true;
if(special)
{
component = { macroIntPropSet, mn, PrintString(genidx(0, "Z"), "const ", tn, " &"), CopyString(ctX == noHeadClass ? " &" : "") };
if(!prototype)
{
ClassType ct2 = ti.type.kind == pointerType && ti.type.type.kind == classType ?
cppGetClassInfoFromType(ti.type.type, false, null/*&clDataType*/, null/*&cDataType*/, null, &isString, null) : ct;
bool ptr = ti.type.kind == pointerType && ti.type.type.kind == classType && ct2 == structClass;
if(isProp)
component.code = { [
// PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", v);") ] };
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", addAmp ? "&" : "", "v", addImpl ? ".impl" : "", ");") ] };
else if(c.cl.type == normalClass)
{
if(ctX == unitClass || ctX == bitClass)
{
const char * castSymbol = ctX == unitClass && cX.cl.base.type == unitClass ? cX.baseSymbolName : cX.cSymbol;
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = ", castX ? "(" : "", castX ? castSymbol : "", castX && ptrX ? stars(ptrX, 0) : "", castX ? ")" : "", "v", addImpl ? ".impl" : "", ";") ] };
}
else if(instCast && !cast && !ptr)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = ", instCast ? "((Instance *)&" : "", "v", instCast ? ")->" : ".", "impl", ";") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", "v", addImpl ? ".impl" : "", ";") ] };
}
else if(c.cl.type == noHeadClass)
{
if(someThisClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)self->impl)->", mn, " = ((TLinkElement<ListItem> *)&v)->impl;") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)self->impl)->", mn, " = v", addImpl ? ".impl" : "", ";") ] };
}
else if(c.cl.type == bitClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), c.upper, "_SET_", mn, "(self->impl, v", addImpl ? ".impl" : "", ");") ] };
else
{
bool instCast = !prototype && ctX == normalClass && cX.cl.templateArgs;
/*
if(!prototype) component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "printf(\"calling ", ocn, "_set_", mn, "(", implStringThis, ", v.impl)", "\\n\");"),
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", instCast ? "((Instance *)&" : "", "v", instCast ? ")->" : ".", "impl);") ] };
*/
if(ctX == unitClass || ctX == bitClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)&self->impl)->", mn, " = ", castX ? "(" : "", castX ? ctX == unitClass ? cX.spec : cX.cSymbol : "", castX && ptrX ? stars(ptrX, 0) : "", castX ? ")" : "", ptr ? "&" : "", "v", ptr ? "->" : "", addImpl ? "." : "", ptr || addImpl ? "impl" : "", ";") ] };
else if(instCast && !cast && !ptr)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)&self->impl)->", mn, " = ", instCast ? "((Instance *)&" : "", "v", instCast ? ")->" : ".", "impl;") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)&self->impl)->", mn, " = ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", ptr ? "&" : "", "v", ptr ? "->" : "", addImpl ? "." : "", ptr || addImpl ? "impl" : "", ";") ] };
}
}
components.Add(component);
}
valAmp = someThisClass;
component = { macroPropSet, mn, PrintString(genidx(0, "H"), someThisClass ? "T" : "", tn, someThisClass ? "<ListItem>" : "", special && !someThisClass ? " *" : valAmp ? " &" : ""), CopyString(ctX == noHeadClass ? " &" : ""), tnp2 ? CopyString(tnp2) : null };
// component = { macroPropSet, mn, PrintString(genidx(0, "H"), tn, " ", special ? "*" : "&"), tnp2 ? CopyString(tnp2) : null };
if(special)
component.dontNest = true;
if(!prototype)
{
ClassType ct2 = ti.type.kind == pointerType && ti.type.type.kind == classType ?
cppGetClassInfoFromType(ti.type.type, false, null/*&clDataType*/, null/*&cDataType*/, null, &isString, null) : ct;
bool ptr = ti.type.kind == pointerType && ti.type.type.kind == classType && ct2 == structClass;
if(isProp)
{
if(ti.userDataProp && ti.userDataProp.pt == ti.pt)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "if(self)"),
PrintString(lc, ln, genloc__, indents(ind + 1), "self->_", ti.userDataProp.name, " = v;") ] };
else
component.code = { [
// PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", v);") ] };
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", addAmp ? "&" : "", toTA ? toTA : "", "v", toTA ? ")" : "", addImpl ? ".impl" : "", ");") ] };
}
else if(c.cl.type == normalClass)
{
if(ctX == unitClass || ctX == bitClass)
{
const char * castSymbol = ctX == unitClass && cX.cl.base.type == unitClass ? cX.baseSymbolName : cX.cSymbol;
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = ", castX ? "(" : "", castX ? castSymbol : "", castX && ptrX ? stars(ptrX, 0) : "", castX ? ")" : "", "v", addImpl ? ".impl" : "", ";") ] };
}
else if(instCast && !cast && !ptr)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = ", instCast ? "((Instance *)&" : "", "v", instCast ? ")->" : ".", "impl", ";") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "IPTR(self->impl, ", cn, ")->", mn, " = ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", "v", addImpl ? ".impl" : "", ";") ] };
}
else if(c.cl.type == noHeadClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "((", c.cSymbol, " *)self->impl)->", mn, " = v", addImpl ? ".impl" : "", ";") ] };
else if(c.cl.type == bitClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), c.upper, "_SET_", mn, "(self->impl, v", addImpl ? ".impl" : "", ");") ] };
else
{
bool instCast = !prototype && ctX == normalClass && cX.cl.templateArgs;
/*
if(!prototype) component.code =
{ [ PrintString(lc, ln, genloc__, indents(ind), "printf(\"calling ", ocn, "_set_", mn, "(", implStringThis, ", v.impl)", "\\n\");"),
PrintString(lc, ln, genloc__, indents(ind), ocn, "_set_", mn, "(", implStringThis, ", ", instCast ? "((Instance *)&" : "", "v", instCast ? ")->" : ".", "impl);") ] };
*/
if(ctX == unitClass || ctX == bitClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "self->impl.", mn, " = ", castX ? "(" : "", castX ? ctX == unitClass ? cX.spec : cX.cSymbol : "", castX && ptrX ? stars(ptrX, 0) : "", castX ? ")" : "", ptr ? "&" : "", "v", ptr ? "->" : "", addImpl ? "." : "", ptr || addImpl ? "impl" : "", ";") ] };
else if(instCast && !cast && !ptr)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "self->impl.", mn, " = ", instCast ? "((Instance *)" : "", tweak, "v", instCast ? ")->" : ".", "impl;") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "self->impl.", mn, " = ", cast ? "(" : "", cast ? cType.cSymbol : "", cast ? ")" : "", ptr ? "&" : "", "v", ptr ? "->" : "", addImpl ? "." : "", ptr || addImpl ? "impl" : "", ";") ] };
}
}
components.Add(component);
}
if(genGet)
{
String valDecl;
bool vAmp = ct == structClass;
valAmp = cZ && !strcmp(cZ.cl.name, "LinkElement<thisclass>");
if(bareStyle)
valDecl = PrintString(tn, tnp2 ? tnp2 : "");
else
valDecl = PrintString("TIH<", tn, tnp2 ? tnp2 : "", ">"); // ', tnp2 ? tnp2 : ""' is probably an issue
component = { macroPropGet, mn, PrintString(genidx(0, "I"), tn, special && !someThisClass ? " *" : valAmp ? " &" : ""), CopyString(ctX == noHeadClass ? " &" : ""), tnp2 ? CopyString(tnp2) : null };
if(!prototype)
{
// notes for possible get of array type member / property
//if(ti.type.kind == arrayType)
// gd.concatx ("return self ? ", "(", tn, ")", "IPTR(self->impl, ", cn, ")->", mn, " : ", tz, ";");
if(isProp && !different) // when different == true we access the data member directly instead of using the property?
{
if(fromTA && (addAmp || addImpl)) debugBreakpoint();
if(ti.userDataProp && ti.userDataProp.pt == ti.pt)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return self ? self->_", ti.userDataProp.name, " : null;") ] };
else if(addAmp)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), tn, tnp2 ? tnp2 : "", " value;", ocn, "_get_", mn, "(", baseCast ? baseCast : "", needAmp ? "&" : "", "self->impl", ", ", vAmp ? "&" : "", "value", addImpl ? ".impl" : "", ");"),
PrintString(lc, ln, genloc__, indents(ind), "return value;") ] };
else if(addImpl)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), tn, tnp2 ? tnp2 : "", " value(", ocn, "_get_", mn, "(", baseCast ? baseCast : "", needAmp ? "&" : "", "self->impl", ")", nc ? "" : ", ", nc ? "" : c.cl.type == noHeadClass ? cpptemplatePrefix : "", nc ? "" : cn, nc ? "" : "::_cpp_class", ");"),
PrintString(lc, ln, genloc__, indents(ind), "return value;") ] };
else
component.code = { [
// PrintString(lc, ln, genloc__, indents(ind), "return ", ocn, "_get_", mn, "(self->impl);") ] };
PrintString(lc, ln, genloc__, indents(ind), "return ", fromTA ? fromTA : "", cast ? "(" : "", cast ? tn : "", cast ? ")" : "", ocn, "_get_", mn, "(", implStringThis, ")", fromTA ? ")" : "", ";") ] };
}
else if(c.cl.type == normalClass)
{
if(addImpl)
{
if(special)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "C(Instance) i = IPTR(self->impl, ", cn, ")->", mn, ";"),
PrintString(lc, ln, genloc__, indents(ind), "return BINDINGS_CLASS(i) ? (", cZ.cpp.name, " *)INSTANCEL(i, i->_class) : (", cZ.cpp.name, " *)0;") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), tn, tnp2 ? tnp2 : "", " value(IPTR(self->impl, ", cn, ")->", mn, nc ? "" : ", ", nc ? "" : cn, nc ? "" : "::_cpp_class", ");"),
// Container value(((C(Iterator))self->impl).container, Iterator::_cpp_class); return value;
// TIH<Container> value((C(Iterator))self->impl).container); return value;
// component.code = { [
// PrintString("TIH<", tn, tnp2 ? tnp2 : "", "> value(IPTR(self->impl, ", cn, ")->", mn, ", ", cn, "::_cpp_class);"),
// gd.concatx("self ? ", tn, " value(IPTR(self->impl, ", cn, ")->", mn, ", ", cn, "::_cpp_class);", "return value;", " : ", tz, ";");
// note: this is apparently missing a self check for when different == true ... but that seems broken... ? : syntax spanning
// two lines of code...
PrintString(lc, ln, genloc__, indents(ind), "return value;") ] };
}
else
{
if(ctX == unitClass || ctX == bitClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return self ? ", cnst ? tn : "", (castX || cnst) ? "(" : "", castX ? tn : "", castX ? ")" : "", "IPTR(self->impl, ", cn, ")->", mn, cnst ? ")" : "", " : ", tz, ";") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return self ? ", cnst ? tn : "", (cast || cnst) ? "(" : "", cast ? tn : "", cast ? ")" : "", "IPTR(self->impl, ", cn, ")->", mn, cnst ? ")" : "", " : ", tz, ";") ] };
}
}
else if(c.cl.type == noHeadClass)
{
if(addImpl)
// component.code = { [
// PrintString(tn, tnp2 ? tnp2 : "", " value(((", c.cSymbol, " *)self->impl)->", mn, ", ", cn, "::_cpp_class);"),
// Container value(((C(Iterator))self->impl).container, Iterator::_cpp_class); return value;
// TIH<Container> value((C(Iterator))self->impl).container); return value;
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), valDecl, " value(((", c.cSymbol, " *)self->impl)->", mn, ");"),
PrintString(lc, ln, genloc__, indents(ind), "return value;") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return self ? ((", c.cSymbol, " *)self->impl)->", mn, " : ", tz, ";") ] };
}
else if(c.cl.type == bitClass)
{
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return ", cast ? "(" : "", cast ? tn : "", cast ? ")" : "", c.upper, "_", mn, "(self->impl);") ] };
}
else
{
if(addImpl)
{
// component.code = { [
// PrintString(tn, tnp2 ? tnp2 : "", " value(((", c.cSymbol, ")self->impl).", mn, ", ", cn, "::_cpp_class);"),
// Container value(((C(Iterator))self->impl).container, Iterator::_cpp_class); return value;
// TIH<Container> value((C(Iterator))self->impl).container); return value;
if(special)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "C(Instance) i = ((", c.cSymbol, " *)&self->impl)->", mn, ";"),
PrintString(lc, ln, genloc__, indents(ind), "return BINDINGS_CLASS(i) ? (", cZ.cpp.name, " *)INSTANCEL(i, i->_class) : (", cZ.cpp.name, " *)0;") ] };
else if(ctX == unitClass)
{
bool baseUnit = cType != cType.cUse;
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return ", cType.cpp.name, baseUnit ? "(" : "", baseUnit ? cType.cUse.cpp.name : "", "(self->impl.", mn, ")", baseUnit ? ")" : "", ";") ] };
}
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), valDecl, " value(((", c.cSymbol, " *)&self->impl)->", mn, ");"),
PrintString(lc, ln, genloc__, indents(ind), "return ", bareStyle ? "" : "*", "value;") ] };
}
else
{
if(ctX == unitClass || ctX == bitClass)
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return self ? ", cnst ? tn : "", (castX || cnst) ? "(" : "", castX ? tn : "", castX ? ")" : "", "((", c.cSymbol, " *)&self->impl)->", mn, cnst ? ")" : "", " : ", ctX == unitClass ? "0" : tz, ";") ] };
else
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return self ? ", cnst ? tn : "", (cast || cnst) ? "(" : "", cast ? tn : "", cast ? ")" : "", "((", c.cSymbol, " *)&self->impl)->", mn, cnst ? ")" : "", " : ", tz, ";") ] };
}
}
}
delete valDecl;
components.Add(component);
if(ct == unitClass && !cType.isUnichar)
{
Class clReduced = getUnitClassReducedToBase(cType.cl);
BClass cReducedType = clReduced ? clReduced : cType;
component = { macroPropGet, mn, PrintString(genidx(0, "J"), cReducedType.cSymbol/*cType.spec*/), CopyString(ctX == noHeadClass ? " &" : ""), null/*, commented = true*/ };
if(!prototype)
{
component.code = { [
PrintString(lc, ln, genloc__, indents(ind), "return ", cType.cpp.name, "(self->", mn, ");") ] };
}
components.Add(component);
}
}
}
// const char * tp = te ? "<TPT>" : "";
// const char * tp2 = te ? "<class TPT>" : "";
// opts.type == template
{
bool is = opts.type == template;
bool only = isProp && !(hasGet && hasSet);
const char * which = only ? hasGet ? "get" : "set" : "";
// if(!isProp) debugBreakpoint();
if(!opts.prototype)
{
const char * subType = cZ && classTypeHasNativeSubType(cZ.cl.type) ? cZ.cl.dataTypeString ? cZ.cl.dataTypeString : "?" : "";
o.z.concatx(ln, "// ", isProp ? "property callers" : "member accessors", ": ", cn, "::", mn, only ? " // " : "", which, only ? " only" : "", ln);
o.z.concatx("// (", bclassToSimpleClassTypeString(c), "::", cZ ? bclassToSimpleClassTypeString(cZ) : ti.typeString, subType[0] ? "|" : "", subType, ")");
// if(c.isClassTemplatable || cXT)
// outputClassView(o.z, genspc__, cXT ? cXT : c);
// o.z.concatx("(", c.simpleTemplateClassKind, "::", cXT ? cXT.simpleTemplateClassKind : cX.simpleTemplateClassKind, ")");
o.z.concatx(ln, ln);
}
cppMacroProperty(g, o.z, g.expansionOrUse, opts, ti, prototype ? 1 : 0, components, mn, tn, cn, "sg", is ? c.cpp.targsbm : "", is ? c.cpp.templatem : "", 0); // todo: why 2... aka <TPT> vs <class TPT>
}
delete tn;
delete implStringThis;
delete toTA;
delete fromTA;
delete fromTA2;
components.Free();
delete components;
}
/*
static void outputClassView(ZString o, const char * str, Class cl)
{
BClass c;
o.concatx(str, "// ");
for(c = cl; c; c = c.cl.base)
{
o.concatx("", ln);
}
o.concat(ln);
}
*/
static bool hasTemplateClass(Class cl)
{
if(cl.templateClass)
return true;
return false;
}
static bool hasOrBaseHasTemplateClass(Class cl)
{
for(; cl; cl = cl.base)
if(cl.templateClass)
return true;
return false;
}
static bool hasOrBaseHasTemplateAnything(Class cl)
{
for(; cl; cl = cl.base)
if(cl.templateClass || cl.templateArgs || cl.templateParams.first/* || cl.templatized*/)
return true;
return false;
}
// TOCHECK: bare being false indicates to add the C() prefixing macro to refer to the C bindings type
// Currently, as only normal classes are generated, and not class:struct classes,
// the class:struct classes should have the C() types
char * cppTypeName(TypeInfo ti, bool bare, char ** typeZero, char ** typeNameSecondPart)
{
char * result = null;
char * secondPart;
bool isString;
bool isConst;
// Class clRegRet;
ClassType ct = cppGetClassInfoFromType(ti.type, true, null/*&clRegRet*/, null, null, &isString, &isConst);
ZString z { allocType = heap };
// BClass cRegRet = clRegRet;
//cppTypeNameCall = true;
// note: calling zTypeName creates templaton output objects with null z
// int ptr = 0;
// Type t = unwrapPointerType(ti.type, &ptr);
if(isString)
{
if(isConst)
z.concatx("/*CT-D*/constString");
else
z.concat("char *");
}
else if(ti.type.kind == templateType/* || t.type.kind == templateType*/)
{
if(ti.type.templateParameter.type != type) debugBreakpoint();
z.concatx("TP_", ti.type.templateParameter.identifier.string);
}
else if(ti.type.kind == subClassType)
z.concatx(g_.sym.__class, " *");
else if(ti.type.kind == thisClassType)
z.concatx(g_.sym.__class, " *");
else
zTypeName(z, null, ti, { anonymous = true, bare = /*cRegRet && cRegRet.isBool ? true : */bare/**/, cpp = true/**/ }, null);
//cppTypeNameCall = false;
{
//if(ct == normalClass) // || ct == noHeadClass)
// z.concat(" &");
}
if(typeNameSecondPart) *typeNameSecondPart = null;
secondPart = strchr(z._string, '[');
if(secondPart)
{
int len = secondPart - z._string;
if(ti.typeString)
{
char * secondPart = strchr(ti.typeString, '[');
if(secondPart)
{
int len = secondPart - (char*)ti.typeString; // weird: warning: incompatible expression secondPart - ti.typeString (char *); expected int
if(typeNameSecondPart)
*typeNameSecondPart = CopyString(secondPart);
while(isspace(ti.typeString[len - 1]))
len--;
result = new char[len + 1];
strncpy(result, ti.typeString, len);
result[len] = '\0';
}
}
if(typeNameSecondPart && *typeNameSecondPart == null)
*typeNameSecondPart = CopyString(secondPart);
if(!result)
{
while(isspace(z._string[len - 1]))
len--;
result = new char[len + 1];
strncpy(result, z._string, len);
result[len] = '\0';
}
if(!typeNameSecondPart)
PrintLn("warning: cppTypeName called without typeNameSecondPart when needed.");
}
else
result = CopyString(z._string);
if(typeZero)
{
if(ti.type.kind == pointerType)
*typeZero = CopyString("null");
else
{
switch(ct)
{
case normalClass:
case noHeadClass:
*typeZero = CopyString("0"/*"null"*/); // is 'null' desireable?
break;
case bitClass:
/*
{
ZString z2 { allocType = heap };
zTypeName(z2, null, ti, { anonymous = true, bare = bare }, null);
*typeZero = PrintString(z._string, "((", z2._string, ")0)");
delete z2;
break;
}
*/
case structClass:
*typeZero = PrintString(z._string, "()"); // "(const ", z._string, "){ 0 }");
break;
case enumClass:
*typeZero = PrintString("(", z._string, ")0"); // todo: false / true
break;
case systemClass:
case unitClass:
case unionClass:
*typeZero = CopyString("0");
break;
}
}
}
delete z;
return result;
/*
char * name = null;
SpecsList quals = null;
if(ti && ti.type)
{
int ptr = 0;
Type t = unwrapPointerType(ti.type, &ptr);
SpecialType st = specialType(t);
switch(st)
{
case normal:
break;
case baseClass:
case typedObject:
case anyObject:
shh();
break;
}
}
return name;
*/
}
char * cppTypeSpecToString(const char * ident, TypeInfo ti, OptBits opt, BVariant vTop)
{
char * result;
TypeNameList list { };
astTypeName(ident, ti, opt, vTop, list);
result = ec2PrintToString(list, false);
list.Free();
delete list;
return result;
}
void cppTypeSpec(ZString z, const char * ident, TypeInfo ti, OptBits opt, BVariant vTop)
{
TypeNameList list { };
astTypeName(ident, ti, opt, vTop, list);
ec2PrintToZedString(z, list, false);
list.Free();
delete list;
}
// todo: remove all use of cppGetClassInfoFromType, remove this function in favor of unwrapPtrTypeGetClassInfo
ClassType cppGetClassInfoFromType(Type type, bool hackTemplates, Class * clRegRet, BClass * cParamRet, bool * hackRet, bool * isString, bool * isConst)
{
// TODO: Review all this...
ClassType ct = systemClass;
Class clReg = null;
BClass cParam = null;
bool hack = false;
if(type.kind == classType && type._class)
{
Symbol _class = type._class;
bool any = type.classObjectType == anyObject;
const char * name = _class.string ? strptrNoNamespace(_class.string) : null;
clReg = type._class.registered;
if(!clReg && name && g_.lib.ecereCOM && tmpcppececeremessclass.Find(name))
clReg = getEcEcereMessBaseClass(name);
if(hackTemplates)
{
if(clReg && clReg.templateClass)
clReg = clReg.templateClass; // Resolve to non-parameterized template class for now...
}
if(clReg) ct = clReg.type;
hack = g_.lib.ecereCOM && (ct == normalClass || ct == noHeadClass) &&
tmpcppececeremessclass.Find(name ? name : strptrNoNamespace(type._class.registered.name));
cParam = (ct != systemClass || any) ?
clReg && !any && !hack ? clReg : eSystem_FindClass(g_.mod, "Instance") : null;
if(!cParam && ct == bitClass)
Print("");
}
if(clRegRet) *clRegRet = clReg;
if(cParamRet) *cParamRet = cParam;
if(hackRet) *hackRet = hack;
if(isString) *isString = cParam ? cParam.isString : false;
if(isConst) *isConst = /*isString && *isString && */type.specConst/* ? true : false*/;
return ct;
}
Type unwrapPtrTypeGetClassInfo(Type type, bool hackTemplates, Class * clRegRet, BClass * cParamRet, BClass * cXT, int * ptr, bool * hackRet, bool * isString, bool * isConst)
{
// todo: assert(*ptr == 0);
// TODO: Review all this...
Type t = unwrapPtrType(type, ptr);
ClassType ct = systemClass;
Class clReg = null;
Class clRegT = null;
BClass cParam = null;
bool hack = false;
if(t.kind == classType && t._class)
{
Symbol _class = t._class;
bool any = t.classObjectType == anyObject;
const char * name = _class.string ? strptrNoNamespace(_class.string) : null;
clReg = t._class.registered;
if(!clReg && name && g_.lib.ecereCOM && tmpcppececeremessclass.Find(name))
clReg = getEcEcereMessBaseClass(name);
if(hackTemplates)
{
if(clReg && clReg.templateClass)
{
clRegT = clReg;
clReg = clReg.templateClass; // Resolve to non-parameterized template class for now...
}
}
if(clReg) ct = clReg.type;
hack = g_.lib.ecereCOM && (ct == normalClass || ct == noHeadClass) &&
tmpcppececeremessclass.Find(name ? name : strptrNoNamespace(t._class.registered.name));
cParam = (ct != systemClass || any) ?
clReg && !any && !hack ? clReg : eSystem_FindClass(g_.mod, "Instance") : null;
if(!cParam && ct == bitClass)
Print("");
}
if(clRegRet) *clRegRet = clReg;
if(cParamRet) *cParamRet = cParam;
if(cXT) *cXT = clRegT;
if(hackRet) *hackRet = hack;
if(isString) *isString = cParam ? cParam.isString : false;
if(isConst) *isConst = /*isString && *isString && */t.specConst/* ? true : false*/;
return t;
}
enum CPPParamsOutputMode
{
regMethodParamList,
regMethodCppParamList,
regMethodCppParamList2,
regMethodArgsPassingEcToCpp,
regMethodArgsPassingCppToEc,
regMethodArgsPassing2,
regMethodArgsPassing3,
regMethodArgsPassingOther,
regMethodLocalConvEcToCppVarsForArgsPassing,
regMethodArgsPoorObjectPassing2,
regMethodArgsPoorObjectPassing3,
_argParamList,
_argSpecialThisParamList,
passing;
property char
{
get
{
switch(this)
{
case regMethodParamList: return 'a';
case regMethodCppParamList: return 'b';
case regMethodCppParamList2: return 'c';
case regMethodArgsPassingEcToCpp: return 'd';
case regMethodArgsPassingCppToEc: return 'm';
case regMethodArgsPassing2: return 'e';
case regMethodArgsPassing3: return 'f';
case regMethodArgsPassingOther: return 'm';
case regMethodLocalConvEcToCppVarsForArgsPassing: return 'g';
case regMethodArgsPoorObjectPassing2: return 'h';
case regMethodArgsPoorObjectPassing3: return 'i';
case _argParamList: return 'j';
case _argSpecialThisParamList: return 'k';
case passing: return 'l';
}
return '0';
}
}
};
struct ParamsOptions
{
bool forMethodCallers; // todo
bool cppDirectObjects;
bool inStdApply;
const String utilStr1;
};
char * cppParams(BClass c, TypeInfo ti, CPPParamsOutputMode mode, BVariant vTop, const char * cn,
bool addthisarg, bool comma, const char * prefix, MacroMode macro, const char ** first, const char ** nameParamOfClassType, bool * hasStructClassParam, bool * hasVarArgs, ParamsOptions opts)
{
char x = mode;
// char m = macro;
char * result;
ZString z { allocType = heap };
Type t = ti.type;
bool noParams = t.params.count == 0 || (t.params.count == 1 && ((Type)t.params.first).kind == voidType);
// z.concatx("/* ", mode, " */");
if(x); // get rid of warning
if(mode == regMethodArgsPassingOther && prefix)
z.concat(prefix);
if(noParams && !addthisarg)
{
/*if(mode == _argParamList)
z.concat("void");*/
}
else
{
Type param;
Type templateParam = null;
Type firstParam = null;
Type nextParam = null;
bool prevParamIsTypedObject = false;
bool skipSep = false;
const char * sep = "";
uint ap;
if(c && !t.staticMethod && t.thisClassTemplate && mode != passing)
{
templateParam = processTypeStringOk("uint64");
if(t.thisClassTemplate.type == type)
{
// t.thisClassTemplate.identifier.string
}
}
if(addthisarg)
{
// if(mode == regMethodParamList)
{
if(t.classObjectType == typedObject && (mode == regMethodParamList || mode == regMethodCppParamList))
{
z.concatx("XClass * _class");
if(!sep[0]) sep = ", ";
}
if(!t.staticMethod)
{
if(t.thisClass && t.thisClass.string)
{
if(!strcmp(t.thisClass.string, "class"))
firstParam = processTypeStringOk("any_object");
else
firstParam = processTypeStringOk(t.thisClass.string);
}
else if(!templateParam || (mode != regMethodParamList && mode != regMethodArgsPassingOther))
{
// if(c.isApplication)
// firstParam = processTypeStringOk("Instance");
// else
firstParam = processTypeStringOk(cn);
}
}
}
}
// todo: handle typed object
if(((mode == regMethodParamList || mode == regMethodCppParamList || mode == regMethodArgsPassingEcToCpp || mode == regMethodArgsPassingCppToEc ||
mode == regMethodArgsPassing2 || mode == regMethodArgsPassing3 || mode == regMethodLocalConvEcToCppVarsForArgsPassing ||
mode == regMethodArgsPoorObjectPassing2 || mode == regMethodArgsPoorObjectPassing3) &&
comma == true) || mode == passing) sep = ", ";
ap = 0;
// for(param = templateParam ? templateParam : firstParam ? firstParam : t.params.first; param; param = nextParam)
for(param = firstParam ? firstParam : templateParam ? templateParam : t.params.first; param; param = nextParam)
{
if(param.kind != voidType)
{
char * apname = null;
MapIterator<consttstr, const String> i { map = methodParamNameSwap };
const char * name = i.Index({ ti.m ? ti.m.mname : ti.f.oname, param.name }, false) ? i.data : param.name;
Class clReg = null;
BClass cParam = null;
BClass cParamT = null;
bool hack;
// bool notSelf = !firstParam || param != firstParam;
bool isString;
bool isConst;
bool prmIsFn = param.kind == functionType || (param.kind == pointerType && param.type.kind == functionType);
int ptr = 0;
Type type = unwrapPtrTypeGetClassInfo(param, true, &clReg, &cParam, &cParamT, &ptr, &hack, &isString, &isConst);
bool boolPtr = ptr && cParam && cParam.isBool;
ClassType ct = clReg ? clReg.type : systemClass;
// ClassType ct = cppGetClassInfoFromType(param, true, &clReg, &cParam, &hack, &isString, &isConst);
char * typeString = null; // will have the name in if dealing with an arrayType
char * paramString = null;
if(g_.lib.ecereCOM && param.kind == classType && !clReg && !strcmp(param._class.string, "Alignment")) // hack
ct = enumClass;
// if(param == templateParam && mode == _argParamList) debugBreakpoint();
if(hasVarArgs && param.kind == ellipsisType)
*hasVarArgs = true;
if(!name) apname = param == firstParam ? CopyString(opts.utilStr1 ? opts.utilStr1 : "o_") : param == templateParam ? CopyString(t.thisClassTemplate.identifier.string) : PrintString("ap", ++ap), name = apname;
if(templateParam)
apname[0] = (char)tolower(apname[0]);
if(skipSep)
skipSep = false;
else
z.concatx(sep);
if(hasStructClassParam && param != firstParam && param.kind == classType && ct == structClass)
*hasStructClassParam = true;
switch(mode)
{
case regMethodParamList:
case regMethodCppParamList:
case regMethodCppParamList2:
case regMethodArgsPassingEcToCpp:
case regMethodArgsPassingCppToEc:
case regMethodArgsPassing2: // tocheck: is this also same and rename?
case regMethodArgsPassing3:
case _argParamList:
// case _argSpecialThisParamList:
{
//const char * typeString = param.kind == classType && param.classObjectType == anyObject ? g.sym.instance : tokenTypeString(param);
bool passing = mode == regMethodArgsPassingEcToCpp || mode == regMethodArgsPassingCppToEc ||
mode == regMethodArgsPassing2 || mode == regMethodArgsPassing3;
bool cpp = mode == regMethodCppParamList || mode == regMethodCppParamList2 ||
mode == regMethodArgsPassing2 || mode == regMethodArgsPassing3;
// bool v2 = mode == regMethodCppParamList2 || mode == regMethodArgsPassing3;
if(type.kind == templateType)
{
// typeString = PrintString("TP(", c.name, ", ", type.templateParameter.identifier.string, ")");
if(type.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
typeString = PrintString("TP_", type.templateParameter.identifier.string);
}
else if(type.kind == classType && type.classObjectType == anyObject)
{
if(c.isInstance)
typeString = CopyString(g_.sym.instance);
else
typeString = printType(type, false, false, true);
}
else if(type.kind == classType && type._class && type._class.registered && type._class.registered.templateClass)
{
if(cParamT && cParamT.cpp.dataTypeString)
typeString = CopyString(cParamT.cpp.dataTypeString);
else if(cpp && (ct == bitClass || ct == noHeadClass || (ct == normalClass && !isString) || ct == structClass || ct == unitClass))
typeString = CopyString(cParam.cpp.name);
else
typeString = CopyString(cParam.cSymbol);
}
else if(prmIsFn)
paramString = cppTypeSpecToString(param.name, { type = param }, { param = true/* todo: set macroCommas when used in virtual method macro? */ }, null);
else if(cParam && type.kind == classType && cParam.isString)
{
if(!passing && mode != _argParamList)
{
bool bare = (ct == bitClass || ct == enumClass || (ct == normalClass && !isString));
cppTypeSpec(z, "ident___", { type = param, cl = ti.cl }, { anonymous = true, bare = bare, cpp = true }, ti.cl);
}
}
else if(type.kind == subClassType)
typeString = PrintString(g_.sym.__class, " *");
else if(type.kind == ellipsisType)
typeString = prevParamIsTypedObject ? CopyString(opts.inStdApply ? "auto ...args" : "const Ts&... ts") : CopyString("Args... args");
else if(!cParam && type.kind == classType && type.classObjectType == typedObject)
;
else if(ptr && cParam && cParam.isBool)
typeString = PrintString(cParam.cSymbol/*, " ", stars(ptr, 0)*/);
else if(mode == regMethodParamList && param == templateParam)
typeString = PrintString("TP(", c.cl.name, ", ", t.thisClassTemplate.identifier.string, ")"); // CopyString("TPT"); // cpp ? : PrintString("")
else if(param == templateParam)
typeString = PrintString("TP_", t.thisClassTemplate.identifier.string); // CopyString("TPT");
else if(mode == regMethodCppParamList && c && cParam && cParam.cl == c.cl && c.cpp.isTemplate) // todo: check if we should apply this to other modes as well
typeString = PrintString(cParam.cpp.tname, cParam.cpp.targsb);
else
{
// tocheck: unitClass is missing here compared to the dependency thing next
bool override = cpp &&
((ct == bitClass && !passing) || (ct == enumClass && !passing) || ct == noHeadClass ||
(ct == normalClass && !isString) || (ct == structClass && !passing) || (ct == unitClass && !passing)); // (!v2 || passing)
if(override) normalClassMacroOverride = true;
typeString = printType(type, type.kind == arrayType, false, true);
if(override) normalClassMacroOverride = false;
}
break;
}
}
switch(mode)
{
case regMethodParamList:
case regMethodCppParamList:
case regMethodCppParamList2:
{
//const char * name = iMetParNamSwp.Index({ ti.m.mname, param.name }, false) ? iMetParNamSwp.data : param.name;
bool cpp = mode == regMethodCppParamList || mode == regMethodCppParamList2;
bool v2 = mode == regMethodCppParamList2;
// if(notSelf && param.kind == classType && !(cParam && cParam.isString) &&
// (ct == normalClass || (cpp && ct == noHeadClass)) && cpp)
// z.concatx("const ");
// ct == structClass param doesn't require a dependency here since it's always a reference
// if(cpp && !ptr && ((ct == normalClass && !isString)/* || ct == noHeadClass || ct == bitClass || ct == enumClass || ct == unitClass*/) &&
// !cParam.isBool && !(vTop.kind == vclass && cParam == vTop.c))
// vTop.processDependency(g_, otypedef, otypedef, cParam.cl);
if(first && !firstParam && !*first) *first = name;
if(nameParamOfClassType && !firstParam && !*nameParamOfClassType && clReg && !strcmp(clReg.name, ti.cl.name))
*nameParamOfClassType = name;
if(typeString)
z.concatx(genidx(1A, x), strptrNoNamespace(typeString), !ptr ? "" : " ", !ptr ? "" : stars(ptr, 0));
else if(param.kind == classType && param.classObjectType == typedObject)
{
if(!(param.next && param.next.kind == ellipsisType))
z.concatx(genidx(1B, x), "typed_object_class_ptr class_", name, ", void * ", name);
else
skipSep = true;
}
if((param.kind == classType && ((ct == noHeadClass && !cpp) || (ct == structClass && (!cpp || v2)))) ||
(firstParam && t.classObjectType == typedObject && t.byReference))
z.concatx(" *");
else if((param == templateParam && mode != regMethodParamList) || (param.kind == classType &&
((ct == normalClass && !isString)/* || (cpp && ct == noHeadClass)*/ || (cpp && !v2 && ct == structClass)) &&
(cpp || (cParam && cParam.isString) || (cParamT && cParamT.cpp.dataTypeString))))
z.concatx(" &");
if(prmIsFn)
z.concatx(paramString);
else if(param.kind == ellipsisType || (param.kind == classType && param.classObjectType == typedObject))
;
else if(param.kind != arrayType)
z.concatx(" ", name);
delete typeString;
if(!sep[0]) sep = ", ";
break;
}
case regMethodLocalConvEcToCppVarsForArgsPassing:
case regMethodArgsPoorObjectPassing2: // tocheck: is this also same and rename?
case regMethodArgsPoorObjectPassing3:
{
bool forMethodCallers = mode == regMethodArgsPoorObjectPassing2 || mode == regMethodArgsPoorObjectPassing3;
if(param == templateParam)
z.concatx(genidx(2A, x), "TIH<", "TP_", t.thisClassTemplate.identifier.string, "> ", name, "__holder(fromTA<C(Instance)>(", name, ")); ");
// use of c instead of cParam probably broken
else if(c && c.isInstance && param.kind == classType && param.classObjectType == anyObject)
z.concatx(genidx(2A, x), "TIH<", c.name, "> ", name, "_l(", name, "); ");
else if((ct == normalClass && !isString) && !forMethodCallers)
{
const char * typeName = cParamT && cParamT.cpp.dataTypeString ? cParamT.cpp.dataTypeString : cParam.cpp.isTemplate ? cParam.cpp.tname : cParam.cpp.name;
// z.concatx(genidx(2B, x), "TIH<", cParam.cl.templateArgs ? cpptemplatePrefix : "", cParam.name, "> ", name, "_l(", name, "); ");
z.concatx(genidx(2B, x), "TIH<", typeName, (!cParamT && cParam.cpp.isTemplate) ? cParam.cpp.targsb : "", "> ", name, "_l(", name, "); ");
}
else if(mode == regMethodLocalConvEcToCppVarsForArgsPassing && ct == noHeadClass && !ptr)
{
// if(clReg && mode == regMethodLocalConvEcToCppVarsForArgsPassing)
// vTop.processDependency(g_, otypedef, otypedef, clReg);
z.concatx(genidx(2C, x), cParam.name, " ", name, "_l(", name, "); ");
}
break;
}
case regMethodArgsPassingOther:
if(param.kind == classType && param.classObjectType == typedObject)
z.concatx("class_", name, ", ");
z.concatx(name);
if(!sep[0]) sep = ", ";
break;
case regMethodArgsPassingEcToCpp:
{
bool inReg = opts.cppDirectObjects;
if(param == templateParam)
z.concatx(genidx(3A, x), "*", name, "__holder");
else if(c && c.isInstance && type.kind == classType && type.classObjectType == anyObject)
z.concatx(genidx(3A, x), "*", name, "_l");
else if(!inReg && ct == normalClass && !isString)
z.concatx(genidx(3B, x), "*", name, "_l");
else if(!inReg && ct == noHeadClass)
z.concatx(genidx(3C, x), name, "_l");
else if(!inReg && boolPtr)
z.concatx(genidx(3F, x), name);
// else if(ct == enumClass)
// z.concatx("(", cParam.name, ")", name);
else if(ct == bitClass || ct == enumClass || (ct == structClass && ptr) || (ct == unitClass && !cParam.isUnichar))
z.concatx(genidx(3H, x), "(", cParam ? cParam.name : "Alignment", ptr ? " " : "", ptr ? stars(ptr, 0): "", ")", name); // hack
else if(ct == structClass)
z.concatx(genidx(3I, x), "*(", cParam.cpp.name, " *)", name);
else if(param.kind == classType && param.classObjectType == typedObject)
z.concatx(genidx(3J, x), "class_", name, ", ", name);
else
z.concatx(genidx(3K, x), name);
if(!sep[0]) sep = ", ";
break;
}
case regMethodArgsPassingCppToEc:
{
bool inReg = opts.cppDirectObjects;
if(c && c.isInstance && type.kind == classType && type.classObjectType == anyObject)
z.concatx(genidx(4A, x), "*", name, "_l");
else if(!inReg && ct == normalClass && !isString)
z.concatx(genidx(4B, x), "*", name, "_l");
else if(!inReg && ct == noHeadClass)
z.concatx(genidx(4C, x), name, "_l");
else if(!inReg && boolPtr)
z.concatx(genidx(4F, x), name);
// else if(ct == enumClass)
// z.concatx("(", cParam.name, ")", name);
else if(ct == bitClass || ct == enumClass || (ct == structClass && ptr) || (ct == unitClass && !cParam.isUnichar))
z.concatx(genidx(4H, x), "(", cParam ? ptr && cParam.isBool ? cParam.cSymbol : cParam.name : "Alignment", ptr ? " " : "", ptr ? stars(ptr, 0): "", ")", name); // hack
else if(c && cParam && cParam.cl == c.cl && c.cpp.isTemplate)
z.concatx(genidx(4I, x), "(c &)", name);
else
z.concatx(genidx(4I, x), name);
if(!sep[0]) sep = ", ";
break;
}
case regMethodArgsPassing2: // tocheck: is this also same and rename?
case regMethodArgsPassing3:
{
// int ptr2 = 0;
bool v2 = mode == regMethodArgsPassing3;
if(param.kind == ellipsisType)
z.concatx(genidx(5A, x), /*prevParamIsTypedObject ? "ts..." : */"args...");
else if(c && c.isInstance && type.kind == classType && type.classObjectType == anyObject)
z.concatx(genidx(5B, x), "*", name, "_l");
else if(!opts.cppDirectObjects && ((ct == normalClass && !isString) || ct == noHeadClass || (ct == structClass && !ptr)))
{
if((v2 && ct == structClass) || (ptr && ct == noHeadClass))
z.concatx(genidx(5C, x), "(", cParam.cSymbol, " *)", name);
else
{
bool tt = ct == normalClass && clReg.templateArgs != null;
bool cpp = mode == regMethodArgsPassing2; // regMethodCppParamList || mode == regMethodCppParamList2;
// bool v2 = mode == regMethodCppParamList2;
// make these into a single enum var
bool usingPtr = false; // todo: make these global to all cases and tweak only where differences exist.... and clean all the things here like that
bool usingRef = false;
if((param.kind == classType && ((ct == noHeadClass && !cpp) || (ct == structClass && (!cpp || v2)))) ||
(firstParam && t.classObjectType == typedObject && t.byReference))
usingPtr = true;
else if(param.kind == classType &&
((ct == normalClass && !isString)/* || (cpp && ct == noHeadClass)*/ || (cpp && !v2 && ct == structClass)) && (cpp || (cParam && cParam.isString)))
usingRef = true;
z.concatx(genidx(5D, x), ct == structClass ? "&" : "", tt ? "((Instance&" : "", tt && usingPtr ? "*" : tt && usingRef ? "&" : "", tt ? ")" : "", name, tt ? ")" : "", ".impl");
}
}
// else if(ct == enumClass)
// z.concatx("(", cParam.cSymbol, ")", name);
else if(ct == bitClass || ct == enumClass || (ct == structClass && ptr) || (ct == unitClass && !cParam.isUnichar))
{
bool impl = !ptr && ct != enumClass;
z.concatx(genidx(5E, x), "(", strptrNoNamespace(typeString), ptr ? " " : "", ptr ? stars(ptr, 0): "", ")", name, impl ? ".impl" : "");
}
else if(param.kind == classType && param.classObjectType == typedObject)
{
if(!(param.next && param.next.kind == ellipsisType))
z.concatx(genidx(5F, x), "class_", name, ", ", name);
else
skipSep = true;
}
else
z.concatx(genidx(5G, x), name);
if(!sep[0]) sep = ", ";
break;
}
case _argParamList:
case _argSpecialThisParamList:
{
bool bare = (ct == bitClass || ct == enumClass || (ct == normalClass && !isString)/* || ct == noHeadClass*/);
// bool bare = (ct == bitClass || ct == enumClass/* || ct == normalClass*/);
if(prmIsFn)
;
else if(hack)
{
char * tStr = cppTypeSpecToString("ident___", { type = param, cl = ti.cl }, { anonymous = true, bare = bare, cpp = true }, ti.cl);
strSquashComments(tStr);
z.concatx(genidx(6A, x), cParam.name, " /*", tStr, "*/");
if((ct == normalClass && !isString) || ct == noHeadClass)
z.concatx(" &");
delete tStr;
}
else if(c.isInstance && param.kind == classType && param.classObjectType == anyObject)
z.concatx(genidx(6B, x), cn, " &");
else if(ptr && cParam && cParam.isBool)
{
z.concatx(genidx(6C, x), cParam.cSymbol);
// cppTypeSpec(z, "ident___", { type = param, cl = ti.cl }, { anonymous = true }, ti.cl);
z.concatx(" ", stars(ptr, 0));
}
else if(param.kind == classType && param.classObjectType == typedObject)
z.concatx(genidx(6D, x), "typed_object_class_ptr class_", name, !macro ? " ," : " _ARG", " void * ");
else if(param.kind == templateType)
{
if(param.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
z.concatx(genidx(6E, x), "TP_", param.templateParameter.identifier.string);
}
else
{
z.concatx(genidx(6F, x));
if(cParam && cParam.cl && cParam.cl.templateArgs && eClass_IsDerived(cParam.cl, c.cl))
z.concatx(cpptemplatePrefix);
if(param == templateParam)
z.concatx(typeString, " &");
else
cppTypeSpec(z, "ident___", { type = param, cl = ti.cl }, { anonymous = true, bare = bare, cpp = true }, ti.cl);
// if(cParam && cParam.cl && cParam.cl.templateArgs && c.cl.templateArgs)
// z.concatx(cParam.cpp.targsb);
if(param.kind == classType)
{
if((ct == normalClass && !isString)/* || ct == noHeadClass*/ || ct == structClass)
z.concat(" &");
else if(ct == structClass && mode != _argParamList)
z.concat(" *");
}
}
//if(!name[0])
// conmsg("noname");
if(prmIsFn)
z.concatx(paramString);
else
z.concatx(" ", name);
if(mode == _argSpecialThisParamList && !noParams)
z.concatx(!macro ? " ," : " _ARG");
break;
}
case passing:
{
bool t = ct == normalClass && clReg.templateArgs != null;
int ptr2 = ptr ? ptr : ct == structClass ? 1 : 0;
bool cast = ct == bitClass || (ct == enumClass && !boolPtr) || (ct == structClass && ptr)/* || (ct == unitClass && ptr)*/;
bool addr = (ct == structClass && !ptr) || (ct == unitClass && ptr);
bool impl = hack || (c.isInstance && param.kind == classType && param.classObjectType == anyObject) ||
ct == noHeadClass || (ct == normalClass && !isString) || (ct == structClass && !ptr) || (ct == unitClass/* && !ptr*/ && !cParam.isUnichar);
z.concatx(genidx(7A, x));
// if(boolPtr) // see above: issue: bool-trouble
// z.concatx("(C(bool)", ptr ? " " : "", stars(ptr, 0), ")");
if(param.kind == classType && param.classObjectType == typedObject)
z.concatx("class_", name, ", ");
else if(param.kind == templateType)
{
if(param.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
z.concatx("toTA<TP_", param.templateParameter.identifier.string, ">("/*"toTA<TP_", x, ">("*/);
}
else
{
if(addr)
z.concatx("&");
if(cast)
z.concatx(ct == unitClass ? "/*CTUC-x*/" : "", "(", cParam ? cParam.cSymbol : "C(Alignment)", ptr2 ? " " : "", ptr2 ? stars(ptr2, 0) : "", ")"); // hack
}
if(impl && t)
{
bool c = (ct == normalClass && !isString)/* || ct == noHeadClass*/ || ct == structClass;
z.concatx("((Instance", c ? "&" : ptr ? "*" : "", ")");
}
z.concatx(name);
if(param.kind == templateType)
z.concatx(")");
if(impl)
z.concatx(t ? ")" : "", ptr ? "->" : ".", "impl");
break;
}
}
if(!sep[0] && mode == _argParamList) sep = !macro ? ", " : " _ARG ";
delete apname;
delete typeString;
delete paramString;
}
if(firstParam)
{
FreeType(firstParam);
firstParam = null;
nextParam = templateParam ? templateParam : t.params.first;
if(mode == _argSpecialThisParamList)
break;
}
else if(templateParam)
{
FreeType(templateParam);
templateParam = null;
nextParam = /*firstParam ? firstParam : */t.params.first;
if(mode == _argSpecialThisParamList) debugBreakpoint();
}
else
{
prevParamIsTypedObject = param.kind == classType && param.classObjectType == typedObject;
nextParam = param.next;
}
}
}
result = CopyString(z._string ? z._string : "");
delete z;
return result;
}
Class getEcEcereMessBaseClass(const char * name)
{
Class cl = eSystem_FindClass(__thisModule, name);
if(cl.type != normalClass && cl.type != noHeadClass)
return cl;
while(cl.base)
{
const char * name = cl.base.name;
Class clAlt = !(!strcmp(name, "Window") || !strcmp(name, "IOChannel")) ? eSystem_FindClass(g_.mod, name) : null;
if(clAlt)
return clAlt;
cl = cl.base;
}
return cl;
}
/*static void processNormalClass(CPPGen g, BClass c, BVariant v, BNamespace n, BOutput o)
{
}*/
static void outputContents(CPPGen g, File out)
{
for(nn : g.bmod.orderedNamespaces)
{
BNamespace n = nn;
/*
for(vv : n.contents)
{
BVariant o = vv;
if(o._class == class(BOutput) && ((BOutput)o).z)
out.Puts(((BOutput)o).z._string);
}*/
// /*
if(n.orderedBackwardsOutputs.count)
{
//g.astAdd(ASTRawString { string = CopyString("// start -- moved backwards outputs") }, true);
for(optr : n.orderedBackwardsOutputs)
{
BOutput o = (BOutput)optr;
// if(o.kind != vfunction)
out.Puts(o.z._string);
}
//g.astAdd(ASTRawString { string = CopyString("// end -- moved backwards outputs") }, true);
}
for(optr : n.orderedOutputs)
{
BOutput o = (BOutput)optr;
if(o.kind == vmanual || o.kind == vdefine || o.kind == vfunction ||
o.kind == vclass || o.kind == vtemplaton || o.kind == vmethod || o.kind == vproperty)
{
if(o.z)
out.Puts(o.z._string);
}
else conmsg("check");
}
// */
}
}
static void outputSplitContents(CPPGen g, File f)
{
ZString z { allocType = heap };
bigCommentLibrary(z, "split implementations");
f.Puts(z._string);
delete z;
for(nn : g.bmod.orderedNamespaces)
{
BNamespace n = nn;
ZString z { allocType = heap };
bigCommentSection(z, n.name && n.name[0] ? n.name : "no namespace name?");
f.Puts(z._string);
delete z;
for(vv : n.splitContents)
{
BVariant v = vv;
if(v.kind == vclass)
{
BClass c = v;
if(c.outSplit.z._string)
f.Puts(c.outSplit.z._string);
}
else if(v.kind == vdefine)
{
BDefine d = v;
if(d.out.z._string)
f.Puts(d.out.z._string);
}
else if(v.kind == vfunction)
;
else
locprintxln("error: unexpected kind (", v.kind, ") of splitContents");
}
}
for(nn : g.bmod.orderedNamespaces)
{
BNamespace n = nn;
for(vv : n.splitContents)
{
BVariant v = vv;
if(v.kind == vfunction)
{
BFunction x = v;
f.Puts(x.out.z._string);
}
}
}
}
static void outputImplementationsContents(CPPGen g, File f)
{
ZString z { allocType = heap };
bigCommentLibrary(z, "moved to cpp implementations");
f.Puts(z._string);
delete z;
for(nn : g.bmod.orderedNamespaces)
{
BNamespace n = nn;
ZString z { allocType = heap };
bigCommentSection(z, n.name && n.name[0] ? n.name : "no namespace name?");
f.Puts(z._string);
delete z;
for(vv : n.implementationsContents)
{
BVariant v = vv;
if(v.kind == vclass)
{
BClass c = v;
if(c.outImplementation.z._string)
f.Puts(c.outImplementation.z._string);
// else
// locprintxln("why is this c.outImplementation.z._string null for this v(", v.kind, ":", v.name, ")");
}
else if(v.kind == vdefine)
{
BDefine d = v;
if(d.out.z._string)
f.Puts(d.out.z._string);
}
else
locprintxln("error: unexpected kind (", v.kind, ") of implementationsContents");
}
}
}
static void cppHeaderStart(CPPGen g, File f)
{
//cInHeaderFileComment(g);
//cInHeaderProcessSourceFile(g, null, ":src/C/c_header_open.src"); //cInHeaderPreprocessorOpen(g);
//cInHeaderIncludes(g);
f.PrintLn(genspc__, "// Preprocessor directives can be added at the beginning (Can't store them in AST)", ln);
f.PrintLn(genspc__, "/****************************************************************************");
f.PrintLn(genspc__, "===========================================================================");
if(g.lib.ecereCOM)
f.PrintLn(genspc__, " Core eC Library");
else
f.PrintLn(genspc__, " ", g.lib.moduleName, " Module");
f.PrintLn(genspc__, "===========================================================================");
f.PrintLn(genspc__, "****************************************************************************/");
f.PrintLn(genloc__, "#if !defined(__", g.lib.defineName, "_HPP__)");
f.PrintLn(genloc__, "#define __", g.lib.defineName, "_HPP__", ln);
if(g.lib.ecereCOM)
{
// f.PrintLn(genloc__, "#define ECPRFX eC_", ln); // no longer needed since it is now the C bindings default
}
else
{
// f.PrintLn(genloc__, "#include \"eC.hpp\"");
for(libDep : g.libDeps)
f.PrintLn(genloc__, "#include \"", libDep.bindingName, ".hpp\"");
/*if(!strcmp(g.lib.moduleName, "gnosis2")) // hack, todo
{
f.PrintLn(genloc__, "#include \"ecere.hpp\"");
f.PrintLn(genloc__, "#include \"EDA.hpp\"");
}*/
/*else
f.PrintLn("#include \"ecere.hpp\"");*/
}
f.PrintLn(genloc__, "#include \"", g.lib.bindingName, ".h\"", ln);
}
static void cppHeaderEnd(CPPGen g, File f)
{
f.PrintLn(genloc__, "#endif // !defined(__", g.lib.defineName, "_HPP__)");
}
// a table of macros
//
// hardcoded macros:
//
// INSTANCEL
// INSTANCE
// newi
// EVOLVE_APP
// REGISTER_APP_CLASS
// APP_CONSTRUCT
// MAIN_DEFINITION
// SELF
// APP_SET_ARGS
// _REGISTER_CLASS intRegisterClass cppMacroIntRegisterClass
// REGISTER_CLASS_DEF registerClassDef cppMacroRegisterClassDef
// CLASS_DEF classDef cppMacroClassDef
// REGISTER_CLASS registerClass cppMacroRegisterClass
// REGISTER_CPP_CLASS registerClassCPP cppMacroRegisterClassCPP
// _CONSTRUCT intConstructClass cppMacroIntConstructClass
// CONSTRUCT constructClass cppMacroConstructClass
// DESTRUCT destructClass cppMacroDestructClass
// REGISTER classRegistration cppMacroClassRegister
// VIRTUAL_METHOD virtualMethod cppMacroVirtualMethod
// _REGISTER_METHOD intRegisterMethod cppMacroIntRegisterMethod
// REGISTER_METHOD registerMethod cppMacroRegisterMethod
// REGISTER_TYPED_METHOD registerTypedMethod cppMacroRegisterTypedMethod
// propertyProto propety cppMacroProperty
// propertyImpl " "
// _setProto intPropSet cppMacroIntPropSet
// setProto propSet cppMacroPropSet
// setImpl " "
// getProto propGet cppMacroPropGet
// getImpl " "
// *_class_registration classRegistration cppMacroClassRegistration
// *_VIRTUAL_METHODS classVirtualMethods cppMacroClassVirtualMethods
// NOTE: 'expansion' is a mode for bgen to itself expansion the macros
enum MacroMode
{
configuration,
expansion,
use,
encapsulation,
definition;
property char
{
get
{
switch(this)
{
case configuration: return 'c';
case expansion: return 'x';
case use: return 'u';
case encapsulation: return 'e';
case definition: return 'd';
}
return '_';
}
}
};
enum MacroModeAll { use, expansion = 0xFFFFFFFF };
/*
class MacroModeBits
{
// warning: these can only store use or expansion
MacroMode intRegisterClass:1;
MacroMode registerClassDef:1;
MacroMode classDef:1;
MacroMode registerClass:1;
MacroMode registerClassCPP:1;
MacroMode intConstructClass:1;
MacroMode constructClass:1;
MacroMode destructClass:1;
MacroMode classRegistration:1;
MacroMode classVirtualMethods:1;
MacroMode virtualMethod:1;
MacroMode intRegisterMethod:1;
MacroMode registerMethod:1;
MacroMode registerTypedMethod:1;
MacroMode propety:1;
MacroMode intPropSet:1;
MacroMode propSet:1;
MacroMode propGet:1;
MacroModeAll all:32:0;
}
*/
class MacroModeBits
{
bool intRegisterClass:1;
bool registerClassDef:1;
bool classDef:1;
bool registerClass:1;
bool registerClassCPP:1;
bool intConstructClass:1;
bool constructClass:1;
bool destructClass:1;
bool classRegistration:1;
bool classVirtualMethods:1;
bool virtualMethod:1;
bool intRegisterMethod:1;
bool registerMethod:1;
bool registerTypedMethod:1;
bool propety:1;
bool intPropSet:1;
bool propSet:1;
bool propGet:1;
MacroModeAll all:32:0;
//property MacroMode all { set { this = value ? 0xFFFFFFFF : 0x0; } };
//property bool { set { all = value ? expansion : use; } };
};
/*static */void cppDefineMacroIntRegisterClass(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroIntRegisterClass(g, o, definition, false/*todo*/, ind,
"n",
"ns",
"bs",
"a",
0); }
static void cppMacroIntRegisterClass(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template,
uint ind, // indentation
const char * n, // n? class name
const char * ns, // ns? class name string
const char * bs, // bs? base class name string
const char * module, // a? module arg
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define _REGISTER_CLASS(", n, ", ", ns, ", ", bs, ", ", module, ")", lc, ln);
ind++;
case expansion:
/*
public dllexport Class eSystem_RegisterClass(ClassType type, const char * name, const char * baseName, int size, int sizeClass,
bool (* Constructor)(void *), void (* Destructor)(void *),
Module module, AccessMode declMode, AccessMode inheritanceAccess)
*/
o.concatx(genloc__, indents(ind), "(XClass *)eC_registerClass(", lc, ln,
genloc__, indents(ind + 2), "ClassType_normalClass,", lc, ln,
genloc__, indents(ind + 2), ns, ", ", bs, ",", lc, ln,
genloc__, indents(ind + 2), "sizeof(Instance *), 0,", lc, ln);
if(template)
o.concatx(
genloc__, indents(ind + 2), "null,", lc, ln,
genloc__, indents(ind + 2), "null,", lc, ln);
else
o.concatx(
genloc__, indents(ind + 2), "(C(bool) (*)(void *)) ", n, "::constructor,", lc, ln,
genloc__, indents(ind + 2), "(void(*)(void *)) ", n, "::destructor,", lc, ln);
o.concatx(
genloc__, indents(ind + 2), "(", module, ").impl,", lc, ln,
genloc__, indents(ind + 2), "AccessMode_privateAccess, AccessMode_publicAccess)");
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "_REGISTER_CLASS(",
n, ", ",
ns, ", ",
bs, ", ",
module, ")");
break;
}
}
/*static */void cppDefineMacroRegisterClassDef(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroRegisterClassDef(g, o, definition, ind,
"n",
"b",
"a",
0); }
static void cppMacroRegisterClassDef(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
uint ind, // indentation
const char * n, // n?
const char * b, // b?
const char * a, // a?
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "// For defining _class and registereing together (single translation unit)", ln);
o.concatx(genloc__, indents(ind), "#define REGISTER_CLASS_DEF(", n, ", ", b, ", ", a, ") ");
ind++;
case expansion:
o.concatx(indents(ind), "TCPPClass<", n, "> ", n, "::_cpp_class(_REGISTER_CLASS(", n, ", #n, ", b, "::_cpp_class.impl->name, ", a, "));", ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "REGISTER_CLASS_DEF(",
n, ", ",
b, ", ",
a, ")");
break;
}
}
/*static */void cppDefineMacroClassDef(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroClassDef(g, o, definition, ind,
"n",
0); }
static void cppMacroClassDef(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
uint ind, // indentation
const char * n, // n?
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "// For defining _class and registering separately (multiple translation units)", ln);
o.concatx(genloc__, indents(ind), "#define CLASS_DEF(", n, ") ");
ind++;
case expansion:
o.concatx(indents(ind), "TCPPClass<", n, "> ", n, "::_cpp_class;", ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "CLASS_DEF(",
n, ")");
break;
}
}
/*static */void cppDefineMacroRegisterClass(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroRegisterClass(g, o, definition, ind,
"n",
"b",
"a",
0); }
static void cppMacroRegisterClass(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
uint ind, // indentation
const char * n, // n?
const char * b, // b?
const char * a, // a?
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define REGISTER_CLASS(", n, ", ", b, ", ", a, ") ");
ind++;
case expansion:
o.concatx(indents(ind), n, "::_cpp_class.setup(_REGISTER_CLASS(", n, ", #n, ", b, "::_cpp_class.impl->name, ", a, "));", ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "REGISTER_CLASS(",
n, ", ",
b, ", ",
a, ")");
break;
}
}
/*static */void cppDefineMacroRegisterClassCPP(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroRegisterClassCPP(g, o, definition, false/*todo*/, ind,
"n",
"a",
0); }
static void cppToFileMacroRegisterClassCPP(
CPPGen g, // generator
File f, // output
MacroMode mode,
bool template,
uint ind, // indentation
const char * n, // class name
const char * a, // a? we use the module parameter of *_cpp_init(const Module & module)
void * unused)
{
ZString z { allocType = heap };
cppMacroRegisterClassCPP(g, z, mode, template, ind, n, a, 0);
f.Puts(z._string);
delete z;
}
static void cppMacroRegisterClassCPP(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template,
uint ind, // indentation
const char * n, // class name
const char * a, // a? we use the module parameter of *_cpp_init(const Module & module)
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "// For C++ classes proxying eC classes:", ln);
o.concatx(genloc__, indents(ind), "#define REGISTER_CPP_CLASS(", n, ", ", a, ") ");
ind++;
o.concatx(indents(ind), n, "::_cpp_class.setup(_REGISTER_CLASS(", n, ", \"CPP\" #n, #n, ", a, "));", ln);
break;
case expansion:
{
String bs = PrintString("\"", n, "\"");
String ns = PrintString("\"CPP\" ", bs);
o.concatx(genloc__, indents(ind), n, "::_cpp_class.setup(", ln);
// "_REGISTER_CLASS(", n, ", \"CPP\" #n, #n, ", a, ")"
cppMacroIntRegisterClass(g, o, smod, template, ind + 2, n, ns, bs, a, 0);
delete ns;
/*
(Class *)eC_registerClass(ClassType_normalClass, ns, bs, sizeof(Instance *), 0, \
(C(bool) (*)(void *)) n::constructor, (void(*)(void *)) n::destructor, (a).impl, AccessMode_privateAccess, AccessMode_publicAccess)
*/
o.concatx(");", ln);
break;
}
case use:
case encapsulation:
o.concatx(genloc__, indents(ind + 1), "REGISTER_CPP_CLASS(",
n, ", ",
a, ")", ln);
break;
}
}
/*static */void cppDefineMacroIntConstructClass(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroIntConstructClass(g, o, definition, false, ind,
"c",
"b",
0); }
static void cppMacroIntConstructClass(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template,
uint ind, // indentation
const char * c, // c?
const char * b, // b?
void * unused)
{
MacroMode smod = mode == configuration ? g.macroModeBits.intConstructClass ? expansion : use : mode; // selected mode
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
// const char * lt = smod == definition ? "" : " { }"; // lt: line termination
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define _CONSTRUCT(", c, ", ", b, ")", lc, ln);
ind++;
case expansion:
// if(smod != definition) o.concatx(ln);
cppMacroClassVirtualMethods(g, o, smod == definition ? encapsulation : configuration, true, template, false, ind, "INSTANCE", c, g.cInstance, g.cclass, g.cInstance, 0);
// todo: spread the lines here
o.concatx(genloc__, indents(ind), "static TCPPClass<", c, "> _cpp_class;", lc, ln);
o.concatx(genloc__, indents(ind), "static C(bool) constructor(C(Instance) i, C(bool) alloc)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
o.concatx(genloc__, indents(ind), " if(alloc && !INSTANCEL(i, i->_class))", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " ", c, " * inst = new ", c, "(i, _cpp_class);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst)", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " /* printf(\"Must free!\\n\");*/", lc, ln);
o.concatx(genloc__, indents(ind), " inst->mustFree = true;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), " return inst != null;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), " return true;", lc, ln);
o.concatx(genloc__, indents(ind), "}", lc, ln);
o.concatx(genloc__, indents(ind), "static void destructor(C(Instance) i)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
o.concatx(genloc__, indents(ind), " ", c, " * inst = (", c, " *)INSTANCEL(i, i->_class);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst)", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " if(_cpp_class.destructor)", lc, ln);
o.concatx(genloc__, indents(ind), " ((void (*)(", c, " & self))_cpp_class.destructor)(*inst);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst->mustFree)", lc, ln);
o.concatx(genloc__, indents(ind), " delete inst;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), "}", lc, ln);
o.concatx(genloc__, indents(ind), "explicit inline ", c, "(", g_.sym.instance, " _impl, CPPClass & cl = _cpp_class) : ", b, "(_impl, cl)"/*, lt*/);
if(smod != expansion) o.concatx(ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "_CONSTRUCT(",
c, ", ",
b, ")");
break;
}
}
/*static */void cppDefineMacroMoveConstructors(
CPPGen g, // generator
ZString o, // output
bool template,
uint ind, // indentation
void * unused) { // unused
cppMacroMoveConstructors(g, o, definition, template, ind,
"c",
"t",
null,
0); }
static void cppMacroMoveConstructors(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template,
uint ind, // indentation
const char * c, // class name
const char * t, // template params
BProperty userDataProp,
void * unused)
{
// todo: switch to own instead of intConstructClass
MacroMode smod = mode == configuration ? g.macroModeBits.intConstructClass ? expansion : use : mode; // selected mode
bool te = template;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
// const char * lt = smod == definition ? "" : " { }"; // lt: line termination
const char * unpk = smod == expansion ? "" : te ? " UNPACK " : "";
const char * upkpaso = smod == expansion ? "" : te ? " (UNPACK " : ""; // upkpaso: unpack passing open
const char * upkpasc = smod == expansion ? "" : te ? ")" : ""; // upkpasc: unpack passing close
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "// NOTE: For some reason not having the move constructors and assignment operator repeated in derived classes causes strange errors", ln);
o.concatx(genloc__, indents(ind), "// e.g. with DisplaySystem::pixelFormat and DisplaySystem::flags properties", ln);
o.concatx(genloc__, indents(ind), "#define ", te ? cpptemplatePrefix : "", "MOVE_CONSTRUCTORS(", c, te ? ", " : "", te ? t : "", ")", lc, ln);
ind++;
case expansion:
o.concatx(genloc__, indents(ind), "inline ", c, unpk, te ? t : "", "(", c, unpk, te ? t : "", " && i)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
o.concatx(genloc__, indents(ind), " Instance * self = (Instance *)this;", lc, ln);
o.concatx(genloc__, indents(ind), " self->impl = i.impl;", lc, ln);
o.concatx(genloc__, indents(ind), " self->vTbl = i.vTbl;", lc, ln);
o.concatx(genloc__, indents(ind), " self->mustFree = i.mustFree; /* checking: should this be in all these instances? */", lc, ln);
o.concatx(genloc__, indents(ind), " i.impl = null;", lc, ln);
o.concatx(genloc__, indents(ind), " i.vTbl = null;", lc, ln);
// tocheck: is this needed?
// if(userDataProp)
// o.concatx(genloc__, indents(ind), " ", userDataProp.fpnSet, "(self->impl, self);", lc, ln);
o.concatx(genloc__, indents(ind), "}", lc, ln/*, lc, ln*/);
o.concatx(genloc__, indents(ind), "inline ", c, unpk, te ? t : "", " & operator= (", c, unpk, te ? t : "", " && i)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
o.concatx(genloc__, indents(ind), " Instance * self = (Instance *)this;", lc, ln);
// o.concatx(genloc__, indents(ind), " moveAssignHandleRefCount();", lc, ln);
o.concatx(genloc__, indents(ind), " if(self->impl)", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " C(Instance) impl = self->impl;", lc, ln);
o.concatx(genloc__, indents(ind), " int refCount = impl->_refCount;", lc, ln);
o.concatx(genloc__, indents(ind), " Instance_decRef(impl);", lc, ln);
o.concatx(genloc__, indents(ind), " if(refCount > 1)", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " Instance ** inst = (Instance **)&INSTANCEL(impl, impl->_class);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst && *inst == self)", lc, ln);
o.concatx(genloc__, indents(ind), " *inst = null;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), " self->impl = i.impl;", lc, ln);
o.concatx(genloc__, indents(ind), " self->vTbl = i.vTbl;", lc, ln);
o.concatx(genloc__, indents(ind), " self->mustFree = i.mustFree; /* checking: should this be in all these instances? */", lc, ln);
o.concatx(genloc__, indents(ind), " i.impl = null;", lc, ln);
o.concatx(genloc__, indents(ind), " i.vTbl = null;", lc, ln);
// tocheck: is this needed?
// if(userDataProp)
// o.concatx(genloc__, indents(ind), " ", userDataProp.fpnSet, "(self->impl, self);", lc, ln);
o.concatx(genloc__, indents(ind), " return *this;", lc, ln);
o.concatx(genloc__, indents(ind), "}");
if(smod != expansion) o.concatx(ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), te ? cpptemplatePrefix : "", "MOVE_CONSTRUCTORS(",
c, te ? ", " : "", upkpaso, te ? t : "", upkpasc, ")");
break;
}
}
/*static */void cppDefineMacroConstructClass(
CPPGen g, // generator
ZString o, // output
bool template,
uint ind, // indentation
void * unused) { // unused
cppMacroConstructClass(g, o, definition, template, ind,
"c",
"b",
"t",
null,
0); }
static void cppMacroConstructClass(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template,
uint ind, // indentation
const char * c, // c?
const char * b, // b?
const char * t, // t?
BProperty userDataProp,
void * unused)
{
// todo?: own bit for template vs normal
MacroMode smod = mode == configuration ? g.macroModeBits.constructClass ? expansion : use : mode; // selected mode
bool te = template;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
const char * sso = smod == expansion ? "\"" : "#"; // sso: symbol stringification open
const char * ssc = smod == expansion ? "\"" : ""; // ssc: symbol stringification close
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define ", te ? cpptemplatePrefix : "", "CONSTRUCT(", c, ", ", b, te ? ", " : "", te ? t : "", ")", lc, ln);
ind++;
case expansion:
if(template)
{
char * tc = PrintString("T", sc, c);
char * tt = smod == expansion ? CopyString(t) : PrintString(" UNPACK ", t, " ");
// todo: expansion
cppMacroMoveConstructors(g, o, smod == definition ? encapsulation : configuration, te, ind, /*c*/tc, t, userDataProp, 0);
o.concatx(lc, ln);
o.concatx(genloc__, indents(ind), tc, " ", tt, "() : ", tc, "((C(Instance))Instance_newEx(ensureTemplatized ", tt, "(_cpp_class, ", sso, c, ssc, ").impl, false), ensureTemplatized ", tt, "(_cpp_class, ", sso, c, ssc, ")) { }", lc, ln);
o.concatx(genloc__, indents(ind), "INSTANCE_VIRTUAL_METHODS_PROTO(", tc, ")", lc, ln);
o.concatx(genloc__, indents(ind), "static TCPPClass<", tc, "> _cpp_class;", lc, ln);
o.concatx(genloc__, indents(ind), "static C(bool) constructor(C(Instance) i, C(bool) alloc)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
o.concatx(genloc__, indents(ind), " if(alloc && !INSTANCEL(i, i->_class))", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " ", tc, " ", tt, " * inst = new ", tc, " ", tt, "(i, _cpp_class);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst)", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " /*printf(\"Must free!\\n\");*/", lc, ln);
o.concatx(genloc__, indents(ind), " inst->mustFree = true;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), " return inst != null;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), " return true;", lc, ln);
o.concatx(genloc__, indents(ind), "}", lc, ln);
o.concatx(genloc__, indents(ind), "static void destructor(C(Instance) i)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
o.concatx(genloc__, indents(ind), " ", tc, " ", tt, "* inst = (", tc, " ", tt, "*)INSTANCEL(i, i->_class);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst)", lc, ln);
o.concatx(genloc__, indents(ind), " {", lc, ln);
o.concatx(genloc__, indents(ind), " if(_cpp_class.destructor) ((void (*)(", tc, " ", tt, " & self))_cpp_class.destructor)(*inst);", lc, ln);
o.concatx(genloc__, indents(ind), " if(inst->mustFree) delete inst;", lc, ln);
o.concatx(genloc__, indents(ind), " }", lc, ln);
o.concatx(genloc__, indents(ind), "}", lc, ln);
o.concatx(genloc__, indents(ind), "explicit inline ", tc, " ", tt, "(C(Instance) _impl, CPPClass & cl = _cpp_class) : ", b, "(_impl, cl)", ln);
delete tc;
delete tt;
}
else
{
cppMacroMoveConstructors(g, o, smod == definition ? encapsulation : configuration, te, ind, c, t, userDataProp, 0);
o.concatx(lc, ln);
if(!strcmp(c, "Application") || !strcmp(c, "GuiApplication"))
o.concatx(genloc__, indents(ind), "inline ", c, "() : ", c, "(eC_init_CALL(__LINK_ECERE__)) { }", ln);
else
{
o.concatx(genloc__, indents(ind), c, "() : ", c, "((", g_.sym.instance, ")Instance_newEx(_cpp_class.impl, false), _cpp_class) { ");
if(userDataProp)
o.concat("Timer_set_userData(this->impl, this); ");
o.concatx("}", lc, ln);
}
//o.concatx(genloc__, indents(ind + 1), "_CONSTRUCT(", c, ", ", b, ")", ln);
cppMacroIntConstructClass(g, o, smod == definition ? encapsulation : configuration, template, ind, c, b, 0);
if(smod != expansion) o.concatx(ln);
}
break;
case use:
case encapsulation:
if(!strcmp(c, "Application") || !strcmp(c, "GuiApplication"))
o.concatx(genloc__, indents(ind), "APP_CONSTRUCT(",
c, ", ",
b, ")");
else
o.concatx(genloc__, indents(ind), te ? "T" : "", "CONSTRUCT(",
c, ", ",
b,
te ? ", " : "", te ? t : "",
")");
break;
}
}
/*static */void cppDefineMacroDestructClass(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
void * unused) { // unused
cppMacroDestructClass(g, o, definition, ind,
"c",
0); }
static void cppMacroDestructClass(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
uint ind, // indentation
const char * c, // c?
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define DESTRUCT(", c, ")", lc, ln);
ind++;
case expansion:
o.concatx(genloc__, indents(ind), "((TCPPClass<", c, "> &)_cpp_class).destructor", ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "DESTRUCT(",
c, ")");
break;
}
}
/*static */void cppDefineMacroClassRegister(
CPPGen g, // generator
ZString o, // output
bool prototype,
bool template,
bool original,
uint ind, // indentation
void * unused) { // unused
cppMacroClassRegister(g, o, definition, prototype, template, original, ind,
"c",
"t",
"a",
0); }
static void cppMacroClassRegister(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool prototype,
bool template,
bool original,
uint ind, // indentation
const char * c, // class name
const char * t, // template def
const char * a, // template args
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
bool pe = prototype;
bool te = template;
bool ol = original;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * lt = pe ? ";" : ""; // lt: line termination
const char * pt = smod == expansion ? "\n" : ""; // pt: prototype termination
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind),
"#define ", te ? "T" : "", "REGISTER", ol ? "" : "_", pe ? "PROTO" : ol ? "" : "IMPL", "(", !pe && !ol ? c : "", !pe && te ? ", " : "", te ? t : "", ")", lc, ln);
ind++;
case expansion:
{
o.concatx(genloc__, indents(ind));
if(pe || ol)
o.concat("static ");
else if(te)
o.concatx(t, " ");
o.concatx("void ");
if(!pe && !ol)
o.concatx(te ? cpptemplatePrefix : "", te ? sc : "", c, te ? /*prototype ? */a/* : t*//*"<TPT>"*/ : "", "::");
o.concatx("class_registration(CPPClass & _cpp_class)", lt, pt);
break;
}
case encapsulation:
Print("");
break;
case use:
{
// if(smod == expansion)
// o.concatx(genloc__, indents(ind));
o.concatx(genloc__, indents(ind), te ? "T" : "", "REGISTER_", pe ? "PROTO" : "IMPL", "(",
!pe ? c : "", !pe && te ? ", " : "",
te ? t : "",
")", lt, ln);
break;
}
}
}
/*static */void cppDefineMacroClassRegistration(
CPPGen g, // generator
ZString o, // output
uint ind, // indentation
BClass c,
BClass cBase,
BVariant vClass,
void * unused) { // unused
cppMacroClassRegistration(g, o, definition, ind,
c,
cBase,
vClass,
null,
0); }
static void cppMacroClassRegistration(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
uint ind, // indentation
BClass c,
BClass cBase,
BVariant vClass,
BProperty userDataProp,
void * unused)
{
MacroMode smod = mode == configuration ? g.macroModeBits.classRegistration ? expansion : use : mode; // selected mode
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
switch(smod)
{
case definition:
if(g.macroModeBits.classRegistration)
break;
o.concatx(ln, genloc__, indents(ind), "#define ", c.name, "_class_registration(d)");
ind++;
case expansion:
{
bool content = false;
bool template = c.cl.type == normalClass && c.cpp.isTemplate/* && c.numTemplateArgsInName*//*c.cl.templateArgs != null*/;
BMethod m; IterMethod itm { c.isInstance ? cBase.cl : c.cl };
while((m = itm.next(publicVirtual)))
{
m.init(itm.md, c.isInstance ? cBase : c, g);
if(m.hasTemplateAnything())
continue;
{
Type t = m.md.dataType;
const char * on = m.name, * mn = m.mname;
bool byRefTypedThis = false;
bool returnAddress = false;
bool noRet = t.returnType.kind == voidType;
bool destVsSrc = false; //!strcmp(mn, "onCopy") ? true : false;
const char * first = null;
const char * nthis = null;
const char * oname = null;
const char * nameParamOfClassType = null;
Type returnType = t.returnType;
char * typeString = returnType.kind == classType && returnType.classObjectType == anyObject ? CopyString(g_.sym.instance) : printType(t.returnType, false, false, true);
// char * typeString = returnType.kind == classType && returnType.classObjectType == anyObject ? /*Copy*/PrintString(g_.sym.instance, "eeee") : printType(t.returnType, false, false, true);
Class clRegRT;
BClass cRT;
bool hackRT;
bool isString;
bool isConst;
int ptrRTGood = 0;
Class clRegRTGood;
BClass cRTGood;
BClass cRTGoodT;
bool hackRTGood;
bool isStringRTGood;
bool isConstRTGood;
Type typeRTGood = unwrapPtrTypeGetClassInfo(m.md.dataType.returnType, true, &clRegRTGood, &cRTGood, &cRTGoodT, &ptrRTGood, &hackRTGood, &isStringRTGood, &isConstRTGood);
ClassType ctRT = cppGetClassInfoFromType(m.md.dataType.returnType, true, &clRegRT, &cRT, &hackRT, &isString, &isConst);
ClassType ctRTGood = clRegRTGood ? clRegRTGood.type : systemClass;
char * args = null;
char * params = null;
TypeInfo argsInfo;
// MapIterator<consttstr, const String> iMetParNamSwp { map = methodParamNameSwap };
// MapIterator<const String, const String> iMetThisNameSwap { map = methodTypedObjectThisNameSwap };
//int ptr = 0; Type t = unwrapPointerType(ti.type, &ptr);
// _REGISTER_METHOD(cp1, cp2, ns, n, bc, c, r, p, ocl, oi, code, ea, rv)
// REGISTER_METHOD(ns, n, bc, c, r, p, ocl, oi, code, ea, rv)
// REGISTER_TYPED_METHOD(ns, n, bc, c, r, p, ocl, oi, code, ea, rv)
// name string, name, base class, class, return (type), parameters, object class?, object instance?, code?, e? arguments?, return value
// bool pfx = c.cl.type == normalClass && c.cl.templateArgs;
const String cn = c.name; // PrintString(pfx ? cpptemplatePrefix : "", c.name);
const String d = smod == definition ? "d" : cn;
ZString r { allocType = heap };
ZString p { allocType = heap };
ZString ocl { allocType = heap };
ZString oi { allocType = heap };
ZString code { allocType = heap };
ZString ea { allocType = heap };
ZString rv { allocType = heap };
// todo: fix these warnings, use the right local vars obtain using the correct function(s)
if(typeRTGood)
; // warning supression
o.concatx(lc, ln);
// o.concatx(" ", t.classObjectType == typedObject ? "REGISTER_TYPED_METHOD" : "REGISTER_METHOD",
// "(\"", on, "\", ", mn, ", ", cn, ", ", d, ", ");
// TODO: Redo this whole type system mess and use Type system directly!!!
// r
r.copy("");
if(returnType.kind == templateType)
{
// r.concatx("TP(", c.name, ", ", returnType.templateParameter.identifier.string, ")");
if(returnType.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
r.concatx("TP_", returnType.templateParameter.identifier.string);
}
else if(ctRT == normalClass || ctRT == noHeadClass)
{
/* r.concatx(cRT.cSymbol);
if(ctRT == noHeadClass)
r.concatx(" *"); */
if(ctRT == normalClass)
{
/*if(!strcmp(cRT.name, "Instance"))
r.concatx(cRT.cSymbol);
else*/
if(isConst && isString)
r.concatx("/*CT-A*/constString");
else
r.concatx(cRT.cSymbol);
}
else if(ctRT == noHeadClass)
r.concatx(cRT.cSymbol, " *");
}
else
r.concatx(strptrNoNamespace(typeString));
// delete typeString;
// p
p.copy("");
if(t.kind == functionType)
{
bool comma = false; //const char * comma = "";
switch(t.classObjectType)
{
case none:
{
/*BClass cReg = null;
if(t.thisClass && t.thisClass.registered)
{
cReg = t.thisClass.registered;
if(cReg.is_class)
nthis = "anyObject";
}*/
/*else if(!strcmp(cn, "Application"))
p.concatx("C(Instance)");
else
p.concatx("C(", cn, ")");
*/
// if(!nthis)
nthis = "o_";
// p.concatx(" ", nthis);
// comma = true;
break;
}
//case classPointer: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
case typedObject:
{
byRefTypedThis = t.byReference;
returnAddress = ctRT == normalClass || ctRT == noHeadClass;
nthis = /*iMetThisNameSwap.Index(mn, false) ? iMetThisNameSwap.data :*/ "o_";
// p.concatx("XClass * _cpp_class, C(Instance) ", byRefTypedThis ? "* " : "", nthis);
// comma = true;
break;
}
//case anyObject: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
default: conmsg("ClassObjectType::", t.classObjectType, " is not handled here. todo?"); break;
}
argsInfo = { type = m.md.dataType, m = m, md = m.md, cl = c.cl, c = c };
// if(!strcmp(cn, "Skin") && !strcmp(on, "CaptionFont"))
// PrintLn(p);
// normalClassMacroOverride = true;
params = cppParams(c, argsInfo, regMethodParamList, vClass, cn, true, comma, null, mode, &first, &nameParamOfClassType, null, null, { });
// normalClassMacroOverride = false;
if(nameParamOfClassType && t.classObjectType == none && ((t.thisClass && t.thisClass.registered) || t.thisClassTemplate))
oname = nameParamOfClassType;
p.concatx(params);
// PrintLn(p);
// if(p._string && !strcmp(p._string, ", ")) p._string[0] = '\0'; // todo: fix this
delete params;
}
else conmsg(t.kind, " is not handled here. todo?");
// ocl
ocl.copy("");
if(t.staticMethod)
ocl.concatx("(C(Instance))null");
else
{
ocl.concatx(destVsSrc ? first : oname ? oname : nthis);
if(byRefTypedThis)
ocl.concatx(" ? *", destVsSrc ? first : oname ? oname : nthis, " : null");
}
// oi
oi.copy("");
if(t.staticMethod)
oi.concatx("(C(Instance))null");
else
{
oi.concatx(oname ? oname : nthis);
if(byRefTypedThis)
oi.concatx(" ? *", nthis, " : null");
}
// code
code.copy("");
{
bool comma = false;
bool ptrI = !t.thisClass || (t.thisClass.string && !strcmp(t.thisClass.string, "class"));
char * args = cppParams(c, argsInfo, regMethodLocalConvEcToCppVarsForArgsPassing, vClass, cn, !ptrI, comma, null, mode, null, null, null, null, { });
code.concatx(genloc__, args);
delete args;
}
if(!noRet)
{
bool cast = ctRT == enumClass || (ctRTGood == structClass && ptrRTGood);
if(returnType.kind == templateType)
{
// code.concatx("TP(", c.name, ", ", returnType.templateParameter.identifier.string, ")");
if(returnType.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
code.concatx("TP_", returnType.templateParameter.identifier.string);
}
else if((ctRT == normalClass || ctRT == noHeadClass))
{
/* if(ctRT == normalClass)
code.concatx(cRT.name, " *");
else if(ctRT == noHeadClass)
code.concatx(cRT.cSymbol, " *"); */
if(cRTGoodT && cRT.cpp.isTemplate)
code.concatx(cRTGoodT.cpp.dataTypeString/*, " *"*/);
else if(ctRT == normalClass)
{
if(cRT.isString)
{
if(isConst)
code.concatx("/*CT-B*/constString");
else
code.concat(cRT.cSymbol);
}
else
{
// if(cRT.isInstance) // Exception
code.concat(cRT.name/*, " *"*/);
// if(returnAddress)
code.concat(" *");
// else
// code.concatx(cRT.cSymbol);
}
}
else if(ctRT == noHeadClass)
code.concatx(cRT.cSymbol, " *");
}
else
code.concatx(strptrNoNamespace(typeString));
code.concatx(" ret = ", cast ? "(" : "", cast ? cRTGood.cSymbol : "", cast && ptrRTGood ? stars(ptrRTGood, 0) : "", cast ? ")" : "");
if(returnAddress) code.concatx(" &");
}
{
bool comma = false;
bool ptrI = !t.thisClass || (t.thisClass.string && !strcmp(t.thisClass.string, "class"));
bool scptr = ctRTGood == structClass && !ptrRTGood;
bool impl = ctRTGood == noHeadClass && !ptrRTGood;
bool normImpl = ctRT == normalClass && !cRT.isString;
bool instCast = cRTGood && ctRTGood == normalClass/* && !cRTGood.cpp.isTemplate*/ && cRTGood.cl.templateArgs;
code.concatx(scptr ? "&" : "", "fn(");
if(ptrI)
{
code.concatx(userDataProp ? "i->_" : "*i", userDataProp ? userDataProp.name : "");
comma = true;
}
code.concat((args = cppParams(c, argsInfo, regMethodArgsPassingEcToCpp, vClass, cn, !ptrI, comma, null, mode, null, null, null, null, { })));
code.concatx(")", scptr ? "->impl" : impl ? ".impl" : "");
if(!noRet)
{
code.concat("; return ");
if(cRTGoodT && cRTGoodT.cpp.dataTypeString)
code.concatx("ret.impl");
else if(returnAddress)
code.concat("ret ? ret->impl : null");
else
{
code.concatx(instCast ? "((Instance *)" : "", "ret", instCast ? ")" : "");
if(normImpl || instCast)
code.concat("->impl");
}
}
}
delete args;
// ea
ea.copy("");
if(t.kind == functionType)
{
const char * prefix = null;
if(t.classObjectType == typedObject)
prefix = "_class, ";
ea.concatx((args = cppParams(c, argsInfo, regMethodArgsPassingOther, vClass, cn, true, prefix != null, prefix, mode, null, null, null, null, { })));
delete args;
}
else conmsg(t.kind, " is not handled here. todo?");
// rv
rv.copy("");
if(!noRet)
{
rv.concat("(");
if(returnType.kind == templateType)
{
// rv.concatx("TP(", c.name, ", ", returnType.templateParameter.identifier.string, ")");
if(returnType.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
rv.concatx("TP_", returnType.templateParameter.identifier.string);
}
else if(ctRT == noHeadClass || ctRT == normalClass)
{
if(ctRT == normalClass && isString && isConst)
rv.concatx("/*CT-C*/constString");
else
rv.concat(cRT.cSymbol);
}
else
rv.concatx(strptrNoNamespace(typeString));
if(ctRT == noHeadClass)
rv.concat(" *");
rv.concat(")");
if(ctRT == normalClass || ctRT == noHeadClass || (ctRT == systemClass && typeString && strstr(typeString, "char *")))
rv.concat("null");
else
rv.concat("1");
}
if(t.classObjectType == typedObject)
cppMacroRegisterTypedMethod(g, o, smod == definition ? encapsulation : /*configuration*/smod, template, ind,
on, // ns
mn, // n
cn, // bc
d, // c
template ? mode == expansion ? c.cpp.targsb : c.cpp.targsbm : "",
r,
p,
ocl,
oi,
code,
ea,
rv,
userDataProp,
0);
else
cppMacroRegisterMethod(g, o, smod == definition ? encapsulation : /*configuration*/smod, template, ind,
on, // ns
mn, // n
cn, // bc
d, // c
template ? mode == expansion ? c.cpp.targsb : c.cpp.targsbm : "",
r,
p,
ocl,
oi,
code,
ea,
rv,
userDataProp,
0);
delete r;
delete p;
delete ocl;
delete oi;
delete code;
delete ea;
delete rv;
content = true;
}
}
if(content) o.concatx(ln);
break;
}
case use:
case encapsulation:
if(smod == expansion)
o.concatx(genloc__, indents(ind));
o.concatx(c.name, "_class_registration(", c.name, ")", ln);
break;
}
}
static void cppMacroRegVirtualMethods(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
uint ind, // indentation
BClass c,
BClass cBase,
BVariant vClass,
void * unused)
{
MacroMode smod = mode == configuration ? g.macroModeBits.classRegistration ? expansion : use : mode; // selected mode
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
switch(smod)
{
case definition:
case expansion:
{
int len, maxNameLen = 0, maxDefLen = 0;
// int maxLen = c.maxVirtualMethodNameLen + 1;
const char * cn = c.name;
List<Class> stack { };
List<String> paramsDefs { };
BMethod m; IterMethod itm { c.isInstance ? cBase.cl : c.cl };
while((m = itm.next(publicVirtual)))
{
m.init(itm.md, c, g);
if(m.hasTemplateAnything())
continue;
if((len = strlen(m.mname)) > maxNameLen)
maxNameLen = len;
{
Type t = m.md.dataType;
TypeInfo argsInfo { type = t, m = m, md = m.md, cl = c.cl, c = c };
char * paramsDef = cppParams(c, argsInfo, regMethodCppParamList, vClass, cn, true, false, null, mode, null, null, null, null, { utilStr1 = "self" });
paramsDefs.Add(paramsDef);
if((len = strlen(paramsDef)) > maxDefLen)
maxDefLen = len;
}
}
while((m = itm.next(publicVirtual)))
{
m.init(itm.md, c.isInstance ? cBase : c, g);
if(m.hasTemplateAnything())
continue;
{
const char * mn = m.mname;
char * paramsDef = paramsDefs.firstIterator.data;
Type t = m.md.dataType;
TypeInfo argsInfo { type = t, m = m, md = m.md, cl = c.cl, c = c };
char * paramsPassing = cppParams(c, argsInfo, regMethodArgsPassingCppToEc, vClass, null, t.thisClass != null, false, null, mode, null, null, null, null, { cppDirectObjects = true, utilStr1 = "self" });
int lenName = strlen(mn);
int lenDef = strlen(paramsDef);
// #define REG_$(classname)_$(methodname)(m,c)
// REGVMETHOD($(classname), $(methodname), c::m,
// (Window & self), c, ())
// These macros will have variable number of args based on template...
o.concatx(genloc__, "#define REG_", cn, "_", mn, "(m, c", c.cpp.isTemplate ? ", " : "", c.cpp.isTemplate ? c.cpp.targs : "", ")", spaces(maxNameLen + 1, lenName),
c.cpp.isTemplate ? "T" : "", "REGVMETHOD(", c.cpp.isTemplate ? c.cpp.tname : "", c.cpp.isTemplate ? c.cpp.targsb : "", c.cpp.isTemplate ? ", " : "", cn, ", ", mn, ", ", spaces(maxNameLen, lenName), "c::m, ",
"(", paramsDef, "), ", spaces(maxDefLen, lenDef), "c, ",
"(", paramsPassing, "))", ln);
paramsDefs.firstIterator.Remove();
delete paramsDef;
delete paramsPassing;
}
}
delete paramsDefs;
o.concatx(ln);
o.concatx(genloc__, "#define ", c.cpp.isTemplate ? "T" : "", "REG_", cn, "(c", c.cpp.isTemplate ? ", " : "", c.cpp.isTemplate ? c.cpp.targs : "", ")", lc, ln,
genloc__, indents(2), c.cpp.isTemplate ? c.cpp.tname : c.cpp.name, "::class_registration(_cpp_class);");
{
Class cl = c.cl;
BClass c = cl;
if(c.isInstance)
Print("");
while(cl)
{
if(!cl.templateClass)
stack.Insert(0, cl);
cl = cl.base.type == normalClass ? cl.base : null;
c = cl ? cl : null;
if(c && c.isInstance)
break;
}
}
for(e : stack)
{
Class cl = e;
BClass c = cl;
BMethod m; IterMethod itm { c.cl };
if(c.isInstance)
Print("");
if(c.isInstance)
c = c.cl.base;
while((m = itm.next(publicVirtual)))
{
m.init(itm.md, c, g);
{
const char * mn = m.mname;
if(m.hasTemplateAnything()) continue;
if(mn)
o.concatx(lc, ln, genloc__, indents(2), "REG_", c.name, "_", mn, "(", mn, ", c", c.cpp.isTemplate ? ", " : "", c.cpp.isTemplate ? c.cpp.targs : "", ");");
}
}
}
o.concatx(ln);
delete stack;
break;
}
}
}
/*static */void cppDefineMacroClassVirtualMethods(
CPPGen g, // generator
ZString o, // output
bool prototype,
bool template,
uint ind, // indentation
const char * un, // uppercase name // TODOGDFOJDFGOIJDFG
BClass c,
BClass cBase,
BVariant vClass,
void * unused) { // unused
cppMacroClassVirtualMethods(g, o, definition, prototype, template, false, ind,
un,
"c",
c,
cBase,
vClass,
0); }
enum StructOrNoheadMode { false, _struct, nohead };
// _VIRTUAL_METHODS
/*static */void cppMacroClassVirtualMethods(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool prototype,
bool template,
StructOrNoheadMode structOrNohead,
uint ind, // indentation
const char * un, // uppercase name // TODOGDFOJDFGOIJDFG
const char * c_, // class
BClass c,
BClass cBase,
BVariant vClass,
void * unused)
{
MacroMode smod = mode == configuration ? g.macroModeBits.virtualMethod ? expansion : use : mode; // selected mode
const char * lc = smod == definition || smod == encapsulation ? " \\" : ""; // lc: line continuation
//const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
switch(smod)
{
case definition:
//if(g.macroModeBits.classVirtualMethods)
// break;
o.concatx(ln, genloc__, indents(ind), "#define ", un, "_VIRTUAL_METHODS");
if(prototype)
o.concat("_PROTO");
o.concatx("(c)", lc, ln);
case expansion:
{
bool first = true;
bool content = false;
bool pfx = (c.cl.type == normalClass || c.cl.type == structClass) && c.cpp.isTemplate && prototype;
char * cname = PrintString(pfx ? cpptemplatePrefix : "", c.name);
const char * cn = smod == definition ? "c" : /*c.name*/cname;
const char * bn = cname; // /*smod == definition ? "b" : *//*c.isInstance ? */c.name/* : cBase.name*/; // tocheck: what's up here? isn't b for base class name?
const char * sn = c.cSymbol;
MacroMode submode = smod == definition ? use : smod;
//MacroMode submode = smod == definition ? true ? expansion : use : smod;
const char * lc = submode == expansion ? "" : " \\"; // lc: line continuation
BMethod m; IterMethod itm { c.isInstance ? cBase.cl : c.cl };
while((m = itm.next(publicVirtual)))
{
m.init(itm.md, c.isInstance ? cBase : c, g);
// if(m.hasTemplateAnything()) continue;
// if(!itm.md.dataType.thisClass.type && itm.md.dataType.thisClass && itm.md.dataType.thisClass.string)
// itm.md.dataType.thisClass.type = processTypeStringOk(itm.md.dataType.thisClass.string);
{
char * params = null;
char * args = null;
const char * mn = m.mname, * tn = m.s;
Type t = m.md.dataType;
Class clRegRT;
BClass cRT;
bool hackRT;
// ctRT is return type's class type
ClassType ctRT = cppGetClassInfoFromType(t.returnType, true, &clRegRT, &cRT, &hackRT, null, null);
int ptrRTGood = 0;
Class clRegRTGood;
BClass cRTGood;
BClass cRTGoodT;
bool hackRTGood;
bool isStringRTGood;
bool isConstRTGood;
Type typeRTGood = unwrapPtrTypeGetClassInfo(t.returnType, true, &clRegRTGood, &cRTGood, &cRTGoodT, &ptrRTGood, &hackRTGood, &isStringRTGood, &isConstRTGood);
ClassType ctRTGood = clRegRTGood ? clRegRTGood.type : systemClass;
bool noRet = t.returnType.kind == voidType;
TypeInfo ti;
TypeInfo argsInfo;
bool hasArgs = !(t.params.count == 0 || (t.params.count == 1 && ((Type)t.params.first).kind == voidType));
// todo: fix these warnings, use the right local vars obtain using the correct function(s)
if(typeRTGood)
; // warning supression
if(!first/* && submode != expansion*/)
o.concatx(lc, ln);
else
first = false;
ti = { type = t.returnType, md = m.md, cl = c.cl, c = c };
argsInfo = { type = t, m = m, md = m.md, cl = c.cl, c = c };
{
bool opt1 = ctRT == normalClass || ctRT == noHeadClass;
bool ptrI = !t.thisClass/* || (t.thisClass.string && !strcmp(t.thisClass.string, "class"))*/;
BClass cThis = t.thisClass && t.thisClass.registered ? t.thisClass.registered : null;
char * s1 = null;
char * s2 = null;
char * s3 = null;
const char * s4;
ZString s3z { allocType = heap };
const char * mncpp = m.cpp_name;
bool anyObject = cThis && cThis.is_class;
if(anyObject)
cThis = null;
// if(cRT && !strcmp(cRT.name, "IteratorPointer"))
// ; //PrintLn("");
s3z.copy("");
if(noRet)
{
if(c.isInstance && !structOrNohead) s3z.concatx("Instance"); // Instance_* prefix for base instance methods
s3z.concatx(tn, "(");
if(structOrNohead == _struct)
s3z.concatx("_class, ");
else if(structOrNohead == nohead)
s3z.concatx("(*TCO), ");
else if(c.isInstance || c.cl.type != normalClass)
s3z.concatx("_cpp_class.impl, ");
if(structOrNohead == _struct)
s3z.concatx("this");
else if(structOrNohead == nohead)
s3z.concatx("impl");
else
{
s3z.concatx("self ? self->impl : (", sn, ")null");
if(!(c.isInstance || c.cl.type != normalClass) && !itm.md.dataType.staticMethod && !c.is_class && itm.md.dataType.thisClass && itm.md.dataType.thisClass.string)
{
s3z.concatx(", ");
s3z.concatx("self ? self->impl : (", sn, ")null");
}
}
s3z.concatx((args = cppParams(c, argsInfo, passing, vClass, null, false, false, null, mode, null, null, null, null, { })));
s3z.concatx(");");
}
else if((ctRT == normalClass && !cRT.isString) || ctRT == noHeadClass)
{
s3z.concatx(cRT.cSymbol);
if(ctRT == noHeadClass)
s3z.concatx(" *");
s3z.concatx(" ret", cRT.name, " = ");
if(c.isInstance) s3z.concatx("Instance"); // Instance_* prefix for base instance methods
s3z.concatx(tn, "(");
if(structOrNohead == _struct)
s3z.concatx("_class, ");
else if(structOrNohead == nohead)
s3z.concatx("(*TCO), ");
else if(c.isInstance || c.cl.type != normalClass)
s3z.concatx("_cpp_class.impl, ");
if(structOrNohead == _struct)
s3z.concatx("this");
else if(structOrNohead == nohead)
s3z.concatx("impl");
else
s3z.concatx("self ? self->impl : (", sn, ")null");
s3z.concatx((args = cppParams(c, argsInfo, passing, vClass, null, false, false, null, mode, null, null, null, null, { })));
s3z.concatx(");", lc, ln);
s3z.concatx(genloc__, indents(ind + 2), "return ");
if(ctRT == noHeadClass)
s3z.concatx("ret", cRT.name, ";");
else if(!strcmp(cRT.name, "Instance"))
s3z.concatx("*(", cRT.name, " *)INSTANCEL(ret", cRT.name, ", ret", cRT.name, "->_class);");
else if(cRTGoodT && cRT.cpp.isTemplate)
s3z.concatx(cRTGoodT.cpp.dataTypeString, "(ret", cRT.name, ");");
else if(ctRT == normalClass && !cRT.isString)
s3z.concatx("BINDINGS_CLASS(ret", cRT.name, ") ? (", cRT.name, " *)INSTANCEL(ret", cRT.name, ", ret", cRT.name, "->_class) : (", cRT.name, " *)0;");
else
s3z.concatx("*(", cRT.cSymbol, " *)INSTANCEL(ret", cRT.name, ", ret", cRT.name, "->_class);");
}
else
{
bool cast = ctRT == enumClass || (ctRTGood == structClass && ptrRTGood);
bool cnst = ctRT == normalClass && !cRT.isString;
char * fromTA = null;
if(t.returnType.kind == templateType)
{
if(t.returnType.templateParameter.type != TemplateParameterType::type) debugBreakpoint();
fromTA = PrintString("fromTA<TP_", t.returnType.templateParameter.identifier.string, ">(");
}
// if(userDataProp) debugBreakpoint();
s3z.concatx("return ", fromTA ? fromTA : "", cnst ? cRTGood.cpp.name : "", (cast || cnst) ? "(" : "", cast ? cRTGood.cpp.name : "", cast && ptrRTGood ? stars(ptrRTGood, 0) : "", cast ? ")" : "");
if(c.isInstance) s3z.concatx("Instance"); // Instance_* prefix for base instance methods
s3z.concatx(tn, "(");
if(structOrNohead == _struct)
s3z.concatx("_class, ");
else if(structOrNohead == nohead)
s3z.concatx("(*TCO), ");
else if(c.isInstance || c.cl.type != normalClass)
s3z.concatx("_cpp_class.impl, ");
if(structOrNohead == _struct)
s3z.concatx("this");
else if(structOrNohead == nohead)
s3z.concatx("impl");
else
s3z.concatx("self ? self->impl : (", sn, ")null");
if(!(c.isInstance || c.cl.type != normalClass) && !itm.md.dataType.staticMethod && !c.is_class && itm.md.dataType.thisClass && itm.md.dataType.thisClass.string)
{
s3z.concatx(", ");
s3z.concatx("o_", anyObject ? "" : ".impl"/*" : (", cThis ? cThis.name : sn, ")null"*/);
}
s3z.concatx((args = cppParams(c, argsInfo, passing, vClass, null, false, false, null, mode, null, null, null, null, { })));
s3z.concatx(")", cnst ? ")" : "", fromTA ? ")" : "", ";");
delete fromTA;
}
s4 = s3z._string;
// c is owning class
if(c.cl.type == normalClass && !c.isInstance)
{
if(ctRT == normalClass && !cRT.isString)
{
char * t;
s1 = PrintString((t = cppTypeName(ti, false /*true*/, null, null)), cRT.cpp.isTemplate && cRTGoodT && cRTGoodT.cpp.dataTypeString ? "" : " *"); // todo tnp2
delete t;
}
else
s1 = /*opt1 ? PrintString("C(", cRT.name, ")") : */cppTypeName(ti, false /*true*/, null, null); // todo tnp2
}
else
s1 = opt1 ? CopyString("Instance &" /*cRT.name*/) : cppTypeName(ti, true, null, null); // todo tnp2
/*if(t.thisClass && t.thisClass.registered)
{
Class clReg = t.thisClass.registered;
BClass cReg = clReg;
// o.concatx("C(", clReg.name, ")");
s2 = PrintString(cReg.is_class ? "Instance" : clReg.name, " & o_", hasArgs ? " _ARG" : "");
}
else*/
// if(cThis)
{
bool any = anyObject && !c.isInstance;
s2 = PrintString(any ? "any_object" : cThis ? cThis.name : cn, any ? "" : " &"/*, " o_"*/, hasArgs ? !mode ? " ," : " _ARG" : "");
}
// else
// s2 = CopyString("");
if(ptrI)
s3 = CopyString("");
else
s3 = cppParams(c, argsInfo, _argSpecialThisParamList, vClass, cn, true, false, null, mode, null, null, null, null, { });
if(vClass && cRT && !cRT.isBool && !ptrRTGood && !(vClass.kind == vclass && cRT == vClass.c))
vClass.processDependency(g, otypedef, otypedef, cRT.cl);
{
const char * tmpl = template ? mode == expansion ? prototype ? c.cpp.tprototype : c.cpp.template : c.cpp.templatem : "";
cppMacroVirtualMethod(g, o, submode, prototype, template, structOrNohead, ind + g.options.expandMacros && !prototype ? 0 : 1,
mn, mncpp, template ? c.name : structOrNohead ? c_ : cn, template ? mode == expansion ? c.cpp.targsb : c.cpp.targsbm : "",
structOrNohead == _struct ? "template <typename TSC>" : structOrNohead == nohead ? cpptemplateNoHeadDef : tmpl, bn, s1, s2, structOrNohead ? "" : s3,
(params = cppParams(c, argsInfo, _argParamList, vClass, cn, false, false, null, mode, null, null, null, null, { })), s4, 0);
}
content = true;
delete s1;
delete s2;
delete s3;
delete s3z;
}
}
}
if(content) o.concatx(ln);
delete cname;
break;
}
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), un, "_VIRTUAL_METHODS");
if(prototype)
o.concat("_PROTO");
o.concatx("(", c_, ")", lc, ln);
break;
}
}
// bindoc: VIRTUAL_METHOD* macros use C++ parameters. aka C++ bindings style parameters
// VIRTUAL_METHOD(
// n: method name,
// c: class name,
// b: base? class name,
// r: return type,
// p0: ?,
// ep: ?,
// p: parameters (list of spec and ident pairs seperated by _ARG),
// d: ?
// )
// c: class object, mc: method class, m: method name, i: instance object, r: return type, p: parameters, a: arguments)
/*static */ void cppMacroVirtualMethod(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool prototype,
bool template,
StructOrNoheadMode structOrNohead,
uint ind, // indentation
const char * n, // name (method) - camelCased eC name
const char * ncpp, // name (method) - cpp name
const char * c, // class
const char * t, // template?
const char * t2, // template definition
const char * b, // base class
const char * r, // return type
const char * p0, // p0?
const char * ep, // ep?
const char * p, // parameters?
const char * d, // dispatch?
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
bool ex = smod == expansion;
bool te = template;
const char * lc = smod == expansion ? "" : " \\"; // lc: line continuation
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
const char * pt = prototype ? ";" : ""; // pt: prototype termination
char * cx = template ? PrintString("T", sc, c, ex ? " " : " UNPACK ", t) : CopyString(structOrNohead == _struct ? "TStruct<TSC>" : structOrNohead == nohead ? "TNHInstance<TC, TCO>" : c);
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define ", te ? "T" : "", "VIRTUAL_METHOD");
if(prototype)
o.concat("_PROTO");
o.concatx("(n, ncpp, c", (te && !prototype) ? ", t" : "", (te && !prototype) ? ", t2" : "", ", b, r, p0, ep, p", prototype ? "" : ", d", ")", lc, ln);
ind++;
case expansion:
if(prototype)
{
o.concatx(genloc__, indents(ind), "struct ", c, sc, "_", sc, n, sc, "_Functor", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
ind++;
o.concatx(genloc__, indents(ind), "[[no_unique_address]] int _[0];", lc, ln);
if(!structOrNohead)
o.concatx(genloc__, indents(ind), "typedef ", r, " (* FunctionType)(", p0, !ex || p[0] != '\0' ? " " : "", p, ")", pt, lc, ln);
}
if(!prototype && template)
{
// o.concatx(genloc__, indents(ind), "template<class TPT> /* TODO: another arg for the class form? */", lc, ln);
o.concatx(genloc__, indents(ind), t2, lc, ln);
}
if(!structOrNohead)
{
o.concatx(genloc__, indents(ind), "inline ");
if(!prototype)
{
if(te)
o.concat("typename ");
o.concatx(cx, "::", c, sc, "_", sc, n, sc, "_Functor::");
}
o.concatx("FunctionType ");
if(!prototype)
o.concatx(cx, "::", c, sc, "_", sc, n, sc, "_Functor::");
o.concatx("operator= (FunctionType func)", pt, lc, ln);
if(!prototype)
{
o.concatx(genloc__, indents(ind), "{", lc, ln);
ind++;
o.concatx(genloc__, indents(ind), te ? "T" : "", "SELF(", c, te ? ", (" : "", te ? t : "", te ? ")" : "", ", ", ncpp, ");", lc, ln);
o.concatx(genloc__, indents(ind), "if(self->vTbl == ", cx, "::_cpp_class.vTbl)", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
ind++;
o.concatx(genloc__, indents(ind), "uint size = ", cx, "::_cpp_class.impl->vTblSize;", lc, ln);
if(template)
o.concatx(genloc__, indents(ind), "self->vTbl = (void (**)())eC_new(sizeof(", cx, "::", c, sc, "_", sc, n, sc, "_Functor::FunctionType) * size);", lc, ln);
else
o.concatx(genloc__, indents(ind), "self->vTbl = (void (**)())newt(", cx, "::", c, sc, "_", sc, n, sc, "_Functor::FunctionType", ", size);", lc, ln);
o.concatx(genloc__, indents(ind), "memcpy(self->vTbl, ", cx, "::_cpp_class.vTbl, sizeof(", cx, "::", c, sc, "_", sc, n, sc, "_Functor::FunctionType", ") * size);", lc, ln);
ind--;
o.concatx(genloc__, indents(ind), "}", lc, ln);
o.concatx(genloc__, indents(ind), "((", cx, "::", c, sc, "_", sc, n, sc, "_Functor::FunctionType", " *)self->vTbl)[M_VTBLID(", b, ", ", n, ")] = func;", lc, ln);
o.concatx(genloc__, indents(ind), "return func;", lc, ln);
ind--;
o.concatx(genloc__, indents(ind), "}", lc, ln);
}
}
if(!prototype && (template || structOrNohead))
// o.concatx(genloc__, indents(ind), "template<class TPT>", lc, ln);
o.concatx(genloc__, indents(ind), t2, lc, ln);
o.concatx(genloc__, indents(ind), "inline ", r, " ");
if(!prototype)
o.concatx(cx, "::", c, sc, "_", sc, n, sc, "_Functor::");
o.concatx("operator()(", ep, " ", p, ")", pt, lc, ln);
if(!prototype)
{
o.concatx(genloc__, indents(ind), "{", lc, ln);
ind++;
if(!structOrNohead)
o.concatx(genloc__, indents(ind), te ? "T" : "", "SELF(", c, te ? ", (" : "", te ? t : "", te ? ")" : "", ", ", ncpp, ");", lc, ln);
o.concatx(genloc__, indents(ind), "", d, lc, ln);
ind--;
o.concatx(genloc__, indents(ind), "}"/*, lc*/, ln);
}
if(prototype)
{
ind--;
o.concatx(genloc__, indents(ind), "} ", ncpp, ";"/*, lc*/, ln);
}
if(g.options.expandMacros && !structOrNohead) // temp: this is removed now replace by new REG_* macros and C++ crazy template stuff
{ // todo: remove this whole block -- temp: just want to see in nomac
o.concatx(genloc__, indents(ind), "// ", "inline ", prototype ? "static " : "", "void ");
if(!prototype)
o.concatx(c, "::");
o.concatx("register_", sc, n, "(CPPClass & cl, ", c, "::", c, sc, "_", sc, n, sc,
"_Functor::FunctionType", " func)"/*, prototype ? pt : lc*/, ln);
if(!prototype)
{
o.concatx(genloc__, indents(ind), "// ", "{"/*, lc*/, ln);
o.concatx(genloc__, indents(ind), "// ", indents(1), "((", c, "::", c, sc, "_", sc, n, sc,
"_Functor::FunctionType", " *)cl.vTbl)[M_VTBLID(", b, ", ", n, ")] = func;"/*, lc*/, ln);
o.concatx(genloc__, indents(ind), "// ", "}", ln);
}
}
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), te ? "T" : "", "VIRTUAL_METHOD");
if(prototype)
o.concat("_PROTO");
o.concatx("(", n, ", ", ncpp, ", ", c, (te && !prototype) ? ", " : "", (te && !prototype) ? t : "", (te && !prototype) ? ", " : "", (te && !prototype) ? t2 : "", ", ", b, ",", lc, ln);
ind++;
o.concatx(genloc__, indents(ind), r, ", ", p0, ", ", ep, ", ", p);
if(prototype)
o.concat(");");
else
{
o.concatx(",", lc, ln);
o.concatx(genloc__, indents(ind), d, ");");
}
break;
}
delete cx;
}
/*static */void cppDefineMacroIntRegisterMethod(
CPPGen g, // generator
ZString o, // output
bool template, // for template
uint ind, // indentation
void * unused) { // unused
cppMacroIntRegisterMethod(g, o, definition, template, ind,
"cp1",
"cp2",
"ns",
"n",
"bc",
"c",
"t",
"r",
"p",
"ocl",
"oi",
"code",
"ea",
"rv",
null,
0); }
// bindoc: _REGISTER_METHOD and related macros use eC style parameters. aka C bindings style parameters
static void cppMacroIntRegisterMethod(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template, // for template
uint ind, // indentation
const char * cp1, // cp1?
const char * cp2, // cp2?
const char * ns, // ns?
const char * n, // n?
const char * bc, // bc?
const char * c, // c?
const char * t, // t?
const char * r, // r?
const char * p, // p?
const char * ocl, // ocl?
const char * oi, // oi?
const char * code, // code?
const char * ea, // ea?
const char * rv, // return value
BProperty userDataProp,
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
bool te = template;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
const char * pt = smod == expansion ? ";" : ""; // pt: prototype termination
const char * edq = smod == expansion ? "\"" : ""; // edq: expansion double quotes
const char * eop = smod == expansion ? "(" : ""; // eop: expansion open parenthesis
const char * ecp = smod == expansion ? ")" : ""; // eop: expansion close parenthesis
char * cx = te ? PrintString("T", sc, c, " ", t) : CopyString(c);
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define _", te ? "T" : "", "REGISTER_METHOD(", cp1, ", ", cp2, ", ", ns, ", ",
n, ", ", bc, ", ", c, ", ", te ? t : "", te ? ", " : "", r, ", ", p, ", ", ocl, ", ", oi, ", ", code, ", ", ea, ", ", rv, ")", lc, ln);
ind++;
case expansion:
o.concatx(genloc__, indents(ind), "addMethod(_cpp_class.impl, ", edq, ns, edq, ", (void *) +[]", eop, p, ecp, lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
if(userDataProp)
o.concatx(genloc__, indents(ind + 1), cx, " * i = (", cx, " *)", ocl, ";", lc, ln);
else
o.concatx(genloc__, indents(ind + 1), "XClass * cl = (", ocl, ") ? (XClass *)(", ocl, ")->_class : null;", lc, ln);
if(smod != definition)
o.concatx(genloc__, indents(ind + 1), "", "// 'cp1' is ", cp1[0] ? "present" : "empty", lc, ln);
if(cp1[0])
o.concatx(/*genloc__, indents(ind + 1), "", */cp1, lc, ln);
if(!userDataProp)
o.concatx(genloc__, indents(ind + 1), cx, " * i = (", oi, ") ? (", cx, " *)INSTANCEL(", oi, ", cl) : null;", lc, ln);
o.concatx(genloc__, indents(ind + 1), "int vid = M_VTBLID(", bc, ", ", n, ");", lc, ln);
o.concatx(genloc__, indents(ind + 1), te ? "typename " : "", bc, sc, "_", sc, n, sc, "_Functor::FunctionType fn;", lc, ln);
o.concatx(genloc__, indents(ind + 1), "if(i && i->vTbl && i->vTbl[vid])", lc, ln);
o.concatx(genloc__, indents(ind + 1), "{", lc, ln);
o.concatx(genloc__, indents(ind + 2), "fn = (", te ? "typename " : "", bc, sc, "_", sc, n, sc, "_Functor::FunctionType) i->vTbl[vid];", lc, ln);
o.concatx(/*genloc__, */indents(ind + 2), "", code, ";", lc, ln);
o.concatx(genloc__, indents(ind + 1), "}", lc, ln);
if(smod != definition)
o.concatx(genloc__, indents(ind + 1), "", "// 'cp2' is ", cp2[0] ? "present" : "empty", lc, ln);
if(cp2[0])
o.concatx(/*genloc__, indents(ind + 1), "", */cp2, lc, ln);
o.concatx(genloc__, indents(ind + 1), "else", lc, ln);
o.concatx(genloc__, indents(ind + 1), "{", lc, ln);
o.concatx(genloc__, indents(ind + 2), "auto method = ((", r, " (*) ", eop, p, ecp, ")(CO(", sc, c, ")->_vTbl)[M_VTBLID(", bc, ", ", n, ")]);", lc, ln);
o.concatx(genloc__, indents(ind + 2), "if(method) return method ", eop, ea, ecp, ";", lc, ln);
o.concatx(genloc__, indents(ind + 1), "}", lc, ln);
o.concatx(genloc__, indents(ind + 1), "return ", rv, ";", lc, ln);
o.concatx(genloc__, indents(ind), "})", pt, ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), "_", te ? "T" : "", "REGISTER_METHOD(",
cp1, ", ",
cp2, ", ",
ns, ", ",
n, ", ",
bc, ", ",
c, ", ",
te ? "(UNPACK " : "", te ? t : "", te ? ")" : "", te ? ", " : "",
r, ", ",
p, ", ",
ocl, ", ",
oi, ", ",
code, ", ",
ea, ", ",
rv, ")");
break;
}
if(smod == definition)
o.concatx(ln);
delete cx;
}
/*static */void cppMacroRegisterMethod(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template, // for template
uint ind, // indentation
const char * ns, // ns?
const char * n, // n?
const char * bc, // bc?
const char * c, // c?
const char * t, // t?
const char * r, // r?
const char * p, // p?
const char * ocl, // ocl?
const char * oi, // oi?
const char * code, // code?
const char * ea, // ea?
const char * rv, // return value
BProperty userDataProp,
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
bool te = template;
MacroMode submode = smod == definition ? use : smod;
//MacroMode /*submode = smod == expansion ? expansion : use; */submode = smod == definition ? g.expansionOrUse : g.macroModeBits.intRegisterMethod;
const char * lc = (smod == definition || smod == encapsulation) ? " \\" : ""; // lc: line continuation
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define ", te ? "T" : "", "REGISTER_METHOD(ns, n, bc, c", te ? ", t" : "", ", r, p, ocl, oi, code, ea, rv)", lc, ln);
ind++;
case expansion:
cppMacroIntRegisterMethod(g, o, submode, template, ind,
"",
"",
ns,
n,
bc,
c,
t,
r,
p,
ocl,
oi,
code,
ea,
rv,
userDataProp,
0);
o.concatx(ln);
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), te ? "T" : "", "REGISTER_METHOD(",
"\"", ns, "\", ",
n, ", ",
bc, ", ",
c, ", ",
te ? t : "", te ? ", " : "",
r, ",", lc, ln,
genloc__, indents(ind + 1), "(", p, "),", lc, ln,
genloc__, indents(ind + 1), ocl, ", ",
oi, ", ",
code, ",", lc, ln,
genloc__, indents(ind + 1), "(", ea, "), ",
rv, ");");
break;
}
}
/*static */void cppDefineMacroRegisterTypedMethod(
CPPGen g, // generator
ZString o, // output
bool template, // for template
uint ind, // indentation
void * unused) { // unused
cppMacroRegisterTypedMethod(g, o, definition, template, ind,
"ns",
"n",
"bc",
"c",
"t",
"r",
"p",
"ocl",
"oi",
"code",
"ea",
"rv",
null,
0); }
static void cppMacroRegisterTypedMethod(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
bool template, // for template
uint ind, // indentation
const char * ns, // ns?
const char * n, // n?
const char * bc, // bc?
const char * c, // c?
const char * t, // t?
const char * r, // r?
const char * p, // p?
const char * ocl, // ocl?
const char * oi, // oi?
const char * code, // code?
const char * ea, // ea?
const char * rv, // return value
BProperty userDataProp,
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
bool te = template;
const char * lc = (smod == definition || smod == encapsulation) ? " \\" : ""; // lc: line continuation
MacroMode submode = smod == definition ? use : smod;
//MacroMode /*submode = smod == expansion ? expansion : use;*/submode = smod == definition ? g.expansionOrUse : g.macroModeBits.intRegisterMethod;
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define ", te ? "T" : "", "REGISTER_TYPED_METHOD(ns, n, bc, c", te ? ", t" : "", ", r, p, ocl, oi, code, ea, rv)", lc, ln);
ind++;
case expansion:
{
const char * lc = submode == expansion ? "" : " \\"; // lc: line continuation
const char * sc = submode == expansion ? "" : " ## "; // sc: symbol concatenation
char * s1;
char * s2;
cppMacroIntRegisterMethod(g, o, submode, template, ind,
(s1 = PrintString(/*lc, ln, */genloc__, indents(ind + 1),
"CPPClass * cppcl = _class ? (CPPClass *)_class->bindingsClass : null;"/*, lc, ln,
genloc__, indents(ind + 1)*/)),
(s2 = PrintString(genloc__, indents(ind + 1), "else if(cppcl && cppcl->vTbl && cppcl->vTbl[vid])", lc, ln,
genloc__, indents(ind + 1), "{", lc, ln,
genloc__, indents(ind + 2), "fn = (", bc, sc, "_", sc, n, sc, "_Functor::FunctionType) cppcl->vTbl[vid];", lc, ln,
genloc__/*, indents(ind + 2)*/, code, ";", lc, ln,
genloc__, indents(ind + 1), "}"/*, lc, ln, genloc__, indents(ind + 1)*/)),
ns,
n,
bc,
c,
t,
r,
p,
ocl,
oi,
code,
ea,
rv,
userDataProp,
0);
delete s1;
delete s2;
o.concatx(ln);
break;
}
case use:
case encapsulation:
o.concatx(genloc__, indents(ind), te ? "T" : "", "REGISTER_TYPED_METHOD(",
"\"", ns, "\", ",
n, ", ",
bc, ", ",
c, ", ",
// te ? t : "", te ? ", " : "",
te ? "(UNPACK " : "", te ? t : "", te ? ")" : "", te ? ", " : "",
r, ",", lc, ln,
genloc__, indents(ind + 1), "(", p, "),", lc, ln,
genloc__, indents(ind + 1), ocl, ", ",
oi, ", ",
code, ",", lc, ln,
genloc__, indents(ind + 1), "(", ea, "), ",
rv, ");");
break;
}
}
/*static */void cppDefineMacroProperty(
CPPGen g, // generator
ZString o, // output
PropertyMacroBits opts,
uint ind, // indentation
void * unused) { // unused
cppMacroProperty(g, o, definition, opts, { }, ind, null,
"n",
"t",
"c",
"sg",
"tp",
"tp2",
0); }
static void cppMacroProperty(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
PropertyMacroBits opts,
TypeInfo ti,
uint ind, // indentation
Array<PropertyComponent> components,
// bool singleSet, // note: attention! 'get' for a set/get property specifically refers to that property
// but it is not required for that other direction so it's missing
// so when singleSet use cppMacroIntPropSet (aka _setProto/_setImpl) instead of
// cppMacroPropSet (aka setProto/setImpl)...
// note that the set* use the _set* internally thus defining both operator overloadings for set
const char * n, // name of property or member
const char * t, // t?
const char * c, // c?
const char * sg, // set/get(/isset)
const char * tp,
const char * tp2,
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.prop ? expansion : use : */mode; // selected mode
// bool te = opts.type == template;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
const char * ps = opts.prototype ? "Proto" : "Impl"; // ps: prototype string
// const char * tp = te ? "<TPT>" : "";
// const char * tp2 = te ? "<class TPT>" : "";
switch(smod)
{
case definition:
o.concatx(genloc__, indents(ind), "#define property", ps, "(", n, ", ", sg, ")", lc, ln);
ind++;
case expansion:
if(opts.prototype)
o.concatx(genloc__);
if(smod == expansion)
o.concat(indents(ind));
if(opts.prototype)
{
o.concatx("struct ", n, sc, "_Prop", lc, ln);
o.concatx(genloc__, indents(ind), "{", lc, ln);
ind++;
o.concatx(genloc__, indents(ind), "constexpr ", n, sc, "_Prop() { };", lc, ln);
o.concatx(genloc__, indents(ind), "[[no_unique_address]] int _[0];", lc, ln);
}
if(smod == definition)
{
if(opts.prototype)
o.concatx(genloc__);
o.concatx(indents(ind), sg, lc, ln);
}
else
{
for(component : components)
{
PropertyComponent comp = component;
switch(comp.type)
{
case macroIntPropSet:
cppMacroIntPropSet(g, o, smod, opts, comp.code, comp.commented, ind, comp.typename, comp.tAmp, comp.typenamePart2, n, c, tp, tp2, "", 0);
break;
case macroPropSet:
cppMacroPropSet(g, o, smod, opts, comp.code/*, comp.code_b*/, comp.dontNest, comp.commented, ind, comp.typename, comp.tAmp, comp.typenamePart2, n, c, tp, tp2, "", 0);
break;
case macroPropGet:
cppMacroPropGet(g, o, smod, opts, comp.code, comp.commented, ind, comp.returnType, comp.typename/*, comp.tAmp*/, comp.typenamePart2, n, c, tp, tp2, "", 0);
break;
}
}
}
if(opts.prototype)
{
ind--;
o.concatx(genloc__, indents(ind), "} ", n, ";"/*, lc*/, ln);
}
break;
case use:
case encapsulation:
o.concatx(genloc__, indents(ind));
o.concatx("property", ps, "(",
n, ",");
for(component : components)
{
PropertyComponent comp = component;
switch(comp.type)
{
case macroIntPropSet:
cppMacroIntPropSet(g, o, use, opts, comp.code, comp.commented, ind + 1, comp.typename, comp.tAmp, comp.typenamePart2, n, c, tp, tp2, "", 0);
break;
case macroPropSet:
cppMacroPropSet(g, o, use, opts, comp.code/*, comp.code_b*/, comp.dontNest, comp.commented, ind + 1, comp.typename, comp.tAmp, comp.typenamePart2, n, c, tp, tp2, "", 0);
break;
case macroPropGet:
cppMacroPropGet(g, o, use, opts, comp.code, comp.commented, ind + 1, comp.returnType, comp.typename/*, comp.tAmp*/, comp.typenamePart2, n, c, tp, tp2, "", 0);
break;
}
// todo: handle printing whitespace (ln or space) between components
// if(genSet && genGet)
// o.concatx(" ");
}
o.concatx(");", ln);
break;
}
}
/*static */void cppDefineMacroIntPropSet(
CPPGen g, // generator
ZString o, // output
PropertyMacroBits opts,
uint ind, // indentation
void * unused) { // unused
cppMacroIntPropSet(g, o, definition, opts, null, false, ind,
"t",
"tAmp",
"t2",
"n",
"c",
"tp",
"tp2",
"d",
0); }
static void cppMacroIntPropSet(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
PropertyMacroBits opts,
Array<String> code, // multiline replacement for d
bool commented,
uint ind, // indentation
const char * t, // t?
const char * tAmp, // &
const char * t2, // n2?
const char * n, // n?
const char * c, // c?
const char * tp, // tp?
const char * tp2, // tp2?
const char * d, // d? (code)
void * unused)
{
MacroMode smod = mode == configuration ? g.macroModeBits.intPropSet ? expansion : use : mode; // selected mode
bool ex = smod == expansion;
bool pe = opts.prototype;
bool nh = opts.type == nohead;
bool te = opts.type == template;
bool pp = !pe && te;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
const char * ps = opts.prototype ? "Proto" : "Impl"; // ps: prototype string
// const char * sso = smod == expansion ? "" : "\"#"; // sso: symbol stringification open
// const char * ssc = smod == expansion ? "" : "\""; // ssc: symbol stringification close
switch(smod)
{
case definition:
o.concatx(genloc__, commented ? "// " : "", indents(ind), "#define _", nh ? "nh" : te ? "t" : "", "set", ps, "(", t, ", ", t2, ", ", n, ", ", c, te ? ", " : "", te ? tp : "", pp ? ", " : "", pp ? tp2 : "", opts.prototype ? "" : ", ", opts.prototype ? "" : d, ")", lc, ln);
ind++;
case expansion:
{
char * cx = te ? PrintString(cpptemplatePrefix, sc, c, te && !ex ? " UNPACK " : "", te ? tp : "", te ? " " : "") : CopyString(c);
//
if(opts.prototype)
o.concatx(genloc__, commented ? "// " : "", indents(ind), genfn(nstSet), "inline ", t, sc, t2 ? t2 : "", " operator= (", t, tAmp, " v", t2 ? t2 : "", ");", ln);
else
{
char * upkpastp = te && !ex ? PrintString(" (UNPACK ", tp, ")") : PrintString("(", tp, ")"); // upkpaso: unpack passing tp
o.concatx(genloc__, commented ? "// " : "", indents(ind), genfn(nstSet));
if(opts.type == nohead)
o.concatx(cpptemplateNoHeadDef, " ");
else if(opts.type == template)
o.concatx(/*"template ", */tp2, " ");
o.concatx("inline ", t, sc, t2 ? t2 : "", " ", nh ? cpptemplatePrefix : "", nh ? sc : "", cx, nh ? "<TC, TCO>" : "", "::", n, sc, "_Prop::", "operator= (", t, tAmp, " v", sc, t2 ? t2 : "", ")", lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), "{", lc, ln);
ind++;
o.concatx(genloc__, commented ? "// " : "", indents(ind), te ? "T" : "", "SELF(", c, te ? ", " : "", te ? upkpastp : "", ", ", n, ");"/*, lc, ln*/);
// o.concatx(genloc__, indents(ind), "printf(\"inside (property _set) ", sso, c, ssc, "::", sso, n, ssc, "_Prop::", "operator= (", sso, t, ssc, " v", t2 ? sso : "", t2 ? t2 : "", t2 ? ssc : "", ")", "\\n\");", lc, ln);
if(code)
{
for(c : code)
o.concatx(/*genloc__, indents(ind), */c/*, lc, ln*/);
o.concatx(lc, ln);
}
else
o.concatx(lc, ln, genloc__, commented ? "// " : "", indents(ind), d, lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), "return v;", lc, ln);
ind--;
o.concatx(genloc__, commented ? "// " : "", indents(ind), "}", ln, ex ? sln : "");
delete upkpastp;
}
delete cx;
break;
}
case use:
o.concatx(ln);
case encapsulation:
o.concatx(genloc__, commented ? "// " : "");
if(smod == use)
o.concat(indents(ind + 2));
o.concat(indents(ind + (smod == use ? 2 : 0)));
/*
if(!strcmp(mn, "transform"))
Print("");
if(c.cl.type == noHeadClass)
{
delete tn;
tn = PrintString(cpptemplatePrefix, c.name);
}
String ncn = c.cl.type == noHeadClass ? PrintString(cpptemplatePrefix, cn) : CopyString(cn);
*/
if(opts.prototype)
o.concatx("_", te ? "t" : "", "set", ps, "(",
t, ", ",
t2 ? t2 : "", ", ",
n, ", ",
nh ? cpptemplatePrefix : "",
c,
"/*l5 c:", nocmt(c), " te:", te, " tp:", tp, " tp2:", tp2, " */",
// pp ? ", " : "", pp ? "tp" : "", pp ? ", " : "", pp ? "tp2" : "",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp : "", te ? ")" : "",
")");
else
{
o.concatx("_", nh ? "nh" : te ? "t" : "", "set", ps, "(",
t, ", ",
t2 ? t2 : "", ", ",
n, ", ",
c,
"/*l6 c:", nocmt(c), " te:", te, " tp:", tp, " tp2:", tp2, " */",
// pp ? ", " : "", pp ? "tp" : "", pp ? ", " : "", pp ? "tp2" : "",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp : "", te ? ")" : "",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp2 : "", te ? ")" : "",
", ");
if(code)
{
for(line : code)
o.concatx(line);
}
else
o.concatx(d);
o.concatx(")");
}
break;
}
}
/*static */void cppDefineMacroPropSet(
CPPGen g, // generator
ZString o, // output
PropertyMacroBits opts,
uint ind, // indentation
void * unused) { // unused
cppMacroPropSet(g, o, definition, opts, null/*, null*/, false, false, ind,
"t",
"tAmp",
"t2",
"n",
"c",
"tp",
"tp2",
"d",
0); }
static void cppMacroPropSet(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
PropertyMacroBits opts,
Array<String> code, // multiline replacement for d
// Array<String> code_b,// multiline replacement for d
bool dontNestMacroIntPropSet,
bool commented,
uint ind, // indentation
const char * t, // t?
const char * tAmp, // tAmp
const char * t2, // t2?
const char * n, // n?
const char * c, // c?
const char * tp, // tp?
const char * tp2, // tp2?
const char * d, // d? (code)
void * unused)
{
MacroMode smod = mode == configuration ? g.macroModeBits.propSet ? expansion : use : mode; // selected mode
bool ex = /*mode == expansion || */smod == expansion;
bool pe = opts.prototype;
bool nh = opts.type == nohead;
bool te = opts.type == template;
bool pp = !pe && te;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * pt = opts.prototype ? ";" : ""; // pt: prototype termination
const char * ps = opts.prototype ? "Proto" : "Impl"; // ps: prototype string
// const char * sso = smod == expansion ? "" : "\"#"; // sso: symbol stringification open
// const char * ssc = smod == expansion ? "" : "\""; // ssc: symbol stringification close
MacroMode submode = smod == definition ? encapsulation : smod;
// smod == definition ? encapsulation : configuration
//MacroMode /*submode = smod == expansion ? expansion : use;*/submode = smod == definition ? g.expansionOrUse : g.macroModeBits.intPropSet;
switch(smod)
{
case definition:
o.concatx(genloc__, commented ? "// " : "", indents(ind), "#define ", nh ? "nh" : te ? "t" : "", "set", ps, "(", t, ", ", t2, ", ", n, ", ", c, te ? ", " : "", te ? tp : "", pp ? ", " : "", pp ? tp2 : "", pe ? "" : ", ", pe ? "" : d, ")", lc, ln);
ind++;
case expansion:
{
const char * lc = submode == expansion ? "" : " \\"; // lc: line continuation
const char * sc = submode == expansion ? "" : " ## "; // sc: symbol concatenation
char * cx = te ? PrintString(cpptemplatePrefix, sc, c, (te && !ex) ? " UNPACK " : "", te ? tp : "", (te && !ex) ? " " : ""/*, pp ? tp2 : tp*/) : CopyString(c);
// if(smod == definition)
// o.concat(indents(ind));
if(!dontNestMacroIntPropSet)
{
cppMacroIntPropSet(g, o, smod == definition ? encapsulation : configuration, pe ? { opts.prototype, opts.type == template ? normal : opts.type } : opts, code, commented, ind,
t,
tAmp,
t2,
n,
c,
tp,
tp2,
d,
0);
// o.concatx(lc, ln);
}
o.concatx(genloc__, commented ? "// " : "", indents(ind), genfn(regSet));
if(!opts.prototype && opts.type == nohead)
o.concatx(cpptemplateNoHeadDef, " ");
else if(!opts.prototype && opts.type == template)
o.concatx(/*"template ", */tp2, " ");
o.concatx("inline ", nh ? "typename " : "", nh ? cpptemplatePrefix : "", nh ? sc : "", pp ? "typename " : "", cx, nh ? "<TC, TCO>" : "", "::", n, sc, "_Prop & ");
if(!opts.prototype)
o.concatx(nh ? cpptemplatePrefix : "", nh ? sc : "", cx, nh ? "<TC, TCO>" : "", "::", n, sc, "_Prop::");
o.concatx("operator= (", nh ? "typename " : "", nh ? cpptemplatePrefix : "", nh ? sc : "", cx, nh ? "<TC, TCO>" : "", "::", n, sc, "_Prop & prop)", pt);
if(!opts.prototype)
{
char * upkpastp = te && !ex ? PrintString(" (UNPACK ", tp, ")") : PrintString("(", tp, ")"); // upkpaso: unpack passing tp
o.concatx(lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), "{", lc, ln);
ind++;
o.concatx(genloc__, commented ? "// " : "", indents(ind), te ? "T" : "", "SELF(", c, te ? ", " : "", te ? upkpastp : "", ", ", n, ");", lc, ln);
// o.concatx(genloc__, indents(ind), "printf(\"inside (property set) ", sso, c, ssc, "::", sso, n, ssc, "_Prop::", "operator= (", sso, c, ssc, "::", sso, n, ssc, "_Prop & prop)", "\\n\");", lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), t, sc, t2 ? t2 : "", " v = prop;"/*, lc, ln*/);
if(code)
{
for(c : /*(code_b ? code_b : */code/*)*/)
o.concatx(/*genloc__, indents(ind), */c/*, lc, ln*/);
o.concatx(lc, ln);
}
else
o.concatx(lc, ln, genloc__, commented ? "// " : "", indents(ind), d, lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), "return prop;", lc, ln);
ind--;
o.concatx(genloc__, commented ? "// " : "", indents(ind), "}");
delete upkpastp;
}
o.concatx(ln);
delete cx;
break;
}
case use:
case encapsulation:
if(opts.prototype)
o.concatx(ln, genloc__, commented ? "// " : "", indents(ind + 2), te ? "t" : "", "set", ps, "(",
t, ", ",
t2 ? t2 : "", ", ",
n, ", ",
// (/*nh || */te) ? cpptemplatePrefix : "",
nh ? cpptemplatePrefix : "",
c,
"/*l1 c:", nocmt(c), " te:", te, " tp:", tp, " tp2:", tp2, " */",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp : "", te ? ")" : "",
")");
else
{
o.concatx(ln, genloc__, commented ? "// " : "", indents(ind + 2), nh ? "nh" : te ? "t" : "", "set", ps, "(",
t, ", ",
t2 ? t2 : "", ", ",
n, ", ",
// (/*nh || */te) ? cpptemplatePrefix : "",
c,
"/*l2 c:", nocmt(c), " te:", te, " tp:", tp, " tp2:", tp2, " */",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp : "", te ? ")" : "",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp2 : "", te ? ")" : "",
", ");
if(code)
{
for(line : code)
o.concatx(line);
}
else
o.concatx(d);
o.concatx(")");
}
break;
}
}
/*static */void cppDefineMacroPropGet(
CPPGen g, // generator
ZString o, // output
PropertyMacroBits opts,
uint ind, // indentation
void * unused) { // unused
cppMacroPropGet(g, o, definition, opts, null, false, ind,
"r",
"t",
"t2",
"n",
"c",
"tp",
"tp2",
"d",
0); }
static void cppMacroPropGet(
CPPGen g, // generator
ZString o, // output
MacroMode mode,
PropertyMacroBits opts,
Array<String> code, // multiline replacement for d
bool commented,
uint ind, // indentation
const char * r, // r: return type
const char * t, // t?
const char * t2, // t2?
const char * n, // n?
const char * c, // c?
const char * tp, // tp?
const char * tp2, // tp2?
const char * d, // d? (code)
void * unused)
{
MacroMode smod = /*mode == configuration ? g.macroModeBits.propSet ? expansion : use : */mode; // selected mode
bool ex = smod == expansion;
bool pe = opts.prototype;
bool nh = opts.type == nohead;
bool te = opts.type == template;
bool pp = !pe && te;
const char * lc = smod == definition ? " \\" : ""; // lc: line continuation
const char * sc = smod == expansion ? "" : " ## "; // sc: symbol concatenation
const char * pt = opts.prototype ? ";" : ""; // pt: prototype termination
const char * ps = opts.prototype ? "Proto" : "Impl"; // ps: prototype string
// const char * sso = smod == expansion ? "" : "\"#"; // sso: symbol stringification open
// const char * ssc = smod == expansion ? "" : "\""; // ssc: symbol stringification close
switch(smod)
{
case definition:
o.concatx(genloc__, commented ? "// " : "", indents(ind), "#define ", nh ? "nh" : te ? "t" : "", "get", ps, "(", r, ", ", t, ", ", t2, ", ", n, ", ", c, te ? ", " : "", te ? tp : "", pp ? ", " : "", pp ? tp2 : "", pe ? "" : ", ", pe ? "" : d, ")", lc, ln);
ind++;
case expansion:
{
char * cx = te ? PrintString(cpptemplatePrefix, sc, c, (te && !ex) ? " UNPACK " : "", te ? tp : "", te ? " " : ""/*pp ? tp2 : tp*/) : CopyString(c);
o.concatx(genloc__, commented ? "// " : "", indents(ind), genfn(regGet));
if(!opts.prototype && opts.type == nohead)
o.concatx(cpptemplateNoHeadDef, " ");
else if(!opts.prototype && opts.type == template)
o.concatx(/*"template ", */tp2, " ");
o.concatx("inline ", r ? r : "", r && *r ? " " : "");
if(!opts.prototype)
o.concatx(nh ? cpptemplatePrefix : "", nh ? sc : "", cx, nh ? "<TC, TCO>" : "", "::", n, sc, "_Prop::");
o.concatx("operator ", t, " () const", pt);
if(!opts.prototype)
{
o.concatx(lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), "{", lc, ln);
ind++;
if(opts.type == normal || opts.type == template)
{
// char * upkpastp = PrintString(smod == expansion ? "" : te ? " (UNPACK " : "", tp, smod == expansion ? "" : te ? ")" : ""); // upkpaso: unpack passing tp
char * upkpastp = te && !ex ? PrintString(" (UNPACK ", tp, ")") : PrintString("(", tp, ")"); // upkpaso: unpack passing tp
o.concatx(genloc__, commented ? "// " : "", indents(ind), te ? "T" : "", "SELF(", c, te ? ", " : "", te ? upkpastp : "", ", ", n, ");"/*, lc, ln*/);
delete upkpastp;
}
else if(opts.type == nohead)
o.concatx(genloc__, commented ? "// " : "", indents(ind), "__attribute__((unused)) T", sc, c, " TCTCO * self = CONTAINER_OF(this, T", sc, c, " TCTCO, ", n, ");"/*, lc, ln*/);
// o.concatx(genloc__, indents(ind), "printf(\"inside (property get) ", sso, c, ssc, "::", sso, n, ssc, "_Prop::", "operator ", sso, t, ssc, sso, t2, ssc, " () const", "\\n\");", lc, ln);
if(code)
{
for(c : code)
o.concatx(/*genloc__, indents(ind), */c/*, lc, ln*/);
o.concatx(lc, ln);
}
else
{
if((opts.type == normal || opts.type == template) || (opts.type == nohead))
o.concatx(lc, ln);
o.concatx(genloc__, commented ? "// " : "", indents(ind), d, lc, ln);
}
ind--;
o.concatx(genloc__, commented ? "// " : "", indents(ind), "}");
}
o.concatx(ln);
delete cx;
break;
}
case use:
case encapsulation:
if(opts.prototype)
// use of pp instead of te, pp will never be true here
o.concatx(ln, genloc__, commented ? "// " : "", indents(ind + 2), pp ? "t" : "", "get", ps, "(",
r ? r : "", r && *r ? " " : "", ", ",
t, ", ",
t2 ? t2 : "", ", ",
n, ", ",
// (/*nh || */te) ? cpptemplatePrefix : "",
(pe && te) ? cpptemplatePrefix : "",
c,
"/*l3 c:", nocmt(c), " pp:", pp, " te:", te, " tp:", tp, "*/",
pp ? ", " : "", pp ? "(" : "", pp ? tp : "", pp ? ")" : "",
")");
else
{
o.concatx(ln, genloc__, commented ? "// " : "", indents(ind + 2), nh ? "nh" : te ? "t" : "", "get", ps, "(",
r ? r : "", r && *r ? " " : "", ", ",
t, ", ",
t2 ? t2 : "", ", ",
n, ", ",
// (/*nh || */te) ? cpptemplatePrefix : "",
c,
"/*l4 c:", nocmt(c), " te:", te, " tp:", tp, " tp2:", tp2, " */",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp : "", te ? ")" : "",
te ? ", " : "", te ? /*"(UNPACK " use unpack if tp is var */"(" : "", te ? tp2 : "", te ? ")" : "",
", ");
if(code)
{
for(line : code)
o.concatx(line);
}
else
o.concatx(d);
o.concatx(")");
}
break;
}
}
int getClassTemplateParamsStringsCPP(BClass c, String * prototype, String * definition, String * use, String * useb, String * definitionm, String * usem, String * usebm)
{
int count = 0;
Class _class = c.cl;
ZString p { allocType = heap };
ZString d { allocType = heap };
ZString e { allocType = heap };
ZString u { allocType = heap };
ZString b { allocType = heap };
ZString s { allocType = heap };
ZString r { allocType = heap };
ZString x { allocType = heap };
const char * comma = "";
const char * comma2 = "";
ClassTemplateParameter tp = null;
Class cl = null;
Class templateClass = null;
// Context context = SetupTemplatesContext(cl);
p.concatx("template <");
d.concatx("template <");
e.concatx("template <");
b.concatx("<");
r.concatx("<");
if(_class.type == noHeadClass)
{
d.concatx("class TC, C(Class) ** TCO");
e.concatx("class TC _ARG C(Class) ** TCO");
u.concatx("TC, TCO");
b.concatx("TC, TCO");
s.concatx("TC _ARG TCO");
r.concatx("TC _ARG TCO");
}
else if(_class.templateParams.count == 0 && _class.base && _class.base.templateClass)
{
Array<String> tArgs { };
c.cpp.setTemplateComplete = true;
/*bool completeTemplate = */c.cpp.templateComplete = isTemplateClassTypeComplete(_class.base, tArgs, false);
for(arg : tArgs)
{
u.concatx(comma, arg);
b.concatx(comma, arg);
s.concatx(comma2, arg);
r.concatx(comma2, arg);
if(!comma[0]) comma = ", ", comma2 = " _ARG "; // ___ARG
++count;
}
}
else
{
for(cl = _class; cl; cl = cl.templateClass ? cl.templateClass : cl.base)
{
if(!templateClass && cl.templateParams.count)
templateClass = cl;
}
/*
for(i : tree)
{
Class cl = i;
bool b = cl.templateClass != null;
x.concatx(" -> ", b ? "(" : "", b && cl.base ? cl.base.name : "", b ? ") " : "", cl.name, ":", cl.templateParams.count);
}
if(_class.templateArgs)
dbglocprintxln(x._string);
*/
// tree.RemoveAll();
// for(cl = _class; cl; cl = cl.base)
// tree.Insert(null, cl);
// for(i : tree)
if(templateClass)
{
if(!c.cpp.templateParamNames)
c.cpp.templateParamNames = { };
cl = templateClass; // i;
for(tp = cl.templateParams.first; tp; tp = tp.next)
{
if(tp.type == type)
{
bool def = tp.defaultArg.dataTypeString != null;
// if(cl == _class || !def)
{
Class clDef = def ? eSystem_FindClass(cl.module, tp.defaultArg.dataTypeString) : null;
const char * typeString = tp.defaultArg.dataTypeString ? strptrNoNamespace(tp.defaultArg.dataTypeString) : "";
c.cpp.templateParamNames.Add(PrintString("TP_", tp.name));
p.concatx(comma, "typename TP_", tp.name);
d.concatx(comma, "typename TP_", tp.name, def ? " = " : "", def && !clDef ? "TP_" : "", def ? typeString : ""); // def && !clDef for TP_ not perfect? but should work
e.concatx(comma2, "typename TP_", tp.name, def ? " = " : "", def && !clDef ? "TP_" : "", def ? typeString : ""); // same
u.concatx(comma, "TP_", tp.name);
b.concatx(comma, "TP_", tp.name);
s.concatx(comma2, "TP_", tp.name);
r.concatx(comma2, "TP_", tp.name);
if(!comma[0]) comma = ", ", comma2 = " _ARG "; // ___ARG
++count;
}
}
}
}
}
// do the derivation thing as well
// eC: public class Array : Container
// eC: public class Container<class T, class I = int, class D = T>
// eC: public class CustomAVLTree<class BT:AVLNode<KT>, class KT = uint64> : Container<BT, I = KT>
// eC: public class AVLTree<class AT> : CustomAVLTree<BT = AVLNode<AT>, KT = AT, T = AT, D = AT>
// goal gen?: class TAVLTree : public TCustomAVLTree<TP_BT = AVLNode<TP_AT>, TP_KT = TP_AT, TP_T = TP_AT, TP_D = TP_AT>
// bad gen: class TAVLTree : public TCustomAVLTree<TP_BT ___ARG TP_KT>
/*
// if(cl.templateClass)
{
// bool skipAllTemplated = false;
ClassTemplateArgument * tArgs = cl.templateArgs;
int tCount = cl.templateParams.count;
int baseParam = cl.numParams - tCount;
int n;
//name = getNoNamespaceString(t.cl.string, null, false, false);
if(tArgs)
{
// for(n = baseParam; n < tCount; n++)
Print("");
for(n = 0; n < cl.numParams; n++)
{
// Type argType;
ClassTemplateArgument * tArg = &tArgs[n];
Print("");
// if(!tArg->dataTypeString) conmsgs("check");
// argType = processTypeStringOk(tArg->dataTypeString);
// FreeType(argType);
}
}
}
*/
/*
if(argType.kind == templateType)
{
ClassTemplateParameter ctp;
for(ctp = cl.templateParams.first; ctp; ctp = ctp.next)
if(!strcmp(ctp.name, type.templateParameter.identifier.string))
{
skip = true;
break;
}
if(skip) break;
}
*/
p.concatx(">");
d.concatx(">");
e.concatx(">");
b.concatx(">");
r.concatx(">");
*prototype = CopyString(p._string);
*definition = CopyString(d._string);
*use = CopyString(u._string);
*useb = CopyString(b._string);
*definitionm = CopyString(e._string);
*usem = CopyString(s._string);
*usebm = CopyString(r._string);
delete p;
delete d;
delete e;
delete u;
delete s;
delete x;
// FinishTemplatesContext(context);
return count;
}
void outTemplateParams(ZString z, BClass c)
{
/*
OldList templateParams;
ClassTemplateArgument * templateArgs;
Class templateClass;
OldList templatized;
*/
const char * comma = "";
ClassTemplateParameter p = null;
z.concatx("template <");
for(p = c.cl.templateParams.first; p; p = p.next)
{
if(p.type == type)
{
z.concatx(comma, "typename TP_", p.name);
if(!comma[0]) comma = ", ";
}
}
z.concatx(">");
/*
for(p = c.cl.templateParams.first; p; p = p.next)
{
z.concatx(ln, p.name, "// type:", p.type);
switch(p.type)
{
case type:
// p.defaultArg.dataTypeString;
// p.defaultArg.dataTypeClass;
Print("");
break;
case identifier: // todo
// p.memberType
// p.defaultArg.memberString
// switch on member type
// p.defaultArg.member;
// p.defaultArg.prop;
// p.defaultArg.method;
z.concatx(" identMemberType:", p.memberType);
break;
case expression: // todo
// p.dataTypeString
// p.defaultArg.expression;
Print("");
break;
}
// void * param; // To attach to Compiler TemplateParameter
}
Print("");
*/
// ClassTemplateArgument * tArgs = c.cl.templateArgs;
// int tCount = c.cl.templateParams.count;
// int baseParam = c.cl.numParams - tCount;
// int n;
//name = getNoNamespaceString(t.cl.string, null, false, false);
// if(tArgs)
/*
{
for(n = baseParam; n < tCount; n++)
{
ClassTemplateArgument * tArg = &tArgs[n];
// if(!tArg->dataTypeString) conmsgs("check");
if(tArg->dataTypeString)
{
Type argType;
argType = processTypeStringOk(tArg->dataTypeString);
if(argType.kind == templateType)
; // skipAllTemplated = true;
else
{
; // skipAllTemplated = false;
break;
}
FreeType(argType);
}
}
}
*/
}
char * cppGetTemplateDataTypeString(Class cl, Array<String> cSymbolTArgs)
{
char * dataTypeString = null;
const char * templateClassName = cl.templateClass.name;
char * d;
int len = strlen(cpptemplatePrefix) + strlen(templateClassName)/* + cSymbolTArgs.count * 2*/;
bool first = true;
for(a : cSymbolTArgs)
{
len += strlen(a) + 6/*2*/;
}
dataTypeString = new char[len + 1];
d = dataTypeString;
strcpy(d, cpptemplatePrefix);
d += strlen(cpptemplatePrefix);
strcpy(d, templateClassName);
d += strlen(templateClassName);
strcpy(d++, "<");
for(a : cSymbolTArgs)
{
if(first)
first = false;
else
{
strcpy(d, " _ARG "/*", "*/);
// d += 2;
d += 6;
}
strcpy(d, a);
d += strlen(a);
}
strcpy(d++, ">");
return dataTypeString;
}
void cppGenClassDetails(BClass c, Class cl, Gen gen)
{
MapIterator<const String, const String> iNameSwaps { map = gen.cpp_classNameSwaps };
const char * n = c.isString ? c.cSymbol : gen.cpp_classNameSwaps && iNameSwaps.Index(c.name, false) ? iNameSwaps.data : c.name;
Context context = SetupTemplatesContext(cl); // TOCHECK: Should we do this only once while we process the whole class?
// Class startClass = getTemplateStartBaseClass(cl);
// cpp.isTemplate = (cl.type == noHeadClass || ((cl.type == normalClass || cl.type == structClass) && (cl.templateParams.count || (cl.templateArgs && !cl.base.templateClass))));
c.cpp.classTypeIsTemplatable = classTypeIsTemplatable(cl.type);
// these have been asserted, can remove
if(!c.cpp.classTypeIsTemplatable && c.isClassTemplatable) debugBreakpoint();
if(!c.cl.templateArgs && c.isClassTemplatable) debugBreakpoint();
c.cpp.isTemplate = cl.type == noHeadClass || getClassIsTemplate(cl);
// todo: fix symbol construction issues before we can use this: ex: 'ocn, "_get_", mn' where cn is not meant to be cpp.name
// cpp_name = PrintString(n, "/*cpp_name_", typeStr, "*/");
// tcpp_name = cpp.isTemplate ? PrintString(cpptemplatePrefix, n, "/*tcpp_name_", typeStr, "*/") : PrintString(n, "/*tcpp_name_", typeStr, "*/");
c.cpp.name = CopyString(n);
c.cpp.tname = c.cpp.isTemplate ? PrintString(cpptemplatePrefix, n) : CopyString(n);
c.cpp.templParamsCount = getClassTemplateParamsStringsCPP(c, &c.cpp.tprototype, &c.cpp.template, &c.cpp.targs, &c.cpp.targsb, &c.cpp.templatem, &c.cpp.targsm, &c.cpp.targsbm);
if(cl.templateArgs)
{
Array<String> cSymbolTArgs { };
if(!c.isClassTemplatable/*c.completeTemplate*/)
{
if(c.numTemplateArgsInName) // tocheck: hackish
{
c.completeTemplate = getSpecifiedTemplateArgsSymbols(cl, cSymbolTArgs, true);
}
// /*c.completeTemplate = */isTemplateClassTypeComplete(cl, cSymbolTArgs, true);
c.cpp.typedTArgsCount = cSymbolTArgs.count;
if(cSymbolTArgs.count && c.completeTemplate)
{
#if 0
if(false) ;
else if(!strcmp(c.cl.name, "Array<ecere::gfx::drivers::BlockEntry>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(BlockEntry)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(BlockEntry)")) ; // else if(!strcmp(c.cl.name, "Array<ecere::gfx::drivers::BlockEntry>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(BlockEntry)")) ;
else if(!strcmp(c.cl.name, "LinkElement<ecere::gfx::FMFont>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(FMFont)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, ecere::gfx::FontInfo, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FontInfo)")) ;// else if(!strcmp(c.cl.name, "MapNode<String, ecere::gfx::FontInfo, T = String>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(FontInfo)")) ;
else if(!strcmp(c.cl.name, "Map<String, ecere::gfx::FontInfo>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(FontInfo)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::gfx::FaceInfo>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(FaceInfo)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(FaceInfo)")) ; // else if(!strcmp(c.cl.name, "Array<ecere::gfx::FaceInfo>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(FaceInfo)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::gfx3D::MeshPart>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(MeshPart)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(MeshPart)")) ; // else if(!strcmp(c.cl.name, "Array<ecere::gfx3D::MeshPart>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(MeshPart)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::gui::TouchPointerInfo>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(TouchPointerInfo)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(TouchPointerInfo)")) ; // else if(!strcmp(c.cl.name, "Array<ecere::gui::TouchPointerInfo>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(TouchPointerInfo)")) ;
else if(!strcmp(c.cl.name, "Array<String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(String)")) ; // else if(!strcmp(c.cl.name, "Array<String>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(String)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::gui::Window>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Window)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Window)")) ; // else if(!strcmp(c.cl.name, "Array<ecere::gui::Window>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Window)")) ;
else if(!strcmp(c.cl.name, "Array<eda::Grouping>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Grouping)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Grouping)")) ; // else if(!strcmp(c.cl.name, "Array<eda::Grouping>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Grouping)")) ;
else if(!strcmp(c.cl.name, "Array<eda::IdFilter>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(IdFilter)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(IdFilter)")) ; // else if(!strcmp(c.cl.name, "Array<eda::IdFilter>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(IdFilter)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::com::Class>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Class)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Class)")) ; // else if(!strcmp(c.cl.name, "Array<ecere::com::Class>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Class)")) ;
else if(!strcmp(c.cl.name, "Array<eda::SQLiteSearchField>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(SQLiteSearchField)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(SQLiteSearchField)")) ; // else if(!strcmp(c.cl.name, "Array<eda::SQLiteSearchField>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(SQLiteSearchField)")) ;
else if(!strcmp(c.cl.name, "Array<eda::StringSearchField>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(StringSearchField)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(StringSearchField)")) ; // else if(!strcmp(c.cl.name, "Array<eda::StringSearchField>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(StringSearchField)")) ;
else if(!strcmp(c.cl.name, "Array<eda::StringSearchTable>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(StringSearchTable)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(StringSearchTable)")) ;
else if(!strcmp(c.cl.name, "Container<eda::Field>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Field)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Field)")) ; // else if(!strcmp(c.cl.name, "Container<eda::Field>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Field)")) ;
else if(!strcmp(c.cl.name, "Array<eda::Id>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Id)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Id)")) ; // else if(!strcmp(c.cl.name, "Array<eda::Id>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Id)")) ;
else if(!strcmp(c.cl.name, "Array<eda::ListField>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(ListField)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(ListField)")) ; // else if(!strcmp(c.cl.name, "Array<eda::ListField>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(ListField)")) ;
else if(!strcmp(c.cl.name, "Array<eda::SQLiteSearchTable>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(SQLiteSearchTable)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(SQLiteSearchTable)")) ; // else if(!strcmp(c.cl.name, "Array<eda::SQLiteSearchTable>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(SQLiteSearchTable)")) ;
else if(!strcmp(c.cl.name, "Array<eda::LookupEditor>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(LookupEditor)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(LookupEditor)")) ; // else if(!strcmp(c.cl.name, "Array<eda::LookupEditor>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(LookupEditor)")) ;
else if(!strcmp(c.cl.name, "CMSSList<CMSSExpression>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(CMSSExpression)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(CMSSExpression)")) ; // else if(!strcmp(c.cl.name, "CMSSList<CMSSExpression>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(CMSSExpression)")) ;
else if(!strcmp(c.cl.name, "CMSSList<CMSSMemberInitList>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(CMSSMemberInitList)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(CMSSMemberInitList)")) ; // else if(!strcmp(c.cl.name, "CMSSList<CMSSMemberInitList>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(CMSSMemberInitList)")) ;
else if(!strcmp(c.cl.name, "CMSSList<CMSSMemberInit>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(CMSSMemberInit)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(CMSSMemberInit)")) ; // else if(!strcmp(c.cl.name, "CMSSList<CMSSMemberInit>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(CMSSMemberInit)")) ;
else if(!strcmp(c.cl.name, "CMSSList<StylingRuleBlock>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(StylingRuleBlock)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(StylingRuleBlock)")) ; // else if(!strcmp(c.cl.name, "CMSSList<StylingRuleBlock>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(StylingRuleBlock)")) ;
else if(!strcmp(c.cl.name, "CMSSList<StylingRuleSelector>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(StylingRuleSelector)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(StylingRuleSelector)")) ; // else if(!strcmp(c.cl.name, "CMSSList<StylingRuleSelector>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(StylingRuleSelector)")) ;
else if(!strcmp(c.cl.name, "Array<int>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "int") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "int")) ; // else if(!strcmp(c.cl.name, "Array<int>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "int")) ;
else if(!strcmp(c.cl.name, "Container<LineString>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(LineString)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(LineString)")) ; // else if(!strcmp(c.cl.name, "Container<LineString>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(LineString)")) ;
else if(!strcmp(c.cl.name, "Container<Polygon>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Polygon)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Polygon)")) ; // else if(!strcmp(c.cl.name, "Container<Polygon>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Polygon)")) ;
else if(!strcmp(c.cl.name, "Container<PolygonContour>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(PolygonContour)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(PolygonContour)")) ; // else if(!strcmp(c.cl.name, "Container<PolygonContour>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(PolygonContour)")) ;
else if(!strcmp(c.cl.name, "Array<int64>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "int64") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "int64")) ; // else if(!strcmp(c.cl.name, "Array<int64>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "int64")) ;
else if(!strcmp(c.cl.name, "Array<RecordField>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(RecordField)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(RecordField)")) ; // else if(!strcmp(c.cl.name, "Array<RecordField>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(RecordField)")) ;
else if(!strcmp(c.cl.name, "Array<eda::FieldValue>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(FieldValue)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(FieldValue)")) ; // else if(!strcmp(c.cl.name, "Array<eda::FieldValue>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(FieldValue)")) ;
else if(!strcmp(c.cl.name, "Array<AttributesKey>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(AttributesKey)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(AttributesKey)")) ; // else if(!strcmp(c.cl.name, "Array<AttributesKey>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(AttributesKey)")) ;
else if(!strcmp(c.cl.name, "Array<double>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "double") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "double")) ; // else if(!strcmp(c.cl.name, "Array<double>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "double")) ;
else if(false) ;
else if(!strcmp(c.cl.name, "Array<const String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(String)")) ; // else if(!strcmp(c.cl.name, "Array<const String>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(String)")) ; // totweak me? use constString type?
else if(false) ;
else if(!strcmp(c.cl.name, "Container<BT, I = KT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(LinkElement)")) ;
else if(!strcmp(c.cl.name, "Container<KT, I = KT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(BinaryTree)")) ; // very odd
else if(!strcmp(c.cl.name, "Container<LT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(Link)")) ;
else if(!strcmp(c.cl.name, "Container<VT, I = KT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "T(Container, KT, I = KT)")) ;
else if(!strcmp(c.cl.name, "Iterator<VT, IT = KT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "T(Container, VT, I = KT)")) ;
// else if(!strcmp(c.cl.name, "MapNode<MT, V>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "T(Iterator, VT, IT = KT)") && !strcmp(cSymbolTArgs[1], "T(Iterator, VT, IT = KT)")) ;
// else if(!strcmp(c.cl.name, "CustomAVLTree<ecere::com::MapNode<MT, V>, I = MT, D = V, KT = MT>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "T(MapNode, MT, V)") && !strcmp(cSymbolTArgs[1], "T(MapNode, MT, V)")) ;
// else if(!strcmp(c.cl.name, "Iterator<V, IT = KT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "T(CustomAVLTree, MapNode<MT, V>, I = MT, D = V, KT = MT)")) ;
// else if(!strcmp(c.cl.name, "AVLNode<KT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "T(Iterator, V, IT = KT)")) ;
// else if(!strcmp(c.cl.name, "LinkList<ecere::com::Link, T = LLT, D = LLT>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "T(AVLNode, KT)")) ;
// else if(!strcmp(c.cl.name, "MapNode<String, ecere::gfx::FontInfo, T = String>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)")) ; // looks bad
else if(!strcmp(c.cl.name, "MapNode<int, eda::FieldValue, T = int>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "int") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(FieldValue)")) ; // else if(!strcmp(c.cl.name, "MapNode<int, eda::FieldValue, T = int>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "int") && !strcmp(cSymbolTArgs[1], "C(FieldValue)")) ;
else if(!strcmp(c.cl.name, "Map<int, eda::FieldValue>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "int") && !strcmp(cSymbolTArgs[1], "C(FieldValue)")) ;
else if(!strcmp(c.cl.name, "HashMap<int64, ecere::com::Map<int, eda::FieldValue> >") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "int64") && !strcmp(cSymbolTArgs[1], "T(Map, int, FieldValue)")) ;
else if(!strcmp(c.cl.name, "MapNode<ecere::com::Array<int>, ecere::com::Array<int64>, T = ecere::com::Array<int> >") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "T(Array, int)") && !strcmp(cSymbolTArgs[1], "T(Array, int)") && !strcmp(cSymbolTArgs[2], "T(Array, int64)")) ; // else if(!strcmp(c.cl.name, "MapNode<ecere::com::Array<int>, ecere::com::Array<int64>, T = ecere::com::Array<int> >") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "T(Array, int)") && !strcmp(cSymbolTArgs[1], "T(Array, int)")) ;
else if(!strcmp(c.cl.name, "Map<ecere::com::Array<int>, ecere::com::Array<int64> >") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "T(Array, int)") && !strcmp(cSymbolTArgs[1], "T(Array, int64)")) ; // else if(!strcmp(c.cl.name, "Map<ecere::com::Array<int>, ecere::com::Array<int64> >") && cSymbolTArgs.count == 4 && !strcmp(cSymbolTArgs[0], "T(MapNode, Array<int>, Array<int64>, T = Array<int> )") && !strcmp(cSymbolTArgs[1], "T(MapNode, Array<int>, Array<int64>, T = Array<int> )") && !strcmp(cSymbolTArgs[2], "T(Array, int)") && !strcmp(cSymbolTArgs[3], "T(Array, int64)")) ;
else if(!strcmp(c.cl.name, "List<CMSSNode>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(CMSSNode)")) ; // else if(!strcmp(c.cl.name, "List<CMSSNode>") && cSymbolTArgs.count == 5 && !strcmp(cSymbolTArgs[0], "C(CMSSNode)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(CMSSNode)") && !strcmp(cSymbolTArgs[3], "C(Link)") && !strcmp(cSymbolTArgs[4], "C(CMSSNode)")) ;
else if(!strcmp(c.cl.name, "List<CMSSIdentifier>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(CMSSIdentifier)")) ; // else if(!strcmp(c.cl.name, "List<CMSSIdentifier>") && cSymbolTArgs.count == 5 && !strcmp(cSymbolTArgs[0], "C(CMSSIdentifier)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(CMSSIdentifier)") && !strcmp(cSymbolTArgs[3], "C(Link)") && !strcmp(cSymbolTArgs[4], "C(CMSSIdentifier)")) ;
else if(!strcmp(c.cl.name, "Array<ValueColor>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(ValueColor)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(ValueColor)")) ;
else if(!strcmp(c.cl.name, "Array<ValueOpacity>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(ValueOpacity)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(ValueOpacity)")) ;
else if(!strcmp(c.cl.name, "FeatureCollection<VectorFeature>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(VectorFeature)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(VectorFeature)")) ;
else if(!strcmp(c.cl.name, "Array<GraphicalElement>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(GraphicalElement)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GraphicalElement)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::gfx::ColorKey>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(ColorKey)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(ColorKey)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, FeatureDataType, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FeatureDataType)")) ;
else if(!strcmp(c.cl.name, "Map<String, FeatureDataType>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(FeatureDataType)")) ; // else if(!strcmp(c.cl.name, "Map<String, FeatureDataType>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, FeatureDataType, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FeatureDataType)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, FeatureDataType, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(FeatureDataType)")) ;
else if(!strcmp(c.cl.name, "Array<GeoData>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(GeoData)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GeoData)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, eda::FieldValue, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FieldValue)")) ;
else if(!strcmp(c.cl.name, "Map<String, eda::FieldValue>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(FieldValue)")) ; // else if(!strcmp(c.cl.name, "Map<String, eda::FieldValue>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, FieldValue, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FieldValue)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, FieldValue, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(FieldValue)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, GeoJSONValue, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(GeoJSONValue)")) ;
else if(!strcmp(c.cl.name, "Map<String, GeoJSONValue>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(GeoJSONValue)")) ; // else if(!strcmp(c.cl.name, "Map<String, GeoJSONValue>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, GeoJSONValue, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(GeoJSONValue)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, GeoJSONValue, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(GeoJSONValue)")) ;
else if(!strcmp(c.cl.name, "Array<GeoJSONFeature>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(GeoJSONFeature)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GeoJSONFeature)")) ;
else if(!strcmp(c.cl.name, "Array<GeoJSONSegment>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(GeoJSONSegment)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GeoJSONSegment)")) ;
else if(!strcmp(c.cl.name, "List<GeoLayer>") && cSymbolTArgs.count == 1 && !strcmp(cSymbolTArgs[0], "C(GeoLayer)")) ; // else if(!strcmp(c.cl.name, "List<GeoLayer>") && cSymbolTArgs.count == 5 && !strcmp(cSymbolTArgs[0], "C(GeoLayer)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GeoLayer)") && !strcmp(cSymbolTArgs[3], "C(Link)") && !strcmp(cSymbolTArgs[4], "C(GeoLayer)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, CMSSStyleSheet, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(CMSSStyleSheet)")) ;
else if(!strcmp(c.cl.name, "Map<String, CMSSStyleSheet>") && cSymbolTArgs.count == 2 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(CMSSStyleSheet)")) ; // else if(!strcmp(c.cl.name, "Map<String, CMSSStyleSheet>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, CMSSStyleSheet, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(CMSSStyleSheet)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, CMSSStyleSheet, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(CMSSStyleSheet)")) ;
else if(!strcmp(c.cl.name, "List<Presentation>") && cSymbolTArgs.count == 5 && !strcmp(cSymbolTArgs[0], "C(Presentation)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Presentation)") && !strcmp(cSymbolTArgs[3], "C(Link)") && !strcmp(cSymbolTArgs[4], "C(Presentation)")) ;
else if(!strcmp(c.cl.name, "Array<uint64>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "uint64") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "uint64")) ;
else if(!strcmp(c.cl.name, "MapNode<ecere::gfx::Color, ecere::com::Array<uint64>, T = ecere::gfx::Color>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Color)") && !strcmp(cSymbolTArgs[1], "C(Color)") && !strcmp(cSymbolTArgs[2], "T(Array, uint64)")) ;
else if(!strcmp(c.cl.name, "Map<ecere::gfx::Color, ecere::com::Array<uint64> >") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, Color, Array<uint64>, T = Color)") && !strcmp(cSymbolTArgs[1], "C(Color)") && !strcmp(cSymbolTArgs[2], "T(Array, uint64)") && !strcmp(cSymbolTArgs[3], "T(MapNode, Color, Array<uint64>, T = Color)") && !strcmp(cSymbolTArgs[4], "C(Color)") && !strcmp(cSymbolTArgs[5], "C(Color)") && !strcmp(cSymbolTArgs[6], "T(Array, uint64)")) ;
else if(!strcmp(c.cl.name, "Container<GeoPoint>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(GeoPoint)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GeoPoint)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, MBGLSpriteSymbol, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(MBGLSpriteSymbol)")) ;
else if(!strcmp(c.cl.name, "Map<String, MBGLSpriteSymbol>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, MBGLSpriteSymbol, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(MBGLSpriteSymbol)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, MBGLSpriteSymbol, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(MBGLSpriteSymbol)")) ;
else if(!strcmp(c.cl.name, "List<GeoExtent>") && cSymbolTArgs.count == 5 && !strcmp(cSymbolTArgs[0], "C(GeoExtent)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GeoExtent)") && !strcmp(cSymbolTArgs[3], "C(Link)") && !strcmp(cSymbolTArgs[4], "C(GeoExtent)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, MapboxGLSourceData, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(MapboxGLSourceData)")) ;
else if(!strcmp(c.cl.name, "Map<String, MapboxGLSourceData>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, MapboxGLSourceData, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(MapboxGLSourceData)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, MapboxGLSourceData, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(MapboxGLSourceData)")) ;
else if(!strcmp(c.cl.name, "Array<MBGLLayersJSONData>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(MBGLLayersJSONData)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(MBGLLayersJSONData)")) ;
else if(!strcmp(c.cl.name, "Container<GraphicalElement>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(GraphicalElement)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(GraphicalElement)")) ;
else if(!strcmp(c.cl.name, "Array<PickResult>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(PickResult)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(PickResult)")) ;
else if(!strcmp(c.cl.name, "Array<StackFrame>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(StackFrame)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(StackFrame)")) ;
else if(!strcmp(c.cl.name, "Container<ecere::sys::Pointf>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Pointf)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Pointf)")) ;
else if(!strcmp(c.cl.name, "Container<ecere::gfx3D::Vector3Df>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Vector3Df)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Vector3Df)")) ;
else if(!strcmp(c.cl.name, "Array<PolygonContour>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(PolygonContour)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(PolygonContour)")) ;
else if(!strcmp(c.cl.name, "Container<StartEndPair>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(StartEndPair)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(StartEndPair)")) ;
else if(!strcmp(c.cl.name, "Array<ProcessInvocation>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(ProcessInvocation)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(ProcessInvocation)")) ;
else if(!strcmp(c.cl.name, "Array<TSRow>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(TSRow)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(TSRow)")) ;
else if(!strcmp(c.cl.name, "Array<Tile>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(Tile)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(Tile)")) ;
else if(!strcmp(c.cl.name, "Array<TSZoomLevel>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(TSZoomLevel)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(TSZoomLevel)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3IdentifierAndLinks>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3IdentifierAndLinks)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3IdentifierAndLinks)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3Link>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3Link)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3Link)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3Collection>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3Collection)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3Collection)")) ;
else if(!strcmp(c.cl.name, "Array<ecere::com::Array<String> >") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "T(Array, String)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "T(Array, String)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3Queryable>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3Queryable)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3Queryable)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3VariableWidth>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3VariableWidth)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3VariableWidth)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3TileMatrixSetLimit>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3TileMatrixSetLimit)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3TileMatrixSetLimit)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3TileMatrixSetLink>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3TileMatrixSetLink)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3TileMatrixSetLink)")) ;
else if(!strcmp(c.cl.name, "Array<WFS3TileMatrix>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(WFS3TileMatrix)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(WFS3TileMatrix)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFAccessor, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFAccessor)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFAccessor>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFAccessor, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFAccessor)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFAccessor, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFAccessor)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFAnimation, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFAnimation)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFAnimation>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFAnimation, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFAnimation)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFAnimation, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFAnimation)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFBufferView, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFBufferView)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFBufferView>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFBufferView, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFBufferView)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFBufferView, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFBufferView)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFBuffer, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFBuffer)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFBuffer>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFBuffer, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFBuffer)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFBuffer, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFBuffer)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFImage, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFImage)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFImage>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFImage, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFImage)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFImage, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFImage)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFMaterial, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFMaterial)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFMaterial>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFMaterial, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFMaterial)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFMaterial, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFMaterial)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFMesh, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFMesh)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFMesh>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFMesh, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFMesh)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFMesh, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFMesh)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFNode, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFNode)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFNode>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFNode, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFNode)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFNode, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFNode)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFProgram, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFProgram)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFProgram>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFProgram, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFProgram)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFProgram, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFProgram)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFSampler, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFSampler)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFSampler>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFSampler, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFSampler)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFSampler, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFSampler)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFScene, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFScene)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFScene>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFScene, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFScene)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFScene, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFScene)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFShader, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFShader)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFShader>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFShader, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFShader)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFShader, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFShader)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFSkin, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFSkin)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFSkin>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFSkin, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFSkin)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFSkin, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFSkin)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFTechnique, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFTechnique)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFTechnique>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFTechnique, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFTechnique)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFTechnique, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFTechnique)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFTexture, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFTexture)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFTexture>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFTexture, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFTexture)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFTexture, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFTexture)")) ;
else if(!strcmp(c.cl.name, "Array<glTFAnimationChannel>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(glTFAnimationChannel)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(glTFAnimationChannel)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFAnimationSampler, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFAnimationSampler)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFAnimationSampler>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFAnimationSampler, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFAnimationSampler)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFAnimationSampler, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFAnimationSampler)")) ;
else if(!strcmp(c.cl.name, "Array<glTFPrimitive>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(glTFPrimitive)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(glTFPrimitive)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, String, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(String)")) ;
else if(!strcmp(c.cl.name, "Map<String, String>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, String, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(String)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, String, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(String)")) ;
else if(!strcmp(c.cl.name, "Array<uint>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "uint") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "uint")) ;
else if(!strcmp(c.cl.name, "Array<bool>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(bool)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(bool)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, glTFTechniqueParameter, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFTechniqueParameter)")) ;
else if(!strcmp(c.cl.name, "Map<String, glTFTechniqueParameter>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, glTFTechniqueParameter, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(glTFTechniqueParameter)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, glTFTechniqueParameter, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(glTFTechniqueParameter)")) ;
else if(!strcmp(c.cl.name, "Array<uint64> >") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "uint64") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "uint64")) ;
else if(!strcmp(c.cl.name, "FeatureCollection<PolygonFeature>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(PolygonFeature)") && !strcmp(cSymbolTArgs[1], "int") && !strcmp(cSymbolTArgs[2], "C(PolygonFeature)")) ;
else if(!strcmp(c.cl.name, "MapNode<String, FeatureCollection, T = String>") && cSymbolTArgs.count == 3 && !strcmp(cSymbolTArgs[0], "C(String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FeatureCollection)")) ;
else if(!strcmp(c.cl.name, "Map<String, FeatureCollection>") && cSymbolTArgs.count == 7 && !strcmp(cSymbolTArgs[0], "T(MapNode, String, FeatureCollection, T = String)") && !strcmp(cSymbolTArgs[1], "C(String)") && !strcmp(cSymbolTArgs[2], "C(FeatureCollection)") && !strcmp(cSymbolTArgs[3], "T(MapNode, String, FeatureCollection, T = String)") && !strcmp(cSymbolTArgs[4], "C(String)") && !strcmp(cSymbolTArgs[5], "C(String)") && !strcmp(cSymbolTArgs[6], "C(FeatureCollection)")) ;
else if(false) ;
else if(false) ;
else if(false) ;
else if(false) ;
else if(false) ;
else if(false) ;
else
{
int i = 0;
Print(" else if(!strcmp(c.cl.name, \"", c.cl.name, "\") && cSymbolTArgs.count == ", cSymbolTArgs.count);
for(i = 0; i < cSymbolTArgs.count; i++)
{
Print(" && !strcmp(cSymbolTArgs[", i, "], \"", cSymbolTArgs[i], "\")");
}
PrintLn(") ;");
debugBreakpoint();
}
#endif // 0
c.cpp.dataTypeString = cppGetTemplateDataTypeString(cl, cSymbolTArgs);
}
else
{
if(c.numTemplateArgsInName)
{
if(false) ;
else if(!strcmp(c.cl.name, "AVLNode<AT>")) ;
else if(!strcmp(c.cl.name, "AVLNode<KT>")) ;
else if(!strcmp(c.cl.name, "CustomAVLTree<BT = ecere::com::AVLNode<AT>, KT = AT, T = AT, D = AT>")) ;
else if(!strcmp(c.cl.name, "Container<BT, I = KT>")) ;
else if(!strcmp(c.cl.name, "Container<KT, I = KT>")) ;
else if(!strcmp(c.cl.name, "Container<LT>")) ;
else if(!strcmp(c.cl.name, "Container<VT, I = KT>")) ;
else if(!strcmp(c.cl.name, "CustomAVLTree<ecere::com::MapNode<MT, V>, I = MT, D = V, KT = MT>")) ;
else if(!strcmp(c.cl.name, "Iterator<V, IT = KT>")) ;
else if(!strcmp(c.cl.name, "Iterator<VT, IT = KT>")) ;
else if(!strcmp(c.cl.name, "LinkList<ecere::com::Link, T = LLT, D = LLT>")) ;
else if(!strcmp(c.cl.name, "MapNode<MT, V>")) ;
else if(!strcmp(c.cl.name, "Container<T>")) ;
else if(!strcmp(c.cl.name, "Iterator<T>")) ;
else if(!strcmp(c.cl.name, "HashMap<KT, VT>")) ;
else if(!strcmp(c.cl.name, "Container<T, IT>")) ;
else if(!strcmp(c.cl.name, "Map<KT, V>")) ;
else if(!strcmp(c.cl.name, "MapNode<KT, V, T = KT>")) ;
else if(!strcmp(c.cl.name, "LinkElement<thisclass>")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else
{
debugBreakpoint();
// c.isClassTemplatable = /*c.cpp.classTypeIsTemplatable && c.cl.templateArgs && */classIsTemplatable(cl);
// c.cpp.dataTypeString = CopyString(c.cpp.name);
}
}
else
{
if(!strcmp(c.cl.name, "FreeBlockMap")) ;
else if(!strcmp(c.cl.name, "GLMB")) ;
else if(!strcmp(c.cl.name, "CMSSExpList")) ;
else if(!strcmp(c.cl.name, "CMSSMemberInitList")) ;
else if(!strcmp(c.cl.name, "CMSSInstInitList")) ;
else if(!strcmp(c.cl.name, "EndOccurrence2")) ;
else if(!strcmp(c.cl.name, "SelectorList")) ;
else if(!strcmp(c.cl.name, "StylesList")) ;
else if(!strcmp(c.cl.name, "StylingRuleBlockList")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else if(!strcmp(c.cl.name, "")) ;
else
debugBreakpoint();
c.cpp.dataTypeString = CopyString(c.cpp.name);
}
}
}
delete cSymbolTArgs;
}
else
{
if(cl.type == normalClass)
c.cpp.dataTypeString = CopyString(c.cpp.name);
}
FinishTemplatesContext(context);
}
| eC | 3 | mingodad/ecere-sdk | bgen/src/cpp/genCPP.ec | [
"BSD-3-Clause"
] |
-- Load table 'sample_07'
sample_07 = LOAD 'sample_07' USING org.apache.hcatalog.pig.HCatLoader();
-- Compute the average salary of the table
salaries = GROUP sample_07 ALL;
out = FOREACH salaries GENERATE AVG(sample_07.salary);
DUMP out;
| PigLatin | 4 | sirishacodes/samplebranchtest | hcatalog/avg_salary.pig | [
"Apache-2.0"
] |
--TEST--
JIT: FETCH_OBJ 006
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
class Test {
readonly array $prop;
}
$test = new Test;
try {
throw new Exception;
} catch (Exception) {}
$appendProp2 = (function() {
$this->prop[] = 1;
})->bindTo($test, Test::class);
$appendProp2();
$appendProp2();
?>
--EXPECTF--
Fatal error: Uncaught Error: Cannot modify readonly property Test::$prop in %sfetch_obj_006.php:13
Stack trace:
#0 %sfetch_obj_006.php(16): Test->{closure}()
#1 {main}
thrown in %sfetch_obj_006.php on line 13 | PHP | 3 | NathanFreeman/php-src | ext/opcache/tests/jit/fetch_obj_006.phpt | [
"PHP-3.01"
] |
// name: phaser.ck
// desc: demo of Faust chugin in action!
// instantiate and connect faust => ck
adc => Faust phaser => dac;
// evaluate Faust code
phaser.eval(`
process = dm.phaser2_demo ;
`);
// print the parameters of the Faust object
phaser.dump();
// time loop
while( true )
{
// advance time
100::ms => now;
}
| ChucK | 4 | ccdarabundit/chugins | Faust/examples/phaser.ck | [
"MIT"
] |
$!
$ write sys$output "*** TEST DELETE FILE ***"
$!
$ create /dir test
$ copy *.dcl test /log
$ delete [.test]*.dcl /log
$ delete test /log
$!
$ write sys$output "*** TEST DELETE SYMBOL ***"
$!
$ s1 := test1
$ s2 :== test2
$ s3 = -1
$ s4 = 1
$ s5 = s1
$ s6 == s1
$ sho symbol /global
$ sho symbol /local
$ sho symbol s1
$ delete /symbol s1 /log
$ delete /symbol /local /log /all
$ delete /symbol s* /global /log
$ show symbol /all
$!
$ write sys$output "*** TEST DELETE KEY ***"
$!
$ define /key F1 "test1" /echo /erase /log /noterminate
$ define /key F2 "test2" /echo /erase /log /noterminate
$ define /key F3 "test3" /echo /erase /log /noterminate
$ define /key F4 "test4" /echo /erase /log /noterminate
$ show key
$ delete /key /log f4
$ delete /key /log /all
$ show key
| Clean | 3 | MichelValentin/PC-DCL | examples/delete.dcl | [
"BSD-3-Clause"
] |
<mt:Ignore>
# =======================
#
# 記事ループ-メディア
#
# 使い方:
# <mt:Include module="記事ループ-メディア" tag="p" thumbnail="0" date="0" excerpt="0" />
#
# モディファイアの基本値:
# tag = h3
# thumbnail = 1
# date = 1
# excerpt = 1
#
# =======================
</mt:Ignore>
<mt:Unless name="tag">
<mt:SetVar name="tag" value="h3" />
</mt:Unless>
<mt:Unless name="thumbnail" eq="0">
<mt:SetVar name="thumbnail" value="1" />
</mt:Unless>
<mt:Unless name="date" eq="0">
<mt:SetVar name="date" value="1" />
</mt:Unless>
<mt:Unless name="excerpt" eq="0">
<mt:SetVar name="excerpt" value="1" />
</mt:Unless>
<div class="media post-<mt:EntryID />">
<a href="<mt:If tag="EcEntryLinkUrl"><mt:EcEntryLinkUrl /><mt:Else><mt:EntryPermalink /></mt:If>">
<mt:If name="thumbnail" eq="1">
<div class="media-left">
<mt:If tag="EcEntryThumbnail">
<mt:EcEntryThumbnailAsset>
<mt:Include module="パーツ-アイキャッチ画像" width="240" />
<img src="<mt:var name="ec_eye_thumb_url" />" alt="<mt:var name="ec_eye_alt" />" width="<mt:var name="ec_eye_width" />" height="<mt:var name="ec_eye_height" />" class="media-object">
</mt:EcEntryThumbnailAsset>
<mt:ElseIf tag="EcEntryEyecatch">
<mt:EcEntryEyecatchAsset>
<mt:Include module="パーツ-アイキャッチ画像" width="240" />
<img src="<mt:var name="ec_eye_thumb_url" />" alt="<mt:var name="ec_eye_alt" />" width="<mt:var name="ec_eye_width" />" height="<mt:var name="ec_eye_height" />" class="media-object">
</mt:EcEntryEyecatchAsset>
<mt:Else>
<img src="<mt:Var name="ec_static_path" />images/noimage.jpg" class="media-object">
</mt:If>
<!-- /.media-left --></div>
</mt:If>
<div class="media-body">
<<mt:Var name="tag" /> class="media-title"><mt:EntryTitle encode_html="1" /></<mt:Var name="tag" />>
<mt:If name="date" eq="1">
<p class="media-date"><mt:EntryDate language="en" format="$ec_entry_date" /></p>
</mt:If>
<mt:If name="excerpt" eq="1">
<p class="media-excerpt"><mt:EntryExcerpt words="120" /></p>
</mt:If>
<!-- /.media-body --></div>
</a>
<!-- /.media --></div>
| MTML | 4 | webbingstudio/mt_theme_echo_bootstrap | dist/themes/echo_bootstrap/templates/loop_media.mtml | [
"MIT"
] |
/* Copyright (c) 2017-2019 Netronome Systems, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
;TEST_INIT_EXEC nfp-mem i32.ctm:0x80 0x00000000 0x00000000 0x00163ec4 0x23450000
;TEST_INIT_EXEC nfp-mem i32.ctm:0x90 0x0b000200 0x86dd6030 0x00000008 0x11fffe80
;TEST_INIT_EXEC nfp-mem i32.ctm:0xa0 0x00000000 0x00000200 0x0bfffe00 0x02003555
;TEST_INIT_EXEC nfp-mem i32.ctm:0xb0 0x55556666 0x66667777 0x77778888 0x8888003f
;TEST_INIT_EXEC nfp-mem i32.ctm:0xc0 0x003f0008 0x9b684dd3 0xe9a20000
#include <aggregate.uc>
#include <stdmac.uc>
#include <pv.uc>
.reg pkt_vec[PV_SIZE_LW]
aggregate_zero(pkt_vec, PV_SIZE_LW)
move(pkt_vec[0], 0x3e)
move(pkt_vec[2], 0x88)
move(pkt_vec[3], 0x1)
move(pkt_vec[4], 0x3fc0)
move(pkt_vec[5], ((14 << 24) | ((14 + 40) << 16) | (14 << 8) | (14 + 40)))
| UnrealScript | 2 | pcasconnetronome/nic-firmware | test/datapath/pkt_ipv6_udp_x88.uc | [
"BSD-2-Clause"
] |
Grim = require 'grim'
path = require 'path'
_ = require 'underscore-plus'
etch = require 'etch'
describe "DeprecationCopView", ->
[deprecationCopView, workspaceElement] = []
beforeEach ->
spyOn(_, 'debounce').andCallFake (func) ->
-> func.apply(this, arguments)
workspaceElement = atom.views.getView(atom.workspace)
jasmine.attachToDOM(workspaceElement)
jasmine.snapshotDeprecations()
Grim.clearDeprecations()
deprecatedMethod = -> Grim.deprecate("A test deprecation. This isn't used")
deprecatedMethod()
spyOn(Grim, 'deprecate') # Don't fail tests if when using deprecated APIs in deprecation cop's activation
activationPromise = atom.packages.activatePackage('deprecation-cop')
atom.commands.dispatch workspaceElement, 'deprecation-cop:view'
waitsForPromise ->
activationPromise
waitsFor -> deprecationCopView = atom.workspace.getActivePane().getActiveItem()
runs ->
jasmine.unspy(Grim, 'deprecate')
afterEach ->
jasmine.restoreDeprecationsSnapshot()
it "displays deprecated methods", ->
expect(deprecationCopView.element.textContent).toMatch /Deprecated calls/
expect(deprecationCopView.element.textContent).toMatch /This isn't used/
# TODO: Remove conditional when the new StyleManager deprecation APIs reach stable.
if atom.styles.getDeprecations?
it "displays deprecated selectors", ->
atom.styles.addStyleSheet("atom-text-editor::shadow { color: red }", sourcePath: path.join('some-dir', 'packages', 'package-1', 'file-1.css'))
atom.styles.addStyleSheet("atom-text-editor::shadow { color: yellow }", context: 'atom-text-editor', sourcePath: path.join('some-dir', 'packages', 'package-1', 'file-2.css'))
atom.styles.addStyleSheet('atom-text-editor::shadow { color: blue }', sourcePath: path.join('another-dir', 'packages', 'package-2', 'file-3.css'))
atom.styles.addStyleSheet('atom-text-editor::shadow { color: gray }', sourcePath: path.join('another-dir', 'node_modules', 'package-3', 'file-4.css'))
promise = etch.getScheduler().getNextUpdatePromise()
waitsForPromise -> promise
runs ->
packageItems = deprecationCopView.element.querySelectorAll("ul.selectors > li")
expect(packageItems.length).toBe(3)
expect(packageItems[0].textContent).toMatch /package-1/
expect(packageItems[1].textContent).toMatch /package-2/
expect(packageItems[2].textContent).toMatch /Other/
packageDeprecationItems = packageItems[0].querySelectorAll("li.source-file")
expect(packageDeprecationItems.length).toBe(2)
expect(packageDeprecationItems[0].textContent).toMatch /atom-text-editor/
expect(packageDeprecationItems[0].querySelector("a").href).toMatch('some-dir/packages/package-1/file-1.css')
expect(packageDeprecationItems[1].textContent).toMatch /:host/
expect(packageDeprecationItems[1].querySelector("a").href).toMatch('some-dir/packages/package-1/file-2.css')
it 'skips stack entries which go through node_modules/ files when determining package name', ->
stack = [
{
"functionName": "function0"
"location": path.normalize "/Users/user/.atom/packages/package1/node_modules/atom-space-pen-viewslib/space-pen.js:55:66"
"fileName": path.normalize "/Users/user/.atom/packages/package1/node_modules/atom-space-pen-views/lib/space-pen.js"
}
{
"functionName": "function1"
"location": path.normalize "/Users/user/.atom/packages/package1/node_modules/atom-space-pen-viewslib/space-pen.js:15:16"
"fileName": path.normalize "/Users/user/.atom/packages/package1/node_modules/atom-space-pen-views/lib/space-pen.js"
}
{
"functionName": "function2"
"location": path.normalize "/Users/user/.atom/packages/package2/lib/module.js:13:14"
"fileName": path.normalize "/Users/user/.atom/packages/package2/lib/module.js"
}
]
packagePathsByPackageName = new Map([
['package1', path.normalize("/Users/user/.atom/packages/package1")],
['package2', path.normalize("/Users/user/.atom/packages/package2")]
])
spyOn(deprecationCopView, 'getPackagePathsByPackageName').andReturn(packagePathsByPackageName)
packageName = deprecationCopView.getPackageName(stack)
expect(packageName).toBe("package2")
| CoffeeScript | 4 | davidbertsch/atom | packages/deprecation-cop/spec/deprecation-cop-view-spec.coffee | [
"MIT"
] |
#!/usr/bin/env dexec
print "hello world\n";
| Perl6 | 0 | docker-exec/perl6 | test/shebang.p6 | [
"MIT"
] |
DROP TABLE IF EXISTS ColumnsClauseTest;
CREATE TABLE ColumnsClauseTest (product_price Int64, product_weight Int16, amount Int64) Engine=TinyLog;
INSERT INTO ColumnsClauseTest VALUES (100, 10, 324), (120, 8, 23);
SELECT COLUMNS('product.*') from ColumnsClauseTest ORDER BY product_price;
DROP TABLE ColumnsClauseTest;
SELECT number, COLUMNS('') FROM numbers(2);
SELECT number, COLUMNS('ber') FROM numbers(2); -- It works for unanchored regular expressions.
SELECT number, COLUMNS('x') FROM numbers(2);
SELECT COLUMNS('') FROM numbers(2);
SELECT COLUMNS('x') FROM numbers(10) WHERE number > 5; -- { serverError 51 }
SELECT * FROM numbers(2) WHERE NOT ignore();
SELECT * FROM numbers(2) WHERE NOT ignore(*);
SELECT * FROM numbers(2) WHERE NOT ignore(COLUMNS('.+'));
SELECT * FROM numbers(2) WHERE NOT ignore(COLUMNS('x'));
SELECT COLUMNS('n') + COLUMNS('u') FROM system.numbers LIMIT 2;
SELECT COLUMNS('n') + COLUMNS('u') FROM (SELECT 1 AS a, 2 AS b); -- { serverError 42 }
SELECT COLUMNS('a') + COLUMNS('b') FROM (SELECT 1 AS a, 2 AS b);
SELECT COLUMNS('a') + COLUMNS('a') FROM (SELECT 1 AS a, 2 AS b);
SELECT COLUMNS('b') + COLUMNS('b') FROM (SELECT 1 AS a, 2 AS b);
SELECT COLUMNS('a|b') + COLUMNS('b') FROM (SELECT 1 AS a, 2 AS b); -- { serverError 42 }
SELECT plus(COLUMNS('^(a|b)$')) FROM (SELECT 1 AS a, 2 AS b);
| SQL | 3 | pdv-ru/ClickHouse | tests/queries/0_stateless/00969_columns_clause.sql | [
"Apache-2.0"
] |
use @pony_exitcode[None](code: I32)
trait T
class C1 is T
class C2 is T
actor Main
new create(env: Env) =>
foo[C2](C2)
fun foo[A: T](x: A) =>
iftype A <: C1 then
None
elseif A <: C2 then
@pony_exitcode(1)
end
| Pony | 3 | rtpax/ponyc | test/libponyc-run/iftype-else-if-true/main.pony | [
"BSD-2-Clause"
] |
<cfcomponent displayname="Controller" output="false">
<!---
Generate an (almost) unique name for the application in case there are multiple instances of the app
on the same server (i.e. different domains or subdomains).
--->
<cfset suffix = hash(getCurrentTemplatePath())>
<cfset suffix = reReplace(suffix, "[^a-zA-Z]","","all")>
<cfset this.name = "ColdBricks_" & left(suffix, 20)>
<!--- Application environment settings --->
<cfset this.clientManagement = false>
<cfset this.sessionManagement = true>
<cfset this.setClientCookies = true>
<cfset this.setDomainCookies = false>
<!--- Application Framework settings --->
<cfset this.appFrameworkVersion = "1.3">
<cfset this.defaultEvent = "ehGeneral.dspMain">
<cfset this.defaultLayout = "Layout.Main">
<cfset this.topLevelErrorRecipient = "bugs@coldbricks.com">
<cfset this.topLevelErrorSender = "info@coldbricks.com">
<cfset this.restartKey = "cookieMonster">
<cfset this.configDoc = "config.xml">
<cfset this.modulesPath = "modules">
<cfset this.externalModulesRoot = "">
<cfset this.externalModulesPrefix = "my">
<cfset this.emailErrors = false>
<cfset this.customtagpaths = expandPath("includes")>
<cfset this.scriptProtect = "none">
<cfset this.extModulesList = -1>
<cffunction name="onRequestStart" output="false">
<cfparam name="Event" default=""> <!--- use to determine the action to perform --->
<cfparam name="resetApp" default="false"> <!--- use to reset the application state --->
<cfscript>
// Check that there is always a value for the event param
if(event eq "") event = this.defaultEvent;
// Check application reset conditions
resetApp = resetApp or (Not structKeyExists(application,"_restartKey") or application["_restartKey"] neq this.restartKey);
// create a structure to hold current request state
reqState = duplicate(form);
StructAppend(reqState, url);
// set initial values in reqState
reqState.event = event;
reqState._isexternalmodule_ = false;
reqState.layout = this.defaultLayout;
reqState.view = "";
reqState.module = "";
// check if there are any override of default app settings from the config file
// (NOTE: any overrides will only take effect after the app has been initialized with the default settings)
checkAppSettingsOverride("externalModulesRoot,externalModulesPrefix,topLevelErrorRecipient,topLevelErrorSender,emailErrors");
// check for external modules
if(Not structKeyExists(application,"_appInited") or resetApp)
structDelete(application, "__core__extModulesList");
reqState._isexternalmodule_ = isExternalModule(event);
if(listLen(event,".") eq 4 and reqState._isexternalmodule_) {
reqState.event = listDeleteAt(event,1,".");
}
// instantiate the general event handler
appEventHandler = createObject("component", "handlers.ehGeneral").init(reqState);
// handle application initialization and re-initialization
if(Not structKeyExists(application,"_appInited") or resetApp)
startApplication(appEventHandler);
// call app's onRequestStart
appEventHandler.onRequestStart();
// execute requested event
runEventHandler(reqState);
// call app's onRequestEnd
appEventHandler.onRequestEnd();
// define path to the view template
reqState.viewTemplatePath = getViewTemplatePath(reqState);
// copy requestState structure to request scope so it can be used by the views and layouts
request.requestState = reqState;
</cfscript>
</cffunction>
<cffunction name="onRequest" output="true">
<cfargument name="targetPage" type="String" required="true" />
<cfif request.requestState.layout neq "">
<cfinclude template="layouts/#request.requestState.layout#.cfm">
<cfelse>
<cfinclude template="#targetPage#">
</cfif>
</cffunction>
<cffunction name="onError" returntype="void" output="true" hint="This method will handle all controller-level exceptions, or any other exceptions not handled by the eventHandler or the view.">
<cfargument name="Exception" required="true" />
<cfargument name="EventName" type="String" required="true" />
<cfset var error = 0>
<cfset var hostName = CreateObject("java", "java.net.InetAddress").getLocalHost().getHostName()>
<cfif structKeyExists(arguments.exception, "rootCause")>
<cfset error = arguments.exception.rootCause>
<cfif arguments.exception.rootCause.type eq "coldfusion.runtime.AbortException">
<cfreturn>
</cfif>
<cfelse>
<cfset error = arguments.exception>
</cfif>
<!--- notify administrator of the error --->
<cfif this.emailErrors>
<cfmail to="#this.topLevelErrorRecipient#"
from="#this.topLevelErrorSender#"
subject="BUG REPORT: [#this.Name#] [#hostName#] #error.message#"
type="html"><cfdump var="#arguments.exception#"></cfmail>
</cfif>
<!--- display a user-friendly error screen --->
<cfinclude template="includes/error.cfm">
<!--- stop execution --->
<cfabort>
</cffunction>
<!--- Do application startup --->
<cffunction name="startApplication" access="private" returntype="void" hint="This method handles the application startup tasks">
<cfargument name="appHandler" type="any" required="true">
<cfset var xmlConfigDoc = 0>
<cfset var xmlMyConfigDoc = 0>
<cfset var hasMyConfig = false>
<cflock name="frAppStart_#this.name#" type="exclusive" timeout="10">
<cfscript>
if(this.configDoc neq "") {
// initialize area for settings and services
application["_appSettings"] = structNew();
application["_appServices"] = structNew();
// load configuration file
xmlConfigDoc = xmlParse(expandPath("config/" & this.configDoc));
// load application settings
loadApplicationSettings(xmlConfigDoc);
// load custom overrides to config
if(fileExists(expandPath("config/my." & this.configDoc))) {
hasMyConfig = true;
xmlMyConfigDoc = xmlParse(expandPath("config/my." & this.configDoc));
loadApplicationSettings(xmlMyConfigDoc);
}
// load application services
loadApplicationServices(xmlConfigDoc);
// load custom overrides to config
if(hasMyConfig) loadApplicationServices(xmlMyConfigDoc);
}
// execute application-specific initialization tasks
arguments.appHandler.onApplicationStart();
// flag application as initialized
application["_appInited"] = true;
// replace restartKey (this flags current server as restarted)
application["_restartKey"] = this.restartKey;
</cfscript>
</cflock>
</cffunction>
<!--- Execute Event Handler --->
<cffunction name="runEventHandler" access="private" returntype="void" hint="This method is in charge of executing the requested event">
<cfargument name="reqState" type="struct" required="true">
<cfscript>
var oEventHandler = 0;
var eh_cfc = ""; var eh_path = "";
var rq = arguments.reqState;
var mp = "";
var modulePath = this.modulesPath;
if(listLen(rq.event,".") gte 2 and listLen(rq.event,".") lt 4) {
// convert modulesPath to a valid dot notation
if(arguments.reqState._isexternalmodule_) modulePath = this.externalModulesRoot;
mp = replace(modulePath,"/",".","ALL");
if(left(mp,1) eq ".") mp = right(mp,len(mp)-1);
if(right(mp,1) neq ".") mp = mp & ".";
// Parse event handler
if(listLen(rq.event,".") eq 2) {
eh_cfc = listFirst(rq.event,".");
eh_path = "handlers.";
} else if(listLen(rq.event,".") eq 3) {
rq.module = listFirst(rq.event,".");
eh_cfc = listGetAt(rq.event,2,".");
eh_path = mp & rq.module & ".handlers.";
}
// Instantiate the event handler
oEventHandler = createObject("component", eh_path & eh_cfc).init(rq);
// Call the selected method on the eventhandler
evaluate("oEventHandler." & listLast(rq.event,".") & "()");
}
</cfscript>
</cffunction>
<!--- Load Application Settings --->
<cffunction name="loadApplicationSettings" access="private" returntype="void">
<cfargument name="xmlConfig" type="XML" required="true">
<cfscript>
var i = 0;
var xmlNode = 0;
// read application settings
if(structKeyExists(arguments.xmlConfig.xmlRoot,"settings")) {
for(i=1;i lte arrayLen(arguments.xmlConfig.xmlRoot.settings.xmlChildren);i=i+1) {
xmlNode = arguments.xmlConfig.xmlRoot.settings.xmlChildren[i];
if(xmlNode.xmlName eq "setting") {
application["_appSettings"][xmlNode.xmlAttributes.name] = xmlNode.xmlAttributes.value;
}
}
}
</cfscript>
</cffunction>
<!--- Load Application Services --->
<cffunction name="loadApplicationServices" access="private" returntype="void">
<cfargument name="xmlConfig" type="XML" required="true">
<cfscript>
var i = 0;
var j = 0;
var xmlNode = 0;
var stArguments = structNew();
var oService = 0;
// read application services
if(structKeyExists(arguments.xmlConfig.xmlRoot,"services")) {
for(i=1;i lte arrayLen(arguments.xmlConfig.xmlRoot.services.xmlChildren);i=i+1) {
xmlNode = arguments.xmlConfig.xmlRoot.services.xmlChildren[i];
if(xmlNode.xmlName eq "service") {
stArguments = structNew();
oService = 0;
// create the argument collection for the init method
for(j=1;j lte arrayLen(xmlNode.xmlChildren);j=j+1) {
if( xmlNode.xmlChildren[j].xmlName eq "init-param" ) {
// check if the parameter value is binded to an application setting
if(structKeyExists(xmlNode.xmlChildren[j].xmlAttributes,"settingName")) {
stArguments[ xmlNode.xmlChildren[j].xmlAttributes.name ] = application["_appSettings"][xmlNode.xmlChildren[j].xmlAttributes.settingName];
} else if(structKeyExists(xmlNode.xmlChildren[j].xmlAttributes,"serviceName")) {
stArguments[ xmlNode.xmlChildren[j].xmlAttributes.name ] = application["_appServices"][xmlNode.xmlChildren[j].xmlAttributes.serviceName];
} else {
// append to argument collection
stArguments[ xmlNode.xmlChildren[j].xmlAttributes.name ] = xmlNode.xmlChildren[j].xmlText;
}
}
}
// instantiate service
oService = createObject("component", xmlNode.xmlAttributes.class);
// initialize service
oService.init(argumentCollection = stArguments);
// add service instance into application scope
application["_appServices"][xmlNode.xmlAttributes.name] = oService;
}
}
}
</cfscript>
</cffunction>
<!--- Compose Path To View Template --->
<cffunction name="getViewTemplatePath" access="private" returntype="string" hint="Returns the full path to the template corresponding to the requested view">
<cfargument name="reqState" type="struct" required="true">
<cfscript>
var basePath = "..";
var viewPath = "";
var modulePath = this.modulesPath;
if(arguments.reqState.view neq "") {
if(arguments.reqState.module neq "") {
if(arguments.reqState._isexternalmodule_) modulePath = this.externalModulesRoot;
if(left(modulePath,1) eq "/")
basePath = modulePath & "/" & arguments.reqState.module;
else
basePath = "../" & modulePath & "/" & arguments.reqState.module;
}
viewPath = basePath & "/views/" & arguments.reqState.view & ".cfm";
}
return viewPath;
</cfscript>
</cffunction>
<cffunction name="isExternalModule" access="private" returntype="boolean" hint="Checks whether the given event belongs to an external module">
<cfargument name="event" type="string" required="true">
<cfif listLen(event,".") eq 4 and listFirst(event,".") eq this.externalModulesPrefix>
<cfreturn true>
<cfelseif listLen(event,".") eq 3>
<cfreturn listFindNoCase(getExternalModulesList(), listFirst(event,"."))>
</cfif>
<cfreturn false>
</cffunction>
<cffunction name="getExternalModulesList" access="private" returntype="string">
<cfset var list = "">
<cfset var qry = 0>
<cfif this.externalModulesRoot neq "">
<cfif not structKeyExists(application,"__core__extModulesList")>
<cfdirectory action="list" name="qry" directory="#expandPath(this.externalModulesRoot)#">
<cfquery name="qry" dbtype="query">
SELECT * FROM qry WHERE upper(type) = 'DIR'
</cfquery>
<cflock name="cbBuildExtModules_lock" type="exclusive" timeout="20">
<cfset application.__core__extModulesList = valueList(qry.name)>
</cflock>
</cfif>
<cfset list = application.__core__extModulesList>
</cfif>
<cfreturn list>
</cffunction>
<cffunction name="checkAppSettingsOverride" access="private" returntype="void">
<cfargument name="overridableKeys" type="string" required="true" hint="list of keys that can be overriden">
<cfif structKeyExists(application,"_appSettings")>
<cfloop list="#arguments.overridableKeys#" index="key">
<cfif structKeyExists(application._appSettings,key)>
<cfset this[key] = application._appSettings[key]>
</cfif>
</cfloop>
</cfif>
</cffunction>
</cfcomponent>
| ColdFusion CFC | 5 | subethaedit/SubEthaEd | Documentation/ModeDevelopment/Reference Files/CFML/Application.cfc | [
"MIT"
] |
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_GRAPPLER_GRAPH_ANALYZER_HASH_TOOLS_H_
#define TENSORFLOW_CORE_GRAPPLER_GRAPH_ANALYZER_HASH_TOOLS_H_
#include <cstddef>
namespace tensorflow {
namespace grappler {
namespace graph_analyzer {
// Unfortunately, std::hash provides no way to combine hashes, so everyone
// is copying boost::hash_combine. This is a version that follows Google's
// guidelines on the arguments, and contains only the combination, without
// hashing.
inline void CombineHash(size_t from, size_t* to) {
*to ^= from + 0x9e3779b9 + (*to << 6) + (*to >> 2);
}
// Combine two hashes in such a way that the order of combination doesn't matter
// (so it's really both commutative and associative). The result is not a very
// high-quality hash but can be used in case if the order of sub-elements must
// not matter in the following comparison. An alternative would be to sort the
// hashes of the sub-elements and then combine them normally in the sorted
// order.
inline void CombineHashCommutative(size_t from, size_t* to) {
*to = *to + from + 0x9e3779b9;
}
} // end namespace graph_analyzer
} // end namespace grappler
} // end namespace tensorflow
#endif // TENSORFLOW_CORE_GRAPPLER_GRAPH_ANALYZER_HASH_TOOLS_H_
| C | 5 | abhaikollara/tensorflow | tensorflow/core/grappler/graph_analyzer/hash_tools.h | [
"Apache-2.0"
] |
(assert (= (str.replaceall "abcdefabcdef" "bc" "xy") "axydefaxydef"))
(check-sat)
| SMT | 3 | mauguignard/cbmc | regression/smt2_strings/replace_all_const_sat/replace_all_const_sat.smt2 | [
"BSD-4-Clause"
] |
"""
Similarity Search : https://en.wikipedia.org/wiki/Similarity_search
Similarity search is a search algorithm for finding the nearest vector from
vectors, used in natural language processing.
In this algorithm, it calculates distance with euclidean distance and
returns a list containing two data for each vector:
1. the nearest vector
2. distance between the vector and the nearest vector (float)
"""
from __future__ import annotations
import math
import numpy as np
def euclidean(input_a: np.ndarray, input_b: np.ndarray) -> float:
"""
Calculates euclidean distance between two data.
:param input_a: ndarray of first vector.
:param input_b: ndarray of second vector.
:return: Euclidean distance of input_a and input_b. By using math.sqrt(),
result will be float.
>>> euclidean(np.array([0]), np.array([1]))
1.0
>>> euclidean(np.array([0, 1]), np.array([1, 1]))
1.0
>>> euclidean(np.array([0, 0, 0]), np.array([0, 0, 1]))
1.0
"""
return math.sqrt(sum(pow(a - b, 2) for a, b in zip(input_a, input_b)))
def similarity_search(
dataset: np.ndarray, value_array: np.ndarray
) -> list[list[list[float] | float]]:
"""
:param dataset: Set containing the vectors. Should be ndarray.
:param value_array: vector/vectors we want to know the nearest vector from dataset.
:return: Result will be a list containing
1. the nearest vector
2. distance from the vector
>>> dataset = np.array([[0], [1], [2]])
>>> value_array = np.array([[0]])
>>> similarity_search(dataset, value_array)
[[[0], 0.0]]
>>> dataset = np.array([[0, 0], [1, 1], [2, 2]])
>>> value_array = np.array([[0, 1]])
>>> similarity_search(dataset, value_array)
[[[0, 0], 1.0]]
>>> dataset = np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]])
>>> value_array = np.array([[0, 0, 1]])
>>> similarity_search(dataset, value_array)
[[[0, 0, 0], 1.0]]
>>> dataset = np.array([[0, 0, 0], [1, 1, 1], [2, 2, 2]])
>>> value_array = np.array([[0, 0, 0], [0, 0, 1]])
>>> similarity_search(dataset, value_array)
[[[0, 0, 0], 0.0], [[0, 0, 0], 1.0]]
These are the errors that might occur:
1. If dimensions are different.
For example, dataset has 2d array and value_array has 1d array:
>>> dataset = np.array([[1]])
>>> value_array = np.array([1])
>>> similarity_search(dataset, value_array)
Traceback (most recent call last):
...
ValueError: Wrong input data's dimensions... dataset : 2, value_array : 1
2. If data's shapes are different.
For example, dataset has shape of (3, 2) and value_array has (2, 3).
We are expecting same shapes of two arrays, so it is wrong.
>>> dataset = np.array([[0, 0], [1, 1], [2, 2]])
>>> value_array = np.array([[0, 0, 0], [0, 0, 1]])
>>> similarity_search(dataset, value_array)
Traceback (most recent call last):
...
ValueError: Wrong input data's shape... dataset : 2, value_array : 3
3. If data types are different.
When trying to compare, we are expecting same types so they should be same.
If not, it'll come up with errors.
>>> dataset = np.array([[0, 0], [1, 1], [2, 2]], dtype=np.float32)
>>> value_array = np.array([[0, 0], [0, 1]], dtype=np.int32)
>>> similarity_search(dataset, value_array) # doctest: +NORMALIZE_WHITESPACE
Traceback (most recent call last):
...
TypeError: Input data have different datatype...
dataset : float32, value_array : int32
"""
if dataset.ndim != value_array.ndim:
raise ValueError(
f"Wrong input data's dimensions... dataset : {dataset.ndim}, "
f"value_array : {value_array.ndim}"
)
try:
if dataset.shape[1] != value_array.shape[1]:
raise ValueError(
f"Wrong input data's shape... dataset : {dataset.shape[1]}, "
f"value_array : {value_array.shape[1]}"
)
except IndexError:
if dataset.ndim != value_array.ndim:
raise TypeError("Wrong shape")
if dataset.dtype != value_array.dtype:
raise TypeError(
f"Input data have different datatype... dataset : {dataset.dtype}, "
f"value_array : {value_array.dtype}"
)
answer = []
for value in value_array:
dist = euclidean(value, dataset[0])
vector = dataset[0].tolist()
for dataset_value in dataset[1:]:
temp_dist = euclidean(value, dataset_value)
if dist > temp_dist:
dist = temp_dist
vector = dataset_value.tolist()
answer.append([vector, dist])
return answer
if __name__ == "__main__":
import doctest
doctest.testmod()
| Python | 5 | NavpreetDevpuri/Python | machine_learning/similarity_search.py | [
"MIT"
] |
namespace eval expectnmcu::xfer {
}
package require expectnmcu::core
# Open remote file `which` on `dev` in `mode` as Lua object `dfh`
proc ::expectnmcu::xfer::open { dev dfh which mode } {
::expectnmcu::core::send_exp_prompt ${dev} "${dfh} = nil"
::expectnmcu::core::send_exp_prompt ${dev} "${dfh} = file.open(\"${which}\",\"${mode}\")"
::expectnmcu::core::send_exp_res_prompt ${dev} "=type(${dfh})" "userdata"
}
# Close Lua file object `dfh` on `dev`
proc ::expectnmcu::xfer::close { dev dfh } {
::expectnmcu::core::send_exp_prompt ${dev} "${dfh}:close()"
}
# Write to `dfh` on `dev` at `where` `what`, using base64 as transport
#
# This does not split lines; write only short amounts of data.
proc ::expectnmcu::xfer::pwrite { dev dfh where what } {
send -i ${dev} -- [string cat \
"do local d,e = encoder.fromBase64(\"[binary encode base64 -maxlen 0 ${what}]\");" \
"${dfh}:seek(\"set\",${where});" \
"print(${dfh}:write(d));" \
"end\n" \
]
expect {
-i ${dev} -re "true\[\r\n\]+> " { }
-i ${dev} -re ${::expectnmcu::core::panicre} { return -code error "Panic!" }
-i ${dev} -ex "\n> " { return -code error "Bad result from pwrite" }
timeout { return -code error "Timeout while waiting for pwrite" }
}
}
# Read `howmuch` byetes from `dfh` on `dev` at `where`, using base64
# as transport. This buffers the whole data and its base64 encoding
# in device RAM; read only short strings.
proc ::expectnmcu::xfer::pread { dev dfh where howmuch } {
send -i ${dev} -- "${dfh}:seek(\"set\",${where}); print(encoder.toBase64(${dfh}:read(${howmuch})))\n"
expect {
-i ${dev} -re "\\)\\)\\)\[\r\n\]+(\[^\r\n\]+)\[\r\n\]+> " {
return [binary decode base64 ${expect_out(1,string)}]
}
-i ${dev} -ex "\n> " { return -code error "No reply to pread" }
-i ${dev} -re ${::expectnmcu::core::panicre} { return -code error "Panic!" }
timeout { return -code error "Timeout while pread-ing" }
}
}
# Check for pipeutils on the target device
proc ::expectnmcu::xfer::haspipeutils { dev } {
send -i ${dev} -- "local ok, pu = pcall(require, \"pipeutils\"); print(ok and type(pu) == \"table\" and pu.chunker and pu.debase64 and true or false)\n"
expect {
-i ${dev} -re "\[\r\n\]+false\[\r\n\]+> " { return 0 }
-i ${dev} -re "\[\r\n\]+true\[\r\n\]+> " { return 1 }
-i ${dev} -ex "\n> " { return -code error "No reply to pipeutils probe" }
-i ${dev} -re ${::expectnmcu::core::panicre} { return -code error "Panic!" }
timeout { return -code error "Timeout while probing for pipeutils" }
}
}
# Send local file `lfn` to the remote filesystem on `dev` and name it `rfn`.
# Use `dfo` as the Lua handle to the remote file for the duration of writing,
# (and `nil` it out afterwards)
proc ::expectnmcu::xfer::sendfile { dev lfn rfn {dfo "xfo"} } {
package require sha256
set has_pipeutils [::expectnmcu::xfer::haspipeutils ${dev} ]
set ltf [::open ${lfn} ]
fconfigure ${ltf} -translation binary
file stat ${lfn} lfstat
::expectnmcu::xfer::open ${dev} ${dfo} "${rfn}.sf" "w+"
if { ${has_pipeutils} } {
# Send over a loader program
::expectnmcu::core::send_exp_prompt_c ${dev} "do"
::expectnmcu::core::send_exp_prompt_c ${dev} " local pu = require \"pipeutils\""
::expectnmcu::core::send_exp_prompt_c ${dev} " local ch = pu.chunker(function(d) ${dfo}:write(d) end, 256)"
::expectnmcu::core::send_exp_prompt_c ${dev} " local db = pu.debase64(ch.write, function(ed,ee)"
::expectnmcu::core::send_exp_prompt_c ${dev} " if ed:match(\"^%.\[\\r\\n\]*$\") then ch.flush() print(\"F I N\")"
::expectnmcu::core::send_exp_prompt_c ${dev} " else print(\"ABORT\", ee, ed) end"
::expectnmcu::core::send_exp_prompt_c ${dev} " uart.on(\"data\") end)"
# TODO: make echo use CRC not full string; probably best add to crypto module
::expectnmcu::core::send_exp_prompt_c ${dev} " uart.on(\"data\", \"\\n\", function(x) db.write(x); uart.write(0, \"OK: \", x) end, 0)"
::expectnmcu::core::send_exp_prompt ${dev} "end"
set xln 90
} else {
set xln 48
}
set lho [sha2::SHA256Init]
set fpos 0
while { 1 } {
send_user ">> xfer ${fpos} of ${lfstat(size)}\n"
set data [read ${ltf} ${xln}]
sha2::SHA256Update ${lho} ${data}
if { ${has_pipeutils} } {
set estr [binary encode base64 -maxlen 0 ${data}]
send -i ${dev} -- "${estr}\n"
expect {
-i ${dev} -ex "OK: ${estr}" { expect -i ${dev} -re "\[\r\n\]+" {} }
-i ${dev} -ex "\n> " { return -code error "Prompt while sending data" }
-i ${dev} -re ${::expectnmcu::core::panicre} { return -code error "Panic!" }
timeout { return -code error "Timeout while sending data" }
}
} else {
::expectnmcu::xfer::pwrite ${dev} ${dfo} ${fpos} ${data}
}
set fpos [expr $fpos + ${xln}]
if { [string length ${data}] != ${xln} } { break }
}
if { ${has_pipeutils} } {
send -i ${dev} -- ".\n"
expect {
-i ${dev} -re "F I N\[\r\n\]+" { }
-i ${dev} -ex "\n> " { return -code error "Prompt while awaiting acknowledgement" }
-i ${dev} -re ${::expectnmcu::core::panicre} { return -code error "Panic!" }
timeout { return -code error "Timeout while awaiting acknowledgement" }
}
}
::close ${ltf}
::expectnmcu::xfer::close ${dev} ${dfo}
::expectnmcu::core::send_exp_prompt ${dev} "${dfo} = nil"
set exphash [sha2::Hex [sha2::SHA256Final ${lho}]]
send -i ${dev} "=encoder.toHex(crypto.fhash(\"sha256\",\"${rfn}.sf\"))\n"
expect {
-i ${dev} -re "\[\r\n\]+(\[a-f0-9\]+)\[\r\n\]+> " {
if { ${expect_out(1,string)} != ${exphash} } {
return -code error \
"Sendfile checksum mismatch: ${expect_out(1,string)} != ${exphash}"
}
}
-i ${dev} -re ${::expectnmcu::core::panicre} { return -code error "Panic!" }
timeout { return -code error "Timeout while verifying checksum" }
}
::expectnmcu::core::send_exp_prompt ${dev} "file.remove(\"${rfn}\")"
::expectnmcu::core::send_exp_res_prompt ${dev} "=file.rename(\"${rfn}.sf\", \"${rfn}\")" "true"
}
package provide expectnmcu::xfer 1.0
| Tcl | 4 | galenzhao/nodemcu-firmware | tests/expectnmcu/xfer.tcl | [
"MIT"
] |
Gramatika
0 $accept: top $end
1 top: expr
2 expr: expr1
3 | '+' expr
4 | '-' expr
5 expr1: expr2
6 | expr1 '+' expr2
7 | expr1 '-' expr2
8 expr2: expr3
9 | expr2 '*' expr3
10 | expr2 '/' expr3
11 expr3: NUM
12 | '(' expr ')'
Terminály s pravidly, ve kterých se objevují
$end (0) 0
'(' (40) 12
')' (41) 12
'*' (42) 9
'+' (43) 3 6
'-' (45) 4 7
'/' (47) 10
error (256)
NUM (258) 11
Neterminály s pravidly, ve kterých se objevují
$accept (10)
vlevo: 0
top (11)
vlevo: 1, vpravo: 0
expr (12)
vlevo: 2 3 4, vpravo: 1 3 4 12
expr1 (13)
vlevo: 5 6 7, vpravo: 2 6 7
expr2 (14)
vlevo: 8 9 10, vpravo: 5 6 7 9 10
expr3 (15)
vlevo: 11 12, vpravo: 8 9 10
State 0
0 $accept: . top $end
1 top: . expr
2 expr: . expr1
3 | . '+' expr
4 | . '-' expr
5 expr1: . expr2
6 | . expr1 '+' expr2
7 | . expr1 '-' expr2
8 expr2: . expr3
9 | . expr2 '*' expr3
10 | . expr2 '/' expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'+' posunout a přejít do stavu 2
'-' posunout a přejít do stavu 3
'(' posunout a přejít do stavu 4
top přejít do stavu 5
expr přejít do stavu 6
expr1 přejít do stavu 7
expr2 přejít do stavu 8
expr3 přejít do stavu 9
State 1
11 expr3: NUM .
$výchozí reduce using rule 11 (expr3)
State 2
2 expr: . expr1
3 | . '+' expr
3 | '+' . expr
4 | . '-' expr
5 expr1: . expr2
6 | . expr1 '+' expr2
7 | . expr1 '-' expr2
8 expr2: . expr3
9 | . expr2 '*' expr3
10 | . expr2 '/' expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'+' posunout a přejít do stavu 2
'-' posunout a přejít do stavu 3
'(' posunout a přejít do stavu 4
expr přejít do stavu 10
expr1 přejít do stavu 7
expr2 přejít do stavu 8
expr3 přejít do stavu 9
State 3
2 expr: . expr1
3 | . '+' expr
4 | . '-' expr
4 | '-' . expr
5 expr1: . expr2
6 | . expr1 '+' expr2
7 | . expr1 '-' expr2
8 expr2: . expr3
9 | . expr2 '*' expr3
10 | . expr2 '/' expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'+' posunout a přejít do stavu 2
'-' posunout a přejít do stavu 3
'(' posunout a přejít do stavu 4
expr přejít do stavu 11
expr1 přejít do stavu 7
expr2 přejít do stavu 8
expr3 přejít do stavu 9
State 4
2 expr: . expr1
3 | . '+' expr
4 | . '-' expr
5 expr1: . expr2
6 | . expr1 '+' expr2
7 | . expr1 '-' expr2
8 expr2: . expr3
9 | . expr2 '*' expr3
10 | . expr2 '/' expr3
11 expr3: . NUM
12 | . '(' expr ')'
12 | '(' . expr ')'
NUM posunout a přejít do stavu 1
'+' posunout a přejít do stavu 2
'-' posunout a přejít do stavu 3
'(' posunout a přejít do stavu 4
expr přejít do stavu 12
expr1 přejít do stavu 7
expr2 přejít do stavu 8
expr3 přejít do stavu 9
State 5
0 $accept: top . $end
$end posunout a přejít do stavu 13
State 6
1 top: expr .
$výchozí reduce using rule 1 (top)
State 7
2 expr: expr1 . [$end, ')']
6 expr1: expr1 . '+' expr2
7 | expr1 . '-' expr2
'+' posunout a přejít do stavu 14
'-' posunout a přejít do stavu 15
$výchozí reduce using rule 2 (expr)
State 8
5 expr1: expr2 . [$end, '+', '-', ')']
9 expr2: expr2 . '*' expr3
10 | expr2 . '/' expr3
'*' posunout a přejít do stavu 16
'/' posunout a přejít do stavu 17
$výchozí reduce using rule 5 (expr1)
State 9
8 expr2: expr3 .
$výchozí reduce using rule 8 (expr2)
State 10
3 expr: '+' expr .
$výchozí reduce using rule 3 (expr)
State 11
4 expr: '-' expr .
$výchozí reduce using rule 4 (expr)
State 12
12 expr3: '(' expr . ')'
')' posunout a přejít do stavu 18
State 13
0 $accept: top $end .
$výchozí přijmout
State 14
6 expr1: expr1 '+' . expr2
8 expr2: . expr3
9 | . expr2 '*' expr3
10 | . expr2 '/' expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'(' posunout a přejít do stavu 4
expr2 přejít do stavu 19
expr3 přejít do stavu 9
State 15
7 expr1: expr1 '-' . expr2
8 expr2: . expr3
9 | . expr2 '*' expr3
10 | . expr2 '/' expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'(' posunout a přejít do stavu 4
expr2 přejít do stavu 20
expr3 přejít do stavu 9
State 16
9 expr2: expr2 '*' . expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'(' posunout a přejít do stavu 4
expr3 přejít do stavu 21
State 17
10 expr2: expr2 '/' . expr3
11 expr3: . NUM
12 | . '(' expr ')'
NUM posunout a přejít do stavu 1
'(' posunout a přejít do stavu 4
expr3 přejít do stavu 22
State 18
12 expr3: '(' expr ')' .
$výchozí reduce using rule 12 (expr3)
State 19
6 expr1: expr1 '+' expr2 . [$end, '+', '-', ')']
9 expr2: expr2 . '*' expr3
10 | expr2 . '/' expr3
'*' posunout a přejít do stavu 16
'/' posunout a přejít do stavu 17
$výchozí reduce using rule 6 (expr1)
State 20
7 expr1: expr1 '-' expr2 . [$end, '+', '-', ')']
9 expr2: expr2 . '*' expr3
10 | expr2 . '/' expr3
'*' posunout a přejít do stavu 16
'/' posunout a přejít do stavu 17
$výchozí reduce using rule 7 (expr1)
State 21
9 expr2: expr2 '*' expr3 .
$výchozí reduce using rule 9 (expr2)
State 22
10 expr2: expr2 '/' expr3 .
$výchozí reduce using rule 10 (expr2)
| Bison | 3 | YKG/y | testdata/ok/expr.y.bison | [
"BSD-3-Clause"
] |
#IF_NOT_DEFINED __PRIME_CONNMAN
#DEFINE __PRIME_CONNMAN
(***********************************************************)
(* FILE CREATED ON: 01/23/2016 AT: 21:43:16 *)
(***********************************************************)
(* FILE_LAST_MODIFIED_ON: 09/17/2016 AT: 22:36:05 *)
(***********************************************************)
(* FILE REVISION: Rev 7 *)
(* REVISION DATE: 07/19/2016 AT: 07:25:31 *)
(* *)
(* COMMENTS: *)
(* Normalised CONNECT and SEND property configuration *)
(* *)
(***********************************************************)
(* FILE REVISION: Rev 6 *)
(* REVISION DATE: 06/26/2016 AT: 20:41:06 *)
(* *)
(* COMMENTS: *)
(* Full review and optimisation *)
(* *)
(***********************************************************)
(* FILE REVISION: Rev 5 *)
(* REVISION DATE: 05/12/2016 AT: 11:21:59 *)
(* *)
(* COMMENTS: *)
(* Corrected debug messages, indentation. *)
(* TODO: Optimise connection request calls - simplify *)
(* waits and remove recurring calls to connman_connect(). *)
(* *)
(***********************************************************)
(* FILE REVISION: Rev 4 *)
(* REVISION DATE: 05/06/2016 AT: 10:26:11 *)
(* *)
(* COMMENTS: *)
(* Added connman_stat_online/offline/error count tracking *)
(* *)
(***********************************************************)
(* FILE REVISION: Rev 3 *)
(* REVISION DATE: 04/21/2016 AT: 14:02:00 *)
(* *)
(* COMMENTS: *)
(* Added CONNECT_ATTEMPTS config parameter *)
(* Improved connect/disconnect and buffer management *)
(* handling for improved long-term stability. *)
(* *)
(***********************************************************)
(* FILE REVISION: Rev 2 *)
(* REVISION DATE: 04/15/2016 AT: 23:04:19 *)
(* *)
(* COMMENTS: *)
(* Added handling of unexpected open socket for *)
(* data_event onerror *)
(* *)
(***********************************************************)
(* System Type : NetLinx *)
(***********************************************************)
(* REV HISTORY: *)
(***********************************************************)
(*
$History: $
*)
(*
prime-connman
NetLinx IP Client Socket Connection Manager
Author: niek.groot@amxaustralia.com.au
No rights or warranties implied.
Usage:
#DEFINE CONNMAN_SET_MAX_NUM_BUFFER_OUT 10 // Maximum number of items that can be stored in the outbound buffer. Default: 10.
#DEFINE CONNMAN_SET_MAX_LEN_BUFFER_OUT 1500 // Maximum size of an item in the outbound buffer. Default: 2048.
#DEFINE CONNMAN_SET_MAX_LEN_BUFFER_IN 1500 // Maximum size of the inbound buffer. Default: 2048.
#INCLUDE 'prime-connman' // Use connman_setProperty() for IP client and preferences configuration.
connman_send_string("'<str[CONNMAN_MAX_LEN_BUFFER_OUT]>'"); // Send string to the configured server address.
connman_connect(); // Connect to the target server.
connman_disconnect(); // Disconnect from the target server.
connman_buffer_clear(); // Clear the outbound buffer contents.
connman_advance_buffer(); // Discard the current item and send the next item in the buffer.
Response:
Strings received from the server are buffered in the connman_buffer_in[CONNMAN_MAX_LEN_BUFFER_IN] variable.
Configuration:
connman_setProperty("'IP_ADDRESS', '<address>'"); // Server address.
connman_setProperty("'PORT', itoa(<port>)"); // Server port.
connman_setProperty("'PROTOCOL', itoa(<IP_TCP|IP_UDP|IP_UDP_2WAY>)"); // Transport protocol using NetLinx transport protocol constants.
connman_setProperty("'CONNECT_ATTEMPTS', itoa(<num>)"); // Maximum number of connection attempts. Default: 3.
connman_setProperty("'CONNECT_DELAY', itoa(<msec>)"); // Delay between connection attempts. Default: 1000ms.
connman_setProperty("'AUTO_DISCONNECT', booltostring(<true|false>)"); // Automatically disconnect when all strings in the buffer have been sent. Default: false.
connman_setProperty("'AUTO_RECONNECT', booltostring(<true|false>)"); // Automatically re-connect if the connection drops. Also connects on reinitialize() without buffer contents. Default: false.
connman_setProperty("'SEND_ATTEMPTS', itoa(<num>)"); // Send strings sent from the outbound buffer <num> times at the SEND_DELAY interval until a response is received. Default: 1.
connman_setProperty("'SEND_DELAY', itoa(<msec>)"); // Delay between concurrent strings sent from the outbound butter. Default: 0msec.
connman_setProperty("'ADVANCE_ON_RESPONSE', booltostring(<true|false>)"); // Advance the outbound buffer when a respons is received. Default: false.
connman_reinitialize()
*)
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
#IF_NOT_DEFINED MAX_LEN_LONG
integer MAX_LEN_LONG = 10; // 4294967295
#END_IF
integer CONNMAN_MAX_LEN_FQDN = 255;
// #DEFINE use as re-assignment below to avoid compiler bug preventing /re-use/ of #DEFINE values in DEFINE_TYPE
#IF_DEFINED CONNMAN_SET_MAX_NUM_BUFFER_OUT
integer CONNMAN_MAX_NUM_BUFFER_OUT = CONNMAN_SET_MAX_NUM_BUFFER_OUT;
#ELSE
integer CONNMAN_MAX_NUM_BUFFER_OUT = 10;
#END_IF
#IF_DEFINED CONNMAN_SET_MAX_LEN_BUFFER_OUT
integer CONNMAN_MAX_LEN_BUFFER_OUT = CONNMAN_SET_MAX_LEN_BUFFER_OUT;
#ELSE
integer CONNMAN_MAX_LEN_BUFFER_OUT = 2048;
#END_IF
#IF_DEFINED CONNMAN_SET_MAX_LEN_BUFFER_IN
integer CONNMAN_MAX_LEN_BUFFER_IN = CONNMAN_SET_MAX_LEN_BUFFER_IN;
#ELSE
integer CONNMAN_MAX_LEN_BUFFER_IN = 2048;
#END_IF
long CONNMAN_BUFFPROC_TL = 1101;
long CONNMAN_CONNECT_TL = 1102;
integer CONNMAN_STATUS_DISCONNECTED = 0;
integer CONNMAN_STATUS_CONNECTING = 1;
integer CONNMAN_STATUS_CONNECTED = 2;
integer CONNMAN_STATUS_DISCONNECTING = 3;
integer CONNMAN_REQUEST_DISCONNECT = 0;
integer CONNMAN_REQUEST_CONNECT = 1;
#IF_NOT_DEFINED __IP_PROTOCOL_STRINGS
#DEFINE __IP_PROTOCOL_STRINGS
char IP_PROTOCOL_STRINGS[3][8] = {
'TCP',
'UDP',
'UDP_2WAY'
}
#END_IF
(***********************************************************)
(* DATA TYPE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_TYPE
structure _connman_host {
integer protocol
char address[CONNMAN_MAX_LEN_FQDN]
integer port
}
structure _connman_buffer {
char str[CONNMAN_MAX_LEN_BUFFER_OUT]
_connman_host host
}
structure _connman_stats {
long connected
long disconnected
long error
long attempts
}
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
volatile _connman_host connman_host;
volatile _connman_stats connman_stats;
// Preferences
volatile integer connman_auto_reconnect = false;
volatile integer connman_auto_disconnect = false;
volatile integer connman_advance_on_response = false;
volatile integer connman_max_transmit_count = 1;
volatile integer connman_max_connect_count = 3;
// Buffer
volatile char connman_buffer_in[connman_MAX_LEN_BUFFER_IN];
volatile _connman_buffer connman_buffer_out[connman_MAX_NUM_BUFFER_OUT];
volatile integer connman_buffer_out_pos_in = 1;
volatile integer connman_buffer_out_pos_out = 1;
// Buffer processing
volatile long connman_buffproc_times[] = { 0, 0, 0 }
volatile integer connman_transmit_count = 0;
// Connection request handling
volatile long connman_connect_times[] = { 0, 5000 }
volatile integer connman_status = CONNMAN_STATUS_DISCONNECTED;
volatile integer connman_request = CONNMAN_REQUEST_DISCONNECT;
(***********************************************************)
(* INCLUDES GO BELOW *)
(***********************************************************)
#INCLUDE 'prime-debug';
(***********************************************************)
(* LIBRARY SUBROUTINE/FUNCTIONS DEFINITIONS GO BELOW *)
(***********************************************************)
#IF_NOT_DEFINED __PRIME_LTOA
#DEFINE __PRIME_LTOA
define_function char[MAX_LEN_LONG] ltoa(long l) {
stack_var volatile char ret[MAX_LEN_LONG];
// if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'ltoa', '(', 'long', ')'");
if (l < 100000) {
ret = itoa(l);
} else {
ret = "itoa(l / 100000), itoa(l % 100000)"; // Keep itoa input under 16 bits
}
// if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'ltoa', '() ', 'returning ', ret");
return ret;
}
#END_IF
#IF_NOT_DEFINED __PRIME_STRINGTOBOOL
#DEFINE __PRIME_STRINGTOBOOL
define_function integer stringtobool(char str[5]) {
str = lower_string(str);
if ((str == 'true') || (str == '1') || (str == 'on')) {
return true;
} else {
return false;
}
}
#END_IF
#IF_NOT_DEFINED __PRIME_IP_ERROR_DESC
#DEFINE __PRIME_IP_ERROR_DESC
define_function char[33] ip_error_desc(slong errorcode) {
select {
active (errorcode == -3): {
return 'Unable to open communication port';
}
active (errorcode == -2): {
return 'Invalid value for Protocol';
}
active (errorcode == -1): {
return 'Invalid server port';
}
active (errorcode == 0): {
return 'Operation was successful';
}
active (errorcode == 2): {
return 'General failure (out of memory)';
}
active (errorcode == 4): {
return 'Unknown host';
}
active (errorcode == 6): {
return 'Connection refused';
}
active (errorcode == 7): {
return 'Connection timed out';
}
active (errorcode == 8): {
return 'Unknown connection error';
}
active (errorcode == 9): {
return 'Already closed';
}
active (errorcode == 10): {
return 'Binding error';
}
active (errorcode == 11): {
return 'Listening error';
}
active (errorcode == 14): {
return 'Local port already used';
}
active (errorcode == 15): {
return 'UDP socket already listening';
}
active (errorcode == 16): {
return 'Too many open sockets';
}
active (errorcode == 17): {
return 'Local Port Not Open';
}
active (1): {
return "'Unidentified error code: ', itoa(errorcode)";
}
}
}
#END_IF
(***********************************************************)
(* SUBROUTINE/FUNCTION DEFINITIONS GO BELOW *)
(***********************************************************)
define_function integer connman_setProperty(char key[], char value[]) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_setProperty', '(', key, ', ', value, ')'");
switch (key) {
case 'IP_ADDRESS': {
connman_host.address = value;
}
case 'PORT': {
stack_var volatile integer i;
i = atoi(value);
if ((i < 1) || (i > 65535)) {
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "'connman_setProperty', '() ', 'invalid port specified!'");
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_setProperty', '() ', 'returning false'");
return false;
} else {
connman_host.port = i;
}
}
case 'PROTOCOL': {
stack_var volatile integer i;
i = atoi(value);
if ((i < IP_TCP ) || (i > IP_UDP_2WAY)) {
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "'connman_setProperty', '() ', 'invalid protocol specified!'");
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_setProperty', '() ', 'returning false'");
return false;
} else {
connman_host.protocol = atoi(value);
}
}
case 'CONNECT_ATTEMPTS': {
connman_max_connect_count = atoi(value);
}
case 'CONNECT_DELAY': {
connman_connect_times[2] = atoi(value);
}
case 'AUTO_DISCONNECT': {
connman_auto_disconnect = stringtobool(value);
}
case 'AUTO_RECONNECT': {
connman_auto_reconnect = stringtobool(value);
}
case 'SEND_ATTEMPTS': {
connman_max_transmit_count = atoi(value);
}
case 'SEND_DELAY': {
connman_buffproc_times[3] = atoi(value);
}
case 'ADVANCE_ON_RESPONSE': {
connman_advance_on_response = stringtobool(value);
}
default: {
return false;
}
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_setProperty', '() ', 'returning true'");
return true;
}
define_function connman_reinitialize() {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_reinitialize', '()'");
connman_buffer_clear();
if (connman_auto_reconnect) {
connman_connect(); // connman_connect will validate the connection parameters
} else {
connman_disconnect();
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_reinitialize', '() ', 'returning'");
}
define_function connman_buffer_add(char str[]) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_add', '(', str, ') passing to connman_buffer_add_ex()'");
connman_buffer_add_ex(connman_host, str);
}
define_function connman_buffer_add_ex(_connman_host host, char str[]) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_add_ex', '(', '_connman_host host', ', ', str, ')'");
if (length_string(connman_buffer_out[connman_buffer_out_pos_in].str)) {
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "'connman_buffer_add_ex() ', 'buffer full! (', itoa(max_length_array(connman_buffer_out)), ' max strings)'");
} else {
connman_buffer_out[connman_buffer_out_pos_in].str = str;
connman_buffer_out[connman_buffer_out_pos_in].host = host;
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_add_ex() ', 'string added to buffer position ', itoa(connman_buffer_out_pos_in)");
connman_buffer_out_pos_in++;
if (connman_buffer_out_pos_in > max_length_array(connman_buffer_out)) connman_buffer_out_pos_in = 1;
}
if (connman_status != CONNMAN_STATUS_CONNECTED) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_add_ex() ', 'requesting connection'");
connman_connect();
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_add_ex() ', 'requesting buffer processing'");
connman_buffer_process();
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_add_ex() ', 'returning'");
}
define_function connman_buffer_advance() {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_advance', '()'");
if (length_string(connman_buffer_out[connman_buffer_out_pos_out].str)) {
// connman_buffer_out[connman_buffer_out_pos_out].str = '';
set_length_string(connman_buffer_out[connman_buffer_out_pos_out].str, 0);
connman_buffer_out_pos_out++;
if (connman_buffer_out_pos_out > max_length_array(connman_buffer_out)) connman_buffer_out_pos_out = 1;
connman_transmit_count = 0;
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_advance', '() ', 'advanced to buffer position ', itoa(connman_buffer_out_pos_out)");
if (timeline_active(CONNMAN_BUFFPROC_TL)) {
timeline_set(CONNMAN_BUFFPROC_TL, 0);
} else {
connman_buffer_process();
}
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_advance', '() ', 'no contents in buffer position ', itoa(connman_buffer_out_pos_out)");
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_advance', '() ', 'returning'");
}
define_function connman_buffer_clear() {
stack_var volatile integer i;
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_clear', '()'");
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_clear', '() ', 'stopping buffer processing'");
if (timeline_active(CONNMAN_BUFFPROC_TL)) timeline_kill(CONNMAN_BUFFPROC_TL);
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_clear', '() ', 'clearing buffer contents'");
for (i = 1; i <= max_length_array(connman_buffer_out); i++) {
// connman_buffer_out[i].str = '';
set_length_string(connman_buffer_out[i].str, 0);
}
connman_buffer_out_pos_in = 1;
connman_buffer_out_pos_out = 1;
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "'connman_buffer_clear() ', 'buffer contents cleared'");
if (connman_auto_disconnect) connman_disconnect();
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_clear() ', 'returning'");
}
define_function connman_buffer_process() {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_process', '()'");
if (!length_string(connman_buffer_out[connman_buffer_out_pos_out].str)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_process', '() ', 'buffer at pos ', itoa(connman_buffer_out_pos_out), ' is empty'");
} else
if (timeline_active(CONNMAN_BUFFPROC_TL)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_process', '() ', 'buffer is already processing'");
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_process', '() ', 'starting buffer processing'");
timeline_create(CONNMAN_BUFFPROC_TL, connman_buffproc_times, length_array(connman_buffproc_times), TIMELINE_RELATIVE, TIMELINE_REPEAT);
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_buffer_process', '() ', 'returning'");
}
define_function integer connman_validate_connection() {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_validate_connection', '()'");
if (!length_string(connman_buffer_out[connman_buffer_out_pos_out].str)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_validate_connection', '() ', 'buffer is empty'");
} else {
if (
(connman_host.address != connman_buffer_out[connman_buffer_out_pos_out].host.address) ||
(connman_host.port != connman_buffer_out[connman_buffer_out_pos_out].host.port) ||
(connman_host.protocol != connman_buffer_out[connman_buffer_out_pos_out].host.protocol)
) {
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "'connman_validate_connection', '() ', 'current connection parameters are not correct'");
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_validate_connection', '() ', 'returning false'");
return false;
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_validate_connection', '() ', 'returning true'");
return true;
}
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_validate_connection', '() ', 'returning true'");
return true;
}
define_function connman_connect() {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '()'");
connman_request = CONNMAN_REQUEST_CONNECT;
if (connman_status == CONNMAN_STATUS_CONNECTED) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'already connected'");
} else
if (connman_status == CONNMAN_STATUS_CONNECTING) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'connection already in-progress'");
} else
if (connman_status == CONNMAN_STATUS_DISCONNECTING) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'disconnection in-progress'");
} else {
if (!connman_validate_connection()) {
if (timeline_active(CONNMAN_CONNECT_TL)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'cancelling connection request pending in ', ftoa(type_cast(connman_connect_times[2] - timeline_get(CONNMAN_CONNECT_TL)) / 1000), ' seconds.'");
timeline_kill(CONNMAN_CONNECT_TL);
}
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "'connman_connect', '() ', 'configuring connection parameters'");
if (connman_host.address != connman_buffer_out[connman_buffer_out_pos_out].host.address) connman_setProperty('IP_ADDRESS', connman_buffer_out[connman_buffer_out_pos_out].host.address);
if (connman_host.port != connman_buffer_out[connman_buffer_out_pos_out].host.port) connman_setProperty('PORT', itoa(connman_buffer_out[connman_buffer_out_pos_out].host.port));
if (connman_host.protocol != connman_buffer_out[connman_buffer_out_pos_out].host.protocol) connman_setProperty('PROTOCOL', itoa(connman_buffer_out[connman_buffer_out_pos_out].host.protocol));
}
if (timeline_active(CONNMAN_CONNECT_TL)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'existing connection request pending in ', ftoa(type_cast(connman_connect_times[2] - timeline_get(CONNMAN_CONNECT_TL)) / 1000), ' seconds.'");
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'connecting'");
connman_status = CONNMAN_STATUS_CONNECTING;
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '() ', 'connecting to ', connman_host.address, ' on port ', itoa(connman_host.port), ' ', IP_PROTOCOL_STRINGS[connman_host.protocol]");
connman_stats.attempts++;
ip_client_open(connman_device.port, connman_host.address, connman_host.port, connman_host.protocol);
}
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '()', ' returning'");
}
define_function connman_disconnect() {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '()'");
connman_request = CONNMAN_REQUEST_DISCONNECT;
if (connman_status == CONNMAN_STATUS_DISCONNECTED) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '() ', 'already disconnected'");
} else
if (connman_status == CONNMAN_STATUS_DISCONNECTING) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '() ', 'disconnection already in-progress'");
} else
if (connman_status == CONNMAN_STATUS_CONNECTING) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '() ', 'connection in-progress'");
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '() ', 'disconnecting'");
connman_status = CONNMAN_STATUS_DISCONNECTING
if (timeline_active(CONNMAN_CONNECT_TL)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '() ', 'cancelling connection request pending in ', ftoa(type_cast(connman_connect_times[2] - timeline_get(CONNMAN_CONNECT_TL)) / 1000), ' seconds.'");
timeline_kill(CONNMAN_CONNECT_TL);
}
if (timeline_active(CONNMAN_BUFFPROC_TL)) {
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "'connman_disconnect', '() ', 'stopping buffer processing'");
timeline_kill(CONNMAN_BUFFPROC_TL);
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_disconnect', '() ', 'closing socket'");
ip_client_close(connman_device.port);
}
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'connman_connect', '()', ' returning'");
}
(***********************************************************)
(* STARTUP CODE GOES BELOW *)
(***********************************************************)
DEFINE_START
create_buffer connman_device, connman_buffer_in;
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
data_event[connman_device] {
online: {
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "devtoa(data.device), ' online: ', 'connected to ', connman_host.address, ' on port ', itoa(connman_host.port), ' ', IP_PROTOCOL_STRINGS[connman_host.protocol]");
connman_status = CONNMAN_STATUS_CONNECTED;
connman_stats.connected++;
connman_stats.attempts = 0;
// Should never occur because this timeline is only used onerror:
if (timeline_active(CONNMAN_CONNECT_TL)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "devtoa(data.device), ' online: ', 'cancelling pending connection request'");
timeline_kill(CONNMAN_CONNECT_TL);
}
if (connman_request = CONNMAN_REQUEST_DISCONNECT) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "devtoa(data.device), ' online: ', 'resuming pending disconnection request'");
connman_disconnect();
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "devtoa(data.device), ' online: ', 'requesting buffer processing'");
connman_buffer_process();
}
}
offline: {
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "devtoa(data.device), ' offline: ', 'disconnected from ', connman_host.address, ' on port ', itoa(connman_host.port), ' ', IP_PROTOCOL_STRINGS[connman_host.protocol]");
connman_status = CONNMAN_STATUS_DISCONNECTED;
connman_stats.disconnected++;
connman_stats.attempts = 0;
if (timeline_active(CONNMAN_BUFFPROC_TL)) {
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "devtoa(data.device), ' offline: ', 'stopping buffer processing'");
timeline_kill(CONNMAN_BUFFPROC_TL);
}
if (connman_request = CONNMAN_REQUEST_CONNECT) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "devtoa(data.device), ' offline: ', 'resuming pending connection request'");
connman_connect();
} else
if (length_string(connman_buffer_out[connman_buffer_out_pos_out].str)) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "devtoa(data.device), ' offline: ', 'reconnecting because there are remaining items in the buffer'");
connman_connect();
} else
if (connman_auto_reconnect) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "devtoa(data.device), ' offline: ', 'automatically re-connecting'");
connman_connect();
}
}
onerror: {
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "devtoa(data.device), ' onerror: ', 'could not connect to ', connman_host.address, ' on port ', itoa(connman_host.port), ' ', IP_PROTOCOL_STRINGS[connman_host.protocol], ' (Error ', itoa(data.number), ' ', ip_error_desc(type_cast(data.number)), ')'");
connman_status = CONNMAN_STATUS_DISCONNECTED;
connman_stats.error++;
if (timeline_active(CONNMAN_BUFFPROC_TL)) {
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "devtoa(data.device), ' onerror: ', 'stopping buffer processing'");
timeline_kill(CONNMAN_BUFFPROC_TL);
}
switch (data.number) {
case 14: { // Local port already used
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "devtoa(data.device), ' onerror: ', 'closing unexpected open socket'");
ip_client_close(data.device.port);
}
/*
case 9: { // Already closed
if (AMX_ERROR <= get_log_level()) debug(AMX_ERROR, "devtoa(data.device), ' onerror: ', 'unexpected closed socket. Using next IP socket.'");
connman_device.port++; // Bad idea
}
*/
default: {
if (connman_request = CONNMAN_REQUEST_CONNECT) {
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "devtoa(data.device), ' onerror: ', 're-trying in ', ltoa(connman_connect_times[1] - timeline_get(CONNMAN_CONNECT_TL)), ' seconds.'");
if (timeline_active(CONNMAN_BUFFPROC_TL)) {
timeline_set(CONNMAN_CONNECT_TL, 0);
} else {
timeline_create(CONNMAN_CONNECT_TL, connman_connect_times, length_array(connman_connect_times), TIMELINE_ABSOLUTE, TIMELINE_ONCE);
}
}
}
}
}
string: {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'string received from ', data.sourceip, ' on port ', itoa(connman_host.port), ' ', IP_PROTOCOL_STRINGS[connman_host.protocol], ' (', itoa(length_string(data.text)), ' bytes): ', data.text");
if (connman_advance_on_response) {
connman_buffer_advance();
}
}
}
timeline_event[CONNMAN_CONNECT_TL] {
switch(timeline.sequence) {
case 1: {
#IF_DEFINED INCLUDE_CONNMAN_CONNECT_FAIL_CALLBACK
connman_connect_fail_callback(connman_buffer_out[connman_buffer_out_pos_out].host, connman_buffer_out[connman_buffer_out_pos_out].str);
#END_IF
if (connman_stats.attempts >= connman_max_connect_count) {
if (AMX_WARNING <= get_log_level()) debug(AMX_WARNING, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'connection attempt failed after ', itoa(connman_stats.attempts), ' attempts'");
connman_buffer_advance();
timeline_kill(timeline.id);
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_CONNECT_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'connecting in ', ftoa(type_cast(CONNMAN_CONNECT_TIMES[2]) / 1000), ' seconds'");
}
}
case 2: {
if (AMX_WARNING <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'resuming pending connection request'");
connman_connect();
}
}
}
timeline_event[CONNMAN_BUFFPROC_TL] {
switch(timeline.sequence) {
case 1: {
if (!length_string(connman_buffer_out[connman_buffer_out_pos_out].str)) { // Confirm there are contents in the buffer
if (timeline_active(timeline.id)) { // Incase the timeline_event runs again whilst it is being terminated (http://www.amx.com/techsupport/technote.asp?id=1040)
timeline_kill(timeline.id);
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'buffer is empty. stopping buffer processing.'");
if (connman_auto_disconnect) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'requesting automatic disconnection'");
connman_disconnect();
}
}
} else
if (connman_status != CONNMAN_STATUS_CONNECTED) { // Confirm connection to host
if (timeline_active(timeline.id)) timeline_kill(timeline.id);
if (AMX_WARNING <= get_log_level()) debug(AMX_WARNING, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'not connected. requesting connection.'");
connman_connect();
} else
if (!connman_validate_connection()) { // Confirm connected to the correct host
if (AMX_INFO <= get_log_level()) debug(AMX_INFO, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'host connection parameters are incorrect. requesting disconnection.'");
connman_disconnect(); // Subsequent connect event will cause for re-confguration of connection parameters
} else
if (connman_transmit_count >= connman_max_transmit_count) { // Check if current string has been sent the maximum number of times
if (AMX_WARNING <= get_log_level()) debug(AMX_WARNING, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'request timed out. advancing buffer after no response was received for ', itoa(connman_transmit_count), ' attempts.'");
#IF_DEFINED INCLUDE_CONNMAN_TIMEOUT_CALLBACK
connman_timeout_callback(connman_buffer_out[connman_buffer_out_pos_out].host, connman_buffer_out[connman_buffer_out_pos_out].str);
#END_IF
connman_buffer_advance();
} else { // Send string from buffer
if (connman_transmit_count) {
if (AMX_WARNING <= get_log_level()) debug(AMX_WARNING, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'request timed out. re-sending string from buffer position ', itoa(connman_buffer_out_pos_out), ' (attempt ', itoa(connman_transmit_count + 1), ')'");
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'sending string from buffer position ', itoa(connman_buffer_out_pos_out), ' (attempt ', itoa(connman_transmit_count + 1), ')'");
}
connman_transmit_count++;
send_string connman_device, connman_buffer_out[connman_buffer_out_pos_out].str;
}
}
case 2: {
if (timeline_active(timeline.id)) { // Incase the timeline_event runs again whilst it is being terminated (http://www.amx.com/techsupport/technote.asp?id=1040)
if (connman_advance_on_response) {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'waiting for response...'");
} else {
if (AMX_DEBUG <= get_log_level()) debug(AMX_DEBUG, "'CONNMAN_BUFFPROC_TL', '(', itoa(timeline.repetition), ', ', itoa(timeline.sequence), ') ', 'waiting...'");
}
}
}
}
}
#END_IF | NetLinx | 5 | marselle001/amx-snmp-library | prime-connman.axi | [
"MIT"
] |
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../../access/Ownable.sol";
import "../../crosschain/amb/CrossChainEnabledAMB.sol";
import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL1.sol";
import "../../crosschain/arbitrum/CrossChainEnabledArbitrumL2.sol";
import "../../crosschain/optimism/CrossChainEnabledOptimism.sol";
import "../../crosschain/polygon/CrossChainEnabledPolygonChild.sol";
abstract contract Receiver is CrossChainEnabled {
// we don't use Ownable because it messes up testing for the upgradeable contracts
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address public immutable owner = msg.sender;
function crossChainRestricted() external onlyCrossChain {}
function crossChainOwnerRestricted() external onlyCrossChainSender(owner) {}
}
/**
* AMB
*/
contract CrossChainEnabledAMBMock is Receiver, CrossChainEnabledAMB {
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address bridge) CrossChainEnabledAMB(bridge) {}
}
/**
* Arbitrum
*/
contract CrossChainEnabledArbitrumL1Mock is Receiver, CrossChainEnabledArbitrumL1 {
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address bridge) CrossChainEnabledArbitrumL1(bridge) {}
}
contract CrossChainEnabledArbitrumL2Mock is Receiver, CrossChainEnabledArbitrumL2 {}
/**
* Optimism
*/
contract CrossChainEnabledOptimismMock is Receiver, CrossChainEnabledOptimism {
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address bridge) CrossChainEnabledOptimism(bridge) {}
}
/**
* Polygon
*/
contract CrossChainEnabledPolygonChildMock is Receiver, CrossChainEnabledPolygonChild {
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address bridge) CrossChainEnabledPolygonChild(bridge) {}
}
| Solidity | 4 | ScopeLift/openzeppelin-contracts | contracts/mocks/crosschain/receivers.sol | [
"MIT"
] |
…
i0.ɵɵproperty("event", ctx.$event);
| JavaScript | 0 | John-Cassidy/angular | packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_listener/event_in_property_binding_template.js | [
"MIT"
] |
class ColumnSelect < Column
attr_reader :header
attr_writer :table
class ColumnSelectEvent
def initialize(event)
@event = event
end
def selected_row_number
event_current_element
class_names_string = @event_current_element.class_name
class_names_array = class_names_string.split(' ')
row_string = class_names_array[1]
row_string_s = class_names_array[1].split('_')
row_number = row_string_s[1]
end
def event_current_element
event_current_targets
@event_current_element = Element.parse( event_current_targets )
end
def event_current_targets
@event_current_targets = `self.event.$current_target()`
end
end
def init( config )
@header = config[:header]
@prompt = config[:prompt]
@click_proc = config[:click_proc]
@table = nil
return self
end
def link_proc
Proc.new do |row, value|
select_links.css 'color', 'blue'
select_links.on(:click) do |event|
@event = ColumnSelectEvent.new(event)
@event.event_current_element.css 'color', 'red'
row_number = @event.selected_row_number
row_content = @table.get_row_content( row_number ) if !@table.nil?
if @click_proc.nil?
alert "Row #{row_number} was clicked"
else
@click_proc.call(row_number,row_content)
end
end
end
end
def data_proc
Proc.new do |row, value|
<<eos
<a class="#{html_class} row_#{row}">#{@prompt}</a>
eos
end
end
def instance_id
`self.$$id`
end
def html_class
"#{self.class.to_s}_#{instance_id}"
end
def select_links
Element.find(".#{html_class}")
end
end | Opal | 4 | bcavileer/digest-rails | app/assets/javascripts/digest-rails/opal_lib/column_select.js.opal | [
"MIT"
] |
{{ .Site.Params.minNodeVersion }}
| HTML | 1 | ansky/gitea | docs/layouts/shortcodes/min-node-version.html | [
"MIT"
] |
=head1 NAME
SDL::Font - Parrot class representing fonts in Parrot SDL
=head1 SYNOPSIS
# load this library
load_bytecode 'SDL/Font.pir'
# create a new SDL::Font object
.local pmc font
font = new ['SDL'; 'Font']
font.'init'( 'font_file' => 'myfont.ttf', 'point_size' => 48 )
# draw text to the screen
# presuming you have an SDL::Surface, SDL::Color, and SDL::Rect here...
font.'draw'( 'some text', font_color, destination_surface, dest_rect )
# or render it to a surface to use later
font.'render_text'( 'some text', font_color )
=head1 DESCRIPTION
A SDL::Font object represents a TrueType font in SDL. You can use this to draw fonts to any L<SDL::Surface>.
=head1 METHODS
All SDL::Font objects have the following methods:
=over
=cut
.namespace [ 'SDL'; 'Font' ]
.sub _sdl_init :load
.local pmc init_ttf
init_ttf = get_hll_global ['SDL'], '_init_ttf'
init_ttf()
.local pmc font_class
newclass font_class, ['SDL'; 'Font']
addattribute font_class, 'font'
addattribute font_class, 'size'
.return()
.end
=item init( font_args )
Given a list of key-value pairs containing arguments, set the attributes of
this font. The valid keys are C<font_file> and C<point_size>, two strings
containing the path to a TrueType font to load and the size of the font when
drawn, in pixels.
=cut
.sub 'init' :method
.param string font_name :named( 'font_file' )
.param int font_size :named( 'point_size' )
.local pmc OpenFont
OpenFont = get_hll_global ['SDL'; 'NCI'; 'TTF'], 'OpenFont'
.local pmc font
font = OpenFont( font_name, font_size )
setattribute self, 'font', font
.local pmc size_value
size_value = new 'Integer'
size_value = font_size
setattribute self, 'size', size_value
.return()
.end
=item draw( text_string, text_color, dest_surface, dest_rect )
Given a string of text to draw, an C<SDL::Color> object representing the color
of the text to draw, a C<SDL::Surface> to which to draw, and a C<SDL::Rect>
representing the placement of the text within the surface, draws some text.
Whew.
=cut
.sub draw :method
.param string text
.param pmc color_pmc
.param pmc screen
.param pmc dest_rect
.local pmc font_surface
font_surface = self.'render_text'( text, color_pmc )
.local int w
.local int h
w = font_surface.'width'()
h = font_surface.'height'()
.local pmc rect
rect = new ['SDL'; 'Rect']
rect.'init'( 'x' => 0, 'y' => 0, 'height' => h, 'width' => w )
dest_rect.'height'( h )
dest_rect.'width'( w )
screen.'blit'( font_surface, rect, dest_rect )
.return()
.end
=item render_text( text_string, text_color )
Renders a string of text of the given C<SDL::Color>. This returns a new
C<SDL::Surface> containing the rendered font.
=cut
.sub render_text :method
.param string text
.param pmc color_pmc
.local pmc font
font = self.'font'()
.local pmc font_surface
font_surface = new ['SDL'; 'Surface']
font_surface.'init'( 'height' => 0, 'width' => 0 )
# RNH use RenderUTF8 in preference to RenderText by default
.local pmc RenderUTF8_Solid
get_hll_global RenderUTF8_Solid, ['SDL'; 'NCI'; 'TTF'], 'RenderUTF8_Solid'
.local int color
# RNH font routine takes color in the order rgb rather than bgr used by surface.pir hence cannot rely on color.get_integer
.local int component
.local pmc colors
colors = color_pmc.'color'()
component = colors['b']
component <<= 16
color = component
component = colors['g']
component <<= 8
color += component
component = colors['r']
color += component
.local pmc font_surface_struct
font_surface_struct = RenderUTF8_Solid( font, text, color )
font_surface.'wrap_surface'( font_surface_struct )
.return( font_surface )
.end
=item font()
Returns the underlying C<SDL_Font> structure this object wraps. You should
never need to call this directly unless you're calling SDL functions directly,
in which case why not send me a patch?
=cut
.sub font :method
.local pmc font
getattribute font, self, 'font'
.return( font )
.end
=item point_size( [ new_size ] )
Gets or sets the point size associated with this font object. The single
argument is an integer and is optional.
=cut
.sub point_size :method
.param int size :optional
.param int have_size :opt_flag
.local pmc size_value
if have_size == 0 goto getter
size_value = new 'Integer'
size_value = size
setattribute self, 'size', size_value
getter:
getattribute size_value, self, 'size'
size = size_value
.return( size )
.end
=back
=head1 AUTHOR
Please send patches, feedback, and suggestions to the Perl 6 Internals mailing
list.
=head1 COPYRIGHT
Copyright (C) 2004-2008, Parrot Foundation.
=cut
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
| Parrot Internal Representation | 5 | winnit-myself/Wifie | runtime/parrot/library/SDL/Font.pir | [
"Artistic-2.0"
] |
<http://a.example/s> <http://a.example/p> [ <http://a.example/p2> <http://a.example/o2> ] .
| Turtle | 0 | joshrose/audacity | lib-src/lv2/serd/tests/TurtleTests/blankNodePropertyList_as_object.ttl | [
"CC-BY-3.0"
] |
%% -*- prolog -*-
%%=============================================================================
%% Copyright (C) 2011 by Denys Duchier
%%
%% This program 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 3 of the License, or (at your
%% option) any later version.
%%
%% This program 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 General Public License for
%% more details.
%%
%% You should have received a copy of the GNU Lesser General Public License
%% along with this program. If not, see <http://www.gnu.org/licenses/>.
%%=============================================================================
is_IntRelType_('IRT_EQ').
is_IntRelType_('IRT_NQ').
is_IntRelType_('IRT_LQ').
is_IntRelType_('IRT_LE').
is_IntRelType_('IRT_GQ').
is_IntRelType_('IRT_GR').
is_IntRelType_('IRT_EQ','IRT_EQ').
is_IntRelType_('IRT_NQ','IRT_NQ').
is_IntRelType_('IRT_LQ','IRT_LQ').
is_IntRelType_('IRT_LE','IRT_LE').
is_IntRelType_('IRT_GQ','IRT_GQ').
is_IntRelType_('IRT_GR','IRT_GR').
is_IntRelType(X,Y) :- nonvar(X), is_IntRelType_(X,Y).
is_IntRelType(X) :- is_IntRelType(X,_).
is_BoolOpType_('BOT_AND').
is_BoolOpType_('BOT_OR').
is_BoolOpType_('BOT_IMP').
is_BoolOpType_('BOT_EQV').
is_BoolOpType_('BOT_XOR').
is_BoolOpType_('BOT_AND','BOT_AND').
is_BoolOpType_('BOT_OR','BOT_OR').
is_BoolOpType_('BOT_IMP','BOT_IMP').
is_BoolOpType_('BOT_EQV','BOT_EQV').
is_BoolOpType_('BOT_XOR','BOT_XOR').
is_BoolOpType(X,Y) :- nonvar(X), is_BoolOpType_(X,Y).
is_BoolOpType(X) :- is_BoolOpType(X,_).
is_IntConLevel_('ICL_VAL').
is_IntConLevel_('ICL_BND').
is_IntConLevel_('ICL_DOM').
is_IntConLevel_('ICL_DEF').
is_IntConLevel_('ICL_VAL','ICL_VAL').
is_IntConLevel_('ICL_BND','ICL_BND').
is_IntConLevel_('ICL_DOM','ICL_DOM').
is_IntConLevel_('ICL_DEF','ICL_DEF').
is_IntConLevel(X,Y) :- nonvar(X), is_IntConLevel_(X,Y).
is_IntConLevel(X) :- is_IntConLevel(X,_).
is_TaskType_('TT_FIXP').
is_TaskType_('TT_FIXS').
is_TaskType_('TT_FIXE').
is_TaskType_('TT_FIXP','TT_FIXP').
is_TaskType_('TT_FIXS','TT_FIXS').
is_TaskType_('TT_FIXE','TT_FIXE').
is_TaskType(X,Y) :- nonvar(X), is_TaskType_(X,Y).
is_TaskType(X) :- is_TaskType(X,_).
is_ExtensionalPropKind_('EPK_DEF').
is_ExtensionalPropKind_('EPK_SPEED').
is_ExtensionalPropKind_('EPK_MEMORY').
is_ExtensionalPropKind_('EPK_DEF','EPK_DEF').
is_ExtensionalPropKind_('EPK_SPEED','EPK_SPEED').
is_ExtensionalPropKind_('EPK_MEMORY','EPK_MEMORY').
is_ExtensionalPropKind(X,Y) :- nonvar(X), is_ExtensionalPropKind_(X,Y).
is_ExtensionalPropKind(X) :- is_ExtensionalPropKind(X,_).
is_IntVarBranch_('INT_VAR_NONE').
is_IntVarBranch_('INT_VAR_RND').
is_IntVarBranch_('INT_VAR_DEGREE_MIN').
is_IntVarBranch_('INT_VAR_DEGREE_MAX').
is_IntVarBranch_('INT_VAR_AFC_MIN').
is_IntVarBranch_('INT_VAR_AFC_MAX').
is_IntVarBranch_('INT_VAR_MIN_MIN').
is_IntVarBranch_('INT_VAR_MIN_MAX').
is_IntVarBranch_('INT_VAR_MAX_MIN').
is_IntVarBranch_('INT_VAR_MAX_MAX').
is_IntVarBranch_('INT_VAR_SIZE_MIN').
is_IntVarBranch_('INT_VAR_SIZE_MAX').
is_IntVarBranch_('INT_VAR_SIZE_DEGREE_MIN').
is_IntVarBranch_('INT_VAR_SIZE_DEGREE_MAX').
is_IntVarBranch_('INT_VAR_SIZE_AFC_MIN').
is_IntVarBranch_('INT_VAR_SIZE_AFC_MAX').
is_IntVarBranch_('INT_VAR_REGRET_MIN_MIN').
is_IntVarBranch_('INT_VAR_REGRET_MIN_MAX').
is_IntVarBranch_('INT_VAR_REGRET_MAX_MIN').
is_IntVarBranch_('INT_VAR_REGRET_MAX_MAX').
is_IntVarBranch_('INT_VAR_NONE','INT_VAR_NONE').
is_IntVarBranch_('INT_VAR_RND','INT_VAR_RND').
is_IntVarBranch_('INT_VAR_DEGREE_MIN','INT_VAR_DEGREE_MIN').
is_IntVarBranch_('INT_VAR_DEGREE_MAX','INT_VAR_DEGREE_MAX').
is_IntVarBranch_('INT_VAR_AFC_MIN','INT_VAR_AFC_MIN').
is_IntVarBranch_('INT_VAR_AFC_MAX','INT_VAR_AFC_MAX').
is_IntVarBranch_('INT_VAR_MIN_MIN','INT_VAR_MIN_MIN').
is_IntVarBranch_('INT_VAR_MIN_MAX','INT_VAR_MIN_MAX').
is_IntVarBranch_('INT_VAR_MAX_MIN','INT_VAR_MAX_MIN').
is_IntVarBranch_('INT_VAR_MAX_MAX','INT_VAR_MAX_MAX').
is_IntVarBranch_('INT_VAR_SIZE_MIN','INT_VAR_SIZE_MIN').
is_IntVarBranch_('INT_VAR_SIZE_MAX','INT_VAR_SIZE_MAX').
is_IntVarBranch_('INT_VAR_SIZE_DEGREE_MIN','INT_VAR_SIZE_DEGREE_MIN').
is_IntVarBranch_('INT_VAR_SIZE_DEGREE_MAX','INT_VAR_SIZE_DEGREE_MAX').
is_IntVarBranch_('INT_VAR_SIZE_AFC_MIN','INT_VAR_SIZE_AFC_MIN').
is_IntVarBranch_('INT_VAR_SIZE_AFC_MAX','INT_VAR_SIZE_AFC_MAX').
is_IntVarBranch_('INT_VAR_REGRET_MIN_MIN','INT_VAR_REGRET_MIN_MIN').
is_IntVarBranch_('INT_VAR_REGRET_MIN_MAX','INT_VAR_REGRET_MIN_MAX').
is_IntVarBranch_('INT_VAR_REGRET_MAX_MIN','INT_VAR_REGRET_MAX_MIN').
is_IntVarBranch_('INT_VAR_REGRET_MAX_MAX','INT_VAR_REGRET_MAX_MAX').
is_IntVarBranch(X,Y) :- nonvar(X), is_IntVarBranch_(X,Y).
is_IntVarBranch(X) :- is_IntVarBranch(X,_).
is_IntValBranch_('INT_VAL_MIN').
is_IntValBranch_('INT_VAL_MED').
is_IntValBranch_('INT_VAL_MAX').
is_IntValBranch_('INT_VAL_RND').
is_IntValBranch_('INT_VAL_SPLIT_MIN').
is_IntValBranch_('INT_VAL_SPLIT_MAX').
is_IntValBranch_('INT_VAL_RANGE_MIN').
is_IntValBranch_('INT_VAL_RANGE_MAX').
is_IntValBranch_('INT_VALUES_MIN').
is_IntValBranch_('INT_VALUES_MAX').
is_IntValBranch_('INT_VAL_MIN','INT_VAL_MIN').
is_IntValBranch_('INT_VAL_MED','INT_VAL_MED').
is_IntValBranch_('INT_VAL_MAX','INT_VAL_MAX').
is_IntValBranch_('INT_VAL_RND','INT_VAL_RND').
is_IntValBranch_('INT_VAL_SPLIT_MIN','INT_VAL_SPLIT_MIN').
is_IntValBranch_('INT_VAL_SPLIT_MAX','INT_VAL_SPLIT_MAX').
is_IntValBranch_('INT_VAL_RANGE_MIN','INT_VAL_RANGE_MIN').
is_IntValBranch_('INT_VAL_RANGE_MAX','INT_VAL_RANGE_MAX').
is_IntValBranch_('INT_VALUES_MIN','INT_VALUES_MIN').
is_IntValBranch_('INT_VALUES_MAX','INT_VALUES_MAX').
is_IntValBranch(X,Y) :- nonvar(X), is_IntValBranch_(X,Y).
is_IntValBranch(X) :- is_IntValBranch(X,_).
is_IntAssign_('INT_ASSIGN_MIN').
is_IntAssign_('INT_ASSIGN_MED').
is_IntAssign_('INT_ASSIGN_MAX').
is_IntAssign_('INT_ASSIGN_RND').
is_IntAssign_('INT_ASSIGN_MIN','INT_ASSIGN_MIN').
is_IntAssign_('INT_ASSIGN_MED','INT_ASSIGN_MED').
is_IntAssign_('INT_ASSIGN_MAX','INT_ASSIGN_MAX').
is_IntAssign_('INT_ASSIGN_RND','INT_ASSIGN_RND').
is_IntAssign(X,Y) :- nonvar(X), is_IntAssign_(X,Y).
is_IntAssign(X) :- is_IntAssign(X,_).
is_SetRelType_('SRT_EQ').
is_SetRelType_('SRT_NQ').
is_SetRelType_('SRT_SUB').
is_SetRelType_('SRT_SUP').
is_SetRelType_('SRT_DISJ').
is_SetRelType_('SRT_CMPL').
is_SetRelType_('SRT_EQ','SRT_EQ').
is_SetRelType_('SRT_NQ','SRT_NQ').
is_SetRelType_('SRT_SUB','SRT_SUB').
is_SetRelType_('SRT_SUP','SRT_SUP').
is_SetRelType_('SRT_DISJ','SRT_DISJ').
is_SetRelType_('SRT_CMPL','SRT_CMPL').
is_SetRelType(X,Y) :- nonvar(X), is_SetRelType_(X,Y).
is_SetRelType(X) :- is_SetRelType(X,_).
is_SetOpType_('SOT_UNION').
is_SetOpType_('SOT_DUNION').
is_SetOpType_('SOT_INTER').
is_SetOpType_('SOT_MINUS').
is_SetOpType_('SOT_UNION','SOT_UNION').
is_SetOpType_('SOT_DUNION','SOT_DUNION').
is_SetOpType_('SOT_INTER','SOT_INTER').
is_SetOpType_('SOT_MINUS','SOT_MINUS').
is_SetOpType(X,Y) :- nonvar(X), is_SetOpType_(X,Y).
is_SetOpType(X) :- is_SetOpType(X,_).
is_SetVarBranch_('SET_VAR_NONE').
is_SetVarBranch_('SET_VAR_RND').
is_SetVarBranch_('SET_VAR_DEGREE_MIN').
is_SetVarBranch_('SET_VAR_DEGREE_MAX').
is_SetVarBranch_('SET_VAR_AFC_MIN').
is_SetVarBranch_('SET_VAR_AFC_MAX').
is_SetVarBranch_('SET_VAR_MIN_MIN').
is_SetVarBranch_('SET_VAR_MIN_MAX').
is_SetVarBranch_('SET_VAR_MAX_MIN').
is_SetVarBranch_('SET_VAR_MAX_MAX').
is_SetVarBranch_('SET_VAR_SIZE_MIN').
is_SetVarBranch_('SET_VAR_SIZE_MAX').
is_SetVarBranch_('SET_VAR_SIZE_DEGREE_MIN').
is_SetVarBranch_('SET_VAR_SIZE_DEGREE_MAX').
is_SetVarBranch_('SET_VAR_SIZE_AFC_MIN').
is_SetVarBranch_('SET_VAR_SIZE_AFC_MAX').
is_SetVarBranch_('SET_VAR_NONE','SET_VAR_NONE').
is_SetVarBranch_('SET_VAR_RND','SET_VAR_RND').
is_SetVarBranch_('SET_VAR_DEGREE_MIN','SET_VAR_DEGREE_MIN').
is_SetVarBranch_('SET_VAR_DEGREE_MAX','SET_VAR_DEGREE_MAX').
is_SetVarBranch_('SET_VAR_AFC_MIN','SET_VAR_AFC_MIN').
is_SetVarBranch_('SET_VAR_AFC_MAX','SET_VAR_AFC_MAX').
is_SetVarBranch_('SET_VAR_MIN_MIN','SET_VAR_MIN_MIN').
is_SetVarBranch_('SET_VAR_MIN_MAX','SET_VAR_MIN_MAX').
is_SetVarBranch_('SET_VAR_MAX_MIN','SET_VAR_MAX_MIN').
is_SetVarBranch_('SET_VAR_MAX_MAX','SET_VAR_MAX_MAX').
is_SetVarBranch_('SET_VAR_SIZE_MIN','SET_VAR_SIZE_MIN').
is_SetVarBranch_('SET_VAR_SIZE_MAX','SET_VAR_SIZE_MAX').
is_SetVarBranch_('SET_VAR_SIZE_DEGREE_MIN','SET_VAR_SIZE_DEGREE_MIN').
is_SetVarBranch_('SET_VAR_SIZE_DEGREE_MAX','SET_VAR_SIZE_DEGREE_MAX').
is_SetVarBranch_('SET_VAR_SIZE_AFC_MIN','SET_VAR_SIZE_AFC_MIN').
is_SetVarBranch_('SET_VAR_SIZE_AFC_MAX','SET_VAR_SIZE_AFC_MAX').
is_SetVarBranch(X,Y) :- nonvar(X), is_SetVarBranch_(X,Y).
is_SetVarBranch(X) :- is_SetVarBranch(X,_).
is_SetValBranch_('SET_VAL_MIN_INC').
is_SetValBranch_('SET_VAL_MIN_EXC').
is_SetValBranch_('SET_VAL_MED_INC').
is_SetValBranch_('SET_VAL_MED_EXC').
is_SetValBranch_('SET_VAL_MAX_INC').
is_SetValBranch_('SET_VAL_MAX_EXC').
is_SetValBranch_('SET_VAL_RND_INC').
is_SetValBranch_('SET_VAL_RND_EXC').
is_SetValBranch_('SET_VAL_MIN_INC','SET_VAL_MIN_INC').
is_SetValBranch_('SET_VAL_MIN_EXC','SET_VAL_MIN_EXC').
is_SetValBranch_('SET_VAL_MED_INC','SET_VAL_MED_INC').
is_SetValBranch_('SET_VAL_MED_EXC','SET_VAL_MED_EXC').
is_SetValBranch_('SET_VAL_MAX_INC','SET_VAL_MAX_INC').
is_SetValBranch_('SET_VAL_MAX_EXC','SET_VAL_MAX_EXC').
is_SetValBranch_('SET_VAL_RND_INC','SET_VAL_RND_INC').
is_SetValBranch_('SET_VAL_RND_EXC','SET_VAL_RND_EXC').
is_SetValBranch(X,Y) :- nonvar(X), is_SetValBranch_(X,Y).
is_SetValBranch(X) :- is_SetValBranch(X,_).
is_SetAssign_('SET_ASSIGN_MIN_INC').
is_SetAssign_('SET_ASSIGN_MIN_EXC').
is_SetAssign_('SET_ASSIGN_MED_INC').
is_SetAssign_('SET_ASSIGN_MED_EXC').
is_SetAssign_('SET_ASSIGN_MAX_INC').
is_SetAssign_('SET_ASSIGN_MAX_EXC').
is_SetAssign_('SET_ASSIGN_RND_INC').
is_SetAssign_('SET_ASSIGN_RND_EXC').
is_SetAssign_('SET_ASSIGN_MIN_INC','SET_ASSIGN_MIN_INC').
is_SetAssign_('SET_ASSIGN_MIN_EXC','SET_ASSIGN_MIN_EXC').
is_SetAssign_('SET_ASSIGN_MED_INC','SET_ASSIGN_MED_INC').
is_SetAssign_('SET_ASSIGN_MED_EXC','SET_ASSIGN_MED_EXC').
is_SetAssign_('SET_ASSIGN_MAX_INC','SET_ASSIGN_MAX_INC').
is_SetAssign_('SET_ASSIGN_MAX_EXC','SET_ASSIGN_MAX_EXC').
is_SetAssign_('SET_ASSIGN_RND_INC','SET_ASSIGN_RND_INC').
is_SetAssign_('SET_ASSIGN_RND_EXC','SET_ASSIGN_RND_EXC').
is_SetAssign(X,Y) :- nonvar(X), is_SetAssign_(X,Y).
is_SetAssign(X) :- is_SetAssign(X,_).
unary(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_TaskTypeArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_BoolVarArgs(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_unary_333(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_BoolVarArgs(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_unary_329(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=2))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4,X5),arg=1))).
sqr(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_sqr_321(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(sqr(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(sqr(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(sqr(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(sqr(X0,X1,X2,X3),arg=1))).
dom(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_dom_135(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_SetRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_int(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> gecode_constraint_dom_145(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=2))))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4,X5),arg=1))).
convex(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVar(X1,Y1)
-> (is_SetVar(X2,Y2)
-> gecode_constraint_convex_51(Y0,Y1,Y2)
; throw(gecode_argument_error(convex(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(convex(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(convex(X0,X1,X2),arg=1))).
nooverlap(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> gecode_constraint_nooverlap_226(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4),arg=1))).
assign(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_BoolVarArgs(X1,Y1)
-> (is_IntAssign(X2,Y2)
-> gecode_constraint_assign_4(Y0,Y1,Y2)
; throw(gecode_argument_error(assign(X0,X1,X2),arg=3)))
; (is_BoolVar(X1,Y1)
-> (is_IntAssign(X2,Y2)
-> gecode_constraint_assign_3(Y0,Y1,Y2)
; throw(gecode_argument_error(assign(X0,X1,X2),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntAssign(X2,Y2)
-> gecode_constraint_assign_5(Y0,Y1,Y2)
; throw(gecode_argument_error(assign(X0,X1,X2),arg=3)))
; (is_IntVar(X1,Y1)
-> (is_IntAssign(X2,Y2)
-> gecode_constraint_assign_7(Y0,Y1,Y2)
; throw(gecode_argument_error(assign(X0,X1,X2),arg=3)))
; (is_SetVarArgs(X1,Y1)
-> (is_SetAssign(X2,Y2)
-> gecode_constraint_assign_6(Y0,Y1,Y2)
; throw(gecode_argument_error(assign(X0,X1,X2),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_SetAssign(X2,Y2)
-> gecode_constraint_assign_8(Y0,Y1,Y2)
; throw(gecode_argument_error(assign(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(assign(X0,X1,X2),arg=2))))))))
; throw(gecode_argument_error(assign(X0,X1,X2),arg=1))).
element(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_element_154(Y0,Y1,Y2,Y3)
; (is_IntVar(X3,Y3)
-> gecode_constraint_element_158(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_element_148(Y0,Y1,Y2,Y3)
; (is_BoolVar(X3,Y3)
-> gecode_constraint_element_146(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=3)))
; (is_IntSetArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_SetVar(X3,Y3)
-> gecode_constraint_element_153(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=3)))
; (is_SetVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_SetVar(X3,Y3)
-> gecode_constraint_element_161(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_element_164(Y0,Y1,Y2,Y3)
; (is_IntVar(X3,Y3)
-> gecode_constraint_element_170(Y0,Y1,Y2,Y3)
; (is_BoolVar(X3,Y3)
-> gecode_constraint_element_162(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=4)))))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=2)))))))
; throw(gecode_argument_error(element(X0,X1,X2,X3),arg=1))).
sequence(X0,X1) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVarArgs(X1,Y1)
-> gecode_constraint_sequence_314(Y0,Y1)
; throw(gecode_argument_error(sequence(X0,X1),arg=2)))
; throw(gecode_argument_error(sequence(X0,X1),arg=1))).
notMax(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_notMax_232(Y0,Y1,Y2)
; throw(gecode_argument_error(notMax(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(notMax(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(notMax(X0,X1,X2),arg=1))).
unary(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> gecode_constraint_unary_326(Y0,Y1,Y2)
; throw(gecode_argument_error(unary(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(unary(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(unary(X0,X1,X2),arg=1))).
circuit(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_circuit_45(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_circuit_36(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3),arg=2))))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3),arg=1))).
dom(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_dom_134(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_dom_139(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5))))
; (is_BoolVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_dom_133(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4))))
; (is_IntSet(X2,Y2)
-> (is_BoolVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_dom_129(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3))))
; (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_dom_127(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_SetRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_dom_144(Y0,Y1,Y2,Y3,Y4)
; (is_BoolVar(X4,Y4)
-> gecode_constraint_dom_143(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5))))
; (is_IntSet(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_dom_141(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=2)))))
; throw(gecode_argument_error(dom(X0,X1,X2,X3,X4),arg=1))).
channel(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_BoolVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_channel_32(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_channel_27(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_channel_23(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))
; (is_BoolVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_channel_21(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=2))))))
; throw(gecode_argument_error(channel(X0,X1,X2,X3),arg=1))).
nooverlap(X0,X1,X2,X3,X4,X5,X6,X7) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntVarArgs(X6,Y6)
-> (is_BoolVarArgs(X7,Y7)
-> gecode_constraint_nooverlap_228(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; (is_IntConLevel(X7,Y7)
-> gecode_constraint_nooverlap_231(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=8))))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7),arg=1))).
element(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_IntVar(X6,Y6)
-> gecode_constraint_element_156(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_BoolVar(X6,Y6)
-> gecode_constraint_element_150(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; (is_IntSetArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_SetVar(X6,Y6)
-> gecode_constraint_element_152(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; (is_SetVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_SetVar(X6,Y6)
-> gecode_constraint_element_160(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_IntVar(X6,Y6)
-> gecode_constraint_element_168(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; (is_BoolVar(X6,Y6)
-> gecode_constraint_element_166(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=7))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=2)))))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6),arg=1))).
max(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_max_208(Y0,Y1,Y2)
; throw(gecode_argument_error(max(X0,X1,X2),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_max_212(Y0,Y1,Y2)
; throw(gecode_argument_error(max(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(max(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(max(X0,X1,X2),arg=1))).
unshare(X0,X1) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> gecode_constraint_unshare_338(Y0,Y1)
; (is_BoolVarArgs(X1,Y1)
-> gecode_constraint_unshare_336(Y0,Y1)
; throw(gecode_argument_error(unshare(X0,X1),arg=2))))
; throw(gecode_argument_error(unshare(X0,X1),arg=1))).
path(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> gecode_constraint_path_244(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_path_243(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=2))))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4),arg=1))).
mult(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_mult_222(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(mult(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3),arg=1))).
clause(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_BoolOpType(X1,Y1)
-> (is_BoolVarArgs(X2,Y2)
-> (is_BoolVarArgs(X3,Y3)
-> (is_int(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_clause_49(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=6)))
; (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_clause_47(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4,X5),arg=1))).
precede(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_precede_249(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(precede(X0,X1,X2,X3,X4),arg=1))).
distinct(X0,X1) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> gecode_constraint_distinct_116(Y0,Y1)
; throw(gecode_argument_error(distinct(X0,X1),arg=2)))
; throw(gecode_argument_error(distinct(X0,X1),arg=1))).
mod(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_mod_221(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3,X4),arg=1))).
cardinality(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_cardinality_18(Y0,Y1,Y2)
; throw(gecode_argument_error(cardinality(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(cardinality(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(cardinality(X0,X1,X2),arg=1))).
atmostOne(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> gecode_constraint_atmostOne_9(Y0,Y1,Y2)
; throw(gecode_argument_error(atmostOne(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(atmostOne(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(atmostOne(X0,X1,X2),arg=1))).
channelSorted(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_SetVar(X2,Y2)
-> gecode_constraint_channelSorted_33(Y0,Y1,Y2)
; throw(gecode_argument_error(channelSorted(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(channelSorted(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(channelSorted(X0,X1,X2),arg=1))).
linear(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_linear_202(Y0,Y1,Y2,Y3)
; (is_IntVar(X3,Y3)
-> gecode_constraint_linear_206(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_linear_178(Y0,Y1,Y2,Y3)
; (is_IntVar(X3,Y3)
-> gecode_constraint_linear_182(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(linear(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3),arg=2))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3),arg=1))).
circuit(X0,X1) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> gecode_constraint_circuit_42(Y0,Y1)
; throw(gecode_argument_error(circuit(X0,X1),arg=2)))
; throw(gecode_argument_error(circuit(X0,X1),arg=1))).
rel(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_BoolVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_264(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_267(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))
; (is_BoolVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_260(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_263(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))
; (is_BoolOpType(X2,Y2)
-> (is_BoolVar(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_rel_258(Y0,Y1,Y2,Y3,Y4)
; (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_256(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_275(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; (is_BoolVarArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_271(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; (is_BoolVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_269(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))
; (is_SetOpType(X1,Y1)
-> (is_SetVarArgs(X2,Y2)
-> (is_IntSet(X3,Y3)
-> (is_SetVar(X4,Y4)
-> gecode_constraint_rel_299(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntSet(X3,Y3)
-> (is_SetVar(X4,Y4)
-> gecode_constraint_rel_297(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))
; (is_IntVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_283(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_285(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; (is_IntVarArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_279(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))
; (is_IntVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_286(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_289(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))
; (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_290(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_293(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))
; (is_SetRelType(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_296(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3))))
; (is_SetVar(X1,Y1)
-> (is_SetRelType(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_307(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; (is_SetVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_rel_309(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))
; (is_BoolOpType(X1,Y1)
-> (is_BoolVarArgs(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_255(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; (is_BoolVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_rel_253(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=2)))))))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4),arg=1))).
min(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_min_216(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_min_215(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_BoolVar(X3,Y3)
-> gecode_constraint_min_219(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=2)))))
; throw(gecode_argument_error(min(X0,X1,X2,X3),arg=1))).
cardinality(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVar(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_cardinality_19(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(cardinality(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(cardinality(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(cardinality(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(cardinality(X0,X1,X2,X3),arg=1))).
count(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_count_65(Y0,Y1,Y2,Y3)
; (is_IntArgs(X3,Y3)
-> gecode_constraint_count_62(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(count(X0,X1,X2,X3),arg=4))))
; (is_IntSet(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> gecode_constraint_count_60(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(count(X0,X1,X2,X3),arg=4)))
; (is_IntSetArgs(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_count_59(Y0,Y1,Y2,Y3)
; (is_IntArgs(X3,Y3)
-> gecode_constraint_count_56(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(count(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(count(X0,X1,X2,X3),arg=3)))))
; throw(gecode_argument_error(count(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(count(X0,X1,X2,X3),arg=1))).
sqrt(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_sqrt_322(Y0,Y1,Y2)
; throw(gecode_argument_error(sqrt(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(sqrt(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(sqrt(X0,X1,X2),arg=1))).
cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_113(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_111(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_109(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_107(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_105(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_103(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_101(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_cumulatives_99(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1))).
binpacking(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> gecode_constraint_binpacking_10(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3),arg=1))).
linear(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_linear_193(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; (is_IntVar(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_linear_197(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; (is_BoolVarArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_linear_185(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; (is_IntVar(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_linear_189(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=3))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=2)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5,X6),arg=1))).
abs(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_abs_2(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(abs(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(abs(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(abs(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(abs(X0,X1,X2,X3),arg=1))).
convex(X0,X1) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVar(X1,Y1)
-> gecode_constraint_convex_50(Y0,Y1)
; throw(gecode_argument_error(convex(X0,X1),arg=2)))
; throw(gecode_argument_error(convex(X0,X1),arg=1))).
div(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_div_118(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(div(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(div(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(div(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(div(X0,X1,X2,X3),arg=1))).
rel(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_rel_287(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_rel_291(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_IntSet(X1,Y1)
-> (is_SetOpType(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_SetRelType(X4,Y4)
-> (is_IntSet(X5,Y5)
-> gecode_constraint_rel_276(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_SetVar(X5,Y5)
-> gecode_constraint_rel_277(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_BoolVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_rel_265(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_BoolVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_rel_261(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))
; (is_BoolOpType(X2,Y2)
-> (is_BoolVar(X3,Y3)
-> (is_int(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_rel_259(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))
; (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_rel_257(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3))))
; (is_SetVar(X1,Y1)
-> (is_SetOpType(X2,Y2)
-> (is_IntSet(X3,Y3)
-> (is_SetRelType(X4,Y4)
-> (is_IntSet(X5,Y5)
-> gecode_constraint_rel_302(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_SetVar(X5,Y5)
-> gecode_constraint_rel_303(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_SetVar(X3,Y3)
-> (is_SetRelType(X4,Y4)
-> (is_IntSet(X5,Y5)
-> gecode_constraint_rel_304(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_SetVar(X5,Y5)
-> gecode_constraint_rel_305(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=2))))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3,X4,X5),arg=1))).
weights(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> gecode_constraint_weights_340(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(weights(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(weights(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(weights(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(weights(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(weights(X0,X1,X2,X3,X4),arg=1))).
max(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_max_211(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(max(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(max(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(max(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(max(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(max(X0,X1,X2,X3,X4),arg=1))).
path(X0,X1,X2,X3,X4,X5,X6,X7,X8) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntVar(X5,Y5)
-> (is_IntVarArgs(X6,Y6)
-> (is_IntVar(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_path_239(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1))).
unary(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_TaskTypeArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> gecode_constraint_unary_334(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> gecode_constraint_unary_330(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=4)))
; (is_IntArgs(X2,Y2)
-> (is_BoolVarArgs(X3,Y3)
-> gecode_constraint_unary_324(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_unary_327(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=3))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=2))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3),arg=1))).
sorted(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_sorted_317(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3,X4),arg=1))).
circuit(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> gecode_constraint_circuit_40(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_circuit_37(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))
; (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> gecode_constraint_circuit_34(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=3))))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4),arg=1))).
dom(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_dom_138(Y0,Y1,Y2,Y3)
; (is_BoolVar(X3,Y3)
-> gecode_constraint_dom_132(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_dom_137(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))))
; (is_IntSet(X2,Y2)
-> (is_BoolVar(X3,Y3)
-> gecode_constraint_dom_128(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_dom_131(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=3))))
; (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_dom_126(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_dom_125(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))
; (is_IntSet(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_dom_123(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=3))))
; (is_SetVar(X1,Y1)
-> (is_SetRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_dom_142(Y0,Y1,Y2,Y3)
; (is_IntSet(X3,Y3)
-> gecode_constraint_dom_140(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=2)))))
; throw(gecode_argument_error(dom(X0,X1,X2,X3),arg=1))).
abs(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_abs_1(Y0,Y1,Y2)
; throw(gecode_argument_error(abs(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(abs(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(abs(X0,X1,X2),arg=1))).
channel(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_channel_29(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_channel_24(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=2))))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4),arg=1))).
rel(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> gecode_constraint_rel_280(Y0,Y1,Y2)
; throw(gecode_argument_error(rel(X0,X1,X2),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> gecode_constraint_rel_272(Y0,Y1,Y2)
; throw(gecode_argument_error(rel(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(rel(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(rel(X0,X1,X2),arg=1))).
path(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_path_242(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(path(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(path(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(path(X0,X1,X2,X3),arg=1))).
branch(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarBranch(X2,Y2)
-> (is_IntValBranch(X3,Y3)
-> gecode_constraint_branch_14(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVarBranch(X2,Y2)
-> (is_IntValBranch(X3,Y3)
-> gecode_constraint_branch_13(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))
; (is_SetVarArgs(X1,Y1)
-> (is_SetVarBranch(X2,Y2)
-> (is_SetValBranch(X3,Y3)
-> gecode_constraint_branch_15(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=2)))))
; throw(gecode_argument_error(branch(X0,X1,X2,X3),arg=1))).
mult(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_mult_223(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(mult(X0,X1,X2,X3,X4),arg=1))).
circuit(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_circuit_41(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))
; (is_IntVarArgs(X4,Y4)
-> (is_IntVar(X5,Y5)
-> gecode_constraint_circuit_38(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_circuit_35(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=3))))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5),arg=1))).
clause(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_BoolOpType(X1,Y1)
-> (is_BoolVarArgs(X2,Y2)
-> (is_BoolVarArgs(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_clause_48(Y0,Y1,Y2,Y3,Y4)
; (is_BoolVar(X4,Y4)
-> gecode_constraint_clause_46(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(clause(X0,X1,X2,X3,X4),arg=1))).
precede(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_precede_251(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_precede_248(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))
; (is_IntArgs(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_precede_247(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=3))))
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=2))))
; throw(gecode_argument_error(precede(X0,X1,X2,X3),arg=1))).
channel(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_int(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_channel_30(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(channel(X0,X1,X2,X3,X4,X5),arg=1))).
cumulative(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_TaskTypeArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> gecode_constraint_cumulative_82(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; (is_IntConLevel(X6,Y6)
-> gecode_constraint_cumulative_85(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> gecode_constraint_cumulative_78(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; (is_IntConLevel(X6,Y6)
-> gecode_constraint_cumulative_81(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_BoolVarArgs(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_cumulative_75(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=3))))
; (is_IntVar(X1,Y1)
-> (is_TaskTypeArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> gecode_constraint_cumulative_94(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; (is_IntConLevel(X6,Y6)
-> gecode_constraint_cumulative_97(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> gecode_constraint_cumulative_90(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; (is_IntConLevel(X6,Y6)
-> gecode_constraint_cumulative_93(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_BoolVarArgs(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_cumulative_87(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=4))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=3))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=2))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6),arg=1))).
distinct(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntConLevel(X2,Y2)
-> gecode_constraint_distinct_117(Y0,Y1,Y2)
; throw(gecode_argument_error(distinct(X0,X1,X2),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> gecode_constraint_distinct_114(Y0,Y1,Y2)
; throw(gecode_argument_error(distinct(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(distinct(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(distinct(X0,X1,X2),arg=1))).
mod(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_mod_220(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(mod(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(mod(X0,X1,X2,X3),arg=1))).
sqr(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_sqr_320(Y0,Y1,Y2)
; throw(gecode_argument_error(sqr(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(sqr(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(sqr(X0,X1,X2),arg=1))).
sequence(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntSet(X2,Y2)
-> (is_int(X3,Y3)
-> (is_int(X4,Y4)
-> (is_int(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_sequence_313(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntSet(X2,Y2)
-> (is_int(X3,Y3)
-> (is_int(X4,Y4)
-> (is_int(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_sequence_311(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=2))))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5,X6),arg=1))).
path(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntVar(X5,Y5)
-> (is_IntVar(X6,Y6)
-> gecode_constraint_path_240(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntVar(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_path_237(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; (is_IntVarArgs(X5,Y5)
-> (is_IntVar(X6,Y6)
-> gecode_constraint_path_234(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=6))))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=3))))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=2)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6),arg=1))).
divmod(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_divmod_121(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4,X5),arg=1))).
sorted(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> gecode_constraint_sorted_318(Y0,Y1,Y2)
; throw(gecode_argument_error(sorted(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(sorted(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(sorted(X0,X1,X2),arg=1))).
circuit(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> gecode_constraint_circuit_44(Y0,Y1,Y2)
; throw(gecode_argument_error(circuit(X0,X1,X2),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntConLevel(X2,Y2)
-> gecode_constraint_circuit_43(Y0,Y1,Y2)
; throw(gecode_argument_error(circuit(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(circuit(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(circuit(X0,X1,X2),arg=1))).
channel(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_BoolVar(X2,Y2)
-> gecode_constraint_channel_31(Y0,Y1,Y2)
; throw(gecode_argument_error(channel(X0,X1,X2),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_SetVarArgs(X2,Y2)
-> gecode_constraint_channel_28(Y0,Y1,Y2)
; (is_IntVarArgs(X2,Y2)
-> gecode_constraint_channel_26(Y0,Y1,Y2)
; throw(gecode_argument_error(channel(X0,X1,X2),arg=3))))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_channel_22(Y0,Y1,Y2)
; (is_SetVar(X2,Y2)
-> gecode_constraint_channel_25(Y0,Y1,Y2)
; throw(gecode_argument_error(channel(X0,X1,X2),arg=3))))
; (is_BoolVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_channel_20(Y0,Y1,Y2)
; throw(gecode_argument_error(channel(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(channel(X0,X1,X2),arg=2))))))
; throw(gecode_argument_error(channel(X0,X1,X2),arg=1))).
count(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_count_52(Y0,Y1,Y2,Y3,Y4)
; (is_IntVar(X4,Y4)
-> gecode_constraint_count_54(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))
; (is_int(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_count_66(Y0,Y1,Y2,Y3,Y4)
; (is_IntVar(X4,Y4)
-> gecode_constraint_count_68(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))
; (is_IntSet(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_count_61(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))
; (is_IntSetArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_count_57(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_count_63(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))
; (is_IntVar(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_count_70(Y0,Y1,Y2,Y3,Y4)
; (is_IntVar(X4,Y4)
-> gecode_constraint_count_72(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=3))))))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4),arg=1))).
cumulatives(X0,X1,X2,X3,X4,X5,X6,X7) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_112(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_110(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_108(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_106(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=4))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_104(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_102(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_100(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; (is_IntArgs(X5,Y5)
-> (is_IntArgs(X6,Y6)
-> (is_bool(X7,Y7)
-> gecode_constraint_cumulatives_98(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=6))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=4))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=2))))
; throw(gecode_argument_error(cumulatives(X0,X1,X2,X3,X4,X5,X6,X7),arg=1))).
binpacking(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_binpacking_11(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(binpacking(X0,X1,X2,X3,X4),arg=1))).
linear(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_201(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_205(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_177(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_181(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> gecode_constraint_linear_192(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_195(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))
; (is_IntVar(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> gecode_constraint_linear_196(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_199(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_BoolVarArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> gecode_constraint_linear_184(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_187(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))
; (is_IntVar(X4,Y4)
-> (is_BoolVar(X5,Y5)
-> gecode_constraint_linear_188(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_linear_191(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=3))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=2)))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4,X5),arg=1))).
nooverlap(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntVarArgs(X6,Y6)
-> gecode_constraint_nooverlap_230(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; (is_IntArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_BoolVarArgs(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_nooverlap_225(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=3))))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=2)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6),arg=1))).
div(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_div_119(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(div(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(div(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(div(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(div(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(div(X0,X1,X2,X3,X4),arg=1))).
max(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_max_210(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_max_209(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_BoolVar(X3,Y3)
-> gecode_constraint_max_213(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=2)))))
; throw(gecode_argument_error(max(X0,X1,X2,X3),arg=1))).
path(X0,X1,X2,X3,X4,X5,X6,X7) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntVar(X5,Y5)
-> (is_IntVar(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_path_241(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; (is_IntVarArgs(X6,Y6)
-> (is_IntVar(X7,Y7)
-> gecode_constraint_path_238(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=7))))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntVar(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_path_235(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5,X6,X7),arg=1))).
unary(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_TaskTypeArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_BoolVarArgs(X4,Y4)
-> gecode_constraint_unary_332(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_unary_335(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_BoolVarArgs(X4,Y4)
-> gecode_constraint_unary_328(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_unary_331(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))
; (is_IntArgs(X2,Y2)
-> (is_BoolVarArgs(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_unary_325(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=3))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=2))))
; throw(gecode_argument_error(unary(X0,X1,X2,X3,X4),arg=1))).
sorted(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> gecode_constraint_sorted_316(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_sorted_319(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(sorted(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(sorted(X0,X1,X2,X3),arg=1))).
element(X0,X1,X2,X3,X4,X5,X6,X7) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_IntVar(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_element_157(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_BoolVar(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_element_151(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_int(X5,Y5)
-> (is_IntVar(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_element_169(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; (is_BoolVar(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_element_167(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=7))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=3)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=2)))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5,X6,X7),arg=1))).
element(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_155(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_159(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_149(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; (is_BoolVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_147(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))
; (is_SetOpType(X1,Y1)
-> (is_SetVarArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_SetVar(X4,Y4)
-> gecode_constraint_element_174(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4)))
; (is_IntSetArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_SetVar(X4,Y4)
-> gecode_constraint_element_172(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3))))
; (is_IntArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_int(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_165(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_171(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; (is_BoolVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_element_163(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=4)))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=2))))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4),arg=1))).
sequence(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVarArgs(X1,Y1)
-> (is_SetVar(X2,Y2)
-> gecode_constraint_sequence_315(Y0,Y1,Y2)
; throw(gecode_argument_error(sequence(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(sequence(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(sequence(X0,X1,X2),arg=1))).
circuit(X0,X1,X2,X3,X4,X5,X6) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVar(X5,Y5)
-> (is_IntConLevel(X6,Y6)
-> gecode_constraint_circuit_39(Y0,Y1,Y2,Y3,Y4,Y5,Y6)
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=7)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=6)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=5)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=4)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=3)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=2)))
; throw(gecode_argument_error(circuit(X0,X1,X2,X3,X4,X5,X6),arg=1))).
precede(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVarArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> gecode_constraint_precede_250(Y0,Y1,Y2)
; throw(gecode_argument_error(precede(X0,X1,X2),arg=3)))
; (is_IntVarArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> gecode_constraint_precede_246(Y0,Y1,Y2)
; throw(gecode_argument_error(precede(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(precede(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(precede(X0,X1,X2),arg=1))).
cumulative(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_TaskTypeArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> gecode_constraint_cumulative_84(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> gecode_constraint_cumulative_80(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_BoolVarArgs(X5,Y5)
-> gecode_constraint_cumulative_74(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_cumulative_77(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=3))))
; (is_IntVar(X1,Y1)
-> (is_TaskTypeArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> gecode_constraint_cumulative_96(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> gecode_constraint_cumulative_92(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))
; (is_IntArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_BoolVarArgs(X5,Y5)
-> gecode_constraint_cumulative_86(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_cumulative_89(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=4))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=3))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=2))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5),arg=1))).
distinct(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_distinct_115(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(distinct(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(distinct(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(distinct(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(distinct(X0,X1,X2,X3),arg=1))).
min(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_min_214(Y0,Y1,Y2)
; throw(gecode_argument_error(min(X0,X1,X2),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_min_218(Y0,Y1,Y2)
; throw(gecode_argument_error(min(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(min(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(min(X0,X1,X2),arg=1))).
sqrt(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntConLevel(X3,Y3)
-> gecode_constraint_sqrt_323(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(sqrt(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(sqrt(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(sqrt(X0,X1,X2,X3),arg=2)))
; throw(gecode_argument_error(sqrt(X0,X1,X2,X3),arg=1))).
sequence(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntSet(X2,Y2)
-> (is_int(X3,Y3)
-> (is_int(X4,Y4)
-> (is_int(X5,Y5)
-> gecode_constraint_sequence_312(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntSet(X2,Y2)
-> (is_int(X3,Y3)
-> (is_int(X4,Y4)
-> (is_int(X5,Y5)
-> gecode_constraint_sequence_310(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=2))))
; throw(gecode_argument_error(sequence(X0,X1,X2,X3,X4,X5),arg=1))).
unshare(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntConLevel(X2,Y2)
-> gecode_constraint_unshare_339(Y0,Y1,Y2)
; throw(gecode_argument_error(unshare(X0,X1,X2),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntConLevel(X2,Y2)
-> gecode_constraint_unshare_337(Y0,Y1,Y2)
; throw(gecode_argument_error(unshare(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(unshare(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(unshare(X0,X1,X2),arg=1))).
path(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_path_245(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> (is_IntVar(X5,Y5)
-> gecode_constraint_path_236(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=2))))
; throw(gecode_argument_error(path(X0,X1,X2,X3,X4,X5),arg=1))).
divmod(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntVar(X4,Y4)
-> gecode_constraint_divmod_120(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(divmod(X0,X1,X2,X3,X4),arg=1))).
nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntVarArgs(X5,Y5)
-> (is_IntVarArgs(X6,Y6)
-> (is_BoolVarArgs(X7,Y7)
-> (is_IntConLevel(X8,Y8)
-> gecode_constraint_nooverlap_229(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8)
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=9)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=8)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=7)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=6)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=5)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=4)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=3)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=2)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5,X6,X7,X8),arg=1))).
cumulative(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> gecode_constraint_cumulative_76(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=3)))
; (is_IntVar(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> gecode_constraint_cumulative_88(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=2))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4),arg=1))).
count(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_count_67(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))
; (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_count_69(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_IntVar(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_count_71(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))
; (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_count_73(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_IntArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_count_53(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))
; (is_IntVar(X4,Y4)
-> (is_IntConLevel(X5,Y5)
-> gecode_constraint_count_55(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=5))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=3)))))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(count(X0,X1,X2,X3,X4,X5),arg=1))).
notMin(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> gecode_constraint_notMin_233(Y0,Y1,Y2)
; throw(gecode_argument_error(notMin(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(notMin(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(notMin(X0,X1,X2),arg=1))).
cumulative(X0,X1,X2,X3,X4,X5,X6,X7) :-
(is_Space_or_Clause(X0,Y0)
-> (is_int(X1,Y1)
-> (is_TaskTypeArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_cumulative_83(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_cumulative_79(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))
; (is_IntVar(X1,Y1)
-> (is_TaskTypeArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_cumulative_95(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntVarArgs(X4,Y4)
-> (is_IntArgs(X5,Y5)
-> (is_BoolVarArgs(X6,Y6)
-> (is_IntConLevel(X7,Y7)
-> gecode_constraint_cumulative_91(Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7)
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=8)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=7)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=6)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=5)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=4)))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=3))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=2))))
; throw(gecode_argument_error(cumulative(X0,X1,X2,X3,X4,X5,X6,X7),arg=1))).
branch(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntValBranch(X2,Y2)
-> gecode_constraint_branch_16(Y0,Y1,Y2)
; throw(gecode_argument_error(branch(X0,X1,X2),arg=3)))
; (is_BoolVar(X1,Y1)
-> (is_IntValBranch(X2,Y2)
-> gecode_constraint_branch_12(Y0,Y1,Y2)
; throw(gecode_argument_error(branch(X0,X1,X2),arg=3)))
; (is_SetVar(X1,Y1)
-> (is_SetValBranch(X2,Y2)
-> gecode_constraint_branch_17(Y0,Y1,Y2)
; throw(gecode_argument_error(branch(X0,X1,X2),arg=3)))
; throw(gecode_argument_error(branch(X0,X1,X2),arg=2)))))
; throw(gecode_argument_error(branch(X0,X1,X2),arg=1))).
dom(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_int(X2,Y2)
-> gecode_constraint_dom_136(Y0,Y1,Y2)
; (is_IntSet(X2,Y2)
-> gecode_constraint_dom_130(Y0,Y1,Y2)
; throw(gecode_argument_error(dom(X0,X1,X2),arg=3))))
; (is_IntVarArgs(X1,Y1)
-> (is_int(X2,Y2)
-> gecode_constraint_dom_124(Y0,Y1,Y2)
; (is_IntSet(X2,Y2)
-> gecode_constraint_dom_122(Y0,Y1,Y2)
; throw(gecode_argument_error(dom(X0,X1,X2),arg=3))))
; throw(gecode_argument_error(dom(X0,X1,X2),arg=2))))
; throw(gecode_argument_error(dom(X0,X1,X2),arg=1))).
linear(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_linear_200(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_linear_203(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))
; (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_linear_204(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_linear_207(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_linear_176(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_linear_179(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))
; (is_IntVar(X3,Y3)
-> (is_BoolVar(X4,Y4)
-> gecode_constraint_linear_180(Y0,Y1,Y2,Y3,Y4)
; (is_IntConLevel(X4,Y4)
-> gecode_constraint_linear_183(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3)))
; (is_IntArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_linear_194(Y0,Y1,Y2,Y3,Y4)
; (is_IntVar(X4,Y4)
-> gecode_constraint_linear_198(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))
; (is_BoolVarArgs(X2,Y2)
-> (is_IntRelType(X3,Y3)
-> (is_int(X4,Y4)
-> gecode_constraint_linear_186(Y0,Y1,Y2,Y3,Y4)
; (is_IntVar(X4,Y4)
-> gecode_constraint_linear_190(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=5))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=3))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=2)))))
; throw(gecode_argument_error(linear(X0,X1,X2,X3,X4),arg=1))).
nooverlap(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntArgs(X2,Y2)
-> (is_IntVarArgs(X3,Y3)
-> (is_IntArgs(X4,Y4)
-> (is_BoolVarArgs(X5,Y5)
-> gecode_constraint_nooverlap_224(Y0,Y1,Y2,Y3,Y4,Y5)
; (is_IntConLevel(X5,Y5)
-> gecode_constraint_nooverlap_227(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=6))))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=3)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(nooverlap(X0,X1,X2,X3,X4,X5),arg=1))).
element(X0,X1,X2,X3,X4,X5) :-
(is_Space_or_Clause(X0,Y0)
-> (is_SetOpType(X1,Y1)
-> (is_SetVarArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_SetVar(X4,Y4)
-> (is_IntSet(X5,Y5)
-> gecode_constraint_element_175(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=4)))
; (is_IntSetArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> (is_SetVar(X4,Y4)
-> (is_IntSet(X5,Y5)
-> gecode_constraint_element_173(Y0,Y1,Y2,Y3,Y4,Y5)
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=6)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=5)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=4)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=3))))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=2)))
; throw(gecode_argument_error(element(X0,X1,X2,X3,X4,X5),arg=1))).
rel(X0,X1,X2,X3) :-
(is_Space_or_Clause(X0,Y0)
-> (is_BoolVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_rel_266(Y0,Y1,Y2,Y3)
; (is_BoolVar(X3,Y3)
-> gecode_constraint_rel_262(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))
; (is_BoolVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_rel_274(Y0,Y1,Y2,Y3)
; (is_BoolVarArgs(X3,Y3)
-> gecode_constraint_rel_270(Y0,Y1,Y2,Y3)
; (is_BoolVar(X3,Y3)
-> gecode_constraint_rel_268(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_rel_273(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))
; (is_SetOpType(X1,Y1)
-> (is_SetVarArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> gecode_constraint_rel_300(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))
; (is_IntVarArgs(X2,Y2)
-> (is_SetVar(X3,Y3)
-> gecode_constraint_rel_298(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))
; (is_IntVarArgs(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_rel_282(Y0,Y1,Y2,Y3)
; (is_IntVar(X3,Y3)
-> gecode_constraint_rel_284(Y0,Y1,Y2,Y3)
; (is_IntVarArgs(X3,Y3)
-> gecode_constraint_rel_278(Y0,Y1,Y2,Y3)
; (is_IntConLevel(X3,Y3)
-> gecode_constraint_rel_281(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))
; (is_IntVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_rel_288(Y0,Y1,Y2,Y3)
; (is_IntVar(X3,Y3)
-> gecode_constraint_rel_292(Y0,Y1,Y2,Y3)
; (is_SetVar(X3,Y3)
-> gecode_constraint_rel_294(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))))
; (is_SetRelType(X2,Y2)
-> (is_SetVar(X3,Y3)
-> gecode_constraint_rel_295(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))
; (is_SetVar(X1,Y1)
-> (is_IntRelType(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_rel_301(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4)))
; (is_SetRelType(X2,Y2)
-> (is_IntVar(X3,Y3)
-> gecode_constraint_rel_306(Y0,Y1,Y2,Y3)
; (is_SetVar(X3,Y3)
-> gecode_constraint_rel_308(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3))))
; (is_BoolOpType(X1,Y1)
-> (is_BoolVarArgs(X2,Y2)
-> (is_int(X3,Y3)
-> gecode_constraint_rel_254(Y0,Y1,Y2,Y3)
; (is_BoolVar(X3,Y3)
-> gecode_constraint_rel_252(Y0,Y1,Y2,Y3)
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=4))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=3)))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=2)))))))))
; throw(gecode_argument_error(rel(X0,X1,X2,X3),arg=1))).
min(X0,X1,X2,X3,X4) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVar(X1,Y1)
-> (is_IntVar(X2,Y2)
-> (is_IntVar(X3,Y3)
-> (is_IntConLevel(X4,Y4)
-> gecode_constraint_min_217(Y0,Y1,Y2,Y3,Y4)
; throw(gecode_argument_error(min(X0,X1,X2,X3,X4),arg=5)))
; throw(gecode_argument_error(min(X0,X1,X2,X3,X4),arg=4)))
; throw(gecode_argument_error(min(X0,X1,X2,X3,X4),arg=3)))
; throw(gecode_argument_error(min(X0,X1,X2,X3,X4),arg=2)))
; throw(gecode_argument_error(min(X0,X1,X2,X3,X4),arg=1))).
count(X0,X1,X2) :-
(is_Space_or_Clause(X0,Y0)
-> (is_IntVarArgs(X1,Y1)
-> (is_IntVarArgs(X2,Y2)
-> gecode_constraint_count_64(Y0,Y1,Y2)
; (is_IntSetArgs(X2,Y2)
-> gecode_constraint_count_58(Y0,Y1,Y2)
; throw(gecode_argument_error(count(X0,X1,X2),arg=3))))
; throw(gecode_argument_error(count(X0,X1,X2),arg=2)))
; throw(gecode_argument_error(count(X0,X1,X2),arg=1))).
| Prolog | 4 | ryandesign/yap | packages/gecode/3.6.0/gecode_yap_auto_generated.yap | [
"Artistic-1.0-Perl",
"ClArtistic"
] |
var content = "<%= for {type, message} <- get_flash(@conn), do: javascript_escape(render(LayoutView, "_flash.html", type: type, message: message)) %>";
u("header.header").append(content);
| HTML+EEX | 3 | PsOverflow/changelog.com | lib/changelog_web/templates/news_item_comment/create_failure.js.eex | [
"MIT"
] |
body,html{height:100%}body{font-family:'Open Sans',sans-serif;font-size:1.5em;padding-top:80px}
| CSS | 1 | 0x7c48/mitmproxy | test/mitmproxy/data/1.css | [
"MIT"
] |
source language/std.nu
| Nu | 1 | WindSoilder/nu_scripts | lib/scripts.nu | [
"MIT"
] |
a:after { content: '\1010101' } | CSS | 2 | vjpr/swc | css/parser/tests/fixture/esbuild/misc/cFk0V1dktTRk2wWOux0Y9A/input.css | [
"Apache-2.0",
"MIT"
] |
Note 0
Copyright (C) 2018 Jonathan Hough. All rights reserved.
)
cocurrent 'jLearnText'
splitText=: <.@:-:@:[ (({ ,"0 _"_ 0 ([ I.@:~: i.@:#@:]) { ]) ])"_ 1 [ ]\ ]
NB. Get all pairs as word vectors of length #x
NB. y: sentences to split into pairs of words
NB. x: list of unique words in the dictionary.
getPairs=: 4 : 0
x ="_ 0"_ 1[ 5 splitText y
)
subsample=: 3 : 0
'text sr'=.y
txt=. ;: text
n=. #txt
r=. (~. ,: <"0@:(#/.~)) txt
t=. (%&n)>1{r
s=. (% * >:@:%:)@:(%&sr) t
f=. r, <"0 s
rnd=. 3 : ' ? 0'
rem=. I.>(rnd < ])&.> (2{f) {~ txt i.~ {. f
rem{txt
)
NB. Parameters:
NB. 0: text to vectorize.
NB. 1: window size for text
NB. 2: output vector size.
NB. 3: Number of iterations for the NN to run.
NB. 4: Batch size per iteration of NN.
NB. 5: Learning rate
NB. 6: do Sub-sample
NB. 7: Sub-sameple rate.
vectorizeText=: 3 : 0
'text window outsize epochs batchSize lr doss sr'=.y
if. doss do.
txt=. subsample text;sr
else.
txt=. ;: text
end.
words=. ~. txt
pairs=. words getPairs txt
X=. ,/0{"2 pairs
Y=. ,/1{"2 pairs
size=. {:$X
C=: ((size,outsize,size);'identity';'softmax'; lr; lr; epochs;'L2'; 'sgd';batchSize) conew 'MLPClassifier'
X fit__C Y
'w1 w2'=. weights__C
destroy__C ''
txt;}:w1 NB. get rid of the bias node
)
0 : 0
Steps
1. Get text S. some sentences etc.
2. use getPairs to split it into pairs, with window
size 5.
3. Use the first item of every pair as X, second as Y
4. create MLPClassifier with softmax output identity middle,
and train X fit__C Y (or is it Y fit__C X?)
http://mccormickml.com/2016/04/19/word2vec-tutorial-the-skip-gram-model/
) | J | 4 | jonghough/jlearn | text/textencoding.ijs | [
"MIT"
] |
% Abstract given nonterminals from potential clones - C# block version
% Jim Cordy, May 2010
% Using C# grammar
include "csharp.grm"
% Redefinition for potential clones
redefine block
{ [IN] [NL]
[opt statement_list] [EX]
} [NL]
end redefine
define potential_clone
[block]
end define
% Generic abstract
include "generic-abstract.txl"
| TXL | 3 | coder-chenzhi/SQA | SourcererCC/parser/java/txl/cs-abstract-blocks.txl | [
"Apache-2.0"
] |
# generated from colcon_core/shell/template/command_prefix.sh.em
@[for pkg_name, pkg_install_base in dependencies.items()]@
@{
import os
pkg_script = os.path.join(pkg_install_base, 'share', pkg_name, 'package.sh')
}@
. "@(pkg_script)"
@[end for]@
| EmberScript | 3 | brawner/colcon-core | colcon_core/shell/template/command_prefix.sh.em | [
"Apache-2.0"
] |
redo-ifchange vars
echo '"""Auto-generated file with git version information."""'
echo "# pylint: disable=bad-whitespace"
cat vars
| Stata | 2 | BlameJohnny/redo | redo/version/_version.py.do | [
"Apache-2.0"
] |
BITS 32
section .text
global main
main:
push byte 0x61
pop eax
cdq
push edx
inc edx
push edx
inc edx
push edx
push dword 0x0100007f
int 0x80
xchg eax, ebp
push word 0xffff
push dx
mov esi, esp
push byte 0x10
push esi
push ebp
push byte 0x62
pop eax
cdq
push edx
int 0x80
mov [esi - 4], byte 0x0c
push byte 0x03
pop eax
int 0x80
push byte 0xff
mov dh, 0x10
mov dl, 0x12 ; 0x1012 (ANON | FIXED | PRIVATE)
push edx
push byte 0x07 ; READ | WRITE | EXEC
push dword [esi] ; size
push dword [esi + 4] ; addr
mov al, 71 ; old_mmap() (portable?!)
push ebp
int 0x80
push byte 0x03
pop eax
push dword [esi + 8]
int 0x80
ret
| Assembly | 3 | OsmanDere/metasploit-framework | external/source/shellcode/bsd/ia32/single_reverse_libinject.asm | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
@namespace \6es 'path'; | CSS | 0 | mengxy/swc | crates/swc_css_parser/tests/fixture/esbuild/misc/IX2tz8hkGmrHq2cazP46_A/input.css | [
"Apache-2.0"
] |
## Description
This module attempts to gain root privileges by exploiting
a vulnerability in ktsuss versions 1.4 and prior.
The `ktsuss` executable is setuid `root` and does not drop
privileges prior to executing user specified commands,
resulting in command execution with `root` privileges.
## Vulnerable Application
This module has been tested successfully on:
* ktsuss 1.3 on SparkyLinux 6 (2019.08) (LXQT) (x64)
* ktsuss 1.3 on SparkyLinux 5.8 (LXQT) (x64)
## Verification Steps
1. Start `msfconsole`
2. Get a session
3. `use exploit/linux/local/ktsuss_suid_priv_esc`
4. `set SESSION [SESSION]`
5. `check`
6. `run`
7. You should get a new *root* session
## Options
**KTSUSS_PATH**
Path to `ktsuss` executable (default: `/usr/bin/ktsuss`)
**WritableDir**
A writable directory file system path. (default: `/tmp`)
## Scenarios
### ktsuss 1.3 on SparkyLinux 5.8 (LXQT) (x64)
```
msf5 > use exploit/linux/local/ktsuss_suid_priv_esc
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set session 1
session => 1
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set verbose true
verbose => true
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > check
[+] /usr/bin/ktsuss is setuid
[*] uid=1001(test) gid=1001(test) euid=0(root) groups=1001(test)
[+] The target is vulnerable.
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set payload linux/x64/meterpreter/reverse_tcp
payload => linux/x64/meterpreter/reverse_tcp
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set lhost 172.16.191.165
lhost => 172.16.191.165
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > run
[*] Started reverse TCP handler on 172.16.191.165:4444
[+] /usr/bin/ktsuss is setuid
[*] uid=1001(test) gid=1001(test) euid=0(root) groups=1001(test)
[*] Writing '/tmp/.lBanpIYpAJ60cwt' (389 bytes) ...
[*] Executing payload ...
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3021284 bytes) to 172.16.191.137
[*] Meterpreter session 2 opened (172.16.191.165:4444 -> 172.16.191.137:53060) at 2019-08-19 09:18:29 -0400
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > sysinfo
Computer : 172.16.191.137
OS : Sparky 5.8 (Linux 4.19.0-5-amd64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter >
```
### ktsuss 1.3 on SparkyLinux 6 (2019.08) (LXQT) (x64)
```
msf5 > use exploit/linux/local/ktsuss_suid_priv_esc
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set session 1
session => 1
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set verbose true
verbose => true
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > check
[+] /usr/bin/ktsuss is setuid
[*] uid=1001(test) gid=1002(test) euid=0(root) groups=1002(test)
[+] The target is vulnerable.
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set payload linux/x64/meterpreter/reverse_tcp
payload => linux/x64/meterpreter/reverse_tcp
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > set lhost 172.16.191.165
lhost => 172.16.191.165
msf5 exploit(linux/local/ktsuss_suid_priv_esc) > run
[*] Started reverse TCP handler on 172.16.191.165:4444
[+] /usr/bin/ktsuss is setuid
[*] uid=1001(test) gid=1002(test) euid=0(root) groups=1002(test)
[*] Writing '/tmp/.R0aTPpB8aHk' (389 bytes) ...
[*] Executing payload ...
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3021284 bytes) to 172.16.191.167
[*] Meterpreter session 2 opened (172.16.191.165:4444 -> 172.16.191.167:44534) at 2019-08-19 09:25:48 -0400
meterpreter > getuid
Server username: uid=0, gid=0, euid=0, egid=0
meterpreter > sysinfo
Computer : 172.16.191.167
OS : Sparky 6 (Linux 4.19.0-5-amd64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter >
```
| Markdown | 1 | OsmanDere/metasploit-framework | documentation/modules/exploit/linux/local/ktsuss_suid_priv_esc.md | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
if(NOT VTK_FOUND)
find_package(VTK QUIET NAMES vtk VTK)
if(VTK_FOUND)
if(NOT (VTK_VERSION VERSION_LESS "9.0.0") AND (VTK_VERSION VERSION_LESS "10.0.0")) # VTK 9.x
find_package(VTK 9 QUIET NAMES vtk COMPONENTS
FiltersExtraction
FiltersSources
FiltersTexture
IOExport
IOGeometry
IOPLY
InteractionStyle
RenderingCore
RenderingLOD
RenderingOpenGL2
NO_MODULE)
elseif(VTK_VERSION VERSION_GREATER "5") # VTK 6.x components
find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
IF(VTK_FOUND)
IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
ELSE(VTK_RENDERING_BACKEND)
find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
ENDIF(VTK_RENDERING_BACKEND)
ENDIF(VTK_FOUND)
elseif(VTK_VERSION VERSION_EQUAL "5") # VTK 5.x components
find_package(VTK QUIET COMPONENTS vtkCommon NO_MODULE)
else()
set(VTK_FOUND FALSE)
endif()
endif()
endif()
if(NOT VTK_FOUND)
set(HAVE_VTK OFF)
message(STATUS "VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file")
return()
endif()
# Don't support earlier VTKs
if(VTK_VERSION VERSION_LESS "5.8.0")
message(STATUS "VTK support is disabled. VTK ver. 5.8.0 is minimum required, but found VTK ver. ${VTK_VERSION}")
return()
endif()
# Different Qt versions can't be linked together
if((HAVE_QT AND VTK_USE_QT)
AND NOT DEFINED FORCE_VTK # deprecated
AND NOT DEFINED OPENCV_FORCE_VTK
)
message(STATUS "VTK support is disabled. Possible incompatible combination: OpenCV+Qt, and VTK ver.${VTK_VERSION} with Qt")
message(STATUS "If it is known that VTK was compiled without Qt4, please define '-DOPENCV_FORCE_VTK=TRUE' flag in CMake")
return()
endif()
try_compile(VTK_COMPILE_STATUS
"${OpenCV_BINARY_DIR}"
"${OpenCV_SOURCE_DIR}/cmake/checks/vtk_test.cpp"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${VTK_INCLUDE_DIRS}"
LINK_LIBRARIES ${VTK_LIBRARIES}
OUTPUT_VARIABLE OUTPUT
)
if(NOT ${VTK_COMPILE_STATUS})
message(STATUS "VTK support is disabled. Compilation of the sample code has failed.")
return()
endif()
set(HAVE_VTK ON)
if (VTK_VERSION VERSION_LESS "8.90.0")
message(STATUS "Found VTK ${VTK_VERSION} (${VTK_USE_FILE})")
else()
message(STATUS "Found VTK ${VTK_VERSION}")
endif()
| CMake | 4 | xipingyan/opencv | cmake/OpenCVDetectVTK.cmake | [
"Apache-2.0"
] |
Print("Hello World"); | Tea | 0 | venusing1998/hello-world | r/richtea.tea | [
"MIT"
] |
.class LML;
.super Ljava/lang/Object;
.source "ML.java"
# direct methods
.method constructor <init>()V
.registers 1
.prologue
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method a()Ljava/lang/Object;
.registers 4
.prologue
.line 3
const/4 v0, 0x4
const/4 v1, 0x5
const/4 v2, 0x6
filled-new-array {v0, v1, v2}, [I
move-result-object v0
const-class v1, Ljava/lang/String;
invoke-static {v1, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;
move-result-object v0
check-cast v0, [[[Ljava/lang/String;
return-object v0
.end method
| Smali | 3 | Mrack/dex2jar | dex-translator/src/test/resources/smalis/ML.smali | [
"Apache-2.0"
] |
// MIT License
// Copyright (c) 2019-2021 bloc97
// All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x3
//!HOOK MAIN
//!BIND MAIN
//!SAVE conv2d_tf
//!WIDTH MAIN.w
//!HEIGHT MAIN.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
vec4 hook() {
vec4 result = mat4(0.1690102, -0.2560719, 0.39658326, -0.3679659, -0.27616683, -0.35619372, -0.3748396, 0.08430813, -0.29574734, -0.31511316, -0.09773105, 0.13616018, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
result += mat4(-0.1326393, -0.259433, 0.025070239, 0.58914864, -0.036478516, 0.30723435, 0.007458902, 0.012962684, 0.2493056, 0.13007334, -0.08448256, -0.38414413, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
result += mat4(-0.11539356, 0.35253766, 0.26143202, 0.2760807, -0.09371543, -0.028165473, -0.028452158, -0.27050856, 0.06718067, -0.0056619495, -0.17654495, 0.17288211, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
result += mat4(-0.16145481, -0.3204927, -0.54317135, 0.11830119, 0.49315026, 0.12008072, 0.50857407, -0.30382085, 0.25807253, 0.020755528, 0.29388228, 0.106109895, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
result += mat4(-0.22728722, 0.50484747, -0.07904469, 0.33114597, 0.50306976, -0.22760947, 0.14773269, 0.17628263, 0.14788547, -0.08223464, -0.10880935, -0.3151985, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
result += mat4(0.3414351, 0.057279214, -0.14419858, 0.09761111, -0.11794496, 0.021717256, -0.22750235, 0.13986664, -0.38932344, 0.28996095, 0.3773904, 0.13175532, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
result += mat4(0.1376552, -0.19587159, -0.35147396, -0.097646296, 0.1686707, -0.14385861, 0.031198, 0.12383533, -0.23089902, 0.08707301, 0.3362293, -0.100579016, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
result += mat4(-0.056774966, 0.047585852, -0.36395878, -0.20211312, 0.4077735, 0.12631284, 0.39813092, -0.033365678, 0.2307249, -0.09131807, 0.20823865, 0.31084216, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
result += mat4(-0.12456089, 0.09755632, 0.31490886, -0.06579996, -0.13386595, 0.07564795, -0.26605195, -0.075180635, -0.11182657, 0.06757017, -0.14351276, -0.16828312, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
result += vec4(-0.046043985, 0.055581126, -0.08791638, -0.13022089);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x3
//!HOOK MAIN
//!BIND MAIN
//!SAVE conv2d_tf1
//!WIDTH MAIN.w
//!HEIGHT MAIN.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
vec4 hook() {
vec4 result = mat4(-0.15485518, -0.29363206, -0.22610365, -0.14291525, -0.45240572, -0.18319772, -0.12209436, 0.15031648, 0.09878383, 0.06711082, 0.25763842, -0.084633484, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
result += mat4(-0.10204406, 0.16167697, 0.22371867, -0.37947702, -0.24476196, -0.038824454, 0.060157117, 0.15764871, -0.08072927, -0.2210841, -0.31835055, 0.009979876, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
result += mat4(0.20506924, 0.21132155, -0.0922578, -0.07430473, 0.14529926, 0.20549752, 0.0077948375, 0.13246094, -0.32353187, 0.21074104, 0.092629515, 0.17590871, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
result += mat4(0.04125819, -0.44050243, 0.23729716, 0.3218237, 0.12943116, -0.011674174, 0.10390632, 0.027775545, -0.20308031, -0.16904089, -0.2121676, -0.022515794, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
result += mat4(0.09664124, 0.20127031, 0.60345304, 0.16697013, 0.23093723, -0.38116834, 0.109695725, 0.0007595324, 0.4092646, 0.009624758, 0.11229678, 0.25326383, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
result += mat4(0.014879592, 0.19204311, 0.07102085, -0.7312604, 0.34860876, 0.3429918, -0.027331594, 0.27636307, 0.1342437, 0.107820466, -0.12645108, 0.21081445, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
result += mat4(-0.12687613, -0.09247973, -0.25973785, 0.4350873, -0.18987224, 0.028678741, -0.0903819, -0.63974863, 0.205591, 0.11308998, 0.18458389, -0.4149041, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
result += mat4(0.34691808, -0.025498383, 0.3428986, 0.21663484, 0.23404741, -0.1725327, -0.0036315925, -0.13299675, -0.1873967, 0.031331502, -0.08785591, -0.0013278709, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
result += mat4(-0.35846514, 0.048703704, -0.104165934, 0.16529736, -0.15378916, 0.26030356, -0.07134151, 0.03692383, -0.15807101, -0.18885155, 0.044707954, -0.11444462, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
result += vec4(-0.0022791293, -0.024132347, -0.57621074, 0.028573977);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_tf
//!BIND conv2d_tf1
//!SAVE conv2d_1_tf
//!WIDTH conv2d_tf.w
//!HEIGHT conv2d_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(0.010346764, 0.07230188, -0.24734616, -0.09937907, 0.02228549, -0.19550583, -0.019540425, -0.1037373, 0.033996485, -0.075554, -0.20228972, 0.07090153, -0.09194035, -0.058972966, 0.1768268, 0.27517542) * go_0(-1.0, -1.0);
result += mat4(0.020078976, 0.12433655, -0.1620775, 0.036401592, 0.079748705, 0.11660013, 0.17917652, -0.017513236, -0.18936846, 0.24478136, -0.45726213, -0.045004416, -0.08295188, 0.067733586, -0.080548316, 0.2744211) * go_0(-1.0, 0.0);
result += mat4(0.024916803, 0.27562472, 0.043771956, -0.012240604, 0.0786355, 0.042651594, 0.16049327, -0.14577515, -0.032735053, 0.17658092, 0.16382934, -0.02337374, 0.11551492, 0.056343183, -0.17930213, 0.14259394) * go_0(-1.0, 1.0);
result += mat4(0.20010485, 0.06747722, -0.19026905, 0.11013709, 0.13062745, -0.044626113, -0.0062261797, 0.2189639, 0.1403497, -0.022713251, -0.19452858, -0.010305412, -0.06407589, 0.09836748, 0.025805516, 0.23430973) * go_0(0.0, -1.0);
result += mat4(-0.14664203, 0.034910418, 0.024714258, -0.066872925, -0.15717538, -0.14179383, -0.14091893, 0.05859166, 0.18919097, -0.18544437, -0.09068573, -0.08615929, -0.051434122, 0.2170678, 0.18409058, -0.17461225) * go_0(0.0, 0.0);
result += mat4(-0.11354446, 0.10745854, 0.2682663, 0.05949201, -0.10695986, 0.1407851, -0.03551388, 0.10691649, -0.17148238, -0.38287184, 0.2074456, 0.11828914, 0.048535194, 0.1464864, -0.18169662, -0.14074169) * go_0(0.0, 1.0);
result += mat4(0.22160622, -0.1513045, -0.053284165, 0.033202525, 0.15574448, -0.043640967, -0.0093824165, -0.0019965349, -0.097964935, -0.08289824, 0.08239996, 0.07868361, 0.05731752, -0.20441617, -0.013016076, -0.253108) * go_0(1.0, -1.0);
result += mat4(-0.031249097, -0.2272863, 0.23573665, 0.03357689, 0.011395065, -0.10885564, -0.06287508, -0.031719524, 0.10331069, 0.17560169, 0.18303394, 0.022961004, -0.17011635, -0.24371737, 0.10678694, -0.3222825) * go_0(1.0, 0.0);
result += mat4(-0.1275465, -0.08844758, 0.10994917, -0.00910273, 0.09393154, 0.03894992, 0.14367905, -0.11811715, -0.09077633, -0.015776094, 0.27427456, -0.13283503, 0.18724327, -0.08139094, 0.04933602, -0.051852766) * go_0(1.0, 1.0);
result += mat4(-0.06764611, -0.27426586, 0.12045272, 0.09410856, -0.14258035, 0.11802992, -0.09093882, 0.0022018093, 0.4590643, 0.046258576, -0.07827223, 0.448011, -0.103631735, -0.016930219, -0.15421398, 0.11045997) * go_1(-1.0, -1.0);
result += mat4(-0.17295076, 0.00151352, 0.14938255, 0.08336512, -0.07496541, -0.07561223, -0.0846474, 0.14979269, -0.09142163, 0.23925088, -0.015199518, -0.37749895, -0.20636298, -0.022585187, -0.20371509, 0.0745308) * go_1(-1.0, 0.0);
result += mat4(0.06458832, -0.009722021, -0.123604394, 0.06548835, -0.3039139, -0.022024399, 0.05297587, -0.0626883, 0.23556642, 0.1516464, -0.07004877, -0.1845364, -0.05918428, 0.19158973, -0.14983447, 0.030489758) * go_1(-1.0, 1.0);
result += mat4(0.36604697, 0.17516142, -0.10853731, -0.22694224, -0.107650936, 0.23013335, 0.094055794, -0.17047717, -0.3006048, -0.08621717, -0.18815655, -0.03570218, 0.09676118, -0.017718751, 0.059138596, 0.073388465) * go_1(0.0, -1.0);
result += mat4(-0.12791575, 0.101956226, 0.13091874, -0.046373338, 0.04955811, -0.04030444, 0.13869923, -0.046699073, -0.42611042, -0.7173929, 0.052184317, 0.6178025, -0.02929954, -0.07638965, -0.15000828, 0.030710017) * go_1(0.0, 0.0);
result += mat4(0.057806686, 0.20842272, -0.20148766, 0.006666912, 0.13356528, -0.45265228, -0.07354092, 0.21447696, 0.019552143, -0.13645506, 0.14643854, -0.0071413796, -0.15487236, -0.002250615, 0.30622452, 0.0033902125) * go_1(0.0, 1.0);
result += mat4(0.06896002, 0.24397352, -0.06479052, 0.20676947, -0.24259068, 0.055320013, -0.09032122, -0.11222854, -0.08982342, -0.114818625, -0.06399291, -0.3024516, -0.06302166, -0.1925528, 0.03458982, 0.028828239) * go_1(1.0, -1.0);
result += mat4(0.09764086, 0.09599894, -0.0073313303, 0.14418933, -0.045712367, 0.12657364, 0.04620374, -0.069778584, 0.30047333, -0.012418192, 0.15516461, -0.18087754, 0.08178273, 0.14262857, -0.01741533, -0.12509112) * go_1(1.0, 0.0);
result += mat4(0.04697884, -0.1506804, 0.031823065, 0.13397239, -0.18396698, 0.10681781, -0.29586303, -0.0039136545, 0.17560847, -0.12486726, -0.018646788, -0.20688744, -0.030614454, -0.0527634, 0.23593572, -0.10542146) * go_1(1.0, 1.0);
result += mat4(-0.19182229, -0.32615846, 0.26283535, -0.1371942, -0.071202695, 0.12056063, -0.11450658, -0.27711076, -0.42096004, 0.0014352369, 0.1559669, -0.14464542, -0.17973948, 0.079166576, -0.12501791, -0.20623216) * go_2(-1.0, -1.0);
result += mat4(0.12469872, 0.32190827, -0.059510354, 0.1393449, -0.12845798, -0.019571869, -0.22630808, -0.14031963, 0.36072046, 0.05858427, 0.19278921, 0.121090546, -0.067538865, -0.018770566, 0.14318037, -0.15561756) * go_2(-1.0, 0.0);
result += mat4(0.024663208, 0.21110268, -0.016415706, 0.060093414, -0.03739678, -0.107412934, -0.077527136, 0.30331334, 0.17196326, -0.15512557, -0.09499732, -0.15748607, -0.16680105, -0.015185634, 0.16114107, -0.21288376) * go_2(-1.0, 1.0);
result += mat4(-0.17739037, -0.1190967, 0.13191372, -0.2527187, -0.14992718, -0.30511454, 0.19145966, 0.002194003, -0.12888977, 0.19152176, 0.27528167, 0.099714965, 0.12865707, -0.12051514, -0.055013947, 0.26231763) * go_2(0.0, -1.0);
result += mat4(0.46433613, -0.11708138, -0.20157282, 0.32022122, 0.079468675, 0.029407484, 0.2559102, -0.15651533, 0.08644574, -0.09747344, -0.07528584, 0.17354868, 0.19167562, -0.17698488, -0.09896657, 0.17093097) * go_2(0.0, 0.0);
result += mat4(0.20283653, -0.33680332, 0.2282385, 0.18832158, 0.20866042, 0.00076752366, 0.16471444, -0.21548858, 0.16193539, 0.17141372, 0.03140222, 0.03913644, -0.030161971, 0.00014570929, 0.08993654, -0.064823024) * go_2(0.0, 1.0);
result += mat4(-0.3075755, 0.19942546, 0.015526995, -0.120868504, -0.254515, -0.07791228, 0.03271691, 0.11794217, 0.11258601, 0.045204375, -0.061196107, -0.115958795, 0.3861869, 0.048215542, 0.07016682, -0.009975758) * go_2(1.0, -1.0);
result += mat4(-0.07623697, 0.16094944, -0.02283455, 0.14112763, -0.051149167, 0.20429814, 0.011314802, 0.18914083, -0.24240434, -0.08784008, -0.16763984, -0.08492233, 0.31062725, -0.11925119, -0.33195966, 0.2060798) * go_2(1.0, 0.0);
result += mat4(-0.016709225, -0.14472668, -0.3677625, -0.09832719, 0.030297454, -0.05775362, -0.1401375, 0.08119674, -0.01795042, 0.05183797, -0.24320887, 0.066842034, -0.22245285, -0.02740993, 0.06316751, 0.053399116) * go_2(1.0, 1.0);
result += mat4(-0.039214406, -0.08876633, 0.045552462, 0.19226661, 0.1355001, -0.13942362, 0.17398876, 0.2914014, -0.191809, 0.037143208, 0.013333581, -0.16632195, 0.113767646, -0.106692605, 0.1589787, 0.030107044) * go_3(-1.0, -1.0);
result += mat4(0.21997562, 0.13855208, -0.05783191, -0.033682413, -0.010961168, 0.10524961, 0.02177416, 0.18289444, 0.043692037, 0.07853899, -0.039936125, -0.1004449, 0.04494073, -0.020680292, 0.17578089, -0.106598996) * go_3(-1.0, 0.0);
result += mat4(0.026852835, -0.16037546, 0.11278316, 0.12656097, -0.006857894, -0.03400118, -0.051564034, 0.00085412664, -0.37556714, -0.05279987, 0.029383834, -0.14246808, -0.056380164, -0.002399925, 0.16025752, 0.036324855) * go_3(-1.0, 1.0);
result += mat4(0.022709966, 0.046350412, 0.03390721, 0.02810572, -0.14394265, 0.04215361, -0.3206118, 0.15034916, -0.0028448137, 0.1682989, -0.042686664, 0.020543462, -0.2786501, -0.007482015, -0.040313292, -0.20745736) * go_3(0.0, -1.0);
result += mat4(0.05417556, 0.18728684, -0.046121832, -0.27939513, 0.05907976, -0.09191223, -0.16625418, -0.26038164, 0.39956605, -0.052594025, -0.0596556, 0.29517552, -0.015181923, -0.0763375, 0.25131205, 0.13038464) * go_3(0.0, 0.0);
result += mat4(-0.036903054, -0.0066989153, -0.062650286, 0.05614359, -0.0064960583, 0.028512698, -0.10906273, -0.010047654, 0.23030473, 0.049983572, 0.10439064, 0.26643834, 0.05041243, 0.09185424, -0.32352915, 0.11295159) * go_3(0.0, 1.0);
result += mat4(0.09724027, -0.34962535, 0.06586686, 0.016635379, 0.13831381, 0.01707076, -0.04690347, 0.022350075, 0.018352794, 0.022000022, 0.070613205, 0.117735535, -0.025971051, 0.18832101, -0.09643588, -0.08512127) * go_3(1.0, -1.0);
result += mat4(-0.17324433, 0.06810613, -0.057295907, -0.05115964, -0.101570815, 0.12491774, 0.08762367, -0.005862404, -0.05342927, -0.031942457, -0.039624047, -0.04298937, -0.1303138, -0.11869282, -0.024832053, 0.070463404) * go_3(1.0, 0.0);
result += mat4(-0.010514842, 0.1376259, -0.11750346, -0.03786737, 0.03459249, 0.015408171, -0.031430878, -0.060825355, -0.072958425, -0.0037895301, 0.041686177, -0.12352204, -0.06261361, 0.054514423, -0.34072715, 0.13860728) * go_3(1.0, 1.0);
result += vec4(0.018166734, -0.11002478, -0.05554318, -0.0988193);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_tf
//!BIND conv2d_tf1
//!SAVE conv2d_1_tf1
//!WIDTH conv2d_tf.w
//!HEIGHT conv2d_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.040142782, 0.0288423, 0.07569487, -0.01490842, 0.14402796, -0.13682005, 0.027765118, 0.03907358, 0.07117706, 0.058157545, -0.23862502, -0.057674367, -0.19220531, 0.0147159435, -0.18028538, 0.0963821) * go_0(-1.0, -1.0);
result += mat4(-0.1676744, -0.11937339, 0.12137117, 0.07119485, 0.14148116, -0.043578617, -0.029261118, -0.0016938087, -0.057269357, -0.080076694, 0.12193026, 0.07326153, -0.056278303, -0.01630716, -0.03792076, 0.1483611) * go_0(-1.0, 0.0);
result += mat4(-0.3021578, 0.011601693, 0.11266048, 0.19086999, -0.0122412145, 0.08431291, 0.11615175, -0.008039614, -0.39987534, 0.07820729, 0.03509667, 0.1963505, -0.08839513, -0.21571854, 0.059425723, -0.06830175) * go_0(-1.0, 1.0);
result += mat4(0.23135209, -0.12452708, 0.0943565, 0.0028859286, -0.09836373, 0.10681712, -0.3535964, 0.08457615, 0.045332734, 0.16579892, -0.03809797, -0.021596594, 0.2937497, -0.028294371, 0.046484597, -0.037604347) * go_0(0.0, -1.0);
result += mat4(0.072675414, -0.16431206, 0.28952035, 0.0076831076, -0.020242939, 0.029483542, -0.092415355, 0.08673106, 0.12109694, 0.14307201, 0.23134442, 0.11731775, 0.09981601, -0.16968462, 0.037470713, 0.14948717) * go_0(0.0, 0.0);
result += mat4(0.0029752052, 0.06526503, 0.1866458, 0.07451277, -0.31836876, 0.17115082, -0.13969697, 0.23844297, -0.03244903, -0.08832665, 0.023691226, -0.18230624, -0.074933805, -0.00044301842, 0.050572682, 0.081511915) * go_0(0.0, 1.0);
result += mat4(0.039502528, 0.051221415, -0.13968123, -0.091212444, -0.016925618, 0.15409444, -0.017455677, -0.11653652, 0.03539446, -0.00087720866, -0.12839639, 0.037198763, 0.03674469, -0.26444665, 0.019721227, -0.13013805) * go_0(1.0, -1.0);
result += mat4(0.039229527, 0.25667152, 0.0032586441, -0.00718359, 0.1617932, 0.10409968, 0.07182867, -0.09810605, 0.07789241, -0.02014911, 0.025767172, -0.14604759, 0.07175764, 0.32513744, -0.20473222, -0.16266066) * go_0(1.0, 0.0);
result += mat4(0.13418433, 0.061813723, -0.13927278, -0.2498272, 0.03468218, 0.29483125, 0.063289374, -0.04726235, 0.1898295, -0.33132064, 0.032045014, 0.02159535, -0.1148363, 0.31306976, 0.06456038, 0.048988886) * go_0(1.0, 1.0);
result += mat4(0.07151646, 0.2799246, -0.107190795, -0.16431166, -0.28007045, 0.07206954, 0.06775463, 0.009758042, 0.07032184, -0.20843789, 0.087045245, 0.1360676, -0.25718534, 0.028249472, -0.12614648, 0.009949602) * go_1(-1.0, -1.0);
result += mat4(0.020241471, -0.23390484, -0.0083223935, 0.08344701, 0.08222297, 0.12026539, -0.08652223, -0.08228822, -0.039576706, -0.24677879, -0.1157289, 0.2590508, -0.23809408, 0.19911982, -0.116798095, -0.035870325) * go_1(-1.0, 0.0);
result += mat4(0.024991842, 0.050509237, -0.024134455, -0.12659028, 0.24089767, 0.122712664, -0.10482493, -0.19403952, -0.19177693, -0.06538376, -0.041478425, 0.32176673, -0.1534002, -0.18680622, 0.06763643, 0.020806564) * go_1(-1.0, 1.0);
result += mat4(0.03437814, -0.28067374, 0.2830681, 0.038812317, -0.021698112, -0.120865285, 0.22695538, -0.045419116, -0.030475847, -0.01977341, -0.1265364, -0.3109814, 0.012255813, 0.053917278, -0.018620957, -0.14599285) * go_1(0.0, -1.0);
result += mat4(-0.016204128, -0.04093018, 0.054571863, 0.02679643, 0.01756274, -0.057685968, 0.16148666, 0.17370272, -0.11065411, 0.06378157, -0.09331551, 0.22985275, 0.057905316, 0.12323568, 0.07748665, 0.09878629) * go_1(0.0, 0.0);
result += mat4(-0.018112244, 0.063234635, -0.013184602, 0.16241394, 0.08877139, 0.02145378, -0.02490027, -0.038920373, 0.13127136, 0.14391647, 0.020553736, 0.14401346, 0.06685973, -0.25398204, 0.10369067, -0.055949755) * go_1(0.0, 1.0);
result += mat4(0.07710333, 0.047412727, 0.13813803, 0.18624061, 0.16907091, -0.039532468, 0.06234584, 0.06408178, -0.054543987, -0.045220226, -0.11093376, -0.37399602, 0.20372874, 0.004580967, -0.07742308, 0.017989937) * go_1(1.0, -1.0);
result += mat4(0.003485311, -0.08897399, -0.013108594, -0.19473282, -0.27081844, -0.16812073, 0.0052992934, -0.055331517, 0.09446357, 0.019280333, 0.16560757, -0.3230032, 0.043096773, 0.059222896, -0.064184934, -0.059852477) * go_1(1.0, 0.0);
result += mat4(0.06794279, -0.034135245, 0.083064295, 0.13506731, 0.13064219, -0.44978833, -0.03513717, 0.08999715, 0.1124541, 0.42208397, -0.0038724816, -0.014332087, -0.13751853, -0.04929869, 0.09134992, -0.17687531) * go_1(1.0, 1.0);
result += mat4(0.100909084, -0.0131197255, 0.082274795, -0.2138443, -0.08515947, -0.021058358, 0.10951775, -0.06349191, -0.29129833, -0.029262653, 0.25235432, -0.11748315, 0.121980384, 0.062347785, 0.10916932, -0.15993518) * go_2(-1.0, -1.0);
result += mat4(0.28893283, -0.05677308, -0.2641288, -0.058937225, -0.16187571, 0.006647366, -0.063294955, 0.04766719, 0.60601914, -0.07831864, -0.15710756, -0.011491797, 0.15587467, -0.08105375, 0.07847514, -0.2803333) * go_2(-1.0, 0.0);
result += mat4(-0.077989794, -0.09871811, -0.3516344, 0.15292728, 0.010889273, 0.0011189661, -0.16118282, -0.018821161, -0.039708678, -0.00060983415, -0.06367813, 0.009148068, 0.03919827, 0.18782744, 0.028040757, -0.10230145) * go_2(-1.0, 1.0);
result += mat4(-0.4079609, 0.18640275, -0.12475227, 0.13891742, 0.25121725, 0.16942379, 0.14409852, 0.087600805, 0.045335658, -0.12683709, -0.0077387216, 0.06563413, -0.19857128, 0.106910795, -0.048285246, 0.10768945) * go_2(0.0, -1.0);
result += mat4(0.5989075, 0.20941062, -0.20086494, 0.13344856, 0.073034994, 0.22358665, 0.101664364, -0.13463663, 0.18816395, -0.061176624, -0.14712185, 0.027320342, -0.09529667, 0.031148786, -0.28744993, 0.18698911) * go_2(0.0, 0.0);
result += mat4(0.14799193, 0.39471942, -0.23340325, -0.4031061, 0.18926248, -0.11091216, 0.118981816, -0.09155061, 0.17049436, 0.19803695, -0.1513267, 0.023817873, 0.0090933135, -0.04134864, 0.060486555, 0.03536634) * go_2(0.0, 1.0);
result += mat4(-0.39094314, 0.01779997, 0.12710269, 0.0067333193, -0.31255835, -0.08206612, -0.048528638, 0.369439, -0.19351655, -0.03420455, 0.15831526, -0.052294146, -0.08481741, 0.0787108, 0.1312136, -0.108919285) * go_2(1.0, -1.0);
result += mat4(-0.16068119, -0.42190582, 0.19383872, -0.018445708, 0.09803051, -0.020769652, -0.022599563, -0.052448895, -0.20645833, -0.031432863, 0.0025441595, 0.03410379, -0.20268854, 0.04481527, 0.05191063, 0.42317194) * go_2(1.0, 0.0);
result += mat4(-0.12786235, -0.23936178, 0.116561726, 0.30756372, -0.09420156, -0.044529166, -0.03585749, 0.1829332, -0.23939075, 0.24030831, 0.019878127, -0.015069802, 0.24300557, -0.22558568, -0.104956664, -0.09393648) * go_2(1.0, 1.0);
result += mat4(-0.04607054, 0.012677649, -0.027597688, 0.1618836, 0.29210827, 0.014221155, -0.13591036, -0.06895336, -0.09559534, 0.07956421, -0.11112994, -0.13325493, 0.24562472, 0.11046177, 0.057847694, 0.0016315983) * go_3(-1.0, -1.0);
result += mat4(-0.03365951, 0.027391057, 0.09653403, -0.14718771, -0.049631152, -0.06467214, -0.058545876, 0.1424002, -0.06320376, 0.181183, 0.10249362, -0.16052136, 0.3013475, -0.04156266, 0.08862033, 0.06888033) * go_3(-1.0, 0.0);
result += mat4(0.10045977, -0.004198456, -0.025856055, 0.05739418, -0.1328637, -0.025975171, 0.06553717, 0.11301186, 0.0704087, -0.083569765, 0.16066101, -0.24453588, 0.25370175, 0.037184533, 0.062386766, -0.20025635) * go_3(-1.0, 1.0);
result += mat4(-0.017958941, 0.06417776, -0.1525265, 0.12451173, 0.14567685, -0.0049682115, -0.23973411, -0.0783304, -0.010629432, 0.08055161, 0.2028341, 0.17640644, -0.20445108, -0.055524793, -0.019326134, 0.081288636) * go_3(0.0, -1.0);
result += mat4(0.007882519, -0.03722546, 0.053249408, 0.00071846246, -0.07053029, -0.21583866, 0.1415364, -0.19486657, 0.20685542, 0.17660026, -0.32156837, 0.1746825, -0.14957622, -0.09224378, -0.098153435, -0.13054638) * go_3(0.0, 0.0);
result += mat4(0.10051427, -0.17398237, 0.09842799, -0.14187703, 0.116901085, -0.1229543, -0.0007776771, -0.20410055, -0.11373484, -0.111150615, -0.1974002, -0.11641459, 0.024105398, 0.24985977, 0.015871854, -0.10724633) * go_3(0.0, 1.0);
result += mat4(-0.18081793, 0.1209351, -0.12867971, -0.019415248, 0.062617876, -0.037130393, -0.07803658, -0.22862352, 0.2586428, -0.030090366, -0.11894069, 0.18087515, -0.40921417, 0.070013195, 0.030540073, 0.035120826) * go_3(1.0, -1.0);
result += mat4(-0.13185939, 0.12992652, 0.08125049, 0.075331174, 0.064219765, 0.056629725, -0.020012032, -0.0855444, -0.044063166, -0.05396545, -0.028002812, 0.21837157, -0.15206428, -0.12681007, 0.14895032, 0.12339962) * go_3(1.0, 0.0);
result += mat4(0.08066341, -0.14773634, -0.0212227, -0.014011867, -0.048505764, 0.075407125, -0.020620076, 0.0003291325, -0.21815202, -0.23136546, 0.10853532, -0.036058456, 0.10952532, -0.052677035, -0.13005799, 0.18398996) * go_3(1.0, 1.0);
result += vec4(0.022609137, -0.028548084, 0.024431901, 0.010504478);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_1_tf
//!BIND conv2d_1_tf1
//!SAVE conv2d_2_tf
//!WIDTH conv2d_1_tf.w
//!HEIGHT conv2d_1_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.069641694, 0.104958326, 0.14786446, 0.027633663, -0.004279524, -0.020451711, 0.0883571, -0.016224537, 0.13585235, 0.11078269, 0.20198658, -0.042161036, 0.020466218, 0.20994963, 0.20072585, -0.028024657) * go_0(-1.0, -1.0);
result += mat4(0.050872434, 0.12874635, 0.1298729, 0.115810685, 0.07087254, 0.09885682, 0.23018982, 0.19187538, 0.10953604, 0.0033836907, -0.13325337, 0.09830315, -0.06528767, 0.05096927, -0.016355392, -0.039334368) * go_0(-1.0, 0.0);
result += mat4(0.027010268, 0.018263958, 0.0360758, 0.016791478, 0.2815702, 0.15517488, 0.43415815, 0.044976447, -0.0070842914, -0.12546758, 0.16874593, 0.077622116, 0.02252915, 0.1769774, 0.07181055, -0.15128697) * go_0(-1.0, 1.0);
result += mat4(0.057129618, 0.118046716, 0.07237424, -0.07842637, -0.044214778, -0.12886304, 0.08603301, -0.10416606, -0.15852053, 0.3788151, 0.26181692, -0.09092249, 0.31635332, 0.064212754, 0.21923725, 0.07500004) * go_0(0.0, -1.0);
result += mat4(-0.16981383, 0.044409662, -0.3717617, -0.031610407, 0.03658662, -0.09459229, -0.09449437, -0.014000666, -0.19656453, 0.03934163, -0.16304104, -0.12761801, -0.06235523, 0.16438273, -0.036933117, -0.095564745) * go_0(0.0, 0.0);
result += mat4(0.09725091, 0.034022827, 0.17699842, 0.1079676, -0.13236652, 0.03718181, -0.06968635, -0.23288171, 0.10275666, 0.08464966, -0.37162134, -0.35782215, -0.11023659, 0.2519236, -0.035197742, -0.019324787) * go_0(0.0, 1.0);
result += mat4(-0.09968464, 0.01102193, 0.0073735216, 0.011999313, -0.004998707, 0.09518938, 0.045727003, -0.21544908, 0.006879454, -0.06398254, -0.12584935, -0.06759933, -0.0820037, -0.07775104, 0.021957919, -0.122708224) * go_0(1.0, -1.0);
result += mat4(-0.08869767, 0.031296413, -0.0034280645, 0.13778855, 0.10073061, -0.08393937, -0.032959275, -0.0500518, 0.010908757, -0.09189417, -0.057760105, 0.17652664, -0.08729078, -0.09639096, -0.25654703, 0.055152636) * go_0(1.0, 0.0);
result += mat4(0.0027847723, -0.12885433, 0.038065907, 0.17450769, 0.0864409, 0.04592345, -0.015443841, 0.077010944, 0.08967368, 0.06800111, -0.23636387, 0.35023567, 0.03165923, 0.03132063, 0.17964344, 0.035610788) * go_0(1.0, 1.0);
result += mat4(-0.032017227, -0.0022808525, -0.08470573, 0.05332408, -0.14674746, 0.025374275, -0.018281924, 0.041163016, 0.00096549373, 0.014724006, 0.004913065, 0.18494442, 0.034953076, -0.15731992, -0.13792977, 0.08041999) * go_1(-1.0, -1.0);
result += mat4(0.08305006, 8.6318905e-05, -0.007895379, 0.02731387, -0.061324496, 0.050034665, 0.22662131, -0.013876427, -0.074468784, -0.008136604, -0.23337875, -0.1742574, 0.011753501, -0.11666686, -0.22541048, -0.14549944) * go_1(-1.0, 0.0);
result += mat4(-0.028333234, 0.121047184, 0.06720256, -0.058930036, 0.030258363, 0.07292774, 0.06455556, 0.0019076486, 0.0073987027, 0.17144889, 0.06084024, -0.08762086, -0.114422195, -0.16595861, -0.08706028, -0.10736261) * go_1(-1.0, 1.0);
result += mat4(-0.02519315, -0.14611271, 0.0388848, 0.19481422, -0.05970354, -0.08391417, 0.18982239, -0.10447052, 0.15587378, -0.023997072, 0.0781739, 0.2182389, -0.023886079, -0.1422596, -0.13352804, 0.005008043) * go_1(0.0, -1.0);
result += mat4(0.08842712, -0.100292705, 0.18925671, 0.12198875, 0.061771665, -0.04473232, 0.025053164, 0.039047796, -0.1672479, -0.08934517, 0.33099812, -0.20269585, -0.21640155, -0.22029749, 0.16539703, -0.2442679) * go_1(0.0, 0.0);
result += mat4(-0.16332205, -0.101898365, 0.02919932, -0.11900455, 0.14442924, 0.0916815, 0.037550304, 0.024123482, 0.02042624, 0.033472955, -0.059437107, -0.18735693, -0.013749093, -0.06199881, -0.08685079, 0.04252364) * go_1(0.0, 1.0);
result += mat4(-0.09047013, -0.055188328, -0.09106191, -0.048969727, 0.05114009, -0.12753403, 0.07116141, 0.060749624, -0.074034564, -0.21952136, -0.09479503, 0.2753584, -0.014141759, -0.14883812, -0.0673838, -0.012279045) * go_1(1.0, -1.0);
result += mat4(0.013816464, -0.0747162, -0.19202435, -0.064403646, 0.34980014, 0.04375546, 0.20264609, 0.006684355, 0.11523799, 0.024674915, -0.08697566, -0.04662527, -0.12743855, -0.39463726, 0.0057380227, 0.01286557) * go_1(1.0, 0.0);
result += mat4(-0.08146522, 0.074080914, -0.16856177, -0.183158, 0.19228102, 0.12373886, 0.017574452, -0.01753772, 0.045071773, 0.07725093, 0.023422163, -0.011545186, 0.20751388, -0.10795588, 0.07606346, 0.10282933) * go_1(1.0, 1.0);
result += mat4(0.12512013, -0.102208994, -0.09125398, 0.12043188, -0.066011876, 0.08831903, -0.017038671, -0.005541508, -0.049607087, 0.08654939, -0.02037085, 0.26887566, 0.005012545, 0.01869507, -0.013064982, -0.010649147) * go_2(-1.0, -1.0);
result += mat4(0.006824864, -0.05071593, -0.20786697, -0.07327317, 0.011382597, 0.030494886, -0.04754353, -0.018284699, 0.01305972, -0.036589053, 0.26637617, 0.021887446, -0.026669119, -0.037982125, -0.063445956, -0.009104248) * go_2(-1.0, 0.0);
result += mat4(0.032602567, 0.07094331, 0.052653246, 0.08342047, -0.085082285, -0.14674088, -0.23073354, -0.07915851, 0.0017120204, 0.032407638, -0.039819505, 0.16942178, 0.023192152, -0.0353237, 0.10930186, 0.22939779) * go_2(-1.0, 1.0);
result += mat4(0.0010455973, -0.11821993, -0.12639599, 0.12250084, -0.12756817, 0.11478416, -0.1862587, 0.016819192, 0.02110181, -0.25492984, -0.1766048, 0.22188173, -0.21305011, 0.113442205, 0.04599144, -0.15840286) * go_2(0.0, -1.0);
result += mat4(-0.15086032, -0.17428935, 0.39080557, 0.07576757, 0.121703945, 0.17944208, -0.003140103, -0.11231332, 0.12102969, 0.15310267, 0.17578171, 0.40631834, -0.21299168, 0.024928993, 0.030104794, 0.020753227) * go_2(0.0, 0.0);
result += mat4(-0.098734386, -0.020072265, -0.14308836, -0.08490801, 0.017175158, 0.02250534, 0.04060829, 0.033022214, 0.0046218676, 0.17923212, 0.0112105915, 0.09574084, 0.14819936, -0.14692923, 0.12634254, 0.060762513) * go_2(0.0, 1.0);
result += mat4(0.030521613, -0.097913325, -0.016720278, 0.11273997, 0.013019863, -0.06557118, 0.0405774, 0.0915019, 0.022414956, -0.053254984, 0.18639986, 0.07820968, 0.06498986, 0.058922634, -0.02240318, -0.086019725) * go_2(1.0, -1.0);
result += mat4(0.2058775, 0.01502064, 0.05847032, 0.007249146, 0.086483665, 0.19420148, 0.03892261, -0.013546935, -0.07980237, 0.04347281, -0.10376214, -0.1366535, 0.05285337, 0.07213318, 0.3642818, -0.11331124) * go_2(1.0, 0.0);
result += mat4(-0.025740806, 0.14551482, -0.037410017, -0.17477523, -0.11853099, -0.060820814, -0.102599286, -0.13267937, -0.103053465, -0.014044828, -0.01888072, -0.06499249, 0.22311528, -0.051850274, -0.034120858, 0.044562567) * go_2(1.0, 1.0);
result += mat4(-0.21360217, 0.10093803, -0.0016407765, -0.1473997, 0.26524043, 0.02112132, 0.23173104, -0.013157391, 0.05945182, 0.044635538, 0.06031638, -0.21435826, -0.10147484, 0.069090195, 0.09641844, -0.09581093) * go_3(-1.0, -1.0);
result += mat4(-0.08576515, -0.122861005, 0.049567085, -0.085854456, 0.23809357, -0.024966082, -0.10294079, 0.046241313, 0.008621132, -0.08323767, 0.20277941, 0.163423, -0.07386535, -0.088738985, 0.05274358, -0.025479877) * go_3(-1.0, 0.0);
result += mat4(-0.041135542, -0.008365642, 0.17088248, 0.04025207, 0.13809255, -0.056895368, -0.01582834, 0.07361908, -0.00068995473, -0.09300962, 0.19117641, 0.24832036, -0.06572358, -0.026025, -0.019093119, -0.049720034) * go_3(-1.0, 1.0);
result += mat4(0.024900286, 0.11525501, 0.025882801, 0.037742402, 0.36976853, 0.052211333, -0.15143296, 0.1802276, -0.059080046, 0.017990451, 0.026395092, -0.12689115, -0.07705386, 0.1232379, 0.13273561, -0.12521964) * go_3(0.0, -1.0);
result += mat4(-0.19788785, 0.044887315, 0.07663442, 0.16688696, -0.2842248, -0.15684547, 0.028387763, 0.0063470444, -0.012245601, -0.038382255, -0.8187406, -0.25245667, 0.23014604, 0.22746666, 0.1594356, 0.16469443) * go_3(0.0, 0.0);
result += mat4(-0.12663333, 0.014730006, 0.03765697, 0.15704912, -0.106595434, -0.05317512, -0.081759915, -0.08797109, 0.064620756, -0.06341419, 0.16493447, 0.23102313, 0.068325415, -0.088058695, 0.16885915, 0.036382258) * go_3(0.0, 1.0);
result += mat4(0.035389822, -0.11811836, -0.035656307, -0.0680554, 0.1338908, 0.065852076, 0.023307983, 0.0675308, 0.09690683, 0.18170924, 0.09862692, -0.20964378, -0.08601271, -0.20016764, -0.01879598, -0.14629345) * go_3(1.0, -1.0);
result += mat4(-0.27183273, 0.013525998, -0.14995874, -0.23938845, -0.26218823, -0.0009874097, -0.13385512, -0.10664239, -0.048931994, 0.039898522, 0.047444753, 0.10934722, 0.10969629, 0.123539805, 0.11692802, 0.14172275) * go_3(1.0, 0.0);
result += mat4(-0.1656506, 0.019683002, 0.0221048, 0.12596753, 0.20420644, -0.07930122, 0.04653823, 0.11492255, -0.0050175437, -0.03271697, 0.013389486, 0.034583613, -0.2196601, -0.1615663, -0.013763388, -0.056037936) * go_3(1.0, 1.0);
result += vec4(-0.022956269, 0.029688787, -0.070148066, -0.07163476);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_1_tf
//!BIND conv2d_1_tf1
//!SAVE conv2d_2_tf1
//!WIDTH conv2d_1_tf.w
//!HEIGHT conv2d_1_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.15104648, 0.05522861, -0.0654341, -0.053517453, -0.08264124, -0.0062249107, -0.20364265, -0.05015117, -0.18837251, 0.030655831, 0.046844713, -0.20673253, -0.14042036, -0.05655449, 0.13994302, 0.011745607) * go_0(-1.0, -1.0);
result += mat4(-0.16517559, 0.1489214, -0.09149559, 0.025003506, -0.124926426, 0.16974348, -0.020857265, 0.08017403, 0.21836148, 0.0025619378, 0.2331612, 0.085599184, -0.030934382, -0.055194855, 0.09527726, -0.10081552) * go_0(-1.0, 0.0);
result += mat4(0.041800212, 0.028859638, 0.09395546, 0.05211183, -0.038541477, 0.021495212, 0.04862346, -0.007864793, 0.038407274, -0.13841268, -0.14963801, 0.26470762, 0.16691841, -0.07262008, 0.034374326, -0.14709206) * go_0(-1.0, 1.0);
result += mat4(0.00094978884, -0.028974704, -0.0900548, -0.08401967, -0.08935931, -0.043606587, -0.14497143, -0.05226239, -0.21516493, 0.19410603, -0.089924194, -0.04335071, -0.012618276, -0.2671613, 0.020422975, -0.037739716) * go_0(0.0, -1.0);
result += mat4(-0.13403237, -0.02524383, -0.03474901, 0.054432765, 0.11946775, 0.107336655, -0.1431715, -0.13370377, 0.015087512, -0.1917613, 0.073493585, 0.2788855, -0.010510839, 0.06891479, -0.06741307, -0.05271205) * go_0(0.0, 0.0);
result += mat4(-0.15432046, 0.04021662, -0.16979513, 0.13660534, -0.10518303, -0.10095502, -0.13092068, 0.022805348, -0.16676381, -0.4273298, 0.020867536, 0.3506733, -0.29459694, -0.055828743, -0.069241956, 0.04106382) * go_0(0.0, 1.0);
result += mat4(-0.08890133, 0.07549666, -0.040735144, -0.1506932, -0.22227979, -0.0762723, -0.17766447, -0.05741318, -0.21885683, 0.2379157, -0.15525854, -0.07306285, 0.15580738, -0.04394069, -0.19175608, 0.018283797) * go_0(1.0, -1.0);
result += mat4(-0.08503275, -0.105500385, -0.114987396, -0.07166016, -0.2147138, 0.09378708, 0.24550334, -0.0834075, -0.033147786, -0.022304727, -0.31062204, 0.027651973, 0.109098755, 0.18889032, 0.1163026, 0.13863255) * go_0(1.0, 0.0);
result += mat4(0.15266588, -0.14901319, 0.033916786, 0.09381096, -0.08196443, -0.16194504, 0.035789456, 0.21234898, -0.48724765, 0.2619442, -0.11215393, 0.25061038, 0.022344576, 0.0116525125, 0.111661114, -0.15242295) * go_0(1.0, 1.0);
result += mat4(0.020475458, 0.0797404, -0.13576819, 0.009681671, 0.030504882, 0.049232908, 0.022025917, 0.16912088, -0.23914136, -0.084663324, 0.020925451, -0.1023938, 0.035916872, -0.07538111, -0.11470242, 0.15238516) * go_1(-1.0, -1.0);
result += mat4(-0.12941381, 0.08509899, -0.029489802, -0.09148447, -0.089406274, -0.116145454, -0.08979843, 0.11908148, 0.15473351, -0.21687616, 0.12607013, -0.08244334, -0.079580925, -0.16613089, -0.09287793, -0.03412643) * go_1(-1.0, 0.0);
result += mat4(-0.023578499, 0.07394217, -0.13069086, -0.1060499, -0.07559958, -0.21839201, 0.1090753, 0.0787872, 0.07677037, -0.25998843, 0.20039314, 0.046882212, 0.31871012, -0.3048051, 0.15118991, -0.00518087) * go_1(-1.0, 1.0);
result += mat4(-0.15338503, -0.11057532, 0.075839415, -0.18592294, -0.0155324, 0.038140323, -0.10498194, 0.09070477, 0.05108992, -0.047939524, -0.091004305, 0.09649005, -0.10967152, -0.051909525, -0.05314551, 0.09661584) * go_1(0.0, -1.0);
result += mat4(-0.14458802, -0.053263694, -0.0010885567, 0.23342133, 0.01918937, 0.12026143, -0.15691495, 0.30480555, -0.08725869, 0.19082253, 0.3594973, 0.016653897, 0.045152336, -0.088590585, 0.0069655925, 0.1392425) * go_1(0.0, 0.0);
result += mat4(0.17944881, -0.17950764, 0.13282645, 0.030974053, 0.32233685, 0.18067117, -0.11472813, 0.097301506, -0.047649745, -0.1053861, -0.081039384, 0.035132434, 0.10204545, 0.085582554, -0.13153993, -0.021741152) * go_1(0.0, 1.0);
result += mat4(-0.15573682, 0.16409989, -0.22574787, -0.03877603, -0.18285516, 0.11638645, 0.18321282, -0.017770218, 0.18230622, 0.16433364, -0.12795393, -0.03805153, 0.14386104, -0.0891527, -0.056928284, -0.10961495) * go_1(1.0, -1.0);
result += mat4(0.257622, 0.052519716, -0.25421762, -0.1887382, -0.083568096, -0.0064690276, -0.029110614, 0.103327505, -0.17006217, 0.2254096, -0.29366904, 0.04302887, -0.10198446, -0.24423616, 0.16781262, -0.005019004) * go_1(1.0, 0.0);
result += mat4(0.103393994, -0.059044626, -0.18192382, 0.0990813, -0.26143607, 0.11036474, 0.04788275, -0.096738026, 0.12825653, 0.13631694, -0.077904984, -0.020790676, -0.25118098, 0.122588515, -0.049440473, -0.10758222) * go_1(1.0, 1.0);
result += mat4(0.06693113, -0.13647175, 0.131139, 0.13143918, 0.081720434, 0.117537096, 0.15387627, -0.008771362, 0.08513583, 0.023794742, -0.0661625, 0.115793936, 0.0023350024, 0.02215075, -0.0494433, -0.013404977) * go_2(-1.0, -1.0);
result += mat4(0.041419264, -0.17622781, 0.028418267, 0.12114493, -0.23587078, 0.08457395, 0.014364018, -0.103271864, -0.051572207, -0.026424447, 0.16755055, -0.10763651, -0.033440586, 0.068594255, -0.050668504, 0.1941505) * go_2(-1.0, 0.0);
result += mat4(-0.2780181, 0.037816502, -0.11516711, -0.09822884, 0.13762361, -0.14317706, 0.14350282, 0.000623895, -0.08601606, 0.08118504, 0.15497385, -0.04721711, -0.008936935, -0.014223618, -0.09641698, -0.013884213) * go_2(-1.0, 1.0);
result += mat4(0.14349665, -0.03144472, -0.057813704, 0.0667044, 0.09026094, 0.051366236, 0.11139983, -0.015782114, -0.18314016, -0.18774192, 0.0014838242, 0.15759028, 0.062388215, 0.13626057, 0.02576217, -0.06317815) * go_2(0.0, -1.0);
result += mat4(0.07151769, 0.14508991, 0.1736844, -0.11487795, -0.07999805, -0.07797908, 0.037923355, -0.059138823, -0.23531209, -0.040207293, -0.068355694, -0.024296658, -0.114820175, 0.19726487, 0.21772414, 0.03659222) * go_2(0.0, 0.0);
result += mat4(0.16858695, -0.12135113, 0.009391182, -0.081519485, 0.13340487, 0.07007004, 0.094124354, 0.035519842, -0.3320139, -0.06624027, -0.14716229, -0.09205287, 0.12664132, -0.05655441, 0.0123263765, 0.04641279) * go_2(0.0, 1.0);
result += mat4(0.19018422, -0.15428329, -0.009354114, 0.04165953, 0.11024837, -0.107493006, -0.05807292, -0.048029456, 0.24319384, -0.10542357, -0.013699952, 0.06228662, -0.06808749, -0.023227982, 0.16528323, -0.05610251) * go_2(1.0, -1.0);
result += mat4(-0.008616222, 0.077674195, -0.08638503, 0.09293109, 0.072474636, 0.05004233, -0.20591061, -0.005301386, -0.15486047, 0.15038474, 0.1262478, 0.021724822, 0.02274613, -0.3088281, -0.08437887, -0.10684698) * go_2(1.0, 0.0);
result += mat4(-0.16960032, 0.09365251, -0.030414175, -0.010766254, 0.18181023, 0.12130318, 0.08913089, -0.06070321, 0.05200306, 0.092584535, 0.17694671, 0.033796314, -0.038107123, -0.04335955, -0.049443472, 0.30465958) * go_2(1.0, 1.0);
result += mat4(0.07661484, -0.009945252, 0.12866217, -0.07592757, -0.21030053, 0.014371748, -0.072458774, -0.04700072, 0.15534303, 0.2007125, -0.15699059, -0.032897495, 0.08110436, -0.11243608, 0.008632577, -0.10153441) * go_3(-1.0, -1.0);
result += mat4(-0.034697928, 0.06928288, -0.2796273, 0.14405379, 0.12248569, 0.036539096, 0.06607706, 0.077684596, -0.16473202, 0.1665916, -0.29977503, 0.21047153, 0.13114224, -0.091579035, -0.045458574, 0.03254245) * go_3(-1.0, 0.0);
result += mat4(0.053284872, 0.053366095, -0.26152626, -0.03123967, -0.031794485, 0.17670582, -0.07450994, 0.017521491, -0.040290453, 0.38342363, -0.25021288, -0.014660264, 0.1621895, 0.25041878, -0.12124821, 0.068036206) * go_3(-1.0, 1.0);
result += mat4(0.11366693, -0.030863572, -0.07411263, 0.12475283, -0.046070684, -0.09033321, 0.013222701, 0.06798592, -0.32814804, 0.057653826, -0.14082801, -0.00217398, -0.22856179, -0.19058353, -0.20992154, -0.03701372) * go_3(0.0, -1.0);
result += mat4(0.20345633, -0.1332355, 0.27152926, -0.13477845, -0.25242096, -0.28281286, 0.31289554, 0.14284514, 0.53362453, -0.46766588, 0.4518293, -0.39291728, -0.3573227, -0.014670052, 0.0051881406, 0.16552156) * go_3(0.0, 0.0);
result += mat4(-0.15017267, -0.07792945, -0.204405, 0.13964304, -0.13642666, -0.10228306, 0.03238279, -0.08689329, -0.072262034, -0.0258388, 0.05689183, 0.055701543, -0.19800112, 0.012217054, -0.033292748, -0.047611095) * go_3(0.0, 1.0);
result += mat4(-0.014704416, -0.12203891, 0.066083655, -0.1409769, 0.0041513643, -0.087383606, -0.17498164, 0.11327789, -0.25947225, -0.0016027623, 0.08202566, 0.042270098, 0.006429511, -0.26576808, -0.08461341, 0.049376782) * go_3(1.0, -1.0);
result += mat4(0.0695189, -0.14753938, 0.09578246, -0.16607563, -0.0105561055, 0.17166016, 0.027422488, -0.14175262, -0.009492696, -0.23449713, 0.018270867, 0.14635146, 0.33451268, 0.030959005, -0.46468422, 0.024256868) * go_3(1.0, 0.0);
result += mat4(-0.16865666, -0.00015881563, -0.054488145, -0.06222717, -0.032101758, 0.06485387, -0.0028512608, 0.046645947, 0.017593225, -0.19447896, -0.024742266, 0.03970127, 0.29845607, -0.16168733, 0.035172883, 0.07924657) * go_3(1.0, 1.0);
result += vec4(0.103826486, 0.045373913, 0.11565896, -0.06568643);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_2_tf
//!BIND conv2d_2_tf1
//!SAVE conv2d_3_tf
//!WIDTH conv2d_2_tf.w
//!HEIGHT conv2d_2_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(0.1851775, 0.053705044, 0.033816848, -0.018555025, -0.21204336, -0.01706974, 0.088259794, -0.13126148, 0.10729598, -0.043457437, 0.08634712, 0.09220895, 0.062131613, -0.01995871, 0.05181067, 0.18520063) * go_0(-1.0, -1.0);
result += mat4(0.1662002, -0.14197104, -0.052809287, 0.025287712, -0.08330898, -0.08998097, -0.15642618, -0.14941245, -0.03481203, 0.061857622, 0.26051775, -0.0005498248, 0.086427025, 0.024108192, -0.12418039, 0.022286376) * go_0(-1.0, 0.0);
result += mat4(0.058200672, -0.3073398, 0.17150162, -0.13394679, -0.075118184, -0.14607768, -0.006172172, 0.007731589, -0.21818224, -0.06449433, -0.038958784, 0.037722416, 0.28699976, -0.027563032, 0.23295315, 0.028444216) * go_0(-1.0, 1.0);
result += mat4(0.12871371, 0.0064904913, 0.14985761, -0.10923005, 0.17413563, 0.1599109, -0.08457703, 0.108153716, -0.08871187, -0.06661137, 0.2754416, -0.009667768, 0.39819396, 0.12392097, 0.14145902, 0.0019376524) * go_0(0.0, -1.0);
result += mat4(0.13893189, 0.12715353, 0.015191678, -0.21003054, -0.030412354, -0.01676613, -0.19799289, -0.006130075, 0.37676954, -0.14475077, -0.2065198, -0.30432892, -0.14944535, -0.09121536, -0.107600585, -0.24462196) * go_0(0.0, 0.0);
result += mat4(-0.11653076, -0.0068671284, -0.02249137, -0.17877012, -0.15063138, -0.13514869, 0.107643366, -0.03196477, -0.086422764, 0.3079287, 0.17584166, -0.032449376, -0.06917114, -0.2682637, -0.18978168, -0.037039287) * go_0(0.0, 1.0);
result += mat4(0.12014731, -0.030360512, -0.12954475, -0.110275604, -0.077214256, 0.019689744, 0.22149551, -0.002266716, 0.09697784, -0.124532826, -0.16776511, -0.034212478, -0.36935154, 0.016926935, 0.1363609, 0.20415346) * go_0(1.0, -1.0);
result += mat4(-0.11199535, -0.001692563, -0.09058429, -0.08437503, 0.092625685, 0.06046257, 0.25509837, -0.011657033, -0.17949764, -0.10718947, -0.1180669, -0.24681842, -0.1747311, 0.0014518246, -0.042863015, 0.06103357) * go_0(1.0, 0.0);
result += mat4(0.14979295, -0.037154514, 0.01957725, 0.012282435, 0.09168596, -0.05552286, 0.111671515, 0.0078630615, -0.10319766, -0.06416261, -0.23097566, -0.13931875, 0.2110811, 0.013095802, -0.2306504, -0.025639111) * go_0(1.0, 1.0);
result += mat4(-0.10091975, -0.10095426, -0.023449723, -0.022170888, 0.054953706, -0.13049407, 0.08289061, 0.023241632, 0.08735388, -0.0058387457, 0.17897247, 0.011434436, 0.008181139, -0.0034718404, -0.015372735, -0.07657766) * go_1(-1.0, -1.0);
result += mat4(-0.023442164, 0.07535702, 0.024391165, -0.050532013, 0.044168636, 0.0062343236, -0.019756999, -0.009695123, 0.10102337, 0.0052776975, -0.14944167, -0.060957722, 0.24367364, -0.08069369, 0.12170072, -0.047048368) * go_1(-1.0, 0.0);
result += mat4(-0.18376935, -0.08407229, -0.12943378, 0.0738419, -0.12404976, -0.13367929, 0.11265896, -0.021353, 0.003783386, 0.50088304, 0.14058582, 0.041053623, 0.038247623, -0.014179976, 0.007905778, -0.042492237) * go_1(-1.0, 1.0);
result += mat4(-0.046272535, 0.052449115, 0.17190954, -0.004745371, -0.045572635, -0.09292636, 0.36309823, 0.16673928, -0.099154025, -0.109614775, 0.17803112, 0.19907133, -0.14306267, 0.06898593, 0.11493454, 0.06795014) * go_1(0.0, -1.0);
result += mat4(0.26181114, -0.044014625, -0.21605036, -0.08646438, 0.21038742, -0.084986, 0.0504626, 0.17514943, -0.25218952, -0.18691514, 0.057650108, 0.08653614, -0.101205684, 0.03176334, 0.18569492, 0.17973189) * go_1(0.0, 0.0);
result += mat4(-0.0339215, 0.20112811, -0.12986277, 0.028961731, -0.056813832, 0.04451147, -0.07827432, -0.0860976, 0.096853435, 0.3483546, -0.35758162, -0.11749375, -0.035918653, 0.06140711, -0.08520154, 0.02418808) * go_1(0.0, 1.0);
result += mat4(-0.09643022, -0.10491069, 0.0068604187, 0.023679713, 0.096521445, -0.29323488, 0.33353668, 0.112864286, -0.1172182, -0.07233183, 0.06607239, 0.08589609, 0.055790007, 0.14396138, -0.14191268, 0.00034840964) * go_1(1.0, -1.0);
result += mat4(0.15357164, -0.038462736, 0.08143956, 0.1744909, 0.40503287, -0.114508316, 0.003937322, 0.2536635, -0.042445306, -0.15622465, 0.09155284, 0.010992155, -0.20646071, 0.022801135, 0.08894491, 0.069300614) * go_1(1.0, 0.0);
result += mat4(-0.12663515, 0.023849454, -0.053604446, 0.12082873, -0.247968, -0.020969635, -0.03831894, -0.014617553, 0.22630337, 0.037801865, 0.052950703, 0.04285706, -0.14487264, 0.20786528, -0.08719664, 0.1752347) * go_1(1.0, 1.0);
result += mat4(-0.073527604, -0.050752833, 0.051830504, 0.32868716, 0.17474994, 0.016937364, -0.08792601, -0.024481766, -0.022229593, 0.030706186, 0.09213566, -0.076506205, 0.073404044, 0.10368055, -0.175889, -0.08453031) * go_2(-1.0, -1.0);
result += mat4(-0.06838216, 0.007698341, 0.063972116, -0.015604406, 0.16135305, 0.18044342, 0.024137018, -0.23326185, 0.13235588, -0.009096587, -0.058368143, -0.077040404, 0.0011419816, -0.09246194, 0.061036937, 0.049564146) * go_2(-1.0, 0.0);
result += mat4(0.023225296, -0.00060856267, -0.07775185, 0.016958566, -0.2641349, -0.08263046, -0.15350416, -0.30203494, 0.113956556, -0.010813236, -0.017738314, -0.13689043, -0.10318342, 0.025793184, -0.010336172, 0.09733422) * go_2(-1.0, 1.0);
result += mat4(-0.04462596, 0.052866418, -0.34754288, 0.05540498, -0.24492586, -0.32016864, 0.18145293, 0.24873725, 0.32388234, -0.034801524, -0.1347588, -0.07565546, 0.015183539, 0.05059595, 0.08090056, 0.05930932) * go_2(0.0, -1.0);
result += mat4(0.045346696, -0.052527856, 0.052270077, 0.13417454, 0.05200045, 0.028119288, 0.005115497, 0.22952151, -0.2158375, 0.12241308, 0.3507457, 0.08616576, 0.07592416, 0.28470486, 0.3432788, 0.24857087) * go_2(0.0, 0.0);
result += mat4(0.21311626, 0.052607164, 0.1248861, 0.20193806, 0.045226507, 0.14512901, -0.15103437, -0.17926466, 0.11657411, -0.32711068, -0.16332194, -0.07793982, -0.21802668, 0.5183869, -0.13567342, 0.07823041) * go_2(0.0, 1.0);
result += mat4(0.00796368, 0.048073012, -0.14537893, -0.021708772, 0.036246423, 0.1062395, 0.12605369, 0.007073524, -0.1572743, 0.07439501, 0.089162275, -0.0039608316, 0.332032, -0.05461242, -0.17615359, -0.10240517) * go_2(1.0, -1.0);
result += mat4(0.20636982, -0.0024615112, -0.10625786, 0.024270926, 0.061810836, -0.13585201, -0.16581286, 0.23549418, 0.01928842, 0.07404979, -0.054449487, 0.04096373, 0.046939734, 0.003980803, 0.02111498, 0.064925276) * go_2(1.0, 0.0);
result += mat4(0.10485388, 0.06850885, -0.11292169, 0.16991565, -0.15282536, 0.124175504, -0.050431166, -0.06689582, -0.00059811946, 0.033696912, 0.11055047, 0.033060126, -0.17472714, 0.0048819613, -0.04478706, -0.1344572) * go_2(1.0, 1.0);
result += mat4(-0.20473132, 0.056477875, 0.059559986, 0.115130566, -0.058425788, -0.035971727, 0.08334707, -0.096510135, -0.23206294, 0.10635798, -0.21575621, -0.07063254, 0.03877511, -0.107549034, 0.22248401, 0.21702304) * go_3(-1.0, -1.0);
result += mat4(-0.02557767, 0.09886609, -0.100499466, 0.16687396, -0.084830604, 0.03150401, -0.049512494, 0.05595696, -0.13193256, -0.08585273, 0.14247662, 0.12290477, -0.07168309, 0.14531752, -0.048359327, 0.27716598) * go_3(-1.0, 0.0);
result += mat4(0.13297586, 0.20674329, 0.14469388, 0.08981846, -0.004231366, -0.02819193, 0.15470329, 0.17299837, 0.113062344, -0.22716297, -0.21754944, -0.00083956274, -0.14160508, 0.1808253, 0.11268379, 0.27335623) * go_3(-1.0, 1.0);
result += mat4(0.07497518, -0.06799594, -0.018158078, -0.00038999433, -0.15169668, -0.06928238, -0.33672288, -0.105485775, 0.33106267, 0.06698315, 0.019718744, -0.06810211, -0.35186404, -0.29145968, -0.056863394, 0.21498048) * go_3(0.0, -1.0);
result += mat4(-0.013215512, -0.24763754, 0.20965266, 0.1068435, -0.13234195, 0.053566497, 0.05061848, -0.28645232, 0.15518288, 0.23247199, 0.017553907, -0.25181335, -0.048030723, -0.06663929, -0.111026704, -0.12663394) * go_3(0.0, 0.0);
result += mat4(-0.010501938, -0.17995767, 0.06010859, 0.050185587, 0.108627126, -0.101203434, 0.07558728, 0.060466755, -0.106942676, -0.35854608, 0.16015992, 0.16823332, -0.06543775, -0.37310675, 0.014043972, -0.18328045) * go_3(0.0, 1.0);
result += mat4(0.09712849, 0.013983463, 0.07291423, 0.031715546, 0.030862397, 0.045510456, -0.22066842, 0.063464865, 0.11721659, -0.10596602, -0.20611264, 0.052158818, -0.3961766, -0.03781582, 0.17633812, 0.1316111) * go_3(1.0, -1.0);
result += mat4(-0.25029674, 0.07153423, -0.35125682, -0.18255402, -0.19569087, 0.00432772, -0.0969035, -0.24648514, -0.0040922165, 0.037500706, -0.038137026, 0.056214277, -0.048258524, 0.03567822, -0.05033007, -0.24696785) * go_3(1.0, 0.0);
result += mat4(-0.03465209, -0.012495964, 0.22782089, 0.012034795, 0.2916752, 0.08264436, 0.15387125, -0.1473455, -0.15614432, 0.05536727, -0.027079755, 0.010725311, -0.03325222, -0.089212805, -0.10559839, -0.19647683) * go_3(1.0, 1.0);
result += vec4(0.0001705175, -0.031081453, 0.010100773, -0.027214011);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_2_tf
//!BIND conv2d_2_tf1
//!SAVE conv2d_3_tf1
//!WIDTH conv2d_2_tf.w
//!HEIGHT conv2d_2_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.026301445, -0.021575214, 0.22165509, 0.059994068, 0.03341161, 0.1831188, 0.20342293, 0.110160105, 0.03908121, 0.020673111, 0.07239561, 0.038754333, 0.15266368, 0.16526422, 0.062376205, -0.09759537) * go_0(-1.0, -1.0);
result += mat4(0.19817191, 0.10267733, 0.17744653, 0.23283184, 0.18810122, 0.2708428, -0.12651879, 0.020756349, 0.039632563, -0.22201295, 0.04873703, 0.09159713, 0.13838065, 0.21169297, 0.30816007, 0.044463675) * go_0(-1.0, 0.0);
result += mat4(-0.27859214, 0.07277634, 0.0021458792, 0.0089682285, -0.069680706, 0.090415835, -0.057762265, 0.18703683, -0.03514389, -0.102816254, -0.036509827, 0.038066104, -0.0168311, 0.094478935, 0.04079697, -0.049064912) * go_0(-1.0, 1.0);
result += mat4(-0.20913245, -0.110538535, -0.08584027, -0.1222067, 0.05414807, -0.045247085, 0.07351766, -0.002078549, -0.1270987, -0.10164512, -0.1857815, 0.08845066, -0.03743333, -0.098948084, 0.21244387, 0.10441866) * go_0(0.0, -1.0);
result += mat4(0.015990427, 0.36396438, -0.24094687, 0.30236533, -0.13271736, 0.06057376, -0.19678196, -0.28577125, -0.25427434, -0.08400598, 0.07284403, -0.18552442, -0.16425897, 0.097259276, -0.32386774, -0.2190484) * go_0(0.0, 0.0);
result += mat4(-0.004581924, -0.13954072, -0.122360416, 0.14132866, -0.08529257, -0.013296556, 0.0848472, 0.09336581, 0.10332182, -0.016313016, 0.07103558, 0.032564916, -0.13478759, -0.20207484, 0.12986964, 0.1219679) * go_0(0.0, 1.0);
result += mat4(0.09817874, -0.10573357, 0.100535244, 0.19608764, -0.13303067, 0.024192972, -0.030689823, 0.02574889, 0.051233094, 0.03489235, -0.18465245, -0.06943822, -0.031604882, 0.1519888, 0.09348508, 0.09187296) * go_0(1.0, -1.0);
result += mat4(-0.21365458, -0.23696984, 0.13097638, -0.09435498, 0.16467983, -0.066370346, 0.1269104, -0.095128186, 0.09954892, 0.12489504, -0.43418056, 0.106512725, -0.17860703, -0.07114084, -0.07630834, -0.26642478) * go_0(1.0, 0.0);
result += mat4(-0.009044342, 0.02711196, -0.14873673, 0.015405045, 0.0071443473, -0.025285944, 0.07409282, 0.06338527, 0.0149676185, 0.011741382, -0.2133069, -0.028912885, 0.19420496, 0.039629057, 0.057636812, 0.15214856) * go_0(1.0, 1.0);
result += mat4(0.07629928, 0.25540486, -0.050925937, -0.18136702, 0.02261603, 0.22343902, 0.003270321, 0.10735731, -0.12541203, -0.10208828, 0.012832783, 0.2591262, 0.08122926, -0.009837677, 0.10308358, 0.19236866) * go_1(-1.0, -1.0);
result += mat4(0.0896358, 0.27571487, 0.04406029, -0.047453407, -0.08587119, 0.16366854, 0.20622262, 0.08347545, -0.3501584, -0.28434548, -0.07592983, 0.09098784, 0.07605388, 0.09677056, 0.0015295541, 0.05102585) * go_1(-1.0, 0.0);
result += mat4(0.18255898, 0.18618028, 0.0017002645, -0.013004655, -0.06436534, 0.13967068, 0.063077755, -0.10632303, -0.20803222, -0.028537111, -0.03144366, -0.08555215, 0.05154303, 0.02431626, 0.15246728, -0.013708507) * go_1(-1.0, 1.0);
result += mat4(-0.020998938, -0.05026291, 0.03700117, 0.00830308, -0.1949294, 0.0026698054, -0.034649856, 0.19784226, -0.083901435, -0.069783084, -0.1504053, 0.16595264, -0.07480141, 0.16067508, 0.06010996, -0.021359695) * go_1(0.0, -1.0);
result += mat4(-0.040828142, -0.20158486, 0.034770954, -0.1894161, 0.11665004, 0.29729164, -0.10584386, 0.13165873, -0.18863006, -0.26719162, -0.047613148, -0.12728356, -0.2033613, 0.10550052, 0.20095508, -0.11275811) * go_1(0.0, 0.0);
result += mat4(-0.0785033, -0.1896073, -0.051492307, -0.1694358, 0.1368308, 0.049355216, -0.05707422, 0.079159185, 0.024578957, -0.0923136, 0.089215435, 0.28670043, 0.027932687, 0.06510816, 0.10810999, 0.05990052) * go_1(0.0, 1.0);
result += mat4(0.08135192, 0.0001326522, -0.16098668, -0.18663193, -0.10280192, 0.078255914, 0.047648013, 0.08326376, 0.055962667, 0.06302574, -0.080121025, -0.031820554, -0.019117938, 0.12515336, 0.09794088, -0.03276838) * go_1(1.0, -1.0);
result += mat4(0.280923, 0.24079335, 0.007883573, 0.06270414, 0.3055441, 0.19291803, -0.16041607, 0.14836526, 0.0013885222, 0.04538063, 0.10742898, -0.064491205, 0.048174977, 4.237692e-05, -0.15194727, 0.024381457) * go_1(1.0, 0.0);
result += mat4(-0.0009164131, -0.031949926, 0.0076425644, -0.036870714, -0.0031292974, 0.017726978, -0.20172147, -0.0770472, 0.26379177, 0.108997814, 0.08069395, 0.2126177, 0.012075376, -0.029457828, 0.062730506, -0.15754452) * go_1(1.0, 1.0);
result += mat4(0.09167904, -0.2657421, -0.03443356, 0.03315832, -0.015365421, -0.1029612, -0.108251, 0.04261033, -0.097120754, -0.05616668, -0.09275983, 0.024902184, 0.050058514, -0.013761632, 0.07555132, -0.0046676896) * go_2(-1.0, -1.0);
result += mat4(-0.10743835, -0.0007361781, -0.042085417, -0.08237517, -0.10094376, -0.24007876, 0.13924706, -0.07526801, 0.01158322, 0.15491122, 0.0069442675, -0.004242352, 0.11429785, 0.02994726, -0.11829945, -0.04108612) * go_2(-1.0, 0.0);
result += mat4(0.073622055, -0.064717196, -0.0025231615, 0.13256475, 0.20159899, 0.047977835, -0.10289233, -0.18419135, -0.00888952, 0.059428576, -0.053062655, -0.02730631, 0.14545685, -0.08686949, 0.17454128, 0.035443828) * go_2(-1.0, 1.0);
result += mat4(-0.010146019, 0.06712568, 0.12614638, 0.023590917, 0.025756737, 0.06603747, -0.17108095, -0.06179699, 0.027241204, -0.13196802, 0.043475866, -0.0397495, 0.05306092, 0.035672903, 0.047219284, -0.16680142) * go_2(0.0, -1.0);
result += mat4(0.079427816, -0.06716479, 0.19028603, -0.19694683, -0.061598092, -0.07471188, 0.21170339, 0.30140215, -0.0023369973, 0.04688297, -0.14154115, 0.19283508, 0.1339858, -0.09116279, 0.15305163, 0.029108394) * go_2(0.0, 0.0);
result += mat4(-0.14902157, -0.03339153, -0.08532003, -0.10736339, 0.08702709, 0.07607574, -0.09955836, -0.016585784, -0.030078214, -0.060374748, -0.2854279, 0.02441719, 0.034877967, 0.2099041, 0.11125731, -0.059071556) * go_2(0.0, 1.0);
result += mat4(-0.08436325, 0.06893047, -0.045362443, -0.02237741, -0.07583875, -0.034830183, -0.024008518, -0.2882329, -0.011109783, 0.101859994, 0.091137715, 0.0020565533, -0.044729806, -0.18168025, 0.069466636, 0.04994174) * go_2(1.0, -1.0);
result += mat4(0.11915174, 0.089596465, -0.18965814, 0.015218237, 0.13500094, 0.19921367, -0.008298205, 0.29650384, -0.049439427, -0.27590424, 0.36169067, -0.030582754, 0.02151196, 0.019915426, 0.04543398, 0.16126189) * go_2(1.0, 0.0);
result += mat4(0.1620274, -0.08264547, 0.082442135, -0.0034478644, 0.09888509, -0.0034957859, -0.107241705, -0.17729597, -0.05138647, 0.02052103, -0.019507123, 0.037574988, -0.1694345, 0.17871588, -0.22510391, 0.019049853) * go_2(1.0, 1.0);
result += mat4(-0.10962245, -0.1329873, -0.060855392, 0.025941676, -0.19536193, -0.120365486, -0.04313703, -0.052912965, 0.20854498, 0.08341353, 0.008687068, -0.20432276, 0.15677948, -0.19000018, 0.01821201, -0.041512605) * go_3(-1.0, -1.0);
result += mat4(0.012287526, -0.14180368, -0.098788455, 0.025949089, 0.09442778, 0.2247651, -0.12453263, 0.10435483, 0.274603, 0.06133054, 0.10506106, 0.14727746, -0.048299775, -0.082819685, 0.07319359, -0.047460355) * go_3(-1.0, 0.0);
result += mat4(-0.070726536, -0.034744017, 0.07521428, 0.070649154, -0.05958955, -0.100232825, -0.010651838, 0.045392875, 0.2930271, -0.04952355, 0.3112155, 0.117203265, 0.025166962, 0.11176862, 0.06716659, 0.07175864) * go_3(-1.0, 1.0);
result += mat4(-0.011560962, -0.14032063, -0.17424704, 0.07652749, -0.04220116, 0.052874275, -0.00225693, -0.031843517, -0.07520102, -0.13775803, 0.2449317, 0.069658786, 0.052280303, -0.105218224, 0.03574522, -0.020500354) * go_3(0.0, -1.0);
result += mat4(0.08793712, 0.26712346, 0.08315631, 0.23813692, -0.04439029, 0.031587064, 0.09561177, -0.13380238, -0.24982157, 0.31701845, -0.3875432, 0.10487225, 0.09201869, -0.037252493, -0.006935219, -0.14650282) * go_3(0.0, 0.0);
result += mat4(0.077635325, 0.13732299, -0.071563005, 0.096517466, -0.15051986, -0.111744404, 0.03996857, -0.052670125, -0.1819665, 0.054554947, -0.13774712, -0.20061246, -0.0023742192, 0.15647805, -0.024121126, 0.075497724) * go_3(0.0, 1.0);
result += mat4(0.0073632775, -0.06535298, 0.039895996, 0.20666869, 0.13625242, 0.04823007, -0.07135618, 0.04787906, 0.01383074, 0.15382123, -0.15519714, 0.056721795, 0.061946746, -0.0586851, 0.028934354, -0.02264129) * go_3(1.0, -1.0);
result += mat4(-0.19791882, -0.111910924, -0.010451344, -0.30566537, -0.1416239, -0.14523096, 0.116883226, -0.18241516, 0.2680614, -0.18487626, 0.17472346, 0.08346682, -0.14510359, -0.029229192, -0.005879142, 0.050247498) * go_3(1.0, 0.0);
result += mat4(0.030153519, -0.092469186, -0.022912916, 0.10200855, -0.04237032, -0.05917764, 0.10479645, -0.05619482, -0.18949397, -0.019547248, 0.013868889, -0.1524476, 0.14048979, -0.032521486, 0.1322921, 0.070972025) * go_3(1.0, 1.0);
result += vec4(0.012053958, -4.6962363e-05, 0.0020099226, -0.033494607);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_3_tf
//!BIND conv2d_3_tf1
//!SAVE conv2d_4_tf
//!WIDTH conv2d_3_tf.w
//!HEIGHT conv2d_3_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.06738501, 0.034009207, -0.21538448, 0.14296548, 0.12896985, -0.23526315, -0.08848608, 0.019602662, 0.14937137, 0.11353096, 0.11884168, -0.016765572, 0.030985225, 0.046430565, 0.06614828, -0.19202724) * go_0(-1.0, -1.0);
result += mat4(-0.10326068, 0.11014975, 0.17069744, -0.21474148, 0.16761585, 0.13434832, -0.101021074, 0.006307025, 0.07478008, -0.1060066, 0.035315692, 0.033488914, -0.24906659, 0.06269967, 0.11120735, -0.040928528) * go_0(-1.0, 0.0);
result += mat4(0.09334615, 0.057705753, 0.12213245, -0.06402275, 0.30694544, 0.034585163, 0.20345578, 0.07489286, 0.07483618, -0.14240396, 0.034846418, -0.03811241, 0.010882573, 0.13204294, 0.017563924, -0.047203008) * go_0(-1.0, 1.0);
result += mat4(-0.21673942, -0.024010994, -0.10238504, -0.041160326, 0.06838163, -0.20950818, 0.06526309, -0.079094924, 0.02208821, -0.28130978, 0.086275116, -0.089067616, 0.12133826, -0.062600106, -0.020521903, -0.07654401) * go_0(0.0, -1.0);
result += mat4(-0.03055029, -0.15683146, -0.20331301, -0.06252028, 0.13350682, 0.20338707, 0.038425338, 0.1581342, -0.27322498, -0.14999662, -0.16681097, 0.0971585, -0.20014858, -0.081635274, -0.0781877, -0.20625232) * go_0(0.0, 0.0);
result += mat4(0.38375977, -0.019825654, 0.1886721, 0.22616312, 0.3402173, 0.1825304, -0.05531195, 0.30973226, -0.2676023, 0.14413352, 0.021706983, 0.01732799, 0.23466855, -0.13805965, 0.22570935, 0.018103868) * go_0(0.0, 1.0);
result += mat4(-0.15169825, 0.0270689, -0.2503316, 0.17289825, -0.16437647, 0.039233048, -0.35572487, -0.048393793, 0.19270042, 0.24260359, 0.12041881, -0.0009793913, 0.11656858, 0.11007414, -0.0757491, 0.047933612) * go_0(1.0, -1.0);
result += mat4(-0.18657999, -0.11252566, -0.05237504, -0.07368097, 0.13882741, -0.13710637, -0.006996468, -0.062354874, 0.23452504, 0.15333645, -0.0022776406, -0.17910439, 0.03629509, -0.16264829, -0.010011833, -0.15313338) * go_0(1.0, 0.0);
result += mat4(-0.060544558, -0.04913478, -0.061717357, 0.02323648, 0.28739056, -0.07434013, 0.19110644, 0.100050166, 0.0073363045, 0.08185653, -0.024797903, -0.14424153, -0.20838726, 0.16154376, -0.048517212, -0.025453888) * go_0(1.0, 1.0);
result += mat4(0.14975396, -0.13142908, 0.36210674, -0.054021083, -0.10632155, 0.045697935, -0.18946633, 0.02228141, -0.08919603, 0.09800842, -0.17634438, 0.09512711, -0.03425503, -0.12298555, -0.05354435, -0.17112055) * go_1(-1.0, -1.0);
result += mat4(0.09958265, -0.057276618, -0.16262266, -0.06415915, 0.14579074, -0.36784375, 0.08034197, -0.04537706, 0.005460582, 0.22313322, 0.07382161, 0.014990379, 0.044636846, -0.2811128, -0.22621547, -0.06044004) * go_1(-1.0, 0.0);
result += mat4(0.10569276, -0.03738662, 0.16100396, 0.058593616, -0.048862137, -0.08796426, 0.20101094, -0.11039573, 0.17196764, -0.04601554, 0.008571281, -0.073729075, 0.051433694, -0.051276565, 0.087334655, -0.0360379) * go_1(-1.0, 1.0);
result += mat4(0.011119538, -0.28781965, 0.28637868, -0.1742508, -0.07121849, 0.10379717, 0.012615981, -0.029563965, -0.18678424, 0.05291095, 0.039143506, -0.028248642, -0.014103922, 0.029155696, 0.10433492, 0.16305852) * go_1(0.0, -1.0);
result += mat4(-0.2231037, -0.13697462, -0.29124337, 0.08519773, 0.15893684, -0.17763218, 0.06950923, 0.34361118, -0.024844287, 0.044008408, -0.033844844, -0.086971916, -0.07884748, 0.2543499, 0.056884114, 0.10068364) * go_1(0.0, 0.0);
result += mat4(-0.07710048, -0.23218372, 0.04346047, 0.21769643, 0.06473219, -0.18066105, -0.2511205, 0.15309611, 0.04535977, 0.16450433, 0.10846344, 0.0016952346, -0.010874939, 0.28966382, -0.121990964, 0.12956186) * go_1(0.0, 1.0);
result += mat4(-0.007910202, 0.17766511, 0.14364475, 0.1016258, 0.0051045395, 0.18691733, 0.005813767, -0.0070582186, 0.019418601, -0.1604435, 0.016088275, -0.18265302, -0.15719391, -0.17369832, -0.036745597, -0.19647408) * go_1(1.0, -1.0);
result += mat4(0.08938396, -0.0073808245, 0.11225727, -0.012303106, 0.096785046, 0.030483445, 0.027719889, -0.052584838, -0.14887555, -0.03422243, 0.12646855, -0.1722482, 0.010239037, 0.06406088, -0.20053658, 0.01964698) * go_1(1.0, 0.0);
result += mat4(-0.120734036, -0.12450362, -0.06582111, 0.1639675, -0.19787048, -0.08049789, -0.014257596, 0.058436662, -0.0009387449, -0.08698089, -0.017400503, 0.06295286, 0.09890349, -0.057190523, -0.103520766, -0.04207548) * go_1(1.0, 1.0);
result += mat4(-0.0118413875, -0.031288836, 0.09749554, -0.012266401, -0.07998591, 0.22615653, -0.06207416, 0.03257896, -0.076378696, -0.079426095, -0.13968349, -0.15423697, -0.1091681, -0.02893125, -0.032659534, -0.063735925) * go_2(-1.0, -1.0);
result += mat4(0.119372696, 0.013176554, -0.029381052, 0.21919228, 0.045041792, 0.24844484, 0.26363325, 0.08480674, 0.087083444, 0.11984778, -0.088715754, 0.06421046, 0.05225977, -0.05140334, -0.055052705, -0.049854077) * go_2(-1.0, 0.0);
result += mat4(0.0035781674, 0.0861361, -0.07675145, -0.056479637, 0.16973391, -0.12113791, 0.10729832, -0.03773517, 0.058618728, 0.12148276, 0.17260705, -0.06968724, 0.076358154, -0.15307103, 0.17700425, -0.13467014) * go_2(-1.0, 1.0);
result += mat4(-0.02752418, -0.06366472, -0.025610954, 0.0013539721, -0.06465272, 0.0806373, -0.07336035, 0.10114861, 0.0041146413, 0.15878421, -0.044668555, -0.12150811, -0.1071482, -0.05086587, 0.18589285, 0.05065092) * go_2(0.0, -1.0);
result += mat4(0.07200056, 0.021739854, 0.29476613, -0.08475931, 0.15018553, -0.07886365, 0.36336347, -0.020576432, 0.25866082, -0.059272554, 0.054249667, -0.17822553, 0.1755872, 0.3244387, -0.39173844, 0.33894604) * go_2(0.0, 0.0);
result += mat4(-0.11570926, 0.1342677, -0.19511898, 0.0075454637, -0.01890476, -0.14239742, 0.18921931, 0.033990458, 0.31306365, -0.006998358, 0.029190077, -0.005679954, -0.15341778, 0.07766778, -0.25691047, -0.0964161) * go_2(0.0, 1.0);
result += mat4(0.019746238, 0.0021332854, -0.00879096, -0.1338671, -0.0001600663, -0.29465106, 0.0867611, -0.114963025, 0.07874301, -0.012734178, -0.11124061, -0.010926616, -0.04941506, -0.07516841, 0.116663, -0.29018974) * go_2(1.0, -1.0);
result += mat4(-0.01651721, 0.05955898, 0.023618208, 0.098695934, 0.018553663, -0.054378513, 0.1436929, 0.1693743, -0.27483663, 0.029127488, 0.09619316, -0.06109113, -0.08619361, 0.09315214, -0.02478657, 0.18544984) * go_2(1.0, 0.0);
result += mat4(0.09570196, -0.016528936, -0.1559397, 0.14312246, 0.04029428, 0.08773151, -0.043646842, 0.17894371, -0.082413055, 0.0027082344, -0.100171275, 0.01547501, 0.18122818, -0.11933676, 0.26404107, -0.3169703) * go_2(1.0, 1.0);
result += mat4(-0.12073344, 0.08683522, -0.09249099, 0.058786053, -0.14480567, -0.121013954, 0.033335857, 0.009353379, -0.055087596, -0.13002734, 0.08890566, 0.05508963, -0.0075715426, -0.15936922, -0.03968994, -0.1690259) * go_3(-1.0, -1.0);
result += mat4(0.2011206, 0.23898427, 0.23656492, 0.1287573, 0.14850396, 0.40532517, -0.107408255, 0.40119782, 0.099813245, -0.03830304, 0.101520434, -0.026478073, -0.048469637, 0.106440455, 0.056632314, -0.17825997) * go_3(-1.0, 0.0);
result += mat4(-0.076735444, 0.05965795, -0.0052469415, -0.21785147, 0.11887833, 0.067560315, 0.051149055, 0.23626682, -0.1297049, -0.035512198, 0.20352256, -0.025064934, 0.04958706, 0.0454198, 0.0113334535, 0.0417486) * go_3(-1.0, 1.0);
result += mat4(-0.09055751, 0.033915352, -0.21836667, 0.22006813, -0.099022895, 0.11720966, -0.15686816, -0.13586599, -0.094427735, -0.08831514, -0.06182928, 0.09213704, -0.03642064, 0.18129414, -0.012926811, 0.12179882) * go_3(0.0, -1.0);
result += mat4(0.19389409, 0.09512252, 0.14768016, -0.16623649, -0.031052284, -0.026814984, 0.106168024, -0.2026781, -0.04581419, -0.0016849053, -0.04101923, 0.038959503, -0.011938445, 0.20096186, -0.26666564, 0.4824324) * go_3(0.0, 0.0);
result += mat4(0.17727576, 0.07309147, 0.12131863, -0.163096, 0.17225246, 0.26256254, 0.27685758, 0.09094053, 0.029605515, -0.20217367, 0.047564875, 0.043115832, 0.15089568, -0.09670934, 0.24131384, 0.03337442) * go_3(0.0, 1.0);
result += mat4(-0.34192136, 0.12063195, -0.31159517, 0.04170889, -0.30147067, -0.21330686, -0.1514457, -0.121126845, 0.04409098, 9.2206596e-05, 0.027680017, 0.03230512, -0.27993527, -0.093485355, 0.07568645, -0.23585452) * go_3(1.0, -1.0);
result += mat4(0.0537712, -0.20847629, 0.1740093, -0.013894753, -0.32719997, -0.059484575, -0.006098233, -0.10336451, -0.14706188, -0.07424865, -0.07045905, 0.17093194, -0.22147557, 0.09086218, -0.11033544, -0.05306482) * go_3(1.0, 0.0);
result += mat4(0.00489003, -0.11509064, -0.021005848, 0.16637677, -0.089347586, 0.17545725, -0.17313693, 0.13742085, -0.14577347, 0.07951095, -0.092139855, 0.017118992, -0.053472433, 0.079414465, 0.0330263, -0.11189824) * go_3(1.0, 1.0);
result += vec4(-0.034743138, 0.012946433, -0.082333155, 0.07721756);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_3_tf
//!BIND conv2d_3_tf1
//!SAVE conv2d_4_tf1
//!WIDTH conv2d_3_tf.w
//!HEIGHT conv2d_3_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.25835788, 0.050451655, -0.1845038, -0.07232528, 0.1323318, 0.26276684, 0.10842882, -0.083056524, 0.17426784, -0.3594826, 0.2728965, 0.08388844, -0.004007842, 0.020535901, -0.051425606, 0.07750436) * go_0(-1.0, -1.0);
result += mat4(-0.11410436, 0.014572361, -0.27057216, -0.023974562, 0.05234827, 0.15328228, -0.17502303, -0.3199359, 0.12188045, -0.095813684, 0.024145132, 0.0856916, -0.027453909, -0.043129764, 0.16971985, 0.021623038) * go_0(-1.0, 0.0);
result += mat4(0.06611095, 0.038625732, -0.13717118, -0.04497733, 0.15213469, 0.04770935, 0.0729271, -0.062052976, 0.004571303, 0.035141192, -0.059409596, 0.044652313, 0.17520894, 0.09665589, -0.1479193, 0.06528058) * go_0(-1.0, 1.0);
result += mat4(-0.1845968, 0.091479465, -0.09394898, -0.13545018, -0.029501775, -0.21426639, 0.09255898, 0.1257644, 0.20256902, 0.06267267, 0.10378081, 0.13494423, 0.058310498, 0.03642236, -0.16268995, -0.048100803) * go_0(0.0, -1.0);
result += mat4(0.2155119, -0.3683131, 0.049449228, -0.20559964, -0.11761922, -0.2518804, -0.020712897, 0.12895772, -0.07543782, 0.5805017, -0.11301444, -0.038493153, -0.06710986, -0.09321189, 0.108671665, -0.03259695) * go_0(0.0, 0.0);
result += mat4(0.035307787, 0.108389005, -0.27493554, 0.27029404, 0.25523573, -0.28636125, -0.20766719, -0.008661457, -0.004480811, -0.046390545, -0.16221444, 0.008979624, -0.061375532, 0.035076566, -0.018924266, 0.01380219) * go_0(0.0, 1.0);
result += mat4(-0.051922515, -0.12463486, -0.10383422, 0.02220095, -0.1573033, 0.13980615, 0.13248625, -0.16803266, -0.0692132, -0.21552645, 0.13744529, 0.23034313, 0.0052666534, 0.028977966, 0.07720251, -0.06477756) * go_0(1.0, -1.0);
result += mat4(-0.14097473, 0.2770271, -0.172289, -0.03000696, -0.028684044, 0.040578447, -0.2290285, 0.082329154, -0.042402364, -0.20926563, 0.08233207, 0.11862443, -0.07038536, -0.02273004, 0.091550544, -0.065856494) * go_0(1.0, 0.0);
result += mat4(0.14879914, -0.023923844, -0.23569296, 0.20306346, 0.17502785, 0.28776234, -0.2788995, 0.10012439, -0.05635638, -0.025840463, 0.09222198, 0.118032, 0.08057015, 0.1286071, 0.060189806, -0.052669708) * go_0(1.0, 1.0);
result += mat4(0.07076086, -0.15111323, -0.07427972, 0.008372168, -0.17791592, -0.16254742, 0.013961132, -0.0944912, -0.23380096, 0.17377278, -0.09683394, 0.019931393, -0.12042098, 0.0016406325, 0.09393333, -0.06882231) * go_1(-1.0, -1.0);
result += mat4(0.21465093, 0.04142968, 0.06840044, -0.37831602, -0.05549571, 0.044905066, -0.07873589, -0.026804, -0.34764197, 0.022487951, -0.077293746, 0.089457795, -0.110094436, 0.24233972, 0.06285107, -0.10851744) * go_1(-1.0, 0.0);
result += mat4(0.093270175, 0.084138945, 0.03938272, 0.063565865, -0.010733802, 0.13554469, -0.06650261, 0.033002816, 0.011187271, -0.12821455, 0.20785914, -0.030438649, -0.124710515, -0.022294303, 0.09732408, 0.057609864) * go_1(-1.0, 1.0);
result += mat4(-0.12833868, 0.021577539, -0.02700365, 0.11799592, -0.03655647, -0.04225167, 0.11049353, -0.16036157, 0.049277548, -0.033842396, 0.10020137, 0.095509745, 0.08060231, -0.09237418, -0.035598125, -0.035926737) * go_1(0.0, -1.0);
result += mat4(-0.32829186, 0.3492363, 0.030671779, -0.12606762, 0.010437313, 0.2757115, -0.21517593, -0.15800527, -0.12592544, -0.20578934, 0.10444053, 0.12993255, -0.046079267, 0.03834173, -0.19277227, -0.22124454) * go_1(0.0, 0.0);
result += mat4(-0.052546192, 0.026082167, 0.13831234, 0.10982424, 0.012946818, -0.12439852, 0.10134106, -0.10050398, -0.04472338, -0.14325236, -0.20579574, 0.0044005127, 0.22013672, -0.32955512, 0.12404084, -0.008160738) * go_1(0.0, 1.0);
result += mat4(-0.10774314, -0.31650826, -0.06601711, 0.19635755, -0.12622592, -0.06396423, 0.13856032, 0.16540553, 0.021387719, 0.23377723, -0.053738154, -0.1000186, -0.08338395, -0.052813534, 0.008122962, 0.13732094) * go_1(1.0, -1.0);
result += mat4(-0.18270823, 0.06966014, -0.17788303, -0.27303055, -0.077971615, 0.013978423, -0.02039098, 0.12715338, -0.11924171, 0.18900296, -0.085199654, 0.215198, 0.18587974, -0.009749325, 0.0173584, -0.12018259) * go_1(1.0, 0.0);
result += mat4(0.052129295, -0.107416354, 0.12711766, 0.03708665, -0.14369462, -0.055359814, -0.16639823, -0.045143317, -0.06925672, -0.040696755, 0.01999809, -0.016040625, -0.02484878, 0.07417094, 0.050875198, 0.2145528) * go_1(1.0, 1.0);
result += mat4(0.055696912, -0.16680926, -0.021987487, 0.024941636, -0.0927883, 0.022136632, 0.033782948, -0.10646058, -0.14944647, 0.25457275, 0.046682496, -0.022462368, -0.07886781, 0.08165927, 0.06848105, 0.0063734027) * go_2(-1.0, -1.0);
result += mat4(0.037053242, 0.033215813, 0.18291366, 0.12340375, 0.08491059, -0.28442004, -0.0127422465, -0.039834313, -0.23321372, 0.26676926, -0.05636355, -0.15672484, -0.12891728, -0.15486577, -0.032004442, -0.092745155) * go_2(-1.0, 0.0);
result += mat4(0.015779478, -0.18457565, 0.24996394, 0.036197674, 0.15694007, 0.15863103, -0.07332398, 0.0016235278, -0.15536517, -0.056062788, 0.14102836, 0.16915025, -0.08001087, 0.07073164, 0.13796777, 0.123867124) * go_2(-1.0, 1.0);
result += mat4(0.045792986, -0.15135059, -0.1354885, -0.043678258, -0.35655212, 0.51232076, -0.12816145, -0.046569496, -0.014127674, -0.06282611, -0.098873, -0.06359104, -0.0919222, 0.11822437, 0.079254694, 0.00579688) * go_2(0.0, -1.0);
result += mat4(-0.15683417, 0.61610246, -0.3024612, 0.12917964, -0.09303367, 0.23612969, -0.40842506, -0.12374661, -0.07572449, -0.2613284, -0.09970177, -0.015227848, 0.106239066, -0.21411185, 0.051998455, -0.1364518) * go_2(0.0, 0.0);
result += mat4(0.23850034, -0.14394449, -0.0031468747, -0.2380617, -0.027200876, -0.041352056, -0.01864445, 0.033848196, -0.12064239, -0.110480845, 0.08450956, -0.22328654, 0.17664163, 0.22268307, 0.050886698, -0.17475672) * go_2(0.0, 1.0);
result += mat4(-0.17808256, 0.010803805, 0.03315186, 0.033143792, -0.14205995, 0.25039625, -0.08784382, -0.13454252, 0.19576813, 0.10755282, 0.22821628, 0.019456752, -0.0422955, -0.016182603, -0.12066697, 0.0548465) * go_2(1.0, -1.0);
result += mat4(0.11563777, -0.257929, 0.0010403778, 0.080267854, -0.0025255163, 0.2855168, -0.060352214, -0.07816255, -0.00090574916, 0.049510725, 0.03720483, 0.059250016, -0.08674136, 0.20522198, -0.28694284, 0.1299507) * go_2(1.0, 0.0);
result += mat4(-0.14638457, 0.04063328, 0.03139636, -0.007934521, 0.07689684, -0.09467145, 0.10607347, 0.054510128, 0.003306194, 0.05347124, 0.062762424, -0.041480847, -0.07677865, -0.139573, 0.010972524, 0.21957156) * go_2(1.0, 1.0);
result += mat4(-0.026845628, -0.043439507, 0.034738723, 0.07281683, 0.14474197, 0.031586993, -0.22767854, -0.0707655, 0.105201736, -0.28805482, 0.008668302, -0.16329518, 0.06157049, 0.3803886, 0.26345953, -0.011096537) * go_3(-1.0, -1.0);
result += mat4(-0.23328833, 0.085731484, -0.07755016, 0.33559516, 0.07704345, 0.115106605, -0.24114038, -0.44630137, 0.2726737, -0.32170138, -0.009236524, -0.11666051, 0.0457048, 0.07876708, 0.13134004, -0.035318643) * go_3(-1.0, 0.0);
result += mat4(-0.05140272, 0.011605703, 0.13899171, -0.05071015, 0.18413687, -0.31413674, -0.13043414, -0.15118152, -0.15326938, -0.10720126, -0.23738635, 0.13481396, 0.25115076, -0.009316611, -0.2584441, -0.14389823) * go_3(-1.0, 1.0);
result += mat4(-0.039723795, -0.14869407, -0.1692942, 0.026501274, -0.10685166, -0.121267825, -0.08584318, -0.09580693, -0.10626739, -0.068417974, 0.11321909, -0.13664317, 0.061380867, -0.2587898, 0.14850819, 0.008178645) * go_3(0.0, -1.0);
result += mat4(0.06912782, 0.24230564, -0.048150286, 0.2203717, -0.17417085, 0.105546735, -0.16648416, -0.0045053074, 0.09764028, 0.37122592, -0.1939995, -0.27899942, -0.088152565, -0.53869057, 0.21676709, -0.08056594) * go_3(0.0, 0.0);
result += mat4(0.07651754, 0.03704878, -0.0197015, 0.1660726, 0.07002748, -0.11820414, -0.23360898, 0.1481592, 0.029847002, 0.054057185, 0.013176299, 0.06552942, -0.13865773, -0.20105527, -0.37550658, 0.005769631) * go_3(0.0, 1.0);
result += mat4(-0.22697811, -0.17426412, 0.10148018, 0.008134666, 0.10771455, 0.16943407, -0.016319012, -0.40176705, -0.06854668, -0.049045276, 0.20919096, 0.13240765, -0.050125647, 0.14902508, 0.052697595, -0.13817468) * go_3(1.0, -1.0);
result += mat4(0.04301619, 0.23184754, -0.023551717, 0.3768405, 0.028999053, 0.06709736, -0.05993663, -0.059861984, 0.15499207, -0.22217415, 0.111131504, -0.09082529, -0.19389243, 0.024621522, -0.15305442, 0.010799284) * go_3(1.0, 0.0);
result += mat4(-0.035496738, 0.010802548, -0.028718363, 0.19263634, 0.16900502, -0.16661702, -0.027631328, 0.18309957, -0.015860107, -0.03309961, -0.091390446, 0.14000848, -0.0036591904, 0.47659522, -0.09373507, -0.29020965) * go_3(1.0, 1.0);
result += vec4(0.08895955, -0.027667087, 0.20500831, 0.00037762933);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_4_tf
//!BIND conv2d_4_tf1
//!SAVE conv2d_5_tf
//!WIDTH conv2d_4_tf.w
//!HEIGHT conv2d_4_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(0.018134737, -0.2296755, -0.07276725, -0.029795367, 0.05382051, 0.092847414, -0.024469728, -0.1674685, 0.0017946451, 0.30074653, 0.0034195695, -0.04892261, 0.18229689, -0.20116119, -0.12702174, -0.08259108) * go_0(-1.0, -1.0);
result += mat4(-0.1357695, -0.08149211, 0.09314453, -0.21966846, 0.34740716, 0.043606415, 0.04225903, 0.034449834, 0.17248215, 0.39148283, -0.13868807, -0.010550686, 0.044238456, -0.09693464, -0.005044985, 0.24383289) * go_0(-1.0, 0.0);
result += mat4(0.19959371, 0.098685324, 0.058746945, 0.010580748, 0.08051514, 0.031898864, 0.017556064, 0.13004355, -0.01727653, 0.11044019, 0.040673427, -0.20064595, -0.23321067, 0.06398686, -0.19126236, -0.2430858) * go_0(-1.0, 1.0);
result += mat4(-0.12870286, -0.113455534, 0.23722827, 0.070718594, 0.19049989, -0.1927299, -0.06343845, 0.113127775, 0.082530305, -0.10972526, -0.090779535, 0.05731582, 0.11018802, -0.18049154, 0.09269507, -0.10304576) * go_0(0.0, -1.0);
result += mat4(0.15513484, 0.06659583, 0.08125296, -0.012350324, -0.09492788, 0.5048303, 0.13206847, 0.39554298, 0.28953737, -0.20913891, -0.26781562, -0.17539899, 0.023778774, 0.29716817, 0.15768486, 0.37702608) * go_0(0.0, 0.0);
result += mat4(0.0724462, 0.015571356, -0.032217246, 0.0050658924, -0.22708446, 0.03968809, 0.016753826, 0.0025668752, -0.055932112, 0.113931604, 0.19766758, -0.030027265, -0.17384295, 0.15013468, -0.0070017707, -0.09469028) * go_0(0.0, 1.0);
result += mat4(-0.078361556, -0.0954201, -0.006358101, 0.040500037, 0.4190454, -0.17622913, -0.07234791, 0.05462559, 0.18641087, 0.058313597, -0.0180785, 0.13818781, -0.14640772, 0.0699486, 0.0073663946, -0.076789856) * go_0(1.0, -1.0);
result += mat4(-0.21421191, 0.08736062, 0.09041226, 0.03608585, 0.02769972, 0.09641289, 0.11824623, 0.05653645, 0.16464607, 0.19839554, -0.13379547, 0.054417104, 0.067530684, 0.18971571, 0.13785432, -0.097639814) * go_0(1.0, 0.0);
result += mat4(-0.32658005, -0.14606023, -0.069448665, 0.032998275, -0.28331423, 0.0011900732, -0.020304207, -0.13535896, 0.08298347, 0.045509677, -0.030503955, -0.037504148, 0.049955815, 0.0925771, 0.00058534974, -0.12398032) * go_0(1.0, 1.0);
result += mat4(-0.2955836, 0.29059318, -0.018196672, -0.35866606, -0.01309431, 0.03540315, 0.010609202, 0.11956812, 0.10296229, 0.22536302, 0.015201129, -0.23797737, -0.16960852, -0.11414787, -0.034440614, 0.112644605) * go_1(-1.0, -1.0);
result += mat4(-0.14952518, 0.07024436, -0.083184876, -0.0814617, -0.13303639, 0.016159372, -0.13521518, 0.2221334, -0.056617837, 0.12958299, 0.064461656, -0.20146395, -0.16023181, 0.2640758, 0.27528805, -0.1426518) * go_1(-1.0, 0.0);
result += mat4(-0.04382363, 0.09856003, -0.08561442, -0.15699928, -0.121069774, 0.04685383, -0.009170197, -0.031489655, 0.18730178, 0.238442, 0.22497098, 0.032015145, -0.03709115, 0.1535079, 0.21674158, 0.10678019) * go_1(-1.0, 1.0);
result += mat4(-0.12200952, 0.24224263, 0.034097504, -0.028179523, -0.011962496, -0.04489487, -0.05198827, 0.22194928, -0.045400873, -0.049828544, 0.111477956, -0.098361604, 0.12788995, -0.016093334, -0.19886433, -0.011161484) * go_1(0.0, -1.0);
result += mat4(0.30563712, 0.013071727, -0.004799883, 0.12888052, -0.259498, -0.041566677, 0.07311124, 0.162324, 0.28371668, -0.004693743, -0.0019395344, 0.029358242, 0.08730285, 0.12184509, 0.05508437, 0.048439097) * go_1(0.0, 0.0);
result += mat4(0.12760857, 0.115813166, -0.217695, -0.10629871, -0.227366, 0.09030426, -0.15313712, 0.020528946, -0.20743734, 0.088583544, 0.04594053, -0.22891994, 0.18949282, -0.042186577, -0.17330512, -0.010711361) * go_1(0.0, 1.0);
result += mat4(0.029503195, 0.0063797613, -0.17004286, -0.096844055, 0.010218098, 0.04247233, 0.02362808, 0.14700809, -0.08082364, 0.11159672, -0.018505255, -0.15228583, 0.15693732, -0.025359154, 0.024829186, 0.1943192) * go_1(1.0, -1.0);
result += mat4(-0.03912932, -0.21989027, 0.12203028, 0.18702275, -0.118537985, 0.21039696, 0.09102061, 0.012288879, 0.031666897, 0.1318455, -0.04901404, -0.07516063, -0.44782668, 0.04884501, 0.047070876, 0.008728358) * go_1(1.0, 0.0);
result += mat4(-0.08669101, 0.3053463, -0.08963947, 0.0034188698, -0.070004664, 0.064788476, 0.093737036, 0.070050925, 0.12728429, -0.13179256, -0.014913502, 0.09308136, -0.027638942, 0.008638711, 0.08794172, -0.05531093) * go_1(1.0, 1.0);
result += mat4(0.0728421, 0.07872358, 0.11454748, 0.08497922, 0.071820416, -0.11789207, -0.08184197, 0.1359588, -0.2143346, -0.05876081, 0.023172129, -0.08430511, -0.19276723, 0.14283359, 0.15604696, -0.055187486) * go_2(-1.0, -1.0);
result += mat4(0.068641685, 0.2732106, -0.2809107, 0.12736696, -0.08642367, 0.023898933, -0.17859498, -0.18299665, -0.06684587, -0.12204666, 0.45898953, -0.24240111, 0.25182098, -0.04395751, 0.10637211, -0.22135144) * go_2(-1.0, 0.0);
result += mat4(0.0852072, 0.051133018, 0.03333165, -0.0008938216, 0.10251267, 0.0550774, 0.041769378, -0.21259712, 0.286912, 0.123342015, 0.282759, -0.0730124, 0.14275575, -0.15580742, -0.15224406, 0.045376908) * go_2(-1.0, 1.0);
result += mat4(0.03328225, 0.11563978, -0.07451964, 0.030546209, -0.04698351, -0.18544962, 0.037350416, 0.13969816, 0.0556746, -0.06359919, 0.06478219, -0.031694926, 0.13396506, 0.09443612, -0.01922686, -0.06290365) * go_2(0.0, -1.0);
result += mat4(0.07495407, 0.063429266, -0.106221214, -0.085107304, 0.2497817, -0.46598253, -0.18833177, -0.2731128, -0.13024822, 0.56053543, 0.055704467, -0.12331414, -0.031199086, 0.05061188, 0.22097112, -0.6611177) * go_2(0.0, 0.0);
result += mat4(0.08276988, -0.044184342, -0.03562185, -0.06159881, 0.27694225, -0.07192965, -0.08663714, 0.020221777, 0.14095962, -0.06229397, 0.051374253, -0.038158998, 0.10664802, -0.041305423, 0.051260717, -0.054698635) * go_2(0.0, 1.0);
result += mat4(0.12800686, 0.03485072, 0.039914366, 0.034041498, -0.08305794, -0.046292894, 0.22765331, 0.10904922, 0.0013937047, -0.08750301, 0.009126207, -0.065589435, 0.2837707, 0.08884436, -0.07234862, -0.093502745) * go_2(1.0, -1.0);
result += mat4(0.113439895, 0.06081726, 0.1122302, -0.022936966, 0.10329637, -0.31816107, -0.051597945, 0.23846027, -0.083913095, -0.29872265, -0.040147282, -0.08981918, -0.04329814, -0.12339693, -0.034489952, 0.013393211) * go_2(1.0, 0.0);
result += mat4(0.33091688, 0.1726297, 0.034332044, -0.091396205, 0.15434311, -0.0022870845, -0.15506189, 0.08710491, -0.16063525, 0.042252056, 0.017086457, 0.08134797, 0.08631321, 0.037843138, 0.088296555, 0.0064518084) * go_2(1.0, 1.0);
result += mat4(0.09161051, 0.114355795, -0.15304486, -0.030537153, 0.1835368, -0.3287635, 0.031197926, 0.09717476, 0.04276852, 0.113250345, 0.05949038, -0.10599563, 0.43574792, -0.060788117, 0.18409383, 0.12678055) * go_3(-1.0, -1.0);
result += mat4(-0.018356865, -0.0072578182, 0.12020777, -0.013127592, 0.20136636, -0.22984362, 0.06896224, 0.00044982752, 0.008428429, -0.123316936, -0.09989286, 0.078248784, -0.16313677, -0.003020313, -0.46285018, -0.08967125) * go_3(-1.0, 0.0);
result += mat4(-0.03451497, -0.10864502, 0.13207638, 0.17194521, 0.0037514758, -0.20222199, -0.12535086, 0.001511977, 0.056294486, -0.2112898, 0.078261316, 0.10118746, -0.044742294, 0.21793383, -0.19927903, -0.21338293) * go_3(-1.0, 1.0);
result += mat4(-0.034903776, -0.10167085, 0.031066334, 0.0379958, 0.20532596, -0.17457838, 0.16556816, -0.0021619152, 0.02682665, 0.03396325, -0.059273884, 0.1922813, -0.072151475, -0.010240544, 0.2302027, 0.12385962) * go_3(0.0, -1.0);
result += mat4(-0.20170145, -0.08203941, -0.028107846, -0.18003726, 0.44744352, -0.13190243, 0.13233365, 0.03626546, 0.085763134, -0.25613126, -0.11213388, 0.15529087, -0.271649, 0.050587676, -0.062583975, 0.057289865) * go_3(0.0, 0.0);
result += mat4(-0.040649455, -0.17949733, 0.35847965, -0.040587306, 0.24314344, -0.23811667, 0.13958354, 0.04961874, 0.09858903, -0.04202913, -0.21850993, 0.0700419, -0.09130745, -0.096835814, 0.0022782686, -0.25416258) * go_3(0.0, 1.0);
result += mat4(-0.08215545, -0.019647893, 0.055263475, 0.053733055, 0.098485716, -0.1041945, -0.06541415, -0.08868577, -0.07262986, 0.03513784, -0.110529095, -0.03369232, 0.056786604, 0.2569229, -0.05931065, -0.22081214) * go_3(1.0, -1.0);
result += mat4(0.066926084, 0.029664058, -0.10779271, 0.11026963, 0.23927264, -0.16914488, 0.022947345, 0.12303853, -0.07066212, -0.013205378, 0.15348643, 0.035568032, 0.20966691, 0.010149819, -0.08814468, -0.064854674) * go_3(1.0, 0.0);
result += mat4(0.11493852, -0.074924305, -0.14840698, -0.16956823, 0.056806292, -0.06387947, -0.06880271, -0.04637334, -0.1929893, 0.18226422, 0.064644486, -0.1594863, 0.027403917, 0.13951495, -0.06569123, -0.07700207) * go_3(1.0, 1.0);
result += vec4(-0.043347504, -0.20504741, -0.037821215, -0.014486937);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_4_tf
//!BIND conv2d_4_tf1
//!SAVE conv2d_5_tf1
//!WIDTH conv2d_4_tf.w
//!HEIGHT conv2d_4_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_4_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(0.047881734, -0.09396414, -0.2839081, 0.3140853, 0.052613556, 0.09940423, 0.23960467, -0.022228222, -0.12065009, 0.07898222, 0.08657881, 0.010852739, -0.050450284, 0.01683982, 0.031813968, 0.053060856) * go_0(-1.0, -1.0);
result += mat4(-0.10252411, -0.03116448, -0.30114275, -0.0316799, -0.017501019, -0.03006003, -0.2095696, 0.10134927, -0.3901916, -0.15335023, -0.11955071, 0.1337449, 0.101239376, -0.25044814, 0.2128469, 0.018979514) * go_0(-1.0, 0.0);
result += mat4(-0.13392173, 0.052036732, 0.1682114, -0.026263753, 0.027221246, -0.15121374, 0.13723798, 0.08950682, -0.1182108, -0.07294226, 0.023392374, 0.052329235, -0.05632852, -0.07036173, 0.06872573, 0.05238042) * go_0(-1.0, 1.0);
result += mat4(0.18112028, 0.18242362, -0.06812871, 0.032463413, 0.124638766, -0.26765212, -0.07678663, 0.33806562, 0.09674393, 0.15574542, 0.23634006, -0.02873782, -0.1626769, -0.14760062, -0.007274849, 0.09866139) * go_0(0.0, -1.0);
result += mat4(-0.10726673, -0.10925056, 0.19967109, -0.19936769, 0.15942842, -0.14870064, 0.15493345, -0.08489036, -0.49053356, -0.17321263, 0.28426084, 0.18721215, -0.09898434, -0.2751838, -0.11833524, 0.028445128) * go_0(0.0, 0.0);
result += mat4(-0.11788817, -0.23724948, -0.046072144, 0.035621114, 0.04527003, -0.0073492974, 0.11097195, 0.06806836, 0.04814677, -0.1408476, -0.1325629, 0.00929532, -0.16699041, -0.03034791, 0.08320368, -0.15429299) * go_0(0.0, 1.0);
result += mat4(0.2729515, 0.008244692, -0.17441982, -0.39026466, 0.17381759, 0.31194404, 0.055934936, 0.20744409, 0.20119062, 0.0734271, 0.0796807, 0.0031037466, -0.0016392237, 0.033733975, 0.07149338, 0.042083208) * go_0(1.0, -1.0);
result += mat4(0.07985744, 0.10945015, 0.018472541, 0.1397503, 0.2005682, 0.42641, 0.23022486, -0.2916921, 0.028285174, -0.31885162, -0.27070364, -0.10390779, 0.0751492, 0.12752363, -0.2279459, 0.08998453) * go_0(1.0, 0.0);
result += mat4(0.18450491, -0.140783, -0.008006845, 0.09029298, 0.12536179, 0.26949662, 0.09491545, 0.063907005, 0.11212244, 0.09778506, -0.1835966, -0.053119674, 0.0072294096, 0.25018227, 0.010868525, -0.22721334) * go_0(1.0, 1.0);
result += mat4(-0.028011927, -0.20073172, 0.5976166, -0.19494139, 0.17958745, -0.03838646, 0.058325976, -0.29409218, -0.12793432, 0.03245129, 0.35662368, -0.05048354, -0.13368197, -0.06151968, -0.012714591, -0.1763054) * go_1(-1.0, -1.0);
result += mat4(0.18468465, 0.31682113, 0.12818255, -0.117110476, 0.13709468, -0.10034022, -0.07994527, -0.1259309, 0.04067299, -0.1147398, 0.28361055, 0.27916273, 0.03696692, 0.16829546, 0.27819383, 0.08305029) * go_1(-1.0, 0.0);
result += mat4(-0.28920117, -0.033877946, 0.01586206, 0.04681198, 0.024248574, -0.045777842, -0.03342128, 0.07525412, -0.063377544, -0.016737273, 0.11235511, -0.04325238, -0.24170023, -0.09993599, -0.03205371, 0.14339828) * go_1(-1.0, 1.0);
result += mat4(-0.008357902, -0.11038377, 0.03709221, 0.26775306, 0.07963845, -0.25377446, -0.17630441, -0.10966474, 0.057311732, -0.083327, 0.044497233, 0.06903858, -0.26531395, -0.103399664, -0.14806591, 0.269314) * go_1(0.0, -1.0);
result += mat4(0.05450808, -0.041993964, -0.07217651, 0.034468375, 0.2117634, 0.0075620585, 0.05825411, -0.2252478, -0.0527787, 0.049732126, -0.032040413, -0.09361454, 0.29585132, 0.018413153, 0.18384546, -0.024226356) * go_1(0.0, 0.0);
result += mat4(-0.031109914, 0.19351351, 0.07405522, -0.06313074, -0.09983541, -0.011495182, 0.11749038, -0.16775608, 0.2790974, -0.09338754, 0.07913264, 0.103792936, -0.18679164, -0.15639925, 0.112943865, 0.07930375) * go_1(0.0, 1.0);
result += mat4(0.004106195, -0.036833283, 0.12908752, 0.12869535, -0.02472107, 0.17561707, -0.025890926, -0.18789047, 0.096218705, -0.16306408, -0.02198454, -0.010134957, -0.09710009, 0.002062143, -0.046785697, 0.0029441968) * go_1(1.0, -1.0);
result += mat4(0.19648251, -0.015663045, -0.0730215, 0.028611008, 0.13529862, -0.015256192, -0.04119306, -0.24628192, 0.02601027, -0.21184283, -0.1962902, 0.09109358, -0.06792383, 0.092336476, 0.12215351, -0.08596062) * go_1(1.0, 0.0);
result += mat4(-0.17530201, -0.0351919, -0.31872514, -0.13933206, -0.07000922, -0.049807087, 0.0010997375, -0.033573963, 0.07442056, -0.33290103, -0.40381998, 0.09435, -0.3280128, -0.09953127, -0.11283648, 0.20685865) * go_1(1.0, 1.0);
result += mat4(-0.052573867, -0.035328753, -0.11132943, -0.17515652, 0.05021051, 0.058642425, -0.046640664, 0.0799107, -0.027398815, -0.33619994, -0.22135767, 0.07894002, -0.14941697, -0.0940996, -0.11655085, 0.049795926) * go_2(-1.0, -1.0);
result += mat4(-0.039301276, 0.041062318, 0.20312686, -0.009338705, 0.013706282, -0.0245852, 0.03458311, 0.09601228, -0.18203016, -0.012260314, 0.17984508, -0.056576703, -0.102844186, 0.24047872, 0.05307189, 0.16066082) * go_2(-1.0, 0.0);
result += mat4(0.1478775, 0.0046362123, 0.05459521, 0.07162838, -0.01896149, 0.23700175, -0.14174299, 0.06988599, -0.32545477, -0.08065096, -0.061227743, -0.0010796773, 0.094327345, -0.20760082, -0.19523263, 0.19859222) * go_2(-1.0, 1.0);
result += mat4(-0.049676366, -0.10381536, 0.02546116, -0.13127093, 0.10954914, 0.0048147943, 0.06962328, -0.30456528, -0.11956627, 0.0150488885, -0.10711722, 0.1684613, -0.1939089, -0.10577047, -0.11980919, -0.036988296) * go_2(0.0, -1.0);
result += mat4(-0.054795764, 0.09491116, -0.08494948, 0.059765853, 0.0131597435, 0.20786162, 0.11999637, 0.024381055, 0.22830428, 0.027053319, -0.011646274, -0.12145409, -0.07899559, -0.012688263, 0.10684157, 0.3824219) * go_2(0.0, 0.0);
result += mat4(-0.23994572, -0.0031532666, -0.0050638164, 0.14236279, 0.05690383, -0.06259682, 0.052624144, 0.20461404, -0.19230312, -0.11072268, 0.013023965, 0.08931543, -0.21997221, 0.11760443, -0.40943825, 0.28656834) * go_2(0.0, 1.0);
result += mat4(-0.06606179, 0.26007771, 0.033754125, 0.119690455, 0.024669139, -0.06752839, 0.12688096, -0.0063201943, -0.17123021, 0.07548857, -0.14213699, 0.034093797, -0.15632647, -0.123243414, -0.42634043, 0.1715022) * go_2(1.0, -1.0);
result += mat4(-0.046503466, 0.13876389, 0.17973013, -0.25938338, -0.18824704, -0.11876702, 0.31065792, -0.041042212, -0.061369427, 0.2057992, 0.17295738, 0.3836555, -0.21109799, -0.10167118, 0.16577047, 0.113483034) * go_2(1.0, 0.0);
result += mat4(-0.24534856, -0.014482421, 0.22515748, -0.12773542, 0.12794174, -0.02528619, 0.41710484, 0.09154934, -0.17805946, -0.25428918, 0.07294183, 0.047079418, -0.30949152, -0.08919157, 0.17888431, 0.17706038) * go_2(1.0, 1.0);
result += mat4(-0.1741826, 0.046225294, -0.10761791, 0.2619953, 0.007373745, 0.05104337, -0.22309966, 0.34529984, -0.034363825, -0.022187237, -0.08609555, 0.16842419, 0.28136057, 0.17843607, -0.11307746, -0.05668021) * go_3(-1.0, -1.0);
result += mat4(-0.12310616, -0.29661375, -0.10581025, -0.049584012, 0.19651765, 0.08436489, -0.14533581, -0.029874112, -0.15422897, -0.062741704, -0.22694711, -0.15547274, -0.15181333, 0.0286061, 0.022438493, -0.062447168) * go_3(-1.0, 0.0);
result += mat4(0.3497046, -0.09455009, 0.060618952, -0.2134236, 0.054515295, 0.07451165, -0.09267233, -0.010513333, 0.13842636, 0.11563433, -0.054750167, 0.050432, 0.1514256, 0.04284002, -0.2095581, 0.07907657) * go_3(-1.0, 1.0);
result += mat4(-0.11745651, -0.04717057, 0.085377194, -0.065956995, 0.07280491, 0.2730059, 0.11088276, 0.2437957, 0.14018989, 0.1164107, -0.09516929, 0.0022427947, 0.111544006, -0.0680495, 0.09324579, -0.12482022) * go_3(0.0, -1.0);
result += mat4(-0.07995795, -0.03387884, 0.019846136, 0.10231208, -0.07017192, 0.18659039, 0.035161644, 0.101182766, -0.14901665, 0.21307294, 0.063894205, -0.27546507, -0.24792959, -0.067731075, 0.13146006, -0.19333683) * go_3(0.0, 0.0);
result += mat4(0.034206454, 0.1472648, -0.07406727, 0.014654025, 0.18703444, 0.1319857, -0.10610886, 0.08427947, -0.017536618, -0.06487879, -0.12095286, -0.050414838, 0.03260879, 0.1558894, -0.031887084, 0.11840288) * go_3(0.0, 1.0);
result += mat4(0.114811294, -0.14574333, -0.09392587, 0.042283528, 0.08919092, 0.18259068, 0.0980717, 0.21024778, -0.1280008, -0.027260462, -0.1129027, 0.18722472, 0.13733985, 0.047153983, 0.030871978, 0.1998385) * go_3(1.0, -1.0);
result += mat4(-0.06783575, 0.004612595, 0.1153467, -0.11531557, -0.048889533, 0.07673577, -0.02041786, 0.22744459, -0.13092506, 0.13484807, 0.40003043, -0.053706612, -0.16985156, -0.04791236, -0.052443005, -0.08363625) * go_3(1.0, 0.0);
result += mat4(0.18187882, 0.017893985, 0.17856054, 0.005413129, 0.014147176, 0.15102178, 0.12436294, -0.02176765, -0.16727823, -0.0364111, 0.17074408, 0.12899421, 0.31984514, -0.0072070034, 0.031895883, -0.1991405) * go_3(1.0, 1.0);
result += vec4(-0.011865144, 0.11717201, -0.13823777, -0.059450272);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_5_tf
//!BIND conv2d_5_tf1
//!SAVE conv2d_6_tf
//!WIDTH conv2d_5_tf.w
//!HEIGHT conv2d_5_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.082203194, 0.021720003, 0.03725474, -0.08048348, 0.2063248, -0.033020593, -0.17585336, 0.06476272, 0.012244563, 0.026554609, 0.014708393, 0.26606125, 0.14248778, 0.12817341, -0.039826933, -0.12751861) * go_0(-1.0, -1.0);
result += mat4(0.24573852, 0.19695967, -0.06257417, -0.04782871, 0.3511875, -0.018083302, -0.077342674, 0.15247667, 0.20321761, -0.07479984, -0.09548503, 0.08109568, -0.23808748, 0.07246303, -0.004242619, 0.16162953) * go_0(-1.0, 0.0);
result += mat4(0.13296306, 0.19495387, 0.009222276, 0.033592198, 0.20443891, 0.16063854, -0.2581601, -0.016132578, -0.2296461, -0.23647323, -0.15407176, -0.18265317, 0.2343241, -0.049697313, -0.09398783, 0.41931856) * go_0(-1.0, 1.0);
result += mat4(-0.10866088, -0.40605694, -0.0042648134, 0.07943803, 0.26914695, 0.14816476, 0.037706107, -0.123223364, -0.19962949, -0.053534556, -0.08397409, -0.04244924, -0.075791344, 0.29629225, 0.2311928, 0.099177904) * go_0(0.0, -1.0);
result += mat4(-0.1748319, -0.2003186, -0.32659066, -0.21007413, 0.20122464, 0.032196607, -0.026299698, 0.33395135, 0.11411664, 0.05971959, 0.09001304, -0.15936212, 0.012322024, 0.19936106, -0.411186, -0.08319479) * go_0(0.0, 0.0);
result += mat4(-0.07349218, 0.006184436, 0.096199185, -0.050186496, 0.064047046, -0.03813128, -0.057007037, -0.025550695, -0.2863145, -0.008512981, -0.20615962, 0.18009211, 0.008298396, 0.22452813, 0.010843521, 0.20169461) * go_0(0.0, 1.0);
result += mat4(0.2691149, 0.059546687, 0.08922005, 0.2252196, 0.30341956, -0.024489028, 0.087045394, -0.03856442, -0.14083561, -0.17683443, 0.14137806, 0.15520614, 0.2073925, -0.19525874, 0.23661858, 0.3098405) * go_0(1.0, -1.0);
result += mat4(0.006530723, 0.04180736, -0.04762067, -0.064395495, 0.02396811, -0.13332283, 0.0037775645, 0.026309434, 0.0033065109, -0.08315753, 0.02917419, 0.12330464, 0.22819455, -0.07489677, 0.12829056, -0.097994626) * go_0(1.0, 0.0);
result += mat4(-0.09983759, 0.032783493, 0.11085758, 0.08993078, -0.057110567, -0.018973934, -0.14946178, -0.03921629, 0.039757587, 0.015860094, 0.04989561, -0.19634786, 0.04351146, 0.019315343, 0.25972188, 0.17989321) * go_0(1.0, 1.0);
result += mat4(-0.04111906, -0.165601, 0.0003682197, -0.056232415, -0.32716644, -0.24015541, -0.057547837, 0.05966729, 0.06854747, 0.03599213, -0.18798864, 0.1183447, 0.014268468, -0.1310834, 0.06415977, -0.19414157) * go_1(-1.0, -1.0);
result += mat4(-0.00070661673, 0.17671427, 0.10584568, -0.060910843, -0.104282066, -0.22676118, -0.01907062, 0.24882245, -0.043454725, 0.07691623, -0.48371696, 0.013537671, -0.025488405, 0.061228953, 0.18548754, 0.028671112) * go_1(-1.0, 0.0);
result += mat4(-0.0121596735, 0.09595702, -0.08244918, -0.1176173, 0.26773354, -0.021729136, 0.075465776, -0.0928876, 0.12461298, 0.16830076, -0.15302569, 0.113850676, 0.09811088, 0.13006307, 0.24999009, 0.10261325) * go_1(-1.0, 1.0);
result += mat4(-0.032246377, 0.038265374, -0.26476422, -0.1442876, -0.19866082, 0.08649541, 0.041478764, 0.11155026, 0.21576422, -0.09572912, -0.11174068, -0.19722937, -0.15801935, 0.29604745, -0.08606268, -0.15532136) * go_1(0.0, -1.0);
result += mat4(-0.06315591, 0.16151646, -0.009230362, -0.04341246, 0.09085519, 0.21924476, 0.38044852, 0.193819, 0.16622902, 0.0025134624, -0.22688466, -0.025276015, 0.07714917, 0.16302192, -0.11767101, -0.11086476) * go_1(0.0, 0.0);
result += mat4(-0.04170153, 0.001859292, -0.26352355, 0.10982333, -0.031867817, 0.15773517, -0.060263418, 0.11117763, -0.017359972, 0.0127261225, 0.0782802, -0.16908924, 0.080516845, -0.05691526, -0.07530135, -0.14553802) * go_1(0.0, 1.0);
result += mat4(0.06112685, -0.032287434, 0.17445667, -0.044935808, -0.11449107, -0.051394563, -0.029589338, -0.14555557, 0.03440661, 0.11035615, -0.17175, -0.14851089, 0.037362, -0.18740481, 0.17278154, 0.18073405) * go_1(1.0, -1.0);
result += mat4(-0.27670652, 0.19484822, 0.2609349, 0.1455016, 0.04438468, 0.1449185, 0.11185832, -0.18598269, -0.019846648, 0.11886126, -0.098498635, 0.15737785, 0.011406795, -0.18860829, -0.13705735, 0.17535745) * go_1(1.0, 0.0);
result += mat4(-0.30244905, -0.28695273, 0.1146976, 0.21144345, -0.037980128, -0.027679864, -0.13992494, -0.04884521, -0.032023884, -0.07921183, -0.16042095, -0.06935386, -0.06570237, -0.1107404, -0.018163798, 0.22625941) * go_1(1.0, 1.0);
result += mat4(-0.07292955, -0.07321777, -0.045146503, -0.33291966, -0.096732594, -0.07203495, 0.33692798, 0.2870733, 0.122160144, -0.076574564, 0.042844944, 0.26448342, 0.07672146, -0.028775277, -0.12088313, 0.15583947) * go_2(-1.0, -1.0);
result += mat4(0.21589327, 0.05258274, 0.09705794, -0.024653846, -0.039402515, 0.28485695, 0.14711736, -0.10556087, -0.15140481, 0.09039498, 0.017308712, 0.11862922, 0.08230978, 0.21678248, -0.043815188, -0.226433) * go_2(-1.0, 0.0);
result += mat4(-0.029258793, 0.26618922, 0.02564014, -0.23189862, -0.24074338, -0.18556763, 0.25973624, 0.04746873, 0.0137007125, -0.22239363, -0.12414957, 0.048228756, -0.22406264, 0.282667, -0.021001073, -0.17465611) * go_2(-1.0, 1.0);
result += mat4(0.32401654, -0.1495363, -0.20869227, 0.04271639, -0.0087802755, 0.031325378, 0.23834595, 0.039336167, 0.17265107, 0.20947595, 0.28737286, 0.0028783784, -0.057340365, -0.050347418, -0.11915604, -0.1831807) * go_2(0.0, -1.0);
result += mat4(0.1811338, 0.07732653, 0.20975596, -0.47129005, 0.07121942, 0.08410583, 0.44170937, -0.19524159, -0.17807977, 0.12837476, 0.20816846, -0.1741958, -0.04411918, 0.06024972, 0.18159702, -0.052485272) * go_2(0.0, 0.0);
result += mat4(-0.15229738, 0.27513, 0.28150418, -0.19543962, -0.02045864, -0.07207227, 0.09589587, 0.09110817, 0.061413247, 0.0046052113, 0.11619411, -0.2988938, 0.065739445, 0.10205611, 0.12847126, -0.028355654) * go_2(0.0, 1.0);
result += mat4(0.0657154, -0.047568597, -0.16148911, 0.16392621, -0.25281775, -0.061153214, 0.017480455, -0.026288848, 0.20319715, 0.04763355, 0.010444491, -0.26671803, -0.25821987, 0.32863674, -0.30734694, -0.18190521) * go_2(1.0, -1.0);
result += mat4(-0.042703815, 0.06633036, -0.048434302, -0.17176376, -0.12699759, -0.1124558, 0.083266065, 0.03354623, -0.13468939, 0.12706263, 0.053659134, -0.06930602, 0.008196115, 0.2034998, -0.06351442, -0.039730288) * go_2(1.0, 0.0);
result += mat4(0.09614661, 0.22500272, 0.088511504, -0.16960482, 0.15364788, -0.18854137, -0.13163191, -0.07503735, -0.23177068, -0.0053305267, -0.041978605, 0.0971947, -0.049034655, 0.04486706, 0.09076307, -0.02310868) * go_2(1.0, 1.0);
result += mat4(-0.1304683, 0.17743458, -0.09817326, -0.0646786, 0.07886976, 0.20109388, -0.034114968, -0.2029261, -0.03348398, 0.029337432, -0.07302782, -0.02240758, 0.030242773, -0.30032325, 0.02085572, -0.027314361) * go_3(-1.0, -1.0);
result += mat4(-0.037377544, 0.026350772, -0.07430488, -0.114671774, -0.126935, -0.046512567, -0.033628833, -0.19018382, -0.041053895, -0.031206857, 0.08562848, -0.01875709, 0.21099389, -0.092511, 0.0073047103, -0.009811013) * go_3(-1.0, 0.0);
result += mat4(0.11358029, 0.17468451, -0.12739041, -0.14332245, -0.22230148, 0.16862972, -0.04462456, 0.2469604, -0.008622369, 0.0081848325, -0.17032363, -0.16024362, 0.21178265, 0.037127133, 0.08559072, 0.11584694) * go_3(-1.0, 1.0);
result += mat4(0.008993893, -0.08037705, 0.4426555, 0.15593371, 0.15273719, -0.03249998, 0.055109, -0.1512612, -0.037183985, 0.20825677, -0.08516227, -0.06664223, -0.10011001, -0.3505215, -0.17941694, 0.052089088) * go_3(0.0, -1.0);
result += mat4(-0.109703645, -0.13505603, 0.1336451, 0.13118869, 0.010915504, 0.12748592, 0.21201555, -0.40841985, -0.11059143, 0.033772044, -0.039282143, 0.03095394, 0.10394723, -0.21343367, -0.10699851, -0.028351074) * go_3(0.0, 0.0);
result += mat4(0.019704714, 0.06243651, 0.09896519, -0.17492259, 0.012675787, -0.004239029, 0.21319824, 0.069183126, -0.0071114586, 0.123431124, -0.24479835, 0.00723795, -0.045293927, 0.014101029, 0.15746681, 0.042405806) * go_3(0.0, 1.0);
result += mat4(0.023828225, -0.0015190929, 0.1194638, 0.082163885, 0.10532113, 0.042044062, 0.02528007, 0.015175004, 0.026613194, 0.33525538, -0.1627064, -0.29887968, -0.197707, 0.038967777, -0.15811683, -0.106895216) * go_3(1.0, -1.0);
result += mat4(0.044362027, -0.04946742, -0.14815849, -0.17660522, -0.034201477, -0.012243106, -0.050183997, 0.06407372, 0.039822515, 0.15880872, -0.0672721, -0.4081093, 0.019489579, -0.060278706, -0.015096743, -0.07799167) * go_3(1.0, 0.0);
result += mat4(0.11861756, 0.27113584, -0.14107186, -0.10246008, -0.124051, -0.1627854, 0.10698585, 0.2846401, -0.061731786, 0.1724438, -0.12428688, -0.09986041, -0.034171514, -0.07100923, 0.041739646, -0.11308375) * go_3(1.0, 1.0);
result += vec4(-0.02981662, -0.26338395, -0.011632586, 0.15063232);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_5_tf
//!BIND conv2d_5_tf1
//!SAVE conv2d_6_tf1
//!WIDTH conv2d_5_tf.w
//!HEIGHT conv2d_5_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_5_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(0.17082009, 0.031344634, -0.06131912, 0.00887183, -0.01528174, 0.12943709, 0.24537678, 0.008178781, -0.312396, -0.023583878, 0.07827866, -0.1231261, 0.15081584, -0.18161978, -0.25179705, -0.036934935) * go_0(-1.0, -1.0);
result += mat4(-0.05768411, 0.16785417, -0.1788644, -0.0067257965, 0.021445744, 0.10066516, -0.23864186, 0.1450302, 0.12892793, 0.19856106, -0.24444748, 0.16531628, -0.044425935, -0.02775357, 0.009059946, -0.12958384) * go_0(-1.0, 0.0);
result += mat4(-0.025798557, -0.17238182, -0.34056288, -0.20921059, -0.03576266, 0.1476854, -0.06264234, 0.14452787, -0.04130045, -0.07275762, 0.034578666, 0.2914669, 0.20879944, 0.21359251, -0.048695553, 0.2638088) * go_0(-1.0, 1.0);
result += mat4(-0.022791177, 0.4204545, 0.116855636, 0.20241925, -0.010444933, -0.14462502, 0.022550104, -0.24423064, -0.09417524, 0.045358784, -0.11405829, 0.035979558, -0.2283092, -0.06670842, -0.23852053, -0.22417003) * go_0(0.0, -1.0);
result += mat4(-0.14526704, 0.040880535, 0.14076385, 0.07795045, -0.059177604, -0.13056375, -0.3373641, -0.19344307, -0.29891858, -0.32578763, -0.29061425, 0.1562214, -0.13578376, 0.36586633, 0.24936736, 0.054629393) * go_0(0.0, 0.0);
result += mat4(-0.025790233, -0.13020341, -0.10084969, 0.15767297, -0.09738769, 0.04034404, 0.0038675873, 0.043515608, 0.16899958, -0.29117966, 0.03420067, 0.14432564, -0.10473084, 0.21014084, 0.07775908, -0.09303797) * go_0(0.0, 1.0);
result += mat4(-0.07443987, -0.16225167, 0.036251917, 0.028432872, 0.03759333, 0.004027401, -0.033941846, 0.0019474924, 0.02357054, 0.30748722, 0.1652115, -0.17361522, 0.16905582, 0.08048018, -0.23639561, -0.029408466) * go_0(1.0, -1.0);
result += mat4(0.0461233, -0.09346199, -0.07063276, -0.19447634, -0.049339604, -0.0032855074, -0.22661209, -0.0543389, 0.11924857, -0.21691081, -0.1645725, -0.0075736847, 0.018572787, -0.06552861, -0.01777661, -0.11651732) * go_0(1.0, 0.0);
result += mat4(-0.06425901, 0.123392984, -0.16395192, -0.093448035, -0.029316641, 0.0986573, -0.23135012, 0.011170849, 0.00023920486, 0.15296175, 0.35453254, -0.05189021, 0.20708887, -0.103900835, 0.081992395, -0.21829562) * go_0(1.0, 1.0);
result += mat4(-0.019074136, -0.1572586, 0.27919227, 0.09119617, 0.035954695, 0.2941489, 0.18262725, -0.055522963, -0.21364328, -0.1573611, 0.104966134, 0.08228523, 0.19945285, -0.0039229114, -0.1565048, 0.028975379) * go_1(-1.0, -1.0);
result += mat4(-0.18501253, 0.006473006, 0.06637501, 0.04295065, 0.06411007, 0.1166344, -0.10060226, 0.46296063, -0.08600344, -0.03560105, 0.012215349, 0.017885283, 0.061346993, 0.17336361, 0.01935021, 0.20198092) * go_1(-1.0, 0.0);
result += mat4(-0.04451627, -0.10372061, -0.13968691, 0.14479733, 0.1660607, 0.19334625, 0.0085214665, 0.28863636, -0.07600901, -0.014777084, 0.13209191, -0.09045013, 0.104893915, -0.04776884, -0.007936376, 0.104568765) * go_1(-1.0, 1.0);
result += mat4(0.023751335, -0.108048, -0.050531313, 0.15916029, 0.13246661, 0.04644228, -0.09586482, -0.17222965, -0.22898191, -0.033484615, 0.078883134, -0.052609313, -0.2721741, 0.045986425, 0.13972299, -0.28923607) * go_1(0.0, -1.0);
result += mat4(-0.23364568, -0.008875902, -0.40894926, 0.060443908, -0.2839635, -0.5270991, -0.2500865, 0.002020195, -0.24488612, -0.04982319, -0.009110353, -0.018023955, 0.06647274, -0.25225738, 0.26154432, -0.033934146) * go_1(0.0, 0.0);
result += mat4(-0.1535129, -0.21257545, -0.16553773, 0.17471452, -0.06203719, 0.15238857, 0.18702018, 0.18572305, 0.07740396, -0.074217625, -0.072156586, -0.2183728, 0.00403749, 0.13750519, 0.30362993, 0.06550286) * go_1(0.0, 1.0);
result += mat4(0.37164542, -0.1980723, -0.15659203, 0.19498909, 0.01748114, 0.011807152, -0.05424202, 0.11926474, 0.050406165, -0.12925303, -0.020280985, 0.08429331, 0.14769496, -0.077555746, -0.15216178, -0.27070466) * go_1(1.0, -1.0);
result += mat4(0.35804263, 0.08539285, -0.14785156, -0.13532467, 0.058254432, 0.20448379, -0.006173341, 0.058168225, -0.21714899, -0.13472849, -0.09392532, -0.12753737, -0.097461835, -0.11419082, 0.09384189, 0.06414768) * go_1(1.0, 0.0);
result += mat4(0.023494452, -0.22187226, -0.16694295, 0.0204334, -0.26720086, 0.15916729, 0.3098874, -0.10292057, 0.008854983, 0.13375004, -0.04409455, 0.09286524, 0.095829524, 0.12427317, -0.048659876, 0.18300754) * go_1(1.0, 1.0);
result += mat4(-0.119153984, 0.10163183, 0.025017537, -0.40096784, 0.026778705, 0.15821172, -0.19947284, -0.33337715, 0.2952563, 0.16820388, -0.057061996, -0.029319009, -0.12184868, 0.09031512, 0.12028806, 0.021044692) * go_2(-1.0, -1.0);
result += mat4(0.086744264, -0.046958666, 0.2130253, -0.46672252, 0.07135636, 0.0100029735, -0.13828261, -0.012365689, -0.11374441, 0.21084632, -0.059631422, -0.013799735, -0.037889663, -0.10701892, -0.09493782, 0.15516634) * go_2(-1.0, 0.0);
result += mat4(0.031181194, -0.01535001, 0.029270316, 0.13128386, 0.11838377, -0.17051528, 0.12228499, -0.04841128, 0.33350074, -0.006144013, -0.09055018, 0.27470216, -0.26665646, -0.08703671, -0.01719071, -0.23449609) * go_2(-1.0, 1.0);
result += mat4(-0.12856458, 0.005562174, -0.19517267, 0.13270985, 0.2776414, 0.032003902, -0.15778573, 0.15344355, 0.26930434, -0.13459459, 0.035019353, 0.08896612, 0.12847935, -0.122637205, 0.001815178, 0.08290523) * go_2(0.0, -1.0);
result += mat4(0.33805037, -0.15318587, -0.20955376, -0.26121393, -0.026022578, -0.1617741, 0.1336867, 0.026223289, 0.012059392, -0.17295446, -0.060811974, 0.14027825, -0.21134059, -0.08408573, -0.23773228, 0.110836074) * go_2(0.0, 0.0);
result += mat4(0.16176093, 0.15307428, -0.07711325, -0.3458805, 0.061291527, 0.023916256, 0.21370678, 0.0015756418, 0.10642374, 0.24807373, 0.11164451, 0.10780487, 0.087194376, -0.2718231, -0.008457387, 0.054078236) * go_2(0.0, 1.0);
result += mat4(-0.03259038, -0.20923306, 0.165477, 0.098864526, -0.02734457, 0.08871225, -0.01552188, 0.047712058, 0.055032052, -0.13044262, -0.2899521, 0.22230095, -0.029343741, -0.16427459, -0.005436118, -0.05111821) * go_2(1.0, -1.0);
result += mat4(0.20065974, -0.1556366, -0.12620135, 0.44572976, -0.020925352, 0.12025185, 0.20588058, 0.06391864, 0.046870507, 0.16942503, -0.049370963, 0.008779016, 0.04954915, 0.090298936, -0.16466027, 0.011152038) * go_2(1.0, 0.0);
result += mat4(0.13587528, 0.047841422, 0.19804007, -0.1672396, -0.072491, 0.04543739, 0.25287256, 0.015226213, 0.02007356, -0.049578942, -0.08796175, 0.1714897, -0.07819061, 0.1509537, 0.093094915, 0.031139288) * go_2(1.0, 1.0);
result += mat4(-0.013774682, 0.118201815, -0.009592314, -0.10837201, -0.0686881, -0.083380274, 0.107689425, 0.046642892, 0.119898744, -0.05502989, -0.19719897, 0.0005697584, -0.0921928, 0.032281205, 0.2568853, 0.2325449) * go_3(-1.0, -1.0);
result += mat4(0.02991112, -0.09898633, 0.06076172, -0.20906185, 0.0026118348, 0.06130956, 0.06760944, -0.16662054, 0.065741204, -0.13144116, 0.011419801, 0.22552124, 0.1465757, -0.07417319, -0.10788749, -0.24952699) * go_3(-1.0, 0.0);
result += mat4(-0.19238451, -0.024058497, 0.19580396, -0.067399554, -0.18832864, -0.11752747, -0.078949094, -0.23762032, -0.04141864, 0.022530237, -0.02222157, 0.0054874527, 0.057746816, -0.34854797, 0.028730657, -0.08976777) * go_3(-1.0, 1.0);
result += mat4(0.16888975, 0.19949849, -0.08456147, -0.03619044, -0.019596824, 0.11214634, 0.13971676, 0.22926724, 0.03219445, -0.04566354, -0.14948955, -0.22817011, -0.08714846, -0.19684613, 0.15479128, 0.2433362) * go_3(0.0, -1.0);
result += mat4(0.16050309, -0.102841675, 0.20855242, -0.011171905, -0.10309409, 0.22455123, 0.15892951, -0.06582373, 0.010079549, -0.2055006, -0.09385158, 0.006519388, 0.11838815, 0.37134558, -0.165772, 0.12704434) * go_3(0.0, 0.0);
result += mat4(0.11643292, 0.03294274, -0.09800525, -0.13601723, -0.081318736, -0.059975546, -0.039105035, -0.2893635, -0.13024913, -0.058016162, -0.09961072, 0.10532414, 0.24250132, -0.35546342, -0.092634924, 0.093994915) * go_3(0.0, 1.0);
result += mat4(-0.18799333, 0.25611782, 0.014645917, -0.063751906, 0.06498416, 0.16619027, -0.14411639, 0.3914421, -0.07343631, -0.116468735, -0.10941946, -0.2553544, -0.37774643, -0.0018441634, 0.06827239, -0.0122299045) * go_3(1.0, -1.0);
result += mat4(-0.11884597, -0.2477297, 0.048488285, -0.06438257, -0.124703035, 0.25932777, 0.0650111, -0.0930877, 0.06463341, -0.000544085, 0.0147504965, -0.170097, -0.13241997, 0.20983136, -0.15956205, 0.03424298) * go_3(1.0, 0.0);
result += mat4(-0.034574904, 0.06755256, 0.09508443, -0.17162292, 0.046379335, 0.2178781, 0.08699012, -0.055380464, -0.2237568, -0.07427848, -0.028395249, -0.3225617, -0.084454566, -0.24776657, 0.254169, 0.13229847) * go_3(1.0, 1.0);
result += vec4(0.18765923, -0.07697714, 0.028134674, -0.060966115);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_6_tf
//!BIND conv2d_6_tf1
//!SAVE conv2d_7_tf
//!WIDTH conv2d_6_tf.w
//!HEIGHT conv2d_6_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_6_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_6_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_6_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_6_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(0.21919365, 0.36627784, 0.12603314, 0.24306288, 0.06447028, 0.06472204, -0.05997039, -0.15651788, 0.017059859, -0.006497198, -0.4189735, 0.021636713, -0.23887977, -0.014220949, 0.031113686, -0.17342716) * go_0(-1.0, -1.0);
result += mat4(-0.10818789, -0.03273837, 0.33918005, -0.19290088, 0.0955361, -0.34107623, -0.054906327, -0.18083344, -0.060723677, 0.24395694, 0.112975016, -0.07254578, -0.14389384, 0.13235968, -0.15054801, -0.26216486) * go_0(-1.0, 0.0);
result += mat4(-0.23442148, -0.07857079, 0.022283873, -0.2656417, 0.037092753, -0.037313666, -0.5057047, 0.042533103, -0.120424, 0.00021930189, -0.0044566668, -0.45536995, 0.00040759926, 0.14597592, -0.094990164, -0.036161344) * go_0(-1.0, 1.0);
result += mat4(0.15024352, 0.19903262, -0.0734784, 0.092836305, -0.025753846, 0.024750374, -0.07550193, 0.035420835, 0.11084378, 0.26119822, -0.08443512, -0.0047807065, -0.042685136, 0.24889739, 0.098650105, 0.2088369) * go_0(0.0, -1.0);
result += mat4(-0.25551823, 0.14455976, 0.19886157, -0.23465924, 0.20711218, -0.20875362, -0.11320392, -0.30852005, -0.06795657, 0.008670962, 0.30601278, 0.6929064, 0.17079145, 0.15744895, 0.06441601, 0.06514001) * go_0(0.0, 0.0);
result += mat4(0.03142604, -0.006410137, -0.023654792, -0.05708553, 0.062985405, -0.077010594, 0.078804865, 0.050882503, 0.010274228, -0.15558401, 0.09490256, 0.14964707, -0.11966925, -0.36176664, 0.27809814, -0.18862294) * go_0(0.0, 1.0);
result += mat4(0.05609992, 0.0041612233, -0.08498908, 0.04479823, -0.080117956, -0.17423204, -0.22858045, 0.054569032, -0.050866384, -0.020000307, 0.027000953, -0.67724514, 0.16240878, -0.04641204, 0.0648367, -0.20613132) * go_0(1.0, -1.0);
result += mat4(0.08542306, -0.08254248, -0.11090553, -0.14140448, -0.10788511, -0.13011602, -0.29319742, -0.26007155, 0.11033401, -0.31966573, 0.32668245, 0.19542319, 0.06329418, 0.20904626, 0.2724067, -0.009155685) * go_0(1.0, 0.0);
result += mat4(-0.007403411, 0.0012836396, -0.23446666, -0.03017208, 0.062420018, -0.13611084, -0.2975928, 0.13173148, -0.03679939, 0.13743873, -0.10121899, 0.074514665, 0.1497629, -0.09523838, 0.39018926, 0.37807035) * go_0(1.0, 1.0);
result += mat4(0.11441487, -0.19565523, -0.25757137, -0.16148767, 0.15575317, -0.12657928, 0.10479676, 0.062919036, 0.010544159, 0.22931573, 0.20360178, 0.4637635, -0.3395036, -0.52467215, 0.08759308, 0.028030418) * go_1(-1.0, -1.0);
result += mat4(0.2699195, -0.34218305, 0.15259695, 0.03139074, -0.024053533, -0.029567484, 0.28480124, 0.20525953, 0.15452823, -0.217713, 0.15861876, -0.012275699, 0.21408023, 0.097508304, -0.57126766, -0.14679857) * go_1(-1.0, 0.0);
result += mat4(-0.0755847, -0.09751562, -0.29480466, -0.22285318, 0.14196442, 0.114573136, -0.22294767, 0.12463806, 0.3322209, -0.04631724, -0.11097061, -0.27986854, -0.16099304, -0.060079545, 0.00299308, 0.120776065) * go_1(-1.0, 1.0);
result += mat4(0.050933484, -0.13776319, -0.18809728, 0.24035202, -0.32528606, -0.41684148, -0.029342847, 0.28642926, -0.07963454, -0.12905268, 0.07606093, 0.24670005, -0.08815598, -0.23320907, -0.008099349, 0.21512873) * go_1(0.0, -1.0);
result += mat4(0.19247563, 0.18083979, -0.09719762, 0.15314941, -0.22350982, 0.46515045, -0.3571128, 0.35953265, 0.06921985, -0.4482386, -0.18732521, -0.5043983, 0.35159567, -0.33315298, -0.21884166, -0.16283798) * go_1(0.0, 0.0);
result += mat4(-0.021124054, -0.007966742, 0.0052493825, 0.022550896, 0.030403977, 0.3377868, -0.47602004, -0.077664234, -0.07222509, -0.07486097, -0.37971064, -0.5107857, -0.06299477, 0.04930232, -0.3330487, 0.29845512) * go_1(0.0, 1.0);
result += mat4(-0.063705474, -0.07917637, -0.02026607, -0.05142568, 0.021577014, -0.07379867, 0.033937998, 0.08148773, -0.02717838, -0.03233838, 0.098000035, 0.036476444, -0.13366953, 0.014477577, 0.24064232, 0.39313284) * go_1(1.0, -1.0);
result += mat4(-0.16046515, -0.094624564, 0.35435164, 0.09942324, -0.07137174, -0.27999225, 0.124644354, -0.0062176553, 0.015016751, -0.05500243, -0.23249559, -0.4508382, 0.1860433, 0.10671491, -0.033345353, -0.06611453) * go_1(1.0, 0.0);
result += mat4(0.21614046, -0.01307525, -0.18941112, -0.20533535, -0.14481686, -0.47801897, 0.22605121, -0.20298961, -0.06744227, -0.20377496, -0.11926173, 0.15645133, -0.31570885, -0.3495616, -0.024666889, 0.040965475) * go_1(1.0, 1.0);
result += mat4(-0.11748018, -0.039976366, -0.00084064255, -0.028653437, -0.16216733, -0.036768105, 0.018064514, -0.0928936, 0.14008482, -0.064511225, 0.24329947, -0.0268608, 0.050330248, 0.08540601, -0.07272679, -0.01187671) * go_2(-1.0, -1.0);
result += mat4(-0.09459936, -0.011723822, -0.06952858, -0.07808506, -0.065588176, 0.332501, -0.0120042395, 0.07668016, 0.14735217, -0.14856043, -0.06702449, -0.020953184, -0.023006834, 0.06135422, 0.1491448, -0.028061569) * go_2(-1.0, 0.0);
result += mat4(0.25136968, 0.25146323, -0.108277924, -0.20407207, -0.0013780294, 0.16108194, 0.25143847, 0.06672421, -0.033905584, -0.021144686, -0.019152718, 0.34619498, 0.14560962, 0.034437314, 0.024790365, -0.049976267) * go_2(-1.0, 1.0);
result += mat4(-0.24928351, 0.12637813, 0.23609994, 0.12722939, -0.036997862, -0.16554876, 0.11144095, -0.10040036, -0.020359103, -0.080701865, -0.3142192, 0.27257237, 0.13546956, -0.14416885, 0.028196262, -0.2886465) * go_2(0.0, -1.0);
result += mat4(0.28524777, -0.4236231, 0.27420738, -0.21095508, 0.23475651, 0.115876295, -0.18837357, -0.0260708, 0.030670704, -0.11516913, -0.11365572, -0.2203149, -0.018612983, -0.10719593, -0.031727783, 0.1403327) * go_2(0.0, 0.0);
result += mat4(0.07240512, 0.03139215, 0.12328737, -0.021201206, -0.13971715, 0.072742075, -0.0011289873, 0.0053133667, 0.035639685, -0.04322272, -0.19288473, -0.15812221, -0.19126481, 0.0698514, 0.17619178, -0.035605464) * go_2(0.0, 1.0);
result += mat4(-0.18552057, 0.07259671, 0.011667668, -0.15630563, 0.11414356, 0.14482655, -0.04021029, 0.18495587, -0.11386139, -0.09058561, -0.011265998, 0.23358451, 0.0521358, 0.12495261, 0.021644838, -0.048094347) * go_2(1.0, -1.0);
result += mat4(-0.09222373, 0.0533347, 0.055820454, 0.22382596, 0.18713981, 0.2668916, -0.019384036, 0.012698582, 0.13325234, 0.20361474, -0.33106443, -0.08571572, -0.21243028, -0.10996386, 0.123459645, 0.1534967) * go_2(1.0, 0.0);
result += mat4(0.18133277, 0.18108074, -0.05638664, 0.29533157, -0.2108019, -0.033636626, 0.5015888, -0.15116066, -0.041320793, -0.14764231, 0.07314567, -0.18865979, 0.10276937, 0.094240844, -0.1364283, 0.27812913) * go_2(1.0, 1.0);
result += mat4(0.06040915, 0.23753685, 0.19019844, 0.23948252, -0.07535012, 0.11848904, 0.14389765, 0.050067905, 0.16150077, -0.030053454, 0.12478255, 0.26020208, 0.111198805, 0.06787492, -0.12771018, 0.006687384) * go_3(-1.0, -1.0);
result += mat4(-0.5421617, 0.10414128, -0.21526064, -0.08883624, 0.13145073, -0.29695904, 0.57386386, 0.073361695, -0.09538372, 0.27593842, 0.070922814, 0.21769938, 0.06214975, 0.11847816, 0.10033405, 0.29360098) * go_3(-1.0, 0.0);
result += mat4(-0.16294672, -0.014815565, 0.22046989, 0.16858687, 0.058917344, 0.21384977, 0.18803519, 0.105688855, 0.0355118, 0.20571202, -0.07341922, 0.26624045, -0.0415102, 0.050942056, 0.19727907, 0.20122413) * go_3(-1.0, 1.0);
result += mat4(-0.020470422, 0.15815964, -0.13437317, -0.1967045, 0.074902646, 0.08356444, 0.055913117, -0.12837863, -0.18647918, 0.07002247, 0.038864706, -0.07288784, 0.04135125, -0.016055549, -0.1340297, -0.15578008) * go_3(0.0, -1.0);
result += mat4(-0.07685624, 0.00079105416, -0.068755336, 0.110282525, -0.014170752, 0.041282844, -0.17035173, 0.19439398, -0.3036256, 0.024148455, -0.19566648, -0.06736254, 0.14203559, -0.13016985, -0.32845357, -0.14266774) * go_3(0.0, 0.0);
result += mat4(0.0087252045, 0.098839566, -0.08770506, -0.08499465, 0.015245115, -0.110854514, 0.054458305, -0.018121868, -0.09666134, -0.08316006, 0.24617113, -0.17195955, 0.2574254, 0.06734342, -0.13792352, -0.07306126) * go_3(0.0, 1.0);
result += mat4(-0.0073954533, -0.20126835, -0.22545357, -0.29462856, 0.057408337, 0.11939119, -0.01846476, 0.12534486, 0.15751605, -0.14282645, -0.14219986, 0.14283386, 0.14090413, 0.10500912, 0.03039335, 0.17448832) * go_3(1.0, -1.0);
result += mat4(0.043910783, -0.09140025, -0.21666165, 0.07616939, 0.104454786, 0.309926, -0.12906921, 0.1140117, 0.09372434, 0.049547072, -0.086615674, -0.034449168, 0.096705064, 0.26001686, 0.027063297, 0.12422948) * go_3(1.0, 0.0);
result += mat4(0.1365422, 0.2679611, 0.12037257, 0.43346113, 0.08223084, -0.016788265, 0.13570398, -0.017974345, -0.17922844, -0.09475725, 0.073539585, -0.106947675, 0.08998511, 0.04133868, 0.16586913, -0.26291734) * go_3(1.0, 1.0);
result += vec4(-0.19233678, 0.016725872, -0.008011114, -0.1977463);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-4x3x3x16
//!HOOK MAIN
//!BIND conv2d_6_tf
//!BIND conv2d_6_tf1
//!SAVE conv2d_7_tf1
//!WIDTH conv2d_6_tf.w
//!HEIGHT conv2d_6_tf.h
//!COMPONENTS 4
#define go_0(x_off, y_off) (max((conv2d_6_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_1(x_off, y_off) (max((conv2d_6_tf1_texOff(vec2(x_off, y_off))), 0.0))
#define go_2(x_off, y_off) (max(-(conv2d_6_tf_texOff(vec2(x_off, y_off))), 0.0))
#define go_3(x_off, y_off) (max(-(conv2d_6_tf1_texOff(vec2(x_off, y_off))), 0.0))
vec4 hook() {
vec4 result = mat4(-0.36016628, 0.019064043, 0.3073228, 0.16891135, 0.026739368, 0.31136194, 0.11260383, -0.26918694, 0.0419928, -0.3365078, 0.20189743, -0.04136312, 0.039564647, 0.033199426, 0.18768296, -0.017119858) * go_0(-1.0, -1.0);
result += mat4(0.28663483, -0.41716507, 0.059281543, 0.043736435, 0.0028875466, 0.13817391, -0.12543318, -0.2794053, -0.023528943, 0.10610115, 0.09100278, 0.040132936, -0.21949205, -0.027810011, -0.0301218, 0.084047124) * go_0(-1.0, 0.0);
result += mat4(0.39674807, -0.0040878756, -0.038235947, 0.11880838, 0.009898328, 0.19107847, -0.009313831, -0.1554276, -0.047341663, 0.18049581, -0.029317195, 0.0708909, 0.0708316, -0.110617444, 0.14584038, -0.022261223) * go_0(-1.0, 1.0);
result += mat4(-0.20400241, 0.0896492, -0.010386381, -0.052133385, 0.005023956, -0.06628705, -0.16436209, -0.25345984, -0.05285192, 0.09706557, -0.03778914, -0.152546, 0.17023252, 0.063713826, 0.00743037, 0.056634087) * go_0(0.0, -1.0);
result += mat4(-0.080793336, 0.4204207, 0.19098237, 0.20028038, -0.054076545, 0.22064368, -0.25853387, -0.3643562, 0.2085573, -0.023731, -0.06727709, -0.18683033, -0.18032159, -0.06388348, 0.304463, -0.2517781) * go_0(0.0, 0.0);
result += mat4(0.11940941, 0.10624008, 0.16120581, 0.2369602, 0.3321827, 0.4272075, -0.10403669, -0.31388018, -0.006372124, -0.00653671, 0.109810196, 0.2277172, 0.005771998, 0.086026914, -0.08934813, -0.094941735) * go_0(0.0, 1.0);
result += mat4(-0.13233568, 0.24112508, -0.0068006413, 0.12466225, 0.11396591, -0.07249253, -0.29090378, -0.12828146, -0.22001141, -0.08532405, -0.11932601, 0.29452974, 0.09572195, 0.017603843, 0.12454017, 0.16321751) * go_0(1.0, -1.0);
result += mat4(0.042107448, -0.00807216, 0.06580674, -0.1289527, 0.13977426, -0.037159685, -0.21001346, -0.08698161, 0.22370502, -0.29170328, 0.2179206, 0.36621302, 0.0825477, -0.016513655, -0.11157249, 0.12861598) * go_0(1.0, 0.0);
result += mat4(0.2246826, -0.13262233, 0.12131653, -0.15522355, 0.38104856, 0.030237729, 0.1286289, -0.19770473, -0.16175011, -0.13688888, 0.23505463, 0.21333031, 0.76352316, -0.17949077, -0.13124311, 0.1613879) * go_0(1.0, 1.0);
result += mat4(-0.050607495, 0.0846705, -0.06136092, -0.033436477, 0.41138348, 0.037043408, -0.02676336, -0.37771952, 0.22147503, 0.06490757, -0.04266158, -0.22606373, 0.045775007, -0.054498192, -0.21495876, -0.036050417) * go_1(-1.0, -1.0);
result += mat4(-0.06242522, 0.2700824, -0.05602621, -0.12361551, 0.14477442, 0.19403581, 0.23505251, -0.072234035, -0.15831544, 0.4640447, -0.104754634, -0.004539681, -0.20246096, 0.23216484, -0.35886365, 0.11360777) * go_1(-1.0, 0.0);
result += mat4(0.14777757, 0.18951412, 0.027219458, 0.11216015, 0.02997997, -0.13466355, -0.0010830094, 0.021302953, 0.23441231, -0.14529245, 0.08068729, 0.10044398, 0.3972878, 0.26570204, 0.0046810666, -0.2863261) * go_1(-1.0, 1.0);
result += mat4(-0.10385485, 0.1053724, 0.16961229, 0.20727012, -0.025148917, -0.011365095, 0.03899919, -0.030950211, 0.079080455, -0.32767853, 0.064670205, -0.035771385, 0.16833797, -0.21567492, 0.30871257, -0.19965471) * go_1(0.0, -1.0);
result += mat4(-0.23420888, -0.004894698, -0.18162623, -0.31107524, 0.11976508, 0.14924951, -0.08723316, 0.21401922, -0.58200324, -0.01177345, -0.049033508, 0.19593577, -0.21139073, 0.13016601, 0.08734843, 0.4158892) * go_1(0.0, 0.0);
result += mat4(0.0009789813, 0.33274913, 0.017405733, -0.042906318, -0.26410276, -0.09291333, 0.019387102, 0.105381854, -0.009176527, 0.09483514, -0.28462934, -0.03644404, 0.285194, -0.4260311, 0.14902237, -0.115670316) * go_1(0.0, 1.0);
result += mat4(-0.09344311, 0.4463103, 0.19984834, -0.09733857, -0.118717775, -0.0708026, 0.24919955, -0.11234634, 0.1246395, -0.052909933, 0.1525815, 0.07724016, 0.0070534665, -0.06404165, -0.18149726, -0.014058336) * go_1(1.0, -1.0);
result += mat4(-0.17353044, 0.15376104, 0.004588994, -0.13554202, -0.19920237, -0.18918681, 0.11327512, -0.117296435, -0.0785251, 0.013677155, -0.2103214, 0.06843426, -0.27790928, 0.09837545, -0.00019213746, 0.09132539) * go_1(1.0, 0.0);
result += mat4(-0.01586651, 0.014929441, 0.2426186, -0.1889374, -0.0865462, -0.07454513, -0.20797268, -0.22366855, 0.19704159, 0.0048206006, -0.16707218, -0.14162683, 0.036798395, -0.1663155, -0.12009389, 0.09603803) * go_1(1.0, 1.0);
result += mat4(-0.041532192, 0.05753804, 0.17927068, -0.042112097, 0.12080969, -0.15052572, -0.34855765, -0.07356988, -0.28199884, -0.18958664, 0.15879883, 0.08511588, 0.0034213227, -0.05338495, -0.37285298, 0.06626709) * go_2(-1.0, -1.0);
result += mat4(-0.20219134, 0.22150375, -0.29405454, 0.06597703, -0.018885285, -0.010551704, -0.010774283, 0.08758955, -0.2015349, -0.17006227, -0.24321876, -0.06864207, -0.118437864, -0.043977212, -0.029736811, 0.14040919) * go_2(-1.0, 0.0);
result += mat4(-0.18709077, -0.09723938, 0.12783436, -0.15167634, 0.29039705, -0.11009911, 0.018371418, -0.060096707, -0.07256923, -0.25799567, -0.06276934, -0.035992302, -0.06729111, -0.059956793, -0.024079734, 0.011838878) * go_2(-1.0, 1.0);
result += mat4(0.010449175, -0.08212451, 0.1409803, 0.11861122, -0.18035835, 0.051930565, 0.01049551, -0.09447962, 0.12029649, 0.040604513, -0.059971705, -0.0044667358, -0.22080486, -0.11187681, 0.124374695, -0.004155485) * go_2(0.0, -1.0);
result += mat4(-0.28584236, -0.38480133, -0.13987814, -0.4463469, -0.3890419, -0.022498172, 0.17334452, 0.21895568, -0.15450422, -0.10905497, 0.15111905, -0.22554915, 0.106121585, -0.029144369, 0.36059046, 0.22140682) * go_2(0.0, 0.0);
result += mat4(-0.23780307, -0.023033705, 0.068205886, -0.110635854, -0.26720005, -0.1608183, 0.19523881, 0.07972837, -0.018495852, -0.2793956, 0.17668398, -0.12020479, -0.079556085, -0.02284952, 0.031480275, 0.31818348) * go_2(0.0, 1.0);
result += mat4(0.22501226, -0.00829407, 0.059581667, 0.16512989, 0.18711442, 0.1200968, 0.11812652, -0.16091056, 0.15733972, 0.045156084, 0.20640492, -0.16852027, -0.11217177, 0.06746273, -0.050218176, 0.08643783) * go_2(1.0, -1.0);
result += mat4(0.20715691, -0.1082907, 0.027892975, 0.19515261, -0.17838904, 0.1532257, -0.108409844, -0.06632365, -0.13805026, 0.23020233, 0.12416581, -0.14861803, 0.16650471, 0.08158386, -0.09051303, -0.06981649) * go_2(1.0, 0.0);
result += mat4(-0.04617126, 0.06579221, 0.25964734, 0.28500968, 0.07641255, -0.090885855, -0.0972522, 0.18298368, -0.06393334, 0.103463, -0.23062052, -0.15270731, 0.13633437, 0.074707486, 0.15065335, -0.024602572) * go_2(1.0, 1.0);
result += mat4(0.118319295, 0.010410938, 0.044655934, -0.104725905, 0.030477569, 0.12867387, 0.039075315, 0.18922117, 0.13301082, -0.1601557, 0.038168408, -0.07372259, -0.09522213, -0.095107146, -0.16679631, 0.044673234) * go_3(-1.0, -1.0);
result += mat4(0.46229, -0.30780822, -0.09081465, 0.1433387, -0.0315039, 0.059409115, -0.24948491, -0.17146957, 0.060843736, -0.041989822, 0.054005735, 0.22835566, 0.12036598, -0.0070898845, 0.17276852, -0.17754094) * go_3(-1.0, 0.0);
result += mat4(-0.35119572, 0.020034311, 0.08751943, 0.08193488, 0.041884877, 0.22649358, -0.07447533, 0.20845473, -0.04859846, -0.16206735, 0.06819576, -0.053000778, 0.18146423, 0.04694148, 0.045293212, 0.06783575) * go_3(-1.0, 1.0);
result += mat4(0.280914, -0.14998704, -0.23485807, -0.015608296, 0.1549556, -0.11992663, -0.094974115, 0.05887284, 0.053392075, 0.10322464, -0.075066686, 0.068358354, -0.18663338, 0.009901499, -0.123370335, -0.12502703) * go_3(0.0, -1.0);
result += mat4(0.7748568, -0.17870626, -0.20770052, 0.024692526, -0.056430295, -0.06324113, -0.03660047, 0.29629672, -0.51896983, -0.027231261, 0.05903762, 0.077677645, -0.061675485, -0.20277846, 0.10352223, -0.08198446) * go_3(0.0, 0.0);
result += mat4(-0.06347568, 0.21643166, -0.09718546, 0.0372257, -0.029537952, -0.0357135, -0.09548363, 0.18225233, -0.29609334, -0.3496132, 0.18245913, -0.10162589, -0.18189451, -0.09077887, 0.117313184, -0.06863874) * go_3(0.0, 1.0);
result += mat4(-0.047373574, -0.020289376, -0.25748715, -0.13568166, 0.15656634, -0.06841899, 0.012100781, -0.13611819, 0.0016357322, -0.23870537, 0.14035743, -0.14700134, 0.2535575, -0.13697346, -0.13693139, -0.10365287) * go_3(1.0, -1.0);
result += mat4(0.4283934, -0.316192, -0.012617617, 0.018468965, 0.21436644, 0.18408814, -0.42651537, 0.12504087, -0.13894933, 0.091662176, -0.20096369, -0.080727175, -0.005487846, 0.17046383, 0.1383948, -0.0054956395) * go_3(1.0, 0.0);
result += mat4(0.20014295, -0.027282396, -0.06317007, 0.04452042, 0.064600386, 0.072222926, -0.33409226, 0.08063831, -0.022607977, 0.1308856, -0.39691743, -0.094889864, -0.1810531, 0.011367248, -0.2531222, -0.22468317) * go_3(1.0, 1.0);
result += vec4(0.26886886, 0.05874665, 0.10268232, 0.05833081);
return result;
}
//!DESC Anime4K-v4.0-Restore-CNN-(VL)-Conv-3x1x1x112
//!HOOK MAIN
//!BIND MAIN
//!BIND conv2d_1_tf
//!BIND conv2d_1_tf1
//!BIND conv2d_2_tf
//!BIND conv2d_2_tf1
//!BIND conv2d_3_tf
//!BIND conv2d_3_tf1
//!BIND conv2d_4_tf
//!BIND conv2d_4_tf1
//!BIND conv2d_5_tf
//!BIND conv2d_5_tf1
//!BIND conv2d_6_tf
//!BIND conv2d_6_tf1
//!BIND conv2d_7_tf
//!BIND conv2d_7_tf1
//!SAVE MAIN
//!WIDTH conv2d_1_tf.w
//!HEIGHT conv2d_1_tf.h
#define g_0 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
#define g_1 (max((conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0))
#define g_2 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
#define g_3 (max(-(conv2d_1_tf1_tex(conv2d_1_tf1_pos)), 0.0))
#define g_4 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
#define g_5 (max((conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0))
#define g_6 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
#define g_7 (max(-(conv2d_2_tf1_tex(conv2d_2_tf1_pos)), 0.0))
#define g_8 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
#define g_9 (max((conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0))
#define g_10 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
#define g_11 (max(-(conv2d_3_tf1_tex(conv2d_3_tf1_pos)), 0.0))
#define g_12 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
#define g_13 (max((conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0))
#define g_14 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
#define g_15 (max(-(conv2d_4_tf1_tex(conv2d_4_tf1_pos)), 0.0))
#define g_16 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
#define g_17 (max((conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0))
#define g_18 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
#define g_19 (max(-(conv2d_5_tf1_tex(conv2d_5_tf1_pos)), 0.0))
#define g_20 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
#define g_21 (max((conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0))
#define g_22 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
#define g_23 (max(-(conv2d_6_tf1_tex(conv2d_6_tf1_pos)), 0.0))
#define g_24 (max((conv2d_7_tf_tex(conv2d_7_tf_pos)), 0.0))
#define g_25 (max((conv2d_7_tf1_tex(conv2d_7_tf1_pos)), 0.0))
#define g_26 (max(-(conv2d_7_tf_tex(conv2d_7_tf_pos)), 0.0))
#define g_27 (max(-(conv2d_7_tf1_tex(conv2d_7_tf1_pos)), 0.0))
vec4 hook() {
vec4 result = mat4(0.09689336, 0.06046458, 0.072598994, 0.0, 0.11994565, 0.104477674, 0.09302802, 0.0, -0.05718302, 0.050438102, 0.08814741, 0.0, 0.0308889, 0.0033925986, -0.01715605, 0.0) * g_0;
result += mat4(-0.028314235, 0.06597744, 0.0966897, 0.0, 0.035656154, 0.07770106, 0.075551905, 0.0, 0.0001793458, -0.000479495, -0.00297406, 0.0, -0.053916585, -0.016807461, -0.0057141334, 0.0) * g_1;
result += mat4(-0.047189303, -0.0207, -0.020910334, 0.0, -0.07933196, -0.06961211, -0.086069845, 0.0, 0.0943727, 0.008463375, 0.010755166, 0.0, 0.062410597, 0.022625161, 0.04068433, 0.0) * g_2;
result += mat4(0.10270994, -0.019080428, 0.0050091282, 0.0, -0.004672948, -0.013966742, -0.0063746064, 0.0, -2.5856789e-05, 0.03151499, -0.0023983798, 0.0, 0.113539025, 0.12381699, 0.100360274, 0.0) * g_3;
result += mat4(0.07868885, -0.030913834, -0.009213676, 0.0, 0.04870991, 0.021467991, 0.038739506, 0.0, -0.042969644, -0.07122453, -0.08798675, 0.0, -0.09784122, 0.021434791, 0.02510374, 0.0) * g_4;
result += mat4(0.050420716, 0.0729716, 0.076532185, 0.0, -0.019112485, -0.01037939, -0.026948035, 0.0, -0.02591423, 0.008927897, -0.00042541025, 0.0, 0.1043701, -0.0071186824, -0.041817162, 0.0) * g_5;
result += mat4(-0.16143242, -0.0009298223, -0.01228508, 0.0, 0.07744052, -0.018313263, -0.0488145, 0.0, 0.09241393, 0.07128674, 0.055164956, 0.0, 0.054884013, -0.04834418, -0.06281626, 0.0) * g_6;
result += mat4(-0.049036566, -0.05979936, -0.05594288, 0.0, -0.014564307, 0.031926468, 0.037857566, 0.0, 0.015474487, -0.11385003, -0.11527764, 0.0, -0.07076006, 0.057038613, 0.095983796, 0.0) * g_7;
result += mat4(0.03094887, -0.008734403, 0.00042712069, 0.0, 0.053891554, 0.05837673, 0.06200635, 0.0, 0.09071558, -0.04202184, -0.046172567, 0.0, -0.0425916, 0.04905093, 0.020835675, 0.0) * g_8;
result += mat4(0.096628904, -0.037792254, -0.043241944, 0.0, -0.011923947, -0.025950424, -0.031381752, 0.0, -0.060941868, -0.07859433, -0.07535451, 0.0, -0.026777223, 0.08604982, 0.07829908, 0.0) * g_9;
result += mat4(-0.06435972, 0.0036599538, 0.00786578, 0.0, -0.061972067, -0.05681472, -0.06667608, 0.0, -0.106890626, 0.007406496, 0.029977169, 0.0, -0.20519382, -0.044860814, 0.0021225857, 0.0) * g_10;
result += mat4(-0.16876474, 0.012789643, 0.026692612, 0.0, 0.017817136, 0.026935097, 0.02227043, 0.0, 0.01690181, 0.07716103, 0.086527, 0.0, 0.07923805, -0.10443151, -0.10859543, 0.0) * g_11;
result += mat4(0.003730466, -0.024648283, -0.022169832, 0.0, -0.0062762927, 0.022062732, 0.032966793, 0.0, 0.016349113, 0.017197203, 0.020952817, 0.0, -0.1763789, 0.035497356, 0.053835396, 0.0) * g_12;
result += mat4(0.020886675, -0.07054202, -0.079142675, 0.0, 0.06664387, 0.044960167, 0.042230908, 0.0, -0.095019594, 0.012421141, 0.0142890485, 0.0, 0.056814816, -0.012751135, -0.014684506, 0.0) * g_13;
result += mat4(0.011765893, 0.0008920681, -0.0018258415, 0.0, -0.010473814, -0.023085753, -0.028783914, 0.0, -0.023034256, -0.0024786016, -0.0052162083, 0.0, 0.1643386, -0.06132718, -0.09289065, 0.0) * g_14;
result += mat4(0.016597198, 0.09389637, 0.10833379, 0.0, -0.043163072, -0.04714812, -0.035274632, 0.0, 0.09634976, -0.009292612, -0.022424143, 0.0, -0.08765172, 0.0051558353, 0.010900356, 0.0) * g_15;
result += mat4(0.030815786, 0.021069322, 0.01812191, 0.0, 0.084839165, -0.0080813095, -0.029270556, 0.0, -0.10456346, 0.062386703, 0.0665605, 0.0, 0.11926609, -0.1104228, -0.13291118, 0.0) * g_16;
result += mat4(-0.07159541, -0.007267032, -0.010134558, 0.0, 0.008234213, 0.045609634, 0.040295456, 0.0, 0.018416971, 0.01308482, 0.014649557, 0.0, 0.035107512, -0.02140815, -0.030279048, 0.0) * g_17;
result += mat4(0.01918586, 0.03875863, 0.03229402, 0.0, -0.07917104, 0.041135103, 0.057182517, 0.0, 0.08609541, 0.0079662455, 0.004327576, 0.0, -0.14332893, 0.03120354, 0.056732506, 0.0) * g_18;
result += mat4(0.03200192, -0.0035752193, -0.0031064528, 0.0, -0.010902813, 0.014607456, 0.019431474, 0.0, -0.016461229, -0.004938204, -0.004655488, 0.0, -0.033470232, 0.0026075812, 0.005896968, 0.0) * g_19;
result += mat4(0.037410006, 0.048742272, 0.04348088, 0.0, 0.037719514, 0.030768529, 0.03127472, 0.0, 0.056426726, 0.03066893, 0.016440205, 0.0, -0.010599352, 0.022832409, 0.023211194, 0.0) * g_20;
result += mat4(-0.005733291, 0.06365659, 0.06663611, 0.0, -0.041917093, -0.016493445, -0.020438088, 0.0, -0.0014357592, -0.0022506563, -0.0045095007, 0.0, 0.029893145, -0.009129354, -0.015173116, 0.0) * g_21;
result += mat4(0.013052085, 0.005108175, 0.0025906067, 0.0, -0.021950055, -0.036447693, -0.036141638, 0.0, -0.036296472, 0.0068928464, 0.013102313, 0.0, 0.0060471976, -0.024798103, -0.023548538, 0.0) * g_22;
result += mat4(0.0067743887, -0.06191211, -0.062355213, 0.0, 0.0016080744, -0.020445071, -0.016840393, 0.0, 0.028264903, 0.01852915, 0.015891539, 0.0, -0.023877412, -0.013271666, -0.008158679, 0.0) * g_23;
result += mat4(-0.04317466, -0.018953001, -0.020452993, 0.0, -0.009322576, -0.03022352, -0.030970376, 0.0, 0.05653658, 0.05430553, 0.046692245, 0.0, 0.05615359, 0.059338935, 0.056018773, 0.0) * g_24;
result += mat4(0.022878079, 0.03392234, 0.033057988, 0.0, -0.017554542, -0.0141542535, -0.014122613, 0.0, -0.048634093, -0.05316463, -0.047988772, 0.0, -0.058002178, -0.040221967, -0.034025013, 0.0) * g_25;
result += mat4(-0.018253656, -0.04197674, -0.040467236, 0.0, -0.04358929, -0.028309818, -0.025425073, 0.0, -0.008488672, -0.001727991, 0.00035808363, 0.0, -0.0011709273, 0.0052514165, 0.0059479307, 0.0) * g_26;
result += mat4(-0.08333935, -0.09818201, -0.09476284, 0.0, -0.033692095, -0.046259012, -0.045797516, 0.0, -0.007577072, 0.0022402718, 0.0016200038, 0.0, 0.0029786075, -0.020728534, -0.018938033, 0.0) * g_27;
result += vec4(0.047567394, -0.02504617, -0.028163986, 0.0);
return result + MAIN_tex(MAIN_pos);
}
| GLSL | 5 | dvdvideo1234/Anime4K | glsl/Restore/Anime4K_Restore_CNN_VL.glsl | [
"MIT"
] |
/*
* Copyright 2005-2010 LAMP/EPFL
*/
// $Id$
package scala.tools.eclipse.contribution.weaving.jdt.ui;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.corext.util.JdtFlags;
import org.eclipse.jdt.internal.corext.util.MethodOverrideTester;
import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache;
import org.eclipse.jdt.ui.JavaElementImageDescriptor;
import org.eclipse.jdt.ui.OverrideIndicatorLabelDecorator;
@SuppressWarnings("restriction")
public privileged aspect ScalaOverrideLabelAspect {
pointcut getOverrideIndicators(IMethod method) :
args (method) &&
(execution(int OverrideIndicatorLabelDecorator.getOverrideIndicators(IMethod)));
int around(IMethod method) throws JavaModelException : getOverrideIndicators(method) {
if (method instanceof IMethodOverrideInfo) {
return ((IMethodOverrideInfo)method).getOverrideInfo();
}
else
return proceed(method);
}
}
| AspectJ | 3 | dragos/scala-ide | org.scala-ide.sdt.aspects/src/scala/tools/eclipse/contribution/weaving/jdt/ui/ScalaOverrideLabelAspect.aj | [
"BSD-3-Clause"
] |