1 /*** keynode.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: 27 ** This header file provides the datatype of a keynode. This is 28 ** an internal structure which is used to built parse trees from 29 ** format specifications. Usually this is done in |key.c| and 30 ** should not be visible outside. 31 ** 32 ******************************************************************************/ 33 34 #include <bibtool/symbols.h> 35 #include <bibtool/type.h> 36 37 /*----------------------------------------------------------------------------- 38 ** Typedef: KeyNode 39 ** Purpose: 40 ** 41 ** 42 **___________________________________________________ */ 43 typedef struct kEYnODE /* */ 44 { short int kn_type; /* */ 45 short int kn_pre; /* */ 46 short int kn_post; /* */ 47 Symbol kn_symbol; /* */ 48 String kn_from; /* */ 49 String kn_to; /* */ 50 struct kEYnODE *kn_next; /* */ 51 struct kEYnODE *kn_then; /* */ 52 struct kEYnODE *kn_else; /* */ 53 } *KeyNode, SKeyNode; /* */ 54 55 #define NodeType(X) ((X)->kn_type) 56 #define NodePre(X) ((X)->kn_pre) 57 #define NodePost(X) ((X)->kn_post) 58 #define NodeSymbol(X) ((X)->kn_symbol) 59 #define NodeNext(X) ((X)->kn_next) 60 #define NodeThen(X) ((X)->kn_then) 61 #define NodeElse(X) ((X)->kn_else) 62 #ifdef REGEX 63 #define NodeFrom(X) ((X)->kn_from) 64 #define NodeTo(X) ((X)->kn_to) 65 #endif 66 67 #define NodeCountMask 0x100 68 #define NodePlusMask 0x200 69 #define NodeMinusMask 0x400 70 #define NodeSTRING 0x800 71 #define NodeTEST 0x801 72 #define NodeTESTneg 0x802 73 #define NodeOR 0x803 74 #define NodeSPECIAL 0x804 75