Example #1
0
struct Specifier * CopySpecifier(struct Specifier * spec)
{
if(spec)
switch(spec->type)
{
case 0:
return MkSpecifier(spec->specifier);
case 2:
{
struct Identifier * id = CopyIdentifier(spec->id);
struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
struct Enumerator * enumerator;

if(spec->list)
{
for(enumerator = (*spec->list).first; enumerator; enumerator = enumerator->next)
ListAdd(list, CopyEnumerator(enumerator));
}
return MkEnum(id, list);
}
case 3:
case 4:
{
struct Identifier * id = CopyIdentifier(spec->id);
struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
struct ClassDef * def;
struct Specifier * s;

if(spec->definitions)
{
list = MkList();
if(spec->list)
{
for(def = (*spec->list).first; def; def = def->next)
ListAdd(list, CopyClassDef(def));
}
}
s = MkStructOrUnion(spec->type, id, list);
s->extDeclStruct = CopyExtDecl(spec->extDeclStruct);
return s;
}
case 1:
{
struct Specifier * copy = (copy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier), copy->type = 1, copy->name = __ecereNameSpace__ecere__sys__CopyString(spec->name), copy->symbol = spec->symbol, copy->templateArgs = (((void *)0)), copy);

return copy;
}
case 7:
return MkSpecifierSubClass(CopySpecifier(spec->_class));
case 8:
return __extension__ ({
struct Specifier * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier);

__ecereInstance1->loc = spec->loc, __ecereInstance1->type = 8, __ecereInstance1->templateParameter = spec->templateParameter, __ecereInstance1;
});
case 5:
return MkSpecifierExtended(CopyExtDecl(spec->extDecl));
}
Example #2
0
struct Declaration * QMkDeclarationBase(int base, struct InitDeclarator * initDecl)
{
struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * initDecls = (((void *)0));

ListAdd(specs, MkSpecifier(base));
if(initDecl)
{
initDecls = MkList();
ListAdd(initDecls, initDecl);
}
return MkDeclaration(specs, initDecls);
}