File indexing completed on 2025-01-26 04:43:59

0001 /* dlgdef.h
0002  * Things in scanner produced by dlg that should be visible to the outside
0003  * world
0004  *
0005  * SOFTWARE RIGHTS
0006  *
0007  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
0008  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
0009  * company may do whatever they wish with source code distributed with
0010  * PCCTS or the code generated by PCCTS, including the incorporation of
0011  * PCCTS, or its output, into commercial software.
0012  * 
0013  * We encourage users to develop software with PCCTS.  However, we do ask
0014  * that credit is given to us for developing PCCTS.  By "credit",
0015  * we mean that if you incorporate our source code into one of your
0016  * programs (commercial product, research project, or otherwise) that you
0017  * acknowledge this fact somewhere in the documentation, research report,
0018  * etc...  If you like PCCTS and have developed a nice tool with the
0019  * output, please mention that you developed it using PCCTS.  In
0020  * addition, we ask that this header remain intact in our source code.
0021  * As long as these guidelines are kept, we expect to continue enhancing
0022  * this system and expect to make other tools available as they are
0023  * completed.
0024  *
0025  * ANTLR 1.33
0026  * Terence Parr
0027  * Parr Research Corporation
0028  * with Purdue University and AHPCRC, University of Minnesota
0029  * 1989-1995
0030  */
0031 
0032 #ifndef ZZDLGDEF_H
0033 #define ZZDLGDEF_H
0034 
0035 #include "btconfig.h"
0036 
0037 #ifndef zzchar_t
0038 #ifdef ZZWCHAR_T
0039 #define zzchar_t unsigned wchar_t
0040 #else
0041 #define zzchar_t unsigned char
0042 #endif
0043 #endif
0044 
0045 struct zzdlg_state {
0046     FILE *stream;
0047     int (*func_ptr)();
0048     zzchar_t *str;
0049     int auto_num;
0050     int add_erase;
0051     int lookc;
0052     int char_full;
0053     int begcol, endcol;
0054     int line;
0055     zzchar_t *lextext, *begexpr, *endexpr;
0056     int bufsize;
0057     int bufovf;
0058     zzchar_t *nextpos;
0059     int class_num;
0060 };
0061 
0062 extern zzchar_t *zzlextext;     /* text of most recently matched token */
0063 extern zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */
0064 extern zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */
0065 extern int  zzbufsize;  /* how long zzlextext is */
0066 extern int  zzbegcol;   /* column that first character of token is in*/
0067 extern int  zzendcol;   /* column that last character of token is in */
0068 extern int  zzline;     /* line current token is on */
0069 extern int  zzreal_line;        /* line of 1st portion of token that is not skipped */
0070 extern int  zzchar;     /* character to determine next state */
0071 extern int  zzbufovf;   /* indicates that buffer too small for text */
0072 extern void (*zzerr)(const char *);/* pointer to error reporting function */
0073 
0074 #ifdef USER_ZZMODE_STACK
0075 extern int     zzauto;
0076 #endif
0077 
0078 extern void zzadvance(void);
0079 extern void zzskip(void);   /* erase zzlextext, look for another token */
0080 extern void zzmore(void);   /* keep zzlextext, look for another token */
0081 extern void zzmode(int k);  /* switch to automaton 'k' */
0082 extern void zzrdstream(FILE *);/* what stream to read from */
0083 extern void zzclose_stream(void);/* close the current input stream */
0084 extern void zzrdfunc(int (*)());/* what function to get char from */
0085 extern void zzrdstr( zzchar_t * );
0086 extern void zzgettok(void); /* get next token */
0087 extern void zzreplchar(zzchar_t c);/* replace last recognized reg. expr. with
0088                     a character */
0089 extern void zzreplstr(zzchar_t *s);/* replace last recognized reg. expr. with
0090                     a string */
0091 extern void zzsave_dlg_state(struct zzdlg_state *);
0092 extern void zzrestore_dlg_state(struct zzdlg_state *);
0093 extern int zzerr_in(void);
0094 extern void zzerrstd(const char *);
0095 extern void zzerraction();
0096 
0097 #endif