2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.7 1995-09-04 12:33:27 adam
8 * Various cleanup. YAZ util used instead.
10 * Revision 1.6 1995/01/25 11:30:51 adam
11 * Simple error reporting when parsing regular expressions.
12 * Memory usage reduced.
14 * Revision 1.5 1995/01/24 16:00:22 adam
15 * Added -ansi to CFLAGS.
16 * Some changes to the dfa module.
18 * Revision 1.4 1994/10/04 17:46:44 adam
19 * Function options now returns arg with error option.
21 * Revision 1.3 1994/10/03 17:22:19 adam
22 * Optimization of grepper.
24 * Revision 1.2 1994/09/27 16:31:20 adam
25 * First version of grepper: grep with error correction.
27 * Revision 1.1 1994/09/26 10:16:55 adam
28 * First version of dfa module in alex. This version uses yacc to parse
29 * regular expressions. This should be hand-made instead.
32 * Adam Dickmeiss. 1992-1993
33 * This module is actually very old...
50 void error (const char *format, ...)
53 va_start (argptr, format);
54 fprintf (stderr, "%s error: ", prog);
55 (void) vfprintf (stderr, format, argptr);
67 static int lexer_options (int argc, char **argv)
76 fprintf (stderr, "%s: %s %s\n", prog, __DATE__, __TIME__);
101 debug_dfa_followpos = 1;
106 debug_dfa_followpos = 1;
111 fprintf (stderr, "%s: unknown option `-%s'\n",
120 int main (int argc, char **argv)
132 i = lexer_options (argc, argv);
138 fprintf (stderr, "usage\n %s [-c] [-V] [-s] [-t] [-d[stf]] file\n",
142 else while (--argc > 0)
143 if (**++argv != '-' && **argv)
147 i = read_file (*argv, dfa);
162 fprintf (stderr, "%s: no files specified\n", prog);