2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1994-09-27 16:31:20 adam
8 * First version of grepper: grep with error correction.
10 * Revision 1.1 1994/09/26 10:16:55 adam
11 * First version of dfa module in alex. This version uses yacc to parse
12 * regular expressions. This should be hand-made instead.
15 * Adam Dickmeiss. 1992-1993
16 * This module is actually very old...
33 void error (const char *format, ...)
36 va_start (argptr, format);
37 fprintf (stderr, "%s error: ", prog);
38 (void) vfprintf (stderr, format, argptr);
50 static int lexer_options (int argc, char **argv)
59 fprintf (stderr, "%s: %s %s\n", prog, __DATE__, __TIME__);
84 debug_dfa_followpos = 1;
89 debug_dfa_followpos = 1;
94 fprintf (stderr, "%s: unknown option `-%s'\n",
103 int main (int argc, char **argv)
115 i = lexer_options (argc, argv);
121 fprintf (stderr, "usage\n %s [-c] [-V] [-v] [-t] [-d[stf]] file\n",
125 else while (--argc > 0)
126 if (**++argv != '-' && **argv)
129 i = read_file (*argv, &dfa);
132 dfas = mk_dfas (dfa, 2000);
141 fprintf (stderr, "%s: no files specified\n", prog);