1 /*** s_parse.h ****************************************************************
2 **
3 ** This file is part of BibTool.
4 ** It is distributed under the GNU General Public License.
5 ** See the file COPYING for details.
6 **
7 ** (c) 1996-2020 Gerd Neugebauer
8 **
9 ** Net: gene@gerd-neugebauer.de
10 **
11 ** This program is free software; you can redistribute it and/or modify
12 ** it under the terms of the GNU General Public License as published by
13 ** the Free Software Foundation; either version 2, or (at your option)
14 ** any later version.
15 **
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ** GNU General Public License for more details.
20 **
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 **
25 **-----------------------------------------------------------------------------
26 ** Description: This header file contains definitions and declarations for the
27 **		string parser.
28 **
29 ******************************************************************************/
30 
31 #ifndef S_PARSE_H_LOADED
32 #define S_PARSE_H_LOADED
33 
34 #include <bibtool/general.h>
35 #include <bibtool/symbols.h>
36 
37 #define StringParseNext		    257
38 #define StringParseNumber	    258
39 #define StringParseSymbol	    259
40 #define StringParseString	    260
41 #define StringParseUnquotedString   261
42 #define StringParseBraces	    262
43 #define StringParseUnquotedBraces   263
44 #define StringParseValue	    265
45 
46 #define SParseSymbol(SP)	    s_parse(StringParseSymbol	     ,SP, true)
47 #define SParseOptionalSymbol(SP)    s_parse(StringParseSymbol	     ,SP, false)
48 #define SParseString(SP)	    s_parse(StringParseString	     ,SP, true)
49 #define SParseUnquotedString(SP)    s_parse(StringParseUnquotedString,SP, true)
50 #define SParseNext(SP)		    s_parse(StringParseNext  	     ,SP, true)
51 #define SParseValue(SP)		    s_parse(StringParseValue 	     ,SP, true)
52 #define SParseExpect(C,SP)	    s_parse((C)&0xff           	     ,SP, true)
53 
54 #ifdef __STDC__
55 #define _ARG(A) A
56 #else
57 #define _ARG(A) ()
58 #endif
59  Symbol s_parse _ARG((int type, String *sp, bool errp));/* s_parse.c         */
60  void sp_close _ARG((void));			   /* s_parse.c              */
61  void sp_open _ARG((String  s));		   /* s_parse.c              */
62  void sp_skip _ARG((String *sp));		   /*                        */
63  bool sp_expect _ARG((String *sp, String expect, bool verbose));/* s_parse.c */
64  Symbol* sp_symbols _ARG((String *sp));		   /* s_parse.c              */
65  String sp_eos _ARG((String *sp));		   /*                        */
66 
67 /*---------------------------------------------------------------------------*/
68 #endif
69