cosmetic variable name changes for abstracts to match previous commit
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13936 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d93dc0f8e2
commit
9b40eb58e3
3 changed files with 45 additions and 45 deletions
|
|
@ -728,33 +728,33 @@ static void check_extensions() {
|
|||
|
||||
/* Check a set of declarations to see if any are pure-abstract */
|
||||
|
||||
static List *pure_abstract(Node *n) {
|
||||
List *abs = 0;
|
||||
static List *pure_abstracts(Node *n) {
|
||||
List *abstracts = 0;
|
||||
while (n) {
|
||||
if (Cmp(nodeType(n),"cdecl") == 0) {
|
||||
String *decl = Getattr(n,"decl");
|
||||
if (SwigType_isfunction(decl)) {
|
||||
String *init = Getattr(n,"value");
|
||||
if (Cmp(init,"0") == 0) {
|
||||
if (!abs) {
|
||||
abs = NewList();
|
||||
if (!abstracts) {
|
||||
abstracts = NewList();
|
||||
}
|
||||
Append(abs,n);
|
||||
Append(abstracts,n);
|
||||
SetFlag(n,"abstract");
|
||||
}
|
||||
}
|
||||
} else if (Cmp(nodeType(n),"destructor") == 0) {
|
||||
if (Cmp(Getattr(n,"value"),"0") == 0) {
|
||||
if (!abs) {
|
||||
abs = NewList();
|
||||
if (!abstracts) {
|
||||
abstracts = NewList();
|
||||
}
|
||||
Append(abs,n);
|
||||
Append(abstracts,n);
|
||||
SetFlag(n,"abstract");
|
||||
}
|
||||
}
|
||||
n = nextSibling(n);
|
||||
}
|
||||
return abs;
|
||||
return abstracts;
|
||||
}
|
||||
|
||||
/* Make a classname */
|
||||
|
|
@ -3002,7 +3002,7 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va
|
|||
if (Strcmp(nodeType(templnode),"class") == 0) {
|
||||
|
||||
/* Identify pure abstract methods */
|
||||
Setattr(templnode,"abstracts", pure_abstract(firstChild(templnode)));
|
||||
Setattr(templnode,"abstracts", pure_abstracts(firstChild(templnode)));
|
||||
|
||||
/* Set up inheritance in symbol table */
|
||||
{
|
||||
|
|
@ -3574,7 +3574,7 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
|
|||
inclass = 0;
|
||||
|
||||
/* Check for pure-abstract class */
|
||||
Setattr($$,"abstracts", pure_abstract($7));
|
||||
Setattr($$,"abstracts", pure_abstracts($7));
|
||||
|
||||
/* This bit of code merges in a previously defined %extend directive (if any) */
|
||||
|
||||
|
|
@ -3737,7 +3737,7 @@ cpp_class_decl : storage_class cpptype idcolon inherit LBRACE {
|
|||
unnamed = Getattr($$,"unnamed");
|
||||
|
||||
/* Check for pure-abstract class */
|
||||
Setattr($$,"abstracts", pure_abstract($5));
|
||||
Setattr($$,"abstracts", pure_abstracts($5));
|
||||
|
||||
n = new_node("cdecl");
|
||||
Setattr(n,"name",$7.id);
|
||||
|
|
|
|||
|
|
@ -327,12 +327,12 @@ class Allocate:public Dispatcher {
|
|||
Swig_symbol_setscope(oldtab);
|
||||
return ret;
|
||||
}
|
||||
List *abstract = Getattr(base, "abstracts");
|
||||
if (abstract) {
|
||||
List *abstracts = Getattr(base, "abstracts");
|
||||
if (abstracts) {
|
||||
int dabstract = 0;
|
||||
int len = Len(abstract);
|
||||
int len = Len(abstracts);
|
||||
for (int i = 0; i < len; i++) {
|
||||
Node *nn = Getitem(abstract, i);
|
||||
Node *nn = Getitem(abstracts, i);
|
||||
String *name = Getattr(nn, "name");
|
||||
if (!name)
|
||||
continue;
|
||||
|
|
@ -348,13 +348,13 @@ class Allocate:public Dispatcher {
|
|||
Delete(base_decl);
|
||||
|
||||
if (!dn) {
|
||||
List *nabstract = Getattr(n, "abstracts");
|
||||
if (!nabstract) {
|
||||
nabstract = NewList();
|
||||
Setattr(n, "abstracts", nabstract);
|
||||
Delete(nabstract);
|
||||
List *nabstracts = Getattr(n, "abstracts");
|
||||
if (!nabstracts) {
|
||||
nabstracts = NewList();
|
||||
Setattr(n, "abstracts", nabstracts);
|
||||
Delete(nabstracts);
|
||||
}
|
||||
Append(nabstract, nn);
|
||||
Append(nabstracts, nn);
|
||||
if (!Getattr(n, "abstracts:firstnode")) {
|
||||
Setattr(n, "abstracts:firstnode", nn);
|
||||
}
|
||||
|
|
@ -605,10 +605,10 @@ Allocate():
|
|||
"Class '%s' might be abstract, " "no constructors generated,\n", SwigType_namestr(Getattr(n, "name")));
|
||||
Swig_warning(WARN_TYPE_ABSTRACT, Getfile(na), Getline(na), "Method %s might not be implemented.\n", Swig_name_decl(na));
|
||||
if (!Getattr(n, "abstracts")) {
|
||||
List *abstract = NewList();
|
||||
Append(abstract, na);
|
||||
Setattr(n, "abstracts", abstract);
|
||||
Delete(abstract);
|
||||
List *abstracts = NewList();
|
||||
Append(abstracts, na);
|
||||
Setattr(n, "abstracts", abstracts);
|
||||
Delete(abstracts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2644,25 +2644,25 @@ int Language::constructorDeclaration(Node *n) {
|
|||
* get_director_ctor_code()
|
||||
* ---------------------------------------------------------------------- */
|
||||
|
||||
static String *get_director_ctor_code(Node *n, String *director_ctor_code, String *director_prot_ctor_code, List *&abstract) {
|
||||
static String *get_director_ctor_code(Node *n, String *director_ctor_code, String *director_prot_ctor_code, List *&abstracts) {
|
||||
String *director_ctor = director_ctor_code;
|
||||
int use_director = Swig_directorclass(n);
|
||||
if (use_director) {
|
||||
Node *pn = Swig_methodclass(n);
|
||||
abstract = Getattr(pn, "abstracts");
|
||||
abstracts = Getattr(pn, "abstracts");
|
||||
if (director_prot_ctor_code) {
|
||||
int is_notabstract = GetFlag(pn, "feature:notabstract");
|
||||
int is_abstract = abstract && !is_notabstract;
|
||||
int is_abstract = abstracts && !is_notabstract;
|
||||
if (is_protected(n) || is_abstract) {
|
||||
director_ctor = director_prot_ctor_code;
|
||||
abstract = Copy(abstract);
|
||||
abstracts = Copy(abstracts);
|
||||
Delattr(pn, "abstracts");
|
||||
} else {
|
||||
if (is_notabstract) {
|
||||
abstract = Copy(abstract);
|
||||
abstracts = Copy(abstracts);
|
||||
Delattr(pn, "abstracts");
|
||||
} else {
|
||||
abstract = 0;
|
||||
abstracts = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2681,10 +2681,10 @@ int Language::constructorHandler(Node *n) {
|
|||
String *mrename = Swig_name_construct(NSpace, symname);
|
||||
String *nodeType = Getattr(n, "nodeType");
|
||||
int constructor = (!Cmp(nodeType, "constructor"));
|
||||
List *abstract = 0;
|
||||
List *abstracts = 0;
|
||||
String *director_ctor = get_director_ctor_code(n, director_ctor_code,
|
||||
director_prot_ctor_code,
|
||||
abstract);
|
||||
abstracts);
|
||||
if (!constructor) {
|
||||
/* if not originally a constructor, still handle it as one */
|
||||
Setattr(n, "handled_as_constructor", "1");
|
||||
|
|
@ -2695,8 +2695,8 @@ int Language::constructorHandler(Node *n) {
|
|||
functionWrapper(n);
|
||||
Delete(mrename);
|
||||
Swig_restore(n);
|
||||
if (abstract)
|
||||
Setattr(Swig_methodclass(n), "abstracts", abstract);
|
||||
if (abstracts)
|
||||
Setattr(Swig_methodclass(n), "abstracts", abstracts);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -2708,17 +2708,17 @@ int Language::copyconstructorHandler(Node *n) {
|
|||
Swig_require("copyconstructorHandler", n, "?name", "*sym:name", "?type", "?parms", NIL);
|
||||
String *symname = Getattr(n, "sym:name");
|
||||
String *mrename = Swig_name_copyconstructor(NSpace, symname);
|
||||
List *abstract = 0;
|
||||
List *abstracts = 0;
|
||||
String *director_ctor = get_director_ctor_code(n, director_ctor_code,
|
||||
director_prot_ctor_code,
|
||||
abstract);
|
||||
abstracts);
|
||||
Swig_ConstructorToFunction(n, NSpace, ClassType, none_comparison, director_ctor, CPlusPlus, Getattr(n, "template") ? 0 : Extend);
|
||||
Setattr(n, "sym:name", mrename);
|
||||
functionWrapper(n);
|
||||
Delete(mrename);
|
||||
Swig_restore(n);
|
||||
if (abstract)
|
||||
Setattr(Swig_methodclass(n), "abstracts", abstract);
|
||||
if (abstracts)
|
||||
Setattr(Swig_methodclass(n), "abstracts", abstracts);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
@ -3436,17 +3436,17 @@ int Language::abstractClassTest(Node *n) {
|
|||
if (Getattr(n, "allocate:nonew"))
|
||||
return 1;
|
||||
/* now check for the rest */
|
||||
List *abstract = Getattr(n, "abstracts");
|
||||
if (!abstract)
|
||||
List *abstracts = Getattr(n, "abstracts");
|
||||
if (!abstracts)
|
||||
return 0;
|
||||
int labs = Len(abstract);
|
||||
int labs = Len(abstracts);
|
||||
#ifdef SWIG_DEBUG
|
||||
List *bases = Getattr(n, "allbases");
|
||||
Printf(stderr, "testing %s %d %d\n", Getattr(n, "name"), labs, Len(bases));
|
||||
#endif
|
||||
if (!labs)
|
||||
return 0; /*strange, but need to be fixed */
|
||||
if (abstract && !directorsEnabled())
|
||||
if (abstracts && !directorsEnabled())
|
||||
return 1;
|
||||
if (!GetFlag(n, "feature:director"))
|
||||
return 1;
|
||||
|
|
@ -3458,7 +3458,7 @@ int Language::abstractClassTest(Node *n) {
|
|||
Printf(stderr, "vtable %s %d %d\n", Getattr(n, "name"), Len(vtable), labs);
|
||||
#endif
|
||||
for (int i = 0; i < labs; i++) {
|
||||
Node *ni = Getitem(abstract, i);
|
||||
Node *ni = Getitem(abstracts, i);
|
||||
Node *method_id = vtable_method_id(ni);
|
||||
if (!method_id)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue