summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Other/Maintained/Tools/Pccts/h/dlgdef.h
blob: d45c6277e27a338c3dae1e2714d373770a798b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* dlgdef.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.33
 * Terence Parr
 * Parr Research Corporation
 * with Purdue University and AHPCRC, University of Minnesota
 * 1989-1998
 */

#ifndef ZZDLGDEF_H
#define ZZDLGDEF_H

#include "pcctscfg.h"

#ifndef zzchar_t
#ifdef ZZWCHAR_T
#define zzchar_t wchar_t
#else
#define zzchar_t char
#endif
#endif

struct zzdlg_state {
  FILE *stream;
#ifdef __USE_PROTOS
  int (*func_ptr)(void);
#else
  int (*func_ptr)();
#endif
  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;
};

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  zzreal_line;    /* line of 1st portion of token that is not skipped */
extern int  zzchar;    /* character to determine next state */
extern int  zzbufovf;  /* indicates that buffer too small for text */
#ifdef __USE_PROTOS
extern void  (*zzerr)(const char *);/* pointer to error reporting function */
#else
extern void  (*zzerr)();
#endif

#ifdef USER_ZZMODE_STACK
extern int     zzauto;
#endif

#ifdef __USE_PROTOS
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 (*)(void));/* 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(const char *);
extern void zzerraction(void);

#else

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();
extern void zzerraction();
#endif

#endif