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. |
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; |
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; |
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__((...)). |
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; |
|
|
} |
|