comparison lib-src/etags.c @ 17785:5b92f8ba5c6d

Added support for the Java language.
author Francesco Potortì <pot@gnu.org>
date Tue, 13 May 1997 09:38:23 +0000
parents c3ff4c535c9c
children c378dd0b8de7
comparison
equal deleted inserted replaced
17784:5b2fa4a13a8b 17785:5b92f8ba5c6d
29 * Regexp tags by Tom Tromey. 29 * Regexp tags by Tom Tromey.
30 * 30 *
31 * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer. 31 * Francesco Potorti` (F.Potorti@cnuce.cnr.it) is the current maintainer.
32 */ 32 */
33 33
34 char pot_etags_version[] = "@(#) pot revision number is 11.90"; 34 char pot_etags_version[] = "@(#) pot revision number is 11.91";
35 35
36 #define TRUE 1 36 #define TRUE 1
37 #define FALSE 0 37 #define FALSE 0
38 38
39 #ifndef DEBUG 39 #ifndef DEBUG
436 { "c", default_C_entries, default_C_suffixes, NULL }, 436 { "c", default_C_entries, default_C_suffixes, NULL },
437 { "c++", Cplusplus_entries, Cplusplus_suffixes, NULL }, 437 { "c++", Cplusplus_entries, Cplusplus_suffixes, NULL },
438 { "c*", Cstar_entries, Cstar_suffixes, NULL }, 438 { "c*", Cstar_entries, Cstar_suffixes, NULL },
439 { "erlang", Erlang_functions, Erlang_suffixes, NULL }, 439 { "erlang", Erlang_functions, Erlang_suffixes, NULL },
440 { "fortran", Fortran_functions, Fortran_suffixes, NULL }, 440 { "fortran", Fortran_functions, Fortran_suffixes, NULL },
441 /*{ "java", Cjava_entries, Cjava_suffixes, NULL },*/ 441 { "java", Cjava_entries, Cjava_suffixes, NULL },
442 { "lisp", Lisp_functions, Lisp_suffixes, NULL }, 442 { "lisp", Lisp_functions, Lisp_suffixes, NULL },
443 { "pascal", Pascal_functions, Pascal_suffixes, NULL }, 443 { "pascal", Pascal_functions, Pascal_suffixes, NULL },
444 { "perl", Perl_functions, Perl_suffixes, Perl_interpreters }, 444 { "perl", Perl_functions, Perl_suffixes, Perl_interpreters },
445 { "postscript", Postscript_functions, Postscript_suffixes, NULL }, 445 { "postscript", Postscript_functions, Postscript_suffixes, NULL },
446 { "proc", plain_C_entries, plain_C_suffixes, NULL }, 446 { "proc", plain_C_entries, plain_C_suffixes, NULL },
1537 */ 1537 */
1538 enum sym_type 1538 enum sym_type
1539 { 1539 {
1540 st_none, st_C_objprot, st_C_objimpl, st_C_objend, st_C_gnumacro, 1540 st_none, st_C_objprot, st_C_objimpl, st_C_objend, st_C_gnumacro,
1541 st_C_struct, st_C_enum, st_C_define, st_C_typedef, st_C_typespec, 1541 st_C_struct, st_C_enum, st_C_define, st_C_typedef, st_C_typespec,
1542 st_C_jstruct 1542 st_C_javastruct
1543 }; 1543 };
1544 1544
1545 /* Feed stuff between (but not including) %[ and %] lines to: 1545 /* Feed stuff between (but not including) %[ and %] lines to:
1546 gperf -c -k 1,3 -o -p -r -t 1546 gperf -c -k 1,3 -o -p -r -t
1547 %[ 1547 %[
1549 %% 1549 %%
1550 @interface, 0, st_C_objprot 1550 @interface, 0, st_C_objprot
1551 @protocol, 0, st_C_objprot 1551 @protocol, 0, st_C_objprot
1552 @implementation,0, st_C_objimpl 1552 @implementation,0, st_C_objimpl
1553 @end, 0, st_C_objend 1553 @end, 0, st_C_objend
1554 extends, C_JAVA, st_C_jstruct 1554 extends, C_JAVA, st_C_javastruct
1555 implements, C_JAVA, st_C_jstruct 1555 implements, C_JAVA, st_C_javastruct
1556 class, C_PLPL, st_C_struct 1556 class, C_PLPL, st_C_struct
1557 namespace, C_PLPL, st_C_struct 1557 namespace, C_PLPL, st_C_struct
1558 domain, C_STAR, st_C_struct 1558 domain, C_STAR, st_C_struct
1559 union, 0, st_C_struct 1559 union, 0, st_C_struct
1560 struct, 0, st_C_struct 1560 struct, 0, st_C_struct
1648 {"class", C_PLPL, st_C_struct}, 1648 {"class", C_PLPL, st_C_struct},
1649 {"auto", 0, st_C_typespec}, 1649 {"auto", 0, st_C_typespec},
1650 {"",}, {"",}, 1650 {"",}, {"",},
1651 {"bool", C_PLPL, st_C_typespec}, 1651 {"bool", C_PLPL, st_C_typespec},
1652 {"extern", 0, st_C_typespec}, 1652 {"extern", 0, st_C_typespec},
1653 {"extends", C_JAVA, st_C_jstruct}, 1653 {"extends", C_JAVA, st_C_javastruct},
1654 {"",}, {"",}, 1654 {"",}, {"",},
1655 {"@implementation", 0, st_C_objimpl}, 1655 {"@implementation", 0, st_C_objimpl},
1656 {"",}, {"",}, {"",}, 1656 {"",}, {"",}, {"",},
1657 {"@end", 0, st_C_objend}, 1657 {"@end", 0, st_C_objend},
1658 {"mutable", C_PLPL, st_C_typespec}, 1658 {"mutable", C_PLPL, st_C_typespec},
1682 {"long", 0, st_C_typespec}, 1682 {"long", 0, st_C_typespec},
1683 {"typedef", 0, st_C_typedef}, 1683 {"typedef", 0, st_C_typedef},
1684 {"typename", C_PLPL, st_C_typespec}, 1684 {"typename", C_PLPL, st_C_typespec},
1685 {"volatile", 0, st_C_typespec}, 1685 {"volatile", 0, st_C_typespec},
1686 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 1686 {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
1687 {"implements", C_JAVA, st_C_jstruct}, 1687 {"implements", C_JAVA, st_C_javastruct},
1688 {"",}, {"",}, 1688 {"",}, {"",},
1689 {"union", 0, st_C_struct}, 1689 {"union", 0, st_C_struct},
1690 {"",}, 1690 {"",},
1691 {"double", 0, st_C_typespec}, 1691 {"double", 0, st_C_typespec},
1692 {"DEFUN", 0, st_C_gnumacro}, 1692 {"DEFUN", 0, st_C_gnumacro},
1795 dignorerest /* ignore rest of line */ 1795 dignorerest /* ignore rest of line */
1796 } definedef; 1796 } definedef;
1797 1797
1798 /* 1798 /*
1799 * State machine for Objective C protocols and implementations. 1799 * State machine for Objective C protocols and implementations.
1800 * Tom R.Hageman <tom@basil.icce.rug.nl>
1800 */ 1801 */
1801 enum 1802 enum
1802 { 1803 {
1803 onone, /* nothing seen */ 1804 onone, /* nothing seen */
1804 oprotocol, /* @interface or @protocol seen */ 1805 oprotocol, /* @interface or @protocol seen */
1948 * file is plain C. This is because a struct tag may have the same 1949 * file is plain C. This is because a struct tag may have the same
1949 * name as another tag, and this loses with ctags. 1950 * name as another tag, and this loses with ctags.
1950 */ 1951 */
1951 switch (toktype) 1952 switch (toktype)
1952 { 1953 {
1953 case st_C_jstruct: 1954 case st_C_javastruct:
1954 if (structdef == stagseen) 1955 if (structdef == stagseen)
1955 structdef = scolonseen; 1956 structdef = scolonseen;
1956 return FALSE; 1957 return FALSE;
1957 break; 1958 break;
1958 case st_C_struct: 1959 case st_C_struct:
3301 } 3302 }
3302 3303
3303 /* 3304 /*
3304 * Postscript tag functions 3305 * Postscript tag functions
3305 * Just look for lines where the first character is '/' 3306 * Just look for lines where the first character is '/'
3307 * Richard Mlynarik <mly@adoc.xerox.com>
3306 */ 3308 */
3307 void 3309 void
3308 Postscript_functions (inf) 3310 Postscript_functions (inf)
3309 FILE *inf; 3311 FILE *inf;
3310 { 3312 {
4071 { 4073 {
4072 error ("missing regexp", (char *)NULL); 4074 error ("missing regexp", (char *)NULL);
4073 return; 4075 return;
4074 } 4076 }
4075 if (regex_arg[0] == '@' 4077 if (regex_arg[0] == '@'
4076 && stat (regex_arg + 1, &stat_buf) == 0 4078 && stat (regex_arg + 1, &stat_buf) == 0)
4077 && S_ISREG (stat_buf.st_mode))
4078 { 4079 {
4079 FILE *regexfp; 4080 FILE *regexfp;
4080 struct linebuffer regexbuf; 4081 struct linebuffer regexbuf;
4081 char *regexfile = regex_arg + 1; 4082 char *regexfile = regex_arg + 1;
4082 4083