diff --git a/SWIG/Source/SWIG1.1/parser.yxx b/SWIG/Source/SWIG1.1/parser.yxx index 3f3908595..ba8b17ade 100644 --- a/SWIG/Source/SWIG1.1/parser.yxx +++ b/SWIG/Source/SWIG1.1/parser.yxx @@ -492,6 +492,7 @@ static void dump_nested(char *parent) { %token TYPEMAP EXCEPT ECHO NEW APPLY CLEAR DOCONLY %token TITLE SECTION SUBSECTION SUBSUBSECTION %token LESSTHAN GREATERTHAN +%token TYPES /* Objective C tokens */ @@ -1251,6 +1252,17 @@ statement : INCLUDE STRING LBRACE { | LOCALSTYLE stylelist { } +/* %types directive. Used to register types with the type-checker */ + | TYPES LPAREN parms RPAREN SEMI { + Parm *p = $3; + while (p) { + SwigType *t = Gettype(p); + SwigType_remember(t); + p = Getnext(p); + } + Delete($3); + } + /* Dcumentation disable/enable */ doc_enable : DOC_DISABLE { diff --git a/SWIG/Source/SWIG1.1/scanner.cxx b/SWIG/Source/SWIG1.1/scanner.cxx index 36fe391e1..58c69ff8f 100644 --- a/SWIG/Source/SWIG1.1/scanner.cxx +++ b/SWIG/Source/SWIG1.1/scanner.cxx @@ -1089,6 +1089,7 @@ extern "C" int yylex(void) { if (strcmp(yytext,"%apply") == 0) return(APPLY); if (strcmp(yytext,"%clear") == 0) return(CLEAR); if (strcmp(yytext,"%doconly") == 0) return(DOCONLY); + if (strcmp(yytext,"%types") == 0) return(TYPES); } // Have an unknown identifier, as a last step, we'll // do a typedef lookup on it.