/[global]/global/gtags-parser/Cpp.c
ViewVC logotype

Diff of /global/gtags-parser/Cpp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by shigio, Fri Feb 18 11:07:18 2005 UTC revision 1.2 by shigio, Thu Feb 24 01:33:48 2005 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003, 2004   * Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3   *      Tama Communications Corporation   *      Tama Communications Corporation
4   *   *
5   * This file is part of GNU GLOBAL.   * This file is part of GNU GLOBAL.
# Line 72  static int namespacelevel;     /* namespace Line 72  static int namespacelevel;     /* namespace
72   * Cpp: read C++ file and pickup tag entries.   * Cpp: read C++ file and pickup tag entries.
73   */   */
74  void  void
75  Cpp()  Cpp(file)
76            const char *file;
77  {  {
78          int c, cc;          int c, cc;
79          int savelevel;          int savelevel;
# Line 101  Cpp() Line 102  Cpp()
102          crflag = 1;                     /* require '\n' as a token */          crflag = 1;                     /* require '\n' as a token */
103          cppmode = 1;                    /* treat '::' as a token */          cppmode = 1;                    /* treat '::' as a token */
104    
105            if (!opentoken(file))
106                    die("'%s' cannot open.", file);
107          while ((cc = nexttoken(interested, reserved_word)) != EOF) {          while ((cc = nexttoken(interested, reserved_word)) != EOF) {
108                  if (cc == '~' && level == stack[classlevel].level)                  if (cc == '~' && level == stack[classlevel].level)
109                          continue;                          continue;
# Line 521  Cpp() Line 524  Cpp()
524                  if (piflevel != 0)                  if (piflevel != 0)
525                          warning("#if block unmatched. (last at level %d.)[+%d %s]", piflevel, lineno, curfile);                          warning("#if block unmatched. (last at level %d.)[+%d %s]", piflevel, lineno, curfile);
526          }          }
527            closetoken();
528  }  }
529  /*  /*
530   * process_attribute: skip attributes in __attribute__((...)).   * process_attribute: skip attributes in __attribute__((...)).
# Line 736  seems_datatype(token) Line 740  seems_datatype(token)
740                          return 0;                          return 0;
741          return 1;          return 1;
742  }  }
 /*  
  * whether or not C++.  
  */  
 int  
 isCpp()  
 {  
         int cc;  
         int Cpp = 0;  
         cmode = 1;                      /* allow token like '#xxx' */  
         cppmode = 1;                    /* treat '::' as a token */  
   
         while ((cc = nexttoken(NULL, reserved_word)) != EOF) {  
                 if (cc == CPP_CLASS || cc == CPP_TEMPLATE ||  
                         cc == CPP_OPERATOR || cc == CPP_VIRTUAL) {  
                         Cpp = 1;  
                         break;  
                 }  
         }  
         rewindtoken();  
         return Cpp;  
 }  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26