2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1994-10-03 17:22:19 adam
8 * Optimization of grepper.
10 * Revision 1.2 1994/09/27 16:31:20 adam
11 * First version of grepper: grep with error correction.
13 * Revision 1.1 1994/09/26 10:16:55 adam
14 * First version of dfa module in alex. This version uses yacc to parse
15 * regular expressions. This should be hand-made instead.
18 * Adam Dickmeiss. 1992-1993
19 * This module is actually very old...
36 void error (const char *format, ...)
39 va_start (argptr, format);
40 fprintf (stderr, "%s error: ", prog);
41 (void) vfprintf (stderr, format, argptr);
53 static int lexer_options (int argc, char **argv)
62 fprintf (stderr, "%s: %s %s\n", prog, __DATE__, __TIME__);
87 debug_dfa_followpos = 1;
92 debug_dfa_followpos = 1;
97 fprintf (stderr, "%s: unknown option `-%s'\n",
106 int main (int argc, char **argv)
118 i = lexer_options (argc, argv);
124 fprintf (stderr, "usage\n %s [-c] [-V] [-s] [-t] [-d[stf]] file\n",
128 else while (--argc > 0)
129 if (**++argv != '-' && **argv)
132 i = read_file (*argv, &dfa);
135 dfas = mk_dfas (dfa, 2000);
144 fprintf (stderr, "%s: no files specified\n", prog);