X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=dfa%2Freadfile.c;h=cd40c926c6d9e192862278800b0d6869b05df1fb;hb=28f3461a79a4569d736f4ffc66c6ae207e38c2ab;hp=4fd9cc9cc30f4cb2e151a5512878cb7b3d64aa20;hpb=6f5101be21e854a5125b489a03814cc7509236cc;p=idzebra-moved-to-github.git diff --git a/dfa/readfile.c b/dfa/readfile.c index 4fd9cc9..cd40c92 100644 --- a/dfa/readfile.c +++ b/dfa/readfile.c @@ -1,10 +1,27 @@ /* - * Copyright (C) 1994, Index Data I/S + * Copyright (C) 1994-1999, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: readfile.c,v $ - * Revision 1.3 1995-01-24 16:00:22 adam + * Revision 1.8 1999-02-02 14:50:12 adam + * Updated WIN32 code specific sections. Changed header. + * + * 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. + * + * Revision 1.3 1995/01/24 16:00:22 adam * Added -ansi to CFLAGS. * Some changes to the dfa module. * @@ -23,7 +40,7 @@ #include #include -#include +#include #include #include "lexer.h" @@ -81,6 +98,7 @@ static void read_defs (void) static void read_rules (struct DFA *dfa) { char *s; + const char *sc; int i; int no = 0; @@ -99,11 +117,13 @@ 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", inf_name, line_no); + assert (0); err_no++; } else @@ -113,9 +133,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);