[gnu.emacs] Asm tags for etags/ctags

wolfgang@mgm.mit.edu (Wolfgang Rupprecht) (11/15/88)

Here is a set of diffs for etags.c for generating tags for
assembly-code files.  Just the thing for hacking the kernel, and also
including "locore.s" and friends in the tags table.

There is also one bug-fix.  The "_" char incorrectly terminated C
tokens.

cd /u/src/gnuemacs-18.52/etc/
diff -c etags.c.orig etags.c
*** etags.c.orig	Thu Jun 23 08:45:37 1988
--- etags.c	Mon Nov 14 20:52:38 1988
***************
*** 1,3 ****
--- 1,7 ----
+ /*
+  * Hacked to understand assembly files. -wolfgang 11/3/88
+  */
+ 
  /* Tags file maker to go with GNUmacs
     Copyright (C) 1984, 1987, 1988 Free Software Foundation, Inc. and Ken Arnold
  
***************
*** 533,538 ****
--- 537,551 ----
        fclose(inf);
        return;
      }
+   /* 
+    * assume that ".s" or ".a" is assembly code. -wolfgang
+    */
+   if (cp && (cp[1] == 's' || cp[1] == 'a') && cp[2] == '\0')
+   {
+       Asm_funcs(inf);
+       fclose(inf);
+       return;
+   }
    /* if not a .c or .h or .y file, try fortran */
    if (cp && (cp[1] != 'c' && cp[1] != 'h' && cp[1] != 'y')
        && cp[2] == '\0')
***************
*** 1195,1203 ****
  
    while (isspace(*dbp))
      dbp++;
!   if (*dbp == 0 || !isalpha(*dbp))
      return;
!   for (cp = dbp+1; *cp && (isalpha(*cp) || isdigit(*cp)); cp++)
      continue;
    c = cp[0];
    cp[0] = 0;
--- 1208,1216 ----
  
    while (isspace(*dbp))
      dbp++;
!   if (*dbp == 0 || (!isalpha(*dbp)) && (*dbp != '_'))
      return;
!   for (cp = dbp+1; *cp && (isalpha(*cp) || isdigit(*cp) || (*cp == '_')); cp++)
      continue;
    c = cp[0];
    cp[0] = 0;
***************
*** 1234,1239 ****
--- 1247,1277 ----
  	  while (isspace(*dbp)) dbp++;
  	  L_getit();
  	}
+     }
+ }
+ 
+ Asm_funcs (fi)
+      FILE *fi;
+ {
+   int i;
+   register char c;
+ 
+   lineno = 0;
+   charno = 0;
+   pfcnt = 0;
+ 
+   while (!feof (fi))
+     {
+       lineno++;
+       linecharno = charno;
+       charno += readline (&lb, fi) + 1;
+       dbp = lb.buffer;
+ 
+       for (i = 0; ((c = dbp[i]) && !isspace(c)) && (c != ':') ; i++)
+ 	   ;
+ 
+       if ((i > 0) && (c == ':'))
+ 	   getit();
      }
  }
  

diff exited abnormally with code 1 at Mon Nov 14 20:53:47
Wolfgang Rupprecht	ARPA:  wolfgang@mgm.mit.edu (IP 18.82.0.114)
TEL: (617) 267-4365	UUCP:  mit-eddie!mgm.mit.edu!wolfgang