2 * Copyright (C) 1994-1996, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.10 1996-10-29 13:57:27 adam
8 * Include of zebrautl.h instead of alexutil.h.
10 * Revision 1.9 1996/05/14 11:33:41 adam
11 * MEMDEBUG turned off by default.
13 * Revision 1.8 1995/09/28 09:18:54 adam
14 * Removed various preprocessor defines.
16 * Revision 1.7 1995/09/04 12:33:27 adam
17 * Various cleanup. YAZ util used instead.
19 * Revision 1.6 1995/01/25 11:30:51 adam
20 * Simple error reporting when parsing regular expressions.
21 * Memory usage reduced.
23 * Revision 1.5 1995/01/24 16:00:22 adam
24 * Added -ansi to CFLAGS.
25 * Some changes to the dfa module.
27 * Revision 1.4 1994/10/04 17:46:44 adam
28 * Function options now returns arg with error option.
30 * Revision 1.3 1994/10/03 17:22:19 adam
31 * Optimization of grepper.
33 * Revision 1.2 1994/09/27 16:31:20 adam
34 * First version of grepper: grep with error correction.
36 * Revision 1.1 1994/09/26 10:16:55 adam
37 * First version of dfa module in alex. This version uses yacc to parse
38 * regular expressions. This should be hand-made instead.
41 * Adam Dickmeiss. 1992-1993
42 * This module is actually very old...
59 void error (const char *format, ...)
62 va_start (argptr, format);
63 fprintf (stderr, "%s error: ", prog);
64 (void) vfprintf (stderr, format, argptr);
71 static int lexer_options (int argc, char **argv)
80 fprintf (stderr, "%s: %s %s\n", prog, __DATE__, __TIME__);
98 debug_dfa_followpos = 1;
103 debug_dfa_followpos = 1;
108 fprintf (stderr, "%s: unknown option `-%s'\n",
117 int main (int argc, char **argv)
124 i = lexer_options (argc, argv);
130 fprintf (stderr, "usage\n %s [-c] [-V] [-s] [-t] [-d[stf]] file\n",
134 else while (--argc > 0)
135 if (**++argv != '-' && **argv)
139 i = read_file (*argv, dfa);
154 fprintf (stderr, "%s: no files specified\n", prog);