~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Source/Modules/typepass.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 *     type-expansion.  All types are fully qualified with namespace prefixes
9
9
 *     and other information needed for compilation.
10
10
 *
11
 
 *     This module also handles the %varargs directive by looking for
12
 
 *     "feature:varargs" and substituting ... with an alternative set of
13
 
 *     arguments.
14
 
 * 
15
11
 * Author(s) : David Beazley (beazley@cs.uchicago.edu)
16
12
 *
17
13
 * Copyright (C) 1998-2002.  The University of Chicago
21
17
 * See the file LICENSE for information on usage and redistribution.    
22
18
 * ----------------------------------------------------------------------------- */
23
19
 
24
 
char cvsroot_typepass_cxx[] = "$Header: /cvsroot/swig/SWIG/Source/Modules/typepass.cxx,v 1.21 2004/12/14 21:25:12 wsfulton Exp $";
 
20
char cvsroot_typepass_cxx[] = "$Header: /cvsroot/swig/SWIG/Source/Modules/typepass.cxx,v 1.25 2005/09/30 21:37:40 wsfulton Exp $";
25
21
 
26
22
#include "swigmod.h"
27
23
 
418
414
 
419
415
    Hash *ts = SwigType_pop_scope();
420
416
    Setattr(n,"typescope",ts);
 
417
    Delete(ts);
421
418
    Setattr(n,"module",module);
422
419
 
423
420
    /* Normalize deferred types */
527
524
      if (name) {
528
525
        Hash *ts = SwigType_pop_scope();
529
526
        Setattr(n,"typescope",ts);
 
527
        Delete(ts);
530
528
      }
531
529
 
532
530
      /* Normalize deferred types */
556
554
      Delattr(n,"throws");
557
555
    }
558
556
 
559
 
    /* Search for var args */
560
 
    if (Getattr(n,"feature:varargs")) {
561
 
      ParmList *v = Getattr(n,"feature:varargs");
562
 
      Parm     *p = Getattr(n,"parms");
563
 
      Parm     *pp = 0;
564
 
      while (p) {
565
 
        SwigType *t = Getattr(p,"type");
566
 
        if (Strcmp(t,"v(...)") == 0) {
567
 
          if (pp) {
568
 
            set_nextSibling(pp,Copy(v));
569
 
          } else {
570
 
            Setattr(n,"parms", Copy(v));
571
 
          }
572
 
          break;
573
 
        }
574
 
        pp = p;
575
 
        p = nextSibling(p);
576
 
      }
577
 
    }
578
 
 
579
557
    /* Normalize types. */
580
558
    SwigType *ty = Getattr(n,"type");
581
559
    normalize_type(ty);
636
614
      Delattr(n,"throws");
637
615
    }
638
616
 
639
 
    /* Search for var args */
640
 
    if (Getattr(n,"feature:varargs")) {
641
 
      ParmList *v = Getattr(n,"feature:varargs");
642
 
      Parm     *p = Getattr(n,"parms");
643
 
      Parm     *pp = 0;
644
 
      while (p) {
645
 
        SwigType *t = Getattr(p,"type");
646
 
        if (Strcmp(t,"v(...)") == 0) {
647
 
          if (pp) {
648
 
            set_nextSibling(pp,Copy(v));
649
 
          } else {
650
 
            Setattr(n,"parms", Copy(v));
651
 
          }
652
 
          break;
653
 
        }
654
 
        pp = p;
655
 
        p = nextSibling(p);
656
 
      }
657
 
    }
658
617
    normalize_parms(Getattr(n,"parms"));
659
618
    normalize_parms(Getattr(n,"throws"));
660
619
      
838
797
            SwigType_typedef_using(uname);
839
798
          } else {
840
799
            /* A normal C declaration. */
841
 
            if ((inclass) && (!Getattr(n,"feature:ignore")) && (Getattr(n,"sym:name"))) {
 
800
            if ((inclass) && (!GetFlag(n,"feature:ignore")) && (Getattr(n,"sym:name"))) {
842
801
              Node *c = ns;
843
802
              Node *unodes = 0, *last_unodes = 0;
844
803
              int   ccount = 0;
849
808
                        || checkAttribute(c,"storage","typedef")
850
809
                        || checkAttribute(c,"storage","friend")
851
810
                        || (Getattr(c,"feature:extend") && !Getattr(c,"code"))
852
 
                        || Getattr(c,"feature:ignore"))) {
 
811
                        || GetFlag(c,"feature:ignore"))) {
853
812
                        
854
813
                    String *csymname = Getattr(c,"sym:name");
855
814
                    if (!csymname || (Strcmp(csymname,symname) == 0)) {
872
831
                        }
873
832
                      }
874
833
                      Node *nn = copyNode(c);
 
834
                      Delattr(nn,"access"); // access might be different from the method in the base class
875
835
                      if (!Getattr(nn,"sym:name")) Setattr(nn,"sym:name", symname);
876
836
 
877
 
                      if (!Getattr(nn,"feature:ignore")) {
 
837
                      if (!GetFlag(nn,"feature:ignore")) {
878
838
                        Setattr(nn,"parms",CopyParmList(Getattr(c,"parms")));
 
839
                        ParmList *throw_parm_list = Getattr(c,"throws");
 
840
                        if (throw_parm_list)
 
841
                          Setattr(nn,"throws",CopyParmList(throw_parm_list));
879
842
                        ccount++;
880
843
                        if (!last_unodes) {
881
844
                          last_unodes = nn;