comparison lib-src/etags.c @ 90751:52a7f3f50b89

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 624-636) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 200-201) - Merge from emacs--devo--0 - Update from CVS: lisp/nnweb.el (nnweb-google-parse-1): Update parser. Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-171
author Miles Bader <miles@gnu.org>
date Tue, 13 Feb 2007 12:14:16 +0000
parents 95d0cdf160ea a3a7c25796a4
children ec58e5c426ef
comparison
equal deleted inserted replaced
90750:f8cc067aba62 90751:52a7f3f50b89
451 /* member functions. */ 451 /* member functions. */
452 static bool constantypedefs; /* -d: create tags for C #define, enum */ 452 static bool constantypedefs; /* -d: create tags for C #define, enum */
453 /* constants and variables. */ 453 /* constants and variables. */
454 /* -D: opposite of -d. Default under ctags. */ 454 /* -D: opposite of -d. Default under ctags. */
455 static bool globals; /* create tags for global variables */ 455 static bool globals; /* create tags for global variables */
456 static bool members; /* create tags for C member variables */
456 static bool declarations; /* --declarations: tag them and extern in C&Co*/ 457 static bool declarations; /* --declarations: tag them and extern in C&Co*/
457 static bool members; /* create tags for C member variables */
458 static bool no_line_directive; /* ignore #line directives (undocumented) */ 458 static bool no_line_directive; /* ignore #line directives (undocumented) */
459 static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */ 459 static bool no_duplicates; /* no duplicate tags for ctags (undocumented) */
460 static bool update; /* -u: update tags */ 460 static bool update; /* -u: update tags */
461 static bool vgrind_style; /* -v: create vgrind style index output */ 461 static bool vgrind_style; /* -v: create vgrind style index output */
462 static bool no_warnings; /* -w: suppress warnings (undocumented) */ 462 static bool no_warnings; /* -w: suppress warnings (undocumented) */
575 static char default_C_help [] = 575 static char default_C_help [] =
576 "In C code, any C function or typedef is a tag, and so are\n\ 576 "In C code, any C function or typedef is a tag, and so are\n\
577 definitions of `struct', `union' and `enum'. `#define' macro\n\ 577 definitions of `struct', `union' and `enum'. `#define' macro\n\
578 definitions and `enum' constants are tags unless you specify\n\ 578 definitions and `enum' constants are tags unless you specify\n\
579 `--no-defines'. Global variables are tags unless you specify\n\ 579 `--no-defines'. Global variables are tags unless you specify\n\
580 `--no-globals'. Use of `--no-globals' and `--no-defines'\n\ 580 `--no-globals' and so are struct members unless you specify\n\
581 can make the tags table file much smaller.\n\ 581 `--no-members'. Use of `--no-globals', `--no-defines' and\n\
582 `--no-members' can make the tags table file much smaller.\n\
582 You can tag function declarations and external variables by\n\ 583 You can tag function declarations and external variables by\n\
583 using `--declarations', and struct members by using `--members'."; 584 using `--declarations'.";
584 585
585 static char *Cplusplus_suffixes [] = 586 static char *Cplusplus_suffixes [] =
586 { "C", "c++", "cc", "cpp", "cxx", "H", "h++", "hh", "hpp", "hxx", 587 { "C", "c++", "cc", "cpp", "cxx", "H", "h++", "hh", "hpp", "hxx",
587 "M", /* Objective C++ */ 588 "M", /* Objective C++ */
588 "pdb", /* Postscript with C syntax */ 589 "pdb", /* Postscript with C syntax */
589 NULL }; 590 NULL };
590 static char Cplusplus_help [] = 591 static char Cplusplus_help [] =
591 "In C++ code, all the tag constructs of C code are tagged. (Use\n\ 592 "In C++ code, all the tag constructs of C code are tagged. (Use\n\
592 --help --lang=c --lang=c++ for full help.)\n\ 593 --help --lang=c --lang=c++ for full help.)\n\
593 In addition to C tags, member functions are also recognized, and\n\ 594 In addition to C tags, member functions are also recognized. Member\n\
594 optionally member variables if you use the `--members' option.\n\ 595 variables are recognized unless you use the `--no-members' option.\n\
595 Tags for variables and functions in classes are named `CLASS::VARIABLE'\n\ 596 Tags for variables and functions in classes are named `CLASS::VARIABLE'\n\
596 and `CLASS::FUNCTION'. `operator' definitions have tag names like\n\ 597 and `CLASS::FUNCTION'. `operator' definitions have tag names like\n\
597 `operator+'."; 598 `operator+'.";
598 599
599 static char *Cjava_suffixes [] = 600 static char *Cjava_suffixes [] =
684 defined in the default package is `main::SUB'."; 685 defined in the default package is `main::SUB'.";
685 686
686 static char *PHP_suffixes [] = 687 static char *PHP_suffixes [] =
687 { "php", "php3", "php4", NULL }; 688 { "php", "php3", "php4", NULL };
688 static char PHP_help [] = 689 static char PHP_help [] =
689 "In PHP code, tags are functions, classes and defines. When using\n\ 690 "In PHP code, tags are functions, classes and defines. Unless you use\n\
690 the `--members' option, vars are tags too."; 691 the `--no-members' option, vars are tags too.";
691 692
692 static char *plain_C_suffixes [] = 693 static char *plain_C_suffixes [] =
693 { "pc", /* Pro*C file */ 694 { "pc", /* Pro*C file */
694 NULL }; 695 NULL };
695 696
927 Create tag entries for global variables in some languages."); 928 Create tag entries for global variables in some languages.");
928 else 929 else
929 puts ("--no-globals\n\ 930 puts ("--no-globals\n\
930 Do not create tag entries for global variables in some\n\ 931 Do not create tag entries for global variables in some\n\
931 languages. This makes the tags file smaller."); 932 languages. This makes the tags file smaller.");
932 puts ("--members\n\ 933 puts ("--no-members\n\
933 Create tag entries for members of structures in some languages."); 934 Do not create tag entries for members of structures\n\
935 in some languages.");
934 936
935 puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ 937 puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\
936 Make a tag for each line matching a regular expression pattern\n\ 938 Make a tag for each line matching a regular expression pattern\n\
937 in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ 939 in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\
938 files only. REGEXFILE is a file containing one REGEXP per line.\n\ 940 files only. REGEXFILE is a file containing one REGEXP per line.\n\
1166 is small. */ 1168 is small. */
1167 argbuffer = xnew (argc, argument); 1169 argbuffer = xnew (argc, argument);
1168 1170
1169 /* 1171 /*
1170 * If etags, always find typedefs and structure tags. Why not? 1172 * If etags, always find typedefs and structure tags. Why not?
1171 * Also default to find macro constants, enum constants and 1173 * Also default to find macro constants, enum constants, struct
1172 * global variables. 1174 * members and global variables.
1173 */ 1175 */
1174 if (!CTAGS) 1176 if (!CTAGS)
1175 { 1177 {
1176 typedefs = typedefs_or_cplusplus = constantypedefs = TRUE; 1178 typedefs = typedefs_or_cplusplus = constantypedefs = TRUE;
1177 globals = TRUE; 1179 globals = TRUE;
2416 __attribute__, 0, st_C_attribute 2418 __attribute__, 0, st_C_attribute
2417 @interface, 0, st_C_objprot 2419 @interface, 0, st_C_objprot
2418 @protocol, 0, st_C_objprot 2420 @protocol, 0, st_C_objprot
2419 @implementation,0, st_C_objimpl 2421 @implementation,0, st_C_objimpl
2420 @end, 0, st_C_objend 2422 @end, 0, st_C_objend
2421 import, (C_JAVA & !C_PLPL), st_C_ignore 2423 import, (C_JAVA & ~C_PLPL), st_C_ignore
2422 package, (C_JAVA & !C_PLPL), st_C_ignore 2424 package, (C_JAVA & ~C_PLPL), st_C_ignore
2423 friend, C_PLPL, st_C_ignore 2425 friend, C_PLPL, st_C_ignore
2424 extends, (C_JAVA & !C_PLPL), st_C_javastruct 2426 extends, (C_JAVA & ~C_PLPL), st_C_javastruct
2425 implements, (C_JAVA & !C_PLPL), st_C_javastruct 2427 implements, (C_JAVA & ~C_PLPL), st_C_javastruct
2426 interface, (C_JAVA & !C_PLPL), st_C_struct 2428 interface, (C_JAVA & ~C_PLPL), st_C_struct
2427 class, 0, st_C_class 2429 class, 0, st_C_class
2428 namespace, C_PLPL, st_C_struct 2430 namespace, C_PLPL, st_C_struct
2429 domain, C_STAR, st_C_struct 2431 domain, C_STAR, st_C_struct
2430 union, 0, st_C_struct 2432 union, 0, st_C_struct
2431 struct, 0, st_C_struct 2433 struct, 0, st_C_struct
2532 {"if", 0, st_C_ignore}, 2534 {"if", 0, st_C_ignore},
2533 {""}, 2535 {""},
2534 {"@end", 0, st_C_objend}, 2536 {"@end", 0, st_C_objend},
2535 {"union", 0, st_C_struct}, 2537 {"union", 0, st_C_struct},
2536 {"define", 0, st_C_define}, 2538 {"define", 0, st_C_define},
2537 {"import", (C_JAVA & !C_PLPL), st_C_ignore}, 2539 {"import", (C_JAVA & ~C_PLPL), st_C_ignore},
2538 {"template", 0, st_C_template}, 2540 {"template", 0, st_C_template},
2539 {"operator", C_PLPL, st_C_operator}, 2541 {"operator", C_PLPL, st_C_operator},
2540 {"@interface", 0, st_C_objprot}, 2542 {"@interface", 0, st_C_objprot},
2541 {"implements", (C_JAVA & !C_PLPL), st_C_javastruct}, 2543 {"implements", (C_JAVA & ~C_PLPL), st_C_javastruct},
2542 {"friend", C_PLPL, st_C_ignore}, 2544 {"friend", C_PLPL, st_C_ignore},
2543 {"typedef", 0, st_C_typedef}, 2545 {"typedef", 0, st_C_typedef},
2544 {"return", 0, st_C_ignore}, 2546 {"return", 0, st_C_ignore},
2545 {"@implementation",0, st_C_objimpl}, 2547 {"@implementation",0, st_C_objimpl},
2546 {"@protocol", 0, st_C_objprot}, 2548 {"@protocol", 0, st_C_objprot},
2547 {"interface", (C_JAVA & !C_PLPL), st_C_struct}, 2549 {"interface", (C_JAVA & ~C_PLPL), st_C_struct},
2548 {"extern", 0, st_C_extern}, 2550 {"extern", 0, st_C_extern},
2549 {"extends", (C_JAVA & !C_PLPL), st_C_javastruct}, 2551 {"extends", (C_JAVA & ~C_PLPL), st_C_javastruct},
2550 {"struct", 0, st_C_struct}, 2552 {"struct", 0, st_C_struct},
2551 {"domain", C_STAR, st_C_struct}, 2553 {"domain", C_STAR, st_C_struct},
2552 {"switch", 0, st_C_ignore}, 2554 {"switch", 0, st_C_ignore},
2553 {"enum", 0, st_C_enum}, 2555 {"enum", 0, st_C_enum},
2554 {"for", 0, st_C_ignore}, 2556 {"for", 0, st_C_ignore},
2555 {"namespace", C_PLPL, st_C_struct}, 2557 {"namespace", C_PLPL, st_C_struct},
2556 {"class", 0, st_C_class}, 2558 {"class", 0, st_C_class},
2557 {"while", 0, st_C_ignore}, 2559 {"while", 0, st_C_ignore},
2558 {"undef", 0, st_C_define}, 2560 {"undef", 0, st_C_define},
2559 {"package", (C_JAVA & !C_PLPL), st_C_ignore}, 2561 {"package", (C_JAVA & ~C_PLPL), st_C_ignore},
2560 {"__attribute__", 0, st_C_attribute}, 2562 {"__attribute__", 0, st_C_attribute},
2561 {"SYSCALL", 0, st_C_gnumacro}, 2563 {"SYSCALL", 0, st_C_gnumacro},
2562 {"ENTRY", 0, st_C_gnumacro}, 2564 {"ENTRY", 0, st_C_gnumacro},
2563 {"PSEUDO", 0, st_C_gnumacro}, 2565 {"PSEUDO", 0, st_C_gnumacro},
2564 {"DEFUN", 0, st_C_gnumacro} 2566 {"DEFUN", 0, st_C_gnumacro}
6892 * Local Variables: 6894 * Local Variables:
6893 * indent-tabs-mode: t 6895 * indent-tabs-mode: t
6894 * tab-width: 8 6896 * tab-width: 8
6895 * fill-column: 79 6897 * fill-column: 79
6896 * c-font-lock-extra-types: ("FILE" "bool" "language" "linebuffer" "fdesc" "node" "regexp") 6898 * c-font-lock-extra-types: ("FILE" "bool" "language" "linebuffer" "fdesc" "node" "regexp")
6897 * c-file-style: gnu 6899 * c-file-style: "gnu"
6898 * End: 6900 * End:
6899 */ 6901 */
6900 6902
6901 /* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051 6903 /* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051
6902 (do not change this comment) */ 6904 (do not change this comment) */