00001 /*******************************************************/ 00002 /* "C" Language Integrated Production System */ 00003 /* */ 00004 /* CLIPS Version 6.20 01/31/02 */ 00005 /* */ 00006 /* SCANNER HEADER FILE */ 00007 /*******************************************************/ 00008 00009 /*************************************************************/ 00010 /* Purpose: Routines for scanning lexical tokens from an */ 00011 /* input source. */ 00012 /* */ 00013 /* Principal Programmer(s): */ 00014 /* Gary D. Riley */ 00015 /* */ 00016 /* Contributing Programmer(s): */ 00017 /* */ 00018 /* Revision History: */ 00019 /* */ 00020 /*************************************************************/ 00021 00022 #ifndef _H_scanner 00023 #define _H_scanner 00024 00025 struct token; 00026 00027 #ifndef _H_pprint 00028 #include "pprint.h" 00029 #endif 00030 00031 #ifdef LOCALE 00032 #undef LOCALE 00033 #endif 00034 00035 #ifdef _SCANNER_SOURCE_ 00036 #define LOCALE 00037 #else 00038 #define LOCALE extern 00039 #endif 00040 00041 struct token 00042 { 00043 unsigned short type; 00044 void *value; 00045 char *printForm; 00046 }; 00047 00048 #define SCANNER_DATA 57 00049 00050 struct scannerData 00051 { 00052 char *GlobalString; 00053 size_t GlobalMax; 00054 size_t GlobalPos; 00055 long LineCount; 00056 int IgnoreCompletionErrors; 00057 }; 00058 00059 #define ScannerData(theEnv) ((struct scannerData *) GetEnvironmentData(theEnv,SCANNER_DATA)) 00060 00061 LOCALE void InitializeScannerData(void *); 00062 LOCALE void GetToken(void *,char *,struct token *); 00063 LOCALE void CopyToken(struct token *,struct token *); 00064 LOCALE void ResetLineCount(void *); 00065 LOCALE long GetLineCount(void *); 00066 LOCALE void IncrementLineCount(void *); 00067 LOCALE void DecrementLineCount(void *); 00068 00069 #endif 00070 00071 00072 00073
1.5.6