X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=dfa%2Freadfile.c;h=b36c6abb6538138cc33e58b930ab121ce78ea0e8;hb=c9ac021f1381269609f3654384698f398cf46b96;hp=7983ca6aa235ebbafd76661018f1d59db03defdb;hpb=4461019c0de49358856cb1c84ca162395b247f16;p=idzebra-moved-to-github.git diff --git a/dfa/readfile.c b/dfa/readfile.c index 7983ca6..b36c6ab 100644 --- a/dfa/readfile.c +++ b/dfa/readfile.c @@ -4,7 +4,17 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: readfile.c,v $ - * Revision 1.4 1995-01-25 11:30:51 adam + * Revision 1.7 1996-10-29 13:57:28 adam + * Include of zebrautl.h instead of alexutil.h. + * + * Revision 1.6 1996/01/08 09:09:21 adam + * Function dfa_parse got 'const' string argument. + * New functions to define char mappings made public. + * + * Revision 1.5 1995/09/04 12:33:27 adam + * Various cleanup. YAZ util used instead. + * + * Revision 1.4 1995/01/25 11:30:51 adam * Simple error reporting when parsing regular expressions. * Memory usage reduced. * @@ -27,7 +37,7 @@ #include #include -#include +#include #include #include "lexer.h" @@ -85,6 +95,7 @@ static void read_defs (void) static void read_rules (struct DFA *dfa) { char *s; + const char *sc; int i; int no = 0; @@ -103,7 +114,8 @@ static void read_rules (struct DFA *dfa) /* preprocess regular expression */ prep (&s); /* now parse regular expression */ - i = dfa_parse (dfa, &s); + sc = s; + i = dfa_parse (dfa, &sc); if (i) { fprintf (stderr, "%s #%d: regular expression syntax error\n", @@ -118,9 +130,9 @@ static void read_rules (struct DFA *dfa) no++; fprintf (outf, "\tcase %d:\n#line %d\n\t\t", no, line_no); } - while (*s == '\t' || *s == ' ') - s++; - fputs (s, outf); + while (*sc == '\t' || *sc == ' ') + sc++; + fputs (sc, outf); } } fputs ("\tYY_BREAK\n\t}\n}\n", outf);