1 /* LEXICAL ANALYSOR (MAINLY FOR CONFIG FILES) 2 3 */ 4 5 #ifndef HTLEX_H 6 #define HTLEX_H 7 8 #ifndef HTUTILS_H 9 #include <HTUtils.h> 10 #endif 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 typedef enum { 16 LEX_NONE, /* Internally used */ 17 LEX_EOF, /* End of file */ 18 LEX_REC_SEP, /* Record separator */ 19 LEX_FIELD_SEP, /* Field separator */ 20 LEX_ITEM_SEP, /* List item separator */ 21 LEX_OPEN_PAREN, /* Group start tag */ 22 LEX_CLOSE_PAREN, /* Group end tag */ 23 LEX_AT_SIGN, /* Address qualifier */ 24 LEX_ALPH_STR, /* Alphanumeric string */ 25 LEX_TMPL_STR /* Template string */ 26 } LexItem; 27 28 extern char HTlex_buffer[]; /* Read lexical string */ 29 extern int HTlex_line; /* Line number in source file */ 30 31 /* 32 33 Get Next Lexical Item 34 35 If returns LEX_ALPH_STR or LEX_TMPL_STR the string is in global buffer lex_buffer. 36 37 */ 38 39 extern LexItem lex(FILE *fp); 40 41 /* 42 43 Push Back Latest Item 44 45 */ 46 47 extern void unlex(LexItem lex_item); 48 49 /* 50 51 Get the Name for Lexical Item 52 53 */ 54 55 extern const char *lex_verbose(LexItem lex_item); 56 57 /* 58 59 */ 60 61 #ifdef __cplusplus 62 } 63 #endif 64 #endif /* not HTLEX_H */ 65