home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pccts1.zip
/
H
/
DLGDEF.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-01
|
5KB
|
124 lines
/* dlg2.h
* Things in scanner produced by dlg that should be visible to the outside
* world
*
* SOFTWARE RIGHTS
*
* We reserve no LEGAL rights to the Purdue Compiler Construction Tool
* Set (PCCTS) -- PCCTS is in the public domain. An individual or
* company may do whatever they wish with source code distributed with
* PCCTS or the code generated by PCCTS, including the incorporation of
* PCCTS, or its output, into commerical software.
*
* We encourage users to develop software with PCCTS. However, we do ask
* that credit is given to us for developing PCCTS. By "credit",
* we mean that if you incorporate our source code into one of your
* programs (commercial product, research project, or otherwise) that you
* acknowledge this fact somewhere in the documentation, research report,
* etc... If you like PCCTS and have developed a nice tool with the
* output, please mention that you developed it using PCCTS. In
* addition, we ask that this header remain intact in our source code.
* As long as these guidelines are kept, we expect to continue enhancing
* this system and expect to make other tools available as they are
* completed.
*
* ANTLR 1.10
* Will Cohen
* Purdue University
* 1989-1993
*/
#ifndef ZZDLGDEF_H
#define ZZDLGDEF_H
#ifndef zzchar_t
#ifdef ZZWCHAR_T
#define zzchar_t wchar_t
#else
#define zzchar_t char
#endif
#endif
struct zzdlg_state {
FILE *stream;
int (*func_ptr)();
zzchar_t *str;
int auto_num;
int add_erase;
int lookc;
int char_full;
int begcol, endcol;
int line;
zzchar_t *lextext, *begexpr, *endexpr;
int bufsize;
int bufovf;
zzchar_t *nextpos;
int class_num;
};
#ifdef __STDC__
extern zzchar_t *zzlextext; /* text of most recently matched token */
extern zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */
extern zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */
extern int zzbufsize; /* how long zzlextext is */
extern int zzbegcol; /* column that first character of token is in*/
extern int zzendcol; /* column that last character of token is in */
extern int zzline; /* line current token is on */
extern int zzchar; /* character to determine next state */
extern int zzbufovf; /* indicates that buffer too small for text */
extern void (*zzerr)(char *);/* pointer to error reporting function */
/* functions */
extern void zzadvance(void);
extern void zzskip(void); /* erase zzlextext, look for antoher token */
extern void zzmore(void); /* keep zzlextext, look for another token */
extern void zzmode(int k); /* switch to automaton 'k' */
extern void zzrdstream(FILE *);/* what stream to read from */
extern void zzclose_stream(void);/* close the current input stream */
extern void zzrdfunc(int (*)());/* what function to get char from */
extern void zzrdstr( zzchar_t * );
extern void zzgettok(void); /* get next token */
extern void zzreplchar(zzchar_t c);/* replace last recognized reg. expr. with
a character */
extern void zzreplstr(zzchar_t *s);/* replace last recognized reg. expr. with
a string */
extern void zzsave_dlg_state(struct zzdlg_state *);
extern void zzrestore_dlg_state(struct zzdlg_state *);
extern int zzerr_in(void);
extern void zzerrstd(char *);
#else
extern zzchar_t *zzlextext; /* text of most recently matched token */
extern zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */
extern zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */
extern int zzbufsize; /* how long zzlextext is */
extern int zzbegcol; /* column that first character of token is in*/
extern int zzendcol; /* column that last character of token is in */
extern int zzline; /* line current token is on */
extern int zzchar; /* character to determine next state */
extern int zzbufovf; /* indicates that buffer too small for text */
extern void (*zzerr)(); /* pointer to error reporting function */
/* functions */
extern void zzadvance();
extern void zzskip(); /* erase zzlextext, look for antoher token */
extern void zzmore(); /* keep zzlextext, look for another token */
extern void zzmode(/*k*/); /* switch to automaton 'k' */
extern void zzrdstream(); /* what stream to read from */
extern void zzclose_stream();/* close the current input stream */
extern void zzrdfunc(); /* what function to get char from */
extern void zzrdstr();
extern void zzgettok(); /* get next token */
extern void zzreplchar(); /* replace last recognized reg. expr. with
a character */
extern void zzreplstr(); /* replace last recognized reg. expr. with
a string */
extern void zzsave_dlg_state();
extern void zzrestore_dlg_state();
extern int zzerr_in();
extern void zzerrstd();
#endif
#endif