%{
/*---------McGill-Computer-Vision-and-Robotics-Laboratory--C-Module---------
 *		
 * NAME:	invxref
 *
 * USAGE:	invxref < input_stream > output_stream
 *
 * DESCRIPTION: invxref is a program which is the inverse of fxref; that is, 
 *		it takes the listing of functions and called functions 
 *		produced by fxref and inverts it, producing a listing of 
 *		functions, and all of the functions which call it.
 *		
 *		The fxref output is fed into the standard input; the inverse
 *		listing is placed onto the standard output. Several fxref
 *		outputs, from say, different directories, may be concatinated
 *		togther and fed in.
 *
 *		The output is a series of constructs of the form:
 *		
 *			function	@ file
 *			   calledby1	: callfile1
 *			   calledby2	: callfile2
 *
 *		where 'function' is the function in question, 'file' is the
 *		place where it is defined, 'calledby1' and 'calledby2' are
 *		functions which refer to it, and 'callfile1' and 'callfile2'
 *		are the places where those functions are defined.
 *
 * FILES:	invxref.lex, the specification for the lexical scanner;
 *		invxref.c, the definitions for the various routines
 *
 * AUTHOR:	Mike Parker, with inspiration from John lloyd
 *
 * UPDATES:	Hoping note!
 *
 * NOTES:	Not now!
 *
 *-------------McGill-Computer-Vision-and-Robotics-Laboratory--------------*/

#include <ctype.h>
%}
%%
^[^ \n].*		{ caller(yytext);
			}
^" "+.*			{ char *cp = yytext;
			  while (isspace(*++cp)) ;
			  called(cp);
			}
.			;
\n			;
%%
#include "invxref.c"
