From b59f35e2b91ce2295019c03c60ad2727a66f577c Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Sat, 2 Sep 2000 16:26:10 +0000 Subject: [PATCH] New %types directive git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@800 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/SWIG1.1/parser.yxx | 12 ++++++++++++ SWIG/Source/SWIG1.1/scanner.cxx | 1 + 2 files changed, 13 insertions(+) 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.