add support for empty throw(), needed by director
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6319 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9455a03257
commit
398b4d6f77
1 changed files with 44 additions and 3 deletions
|
|
@ -926,6 +926,7 @@ static void default_arguments(Node *n) {
|
||||||
Setattr(new_function,"parms",newparms);
|
Setattr(new_function,"parms",newparms);
|
||||||
Setattr(new_function,"storage",Copy(Getattr(function,"storage")));
|
Setattr(new_function,"storage",Copy(Getattr(function,"storage")));
|
||||||
Setattr(new_function,"type",Copy(Getattr(function,"type")));
|
Setattr(new_function,"type",Copy(Getattr(function,"type")));
|
||||||
|
Setattr(new_function,"throw",Copy(Getattr(function,"throw")));
|
||||||
|
|
||||||
{
|
{
|
||||||
Node *throws = Getattr(function,"throws");
|
Node *throws = Getattr(function,"throws");
|
||||||
|
|
@ -972,6 +973,7 @@ static void default_arguments(Node *n) {
|
||||||
String *qualifier;
|
String *qualifier;
|
||||||
String *bitfield;
|
String *bitfield;
|
||||||
Parm *throws;
|
Parm *throws;
|
||||||
|
String *throw;
|
||||||
} dtype;
|
} dtype;
|
||||||
struct {
|
struct {
|
||||||
char *type;
|
char *type;
|
||||||
|
|
@ -985,6 +987,7 @@ static void default_arguments(Node *n) {
|
||||||
ParmList *parms;
|
ParmList *parms;
|
||||||
short have_parms;
|
short have_parms;
|
||||||
ParmList *throws;
|
ParmList *throws;
|
||||||
|
String *throw;
|
||||||
} decl;
|
} decl;
|
||||||
Parm *tparms;
|
Parm *tparms;
|
||||||
struct {
|
struct {
|
||||||
|
|
@ -1067,7 +1070,7 @@ static void default_arguments(Node *n) {
|
||||||
/* Misc */
|
/* Misc */
|
||||||
%type <dtype> initializer cpp_const ;
|
%type <dtype> initializer cpp_const ;
|
||||||
%type <id> storage_class;
|
%type <id> storage_class;
|
||||||
%type <pl> parms ptail rawparms varargs_parms ;
|
%type <pl> parms ptail rawparms varargs_parms;
|
||||||
%type <p> parm valparm rawvalparms valparms valptail ;
|
%type <p> parm valparm rawvalparms valparms valptail ;
|
||||||
%type <p> typemap_parm tm_list tm_tail ;
|
%type <p> typemap_parm tm_list tm_tail ;
|
||||||
%type <id> cpptype access_specifier;
|
%type <id> cpptype access_specifier;
|
||||||
|
|
@ -1091,7 +1094,7 @@ static void default_arguments(Node *n) {
|
||||||
%type <str> idcolon idcolontail idcolonnt idcolontailnt idtemplate stringbrace stringbracesemi;
|
%type <str> idcolon idcolontail idcolonnt idcolontailnt idtemplate stringbrace stringbracesemi;
|
||||||
%type <id> string stringnum ;
|
%type <id> string stringnum ;
|
||||||
%type <tparms> template_parms;
|
%type <tparms> template_parms;
|
||||||
%type <dtype> cpp_vend;
|
%type <dtype> cpp_end cpp_vend;
|
||||||
%type <ivalue> rename_namewarn;
|
%type <ivalue> rename_namewarn;
|
||||||
%type <ptype> type_specifier primitive_type_list ;
|
%type <ptype> type_specifier primitive_type_list ;
|
||||||
%type <node> fname stringtype;
|
%type <node> fname stringtype;
|
||||||
|
|
@ -2294,6 +2297,7 @@ c_decl : storage_class type declarator initializer c_decl_tail {
|
||||||
Setattr($$,"parms",$3.parms);
|
Setattr($$,"parms",$3.parms);
|
||||||
Setattr($$,"value",$4.val);
|
Setattr($$,"value",$4.val);
|
||||||
Setattr($$,"throws",$4.throws);
|
Setattr($$,"throws",$4.throws);
|
||||||
|
Setattr($$,"throw",$4.throw);
|
||||||
if (!$5) {
|
if (!$5) {
|
||||||
if (Len(scanner_ccode)) {
|
if (Len(scanner_ccode)) {
|
||||||
Setattr($$,"code",Copy(scanner_ccode));
|
Setattr($$,"code",Copy(scanner_ccode));
|
||||||
|
|
@ -2349,6 +2353,7 @@ c_decl_tail : SEMI {
|
||||||
Setattr($$,"parms",$2.parms);
|
Setattr($$,"parms",$2.parms);
|
||||||
Setattr($$,"value",$3.val);
|
Setattr($$,"value",$3.val);
|
||||||
Setattr($$,"throws",$3.throws);
|
Setattr($$,"throws",$3.throws);
|
||||||
|
Setattr($$,"throw",$3.throw);
|
||||||
if ($3.bitfield) {
|
if ($3.bitfield) {
|
||||||
Setattr($$,"bitfield", $3.bitfield);
|
Setattr($$,"bitfield", $3.bitfield);
|
||||||
}
|
}
|
||||||
|
|
@ -2370,21 +2375,25 @@ initializer : def_args {
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
$$.qualifier = 0;
|
$$.qualifier = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| type_qualifier def_args {
|
| type_qualifier def_args {
|
||||||
$$ = $2;
|
$$ = $2;
|
||||||
$$.qualifier = $1;
|
$$.qualifier = $1;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| THROW LPAREN parms RPAREN def_args {
|
| THROW LPAREN parms RPAREN def_args {
|
||||||
$$ = $5;
|
$$ = $5;
|
||||||
$$.qualifier = 0;
|
$$.qualifier = 0;
|
||||||
$$.throws = $3;
|
$$.throws = $3;
|
||||||
|
$$.throw = NewString("1");
|
||||||
}
|
}
|
||||||
| type_qualifier THROW LPAREN parms RPAREN def_args {
|
| type_qualifier THROW LPAREN parms RPAREN def_args {
|
||||||
$$ = $6;
|
$$ = $6;
|
||||||
$$.qualifier = $1;
|
$$.qualifier = $1;
|
||||||
$$.throws = $4;
|
$$.throws = $4;
|
||||||
|
$$.throw = NewString("1");
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -2521,6 +2530,7 @@ c_constructor_decl : storage_class type LPAREN parms RPAREN ctor_end {
|
||||||
Setattr($$,"value",$6.defarg);
|
Setattr($$,"value",$6.defarg);
|
||||||
}
|
}
|
||||||
Setattr($$,"throws",$6.throws);
|
Setattr($$,"throws",$6.throws);
|
||||||
|
Setattr($$,"throw",$6.throw);
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3275,6 +3285,7 @@ cpp_constructor_decl : storage_class type LPAREN parms RPAREN ctor_end {
|
||||||
SwigType_add_function(decl,$4);
|
SwigType_add_function(decl,$4);
|
||||||
Setattr($$,"decl",decl);
|
Setattr($$,"decl",decl);
|
||||||
Setattr($$,"throws",$6.throws);
|
Setattr($$,"throws",$6.throws);
|
||||||
|
Setattr($$,"throw",$6.throw);
|
||||||
if (Len(scanner_ccode)) {
|
if (Len(scanner_ccode)) {
|
||||||
Setattr($$,"code",Copy(scanner_ccode));
|
Setattr($$,"code",Copy(scanner_ccode));
|
||||||
}
|
}
|
||||||
|
|
@ -3298,6 +3309,8 @@ cpp_destructor_decl : NOT idtemplate LPAREN parms RPAREN cpp_end {
|
||||||
SwigType_add_function(decl,$4);
|
SwigType_add_function(decl,$4);
|
||||||
Setattr($$,"decl",decl);
|
Setattr($$,"decl",decl);
|
||||||
}
|
}
|
||||||
|
Setattr($$,"throws",$6.throws);
|
||||||
|
Setattr($$,"throw",$6.throw);
|
||||||
add_symbols($$);
|
add_symbols($$);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3318,6 +3331,8 @@ cpp_destructor_decl : NOT idtemplate LPAREN parms RPAREN cpp_end {
|
||||||
}
|
}
|
||||||
Setattr($$,"storage","virtual");
|
Setattr($$,"storage","virtual");
|
||||||
Setattr($$,"name",NewStringf("~%s",$3));
|
Setattr($$,"name",NewStringf("~%s",$3));
|
||||||
|
Setattr($$,"throws",$7.throws);
|
||||||
|
Setattr($$,"throw",$7.throw);
|
||||||
if ($7.val) {
|
if ($7.val) {
|
||||||
Setattr($$,"value","0");
|
Setattr($$,"value","0");
|
||||||
}
|
}
|
||||||
|
|
@ -3515,8 +3530,14 @@ cpp_swig_directive: pragma_directive { $$ = $1; }
|
||||||
|
|
||||||
cpp_end : cpp_const SEMI {
|
cpp_end : cpp_const SEMI {
|
||||||
Clear(scanner_ccode);
|
Clear(scanner_ccode);
|
||||||
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
}
|
}
|
||||||
| cpp_const LBRACE { skip_balanced('{','}'); }
|
| cpp_const LBRACE {
|
||||||
|
skip_balanced('{','}');
|
||||||
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
cpp_vend : cpp_const SEMI {
|
cpp_vend : cpp_const SEMI {
|
||||||
|
|
@ -3525,6 +3546,7 @@ cpp_vend : cpp_const SEMI {
|
||||||
$$.qualifier = $1.qualifier;
|
$$.qualifier = $1.qualifier;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = $1.throws;
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
}
|
}
|
||||||
| cpp_const EQUAL definetype SEMI {
|
| cpp_const EQUAL definetype SEMI {
|
||||||
Clear(scanner_ccode);
|
Clear(scanner_ccode);
|
||||||
|
|
@ -3532,6 +3554,7 @@ cpp_vend : cpp_const SEMI {
|
||||||
$$.qualifier = $1.qualifier;
|
$$.qualifier = $1.qualifier;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = $1.throws;
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
}
|
}
|
||||||
| cpp_const LBRACE {
|
| cpp_const LBRACE {
|
||||||
skip_balanced('{','}');
|
skip_balanced('{','}');
|
||||||
|
|
@ -3539,6 +3562,7 @@ cpp_vend : cpp_const SEMI {
|
||||||
$$.qualifier = $1.qualifier;
|
$$.qualifier = $1.qualifier;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = $1.throws;
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -3702,6 +3726,7 @@ def_args : EQUAL definetype {
|
||||||
$$.rawval = 0;
|
$$.rawval = 0;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
| EQUAL AND declarator {
|
| EQUAL AND declarator {
|
||||||
|
|
@ -3723,6 +3748,7 @@ def_args : EQUAL definetype {
|
||||||
$$.type = T_USER;
|
$$.type = T_USER;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| EQUAL LBRACE {
|
| EQUAL LBRACE {
|
||||||
skip_balanced('{','}');
|
skip_balanced('{','}');
|
||||||
|
|
@ -3731,6 +3757,7 @@ def_args : EQUAL definetype {
|
||||||
$$.type = T_INT;
|
$$.type = T_INT;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| COLON expr {
|
| COLON expr {
|
||||||
$$.val = 0;
|
$$.val = 0;
|
||||||
|
|
@ -3738,6 +3765,7 @@ def_args : EQUAL definetype {
|
||||||
$$.type = 0;
|
$$.type = 0;
|
||||||
$$.bitfield = $2.val;
|
$$.bitfield = $2.val;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| empty {
|
| empty {
|
||||||
$$.val = 0;
|
$$.val = 0;
|
||||||
|
|
@ -3745,6 +3773,7 @@ def_args : EQUAL definetype {
|
||||||
$$.type = T_INT;
|
$$.type = T_INT;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -4393,6 +4422,7 @@ definetype : { /* scanner_check_typedef(); */ } expr {
|
||||||
}
|
}
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
scanner_ignore_typedef();
|
scanner_ignore_typedef();
|
||||||
}
|
}
|
||||||
/* | string {
|
/* | string {
|
||||||
|
|
@ -4401,6 +4431,7 @@ definetype : { /* scanner_check_typedef(); */ } expr {
|
||||||
$$.type = T_STRING;
|
$$.type = T_STRING;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
| CHARCONST {
|
| CHARCONST {
|
||||||
|
|
@ -4415,6 +4446,7 @@ definetype : { /* scanner_check_typedef(); */ } expr {
|
||||||
$$.type = T_CHAR;
|
$$.type = T_CHAR;
|
||||||
$$.bitfield = 0;
|
$$.bitfield = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -4708,18 +4740,22 @@ opt_virtual : VIRTUAL
|
||||||
cpp_const : type_qualifier {
|
cpp_const : type_qualifier {
|
||||||
$$.qualifier = $1;
|
$$.qualifier = $1;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| THROW LPAREN parms RPAREN {
|
| THROW LPAREN parms RPAREN {
|
||||||
$$.qualifier = 0;
|
$$.qualifier = 0;
|
||||||
$$.throws = $3;
|
$$.throws = $3;
|
||||||
|
$$.throw = NewString("1");
|
||||||
}
|
}
|
||||||
| type_qualifier THROW LPAREN parms RPAREN {
|
| type_qualifier THROW LPAREN parms RPAREN {
|
||||||
$$.qualifier = $1;
|
$$.qualifier = $1;
|
||||||
$$.throws = $4;
|
$$.throws = $4;
|
||||||
|
$$.throw = NewString("1");
|
||||||
}
|
}
|
||||||
| empty {
|
| empty {
|
||||||
$$.qualifier = 0;
|
$$.qualifier = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -4728,12 +4764,14 @@ ctor_end : cpp_const ctor_initializer SEMI {
|
||||||
$$.have_parms = 0;
|
$$.have_parms = 0;
|
||||||
$$.defarg = 0;
|
$$.defarg = 0;
|
||||||
$$.throws = $1.throws;
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
}
|
}
|
||||||
| cpp_const ctor_initializer LBRACE {
|
| cpp_const ctor_initializer LBRACE {
|
||||||
skip_balanced('{','}');
|
skip_balanced('{','}');
|
||||||
$$.have_parms = 0;
|
$$.have_parms = 0;
|
||||||
$$.defarg = 0;
|
$$.defarg = 0;
|
||||||
$$.throws = $1.throws;
|
$$.throws = $1.throws;
|
||||||
|
$$.throw = $1.throw;
|
||||||
}
|
}
|
||||||
| LPAREN parms RPAREN SEMI {
|
| LPAREN parms RPAREN SEMI {
|
||||||
Clear(scanner_ccode);
|
Clear(scanner_ccode);
|
||||||
|
|
@ -4741,6 +4779,7 @@ ctor_end : cpp_const ctor_initializer SEMI {
|
||||||
$$.have_parms = 1;
|
$$.have_parms = 1;
|
||||||
$$.defarg = 0;
|
$$.defarg = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| LPAREN parms RPAREN LBRACE {
|
| LPAREN parms RPAREN LBRACE {
|
||||||
skip_balanced('{','}');
|
skip_balanced('{','}');
|
||||||
|
|
@ -4748,11 +4787,13 @@ ctor_end : cpp_const ctor_initializer SEMI {
|
||||||
$$.have_parms = 1;
|
$$.have_parms = 1;
|
||||||
$$.defarg = 0;
|
$$.defarg = 0;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
| EQUAL definetype SEMI {
|
| EQUAL definetype SEMI {
|
||||||
$$.have_parms = 0;
|
$$.have_parms = 0;
|
||||||
$$.defarg = $2.val;
|
$$.defarg = $2.val;
|
||||||
$$.throws = 0;
|
$$.throws = 0;
|
||||||
|
$$.throw = 0;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue