the function 'need_protected' outside parser.y,
ie, if more subtle cases appear, they can be
fixed without changing parser.y.
Now parser.y looks much more like the original 1.32.
Source/CParse/parser.y: moving and fixing 'need_protected'
Source/CParse/util.c: moving and fixing 'need_protected'
Examples/test-suite/director_protected.i: more %rename cases
Examples/test-suite/director_using.i: fixing bad module name
The errors in question where related to the mix of
%rename + (typedef|static) + protected + dirprot_mode:
%rename(s) Foo::p;
%rename(q) Foo::r;
%inline {
class Foo {
public:
virtual ~Foo() {}
int p(){ return 1;}
int r(){ return 1;}
protected:
typedef int q();
static int s();
};
since q and s look like functions, the parser was adding them
completly to the symbol table, and clashing latter with the
attemped renames.
The error was only visible when dirprot was enabled, with
the old behavior it was ok.
Marcelo
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
88 lines
1.1 KiB
OpenEdge ABL
88 lines
1.1 KiB
OpenEdge ABL
%module(directors="1",dirprot="1") director_protected
|
|
|
|
%{
|
|
#include <string>
|
|
#include <iostream>
|
|
%}
|
|
|
|
%include "std_string.i"
|
|
|
|
%feature("director") Foo;
|
|
%feature("director") Bar;
|
|
|
|
%newobject *::create();
|
|
|
|
%rename(a) Bar::hello;
|
|
%rename(s) Foo::p;
|
|
%rename(q) Foo::r;
|
|
|
|
%inline {
|
|
class Foo {
|
|
public:
|
|
virtual ~Foo() {}
|
|
virtual std::string pong() {
|
|
return "Foo::pong();" + ping();
|
|
}
|
|
|
|
int p(){ return 1;}
|
|
int r(){ return 1;}
|
|
|
|
|
|
protected:
|
|
|
|
typedef int q();
|
|
static int s();
|
|
|
|
Foo() {}
|
|
|
|
virtual std::string ping() = 0;
|
|
|
|
virtual std::string pang()
|
|
{
|
|
return "Foo::pang();";
|
|
}
|
|
|
|
void hellom() {}
|
|
|
|
virtual std::string used() {
|
|
return pang() + pong();
|
|
}
|
|
};
|
|
|
|
class Bar : public Foo
|
|
{
|
|
public:
|
|
Foo* create()
|
|
{
|
|
return new Bar();
|
|
}
|
|
|
|
std::string pong() {
|
|
return "Bar::pong();" + Foo::pong();
|
|
}
|
|
|
|
int hello;
|
|
|
|
using Foo::used;
|
|
|
|
protected:
|
|
std::string ping() {
|
|
return "Bar::ping();";
|
|
};
|
|
|
|
enum Hello {hola, chao};
|
|
|
|
static int a;
|
|
static const int b;
|
|
|
|
int hi;
|
|
void him() {}
|
|
|
|
private:
|
|
int c;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|