]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /* dlgdef.h\r |
2 | * Things in scanner produced by dlg that should be visible to the outside\r | |
3 | * world\r | |
4 | *\r | |
5 | * SOFTWARE RIGHTS\r | |
6 | *\r | |
7 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool\r | |
8 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or\r | |
9 | * company may do whatever they wish with source code distributed with\r | |
10 | * PCCTS or the code generated by PCCTS, including the incorporation of\r | |
11 | * PCCTS, or its output, into commerical software.\r | |
12 | *\r | |
13 | * We encourage users to develop software with PCCTS. However, we do ask\r | |
14 | * that credit is given to us for developing PCCTS. By "credit",\r | |
15 | * we mean that if you incorporate our source code into one of your\r | |
16 | * programs (commercial product, research project, or otherwise) that you\r | |
17 | * acknowledge this fact somewhere in the documentation, research report,\r | |
18 | * etc... If you like PCCTS and have developed a nice tool with the\r | |
19 | * output, please mention that you developed it using PCCTS. In\r | |
20 | * addition, we ask that this header remain intact in our source code.\r | |
21 | * As long as these guidelines are kept, we expect to continue enhancing\r | |
22 | * this system and expect to make other tools available as they are\r | |
23 | * completed.\r | |
24 | *\r | |
25 | * ANTLR 1.33\r | |
26 | * Terence Parr\r | |
27 | * Parr Research Corporation\r | |
28 | * with Purdue University and AHPCRC, University of Minnesota\r | |
29 | * 1989-2000\r | |
30 | */\r | |
31 | \r | |
32 | #ifndef ZZDLGDEF_H\r | |
33 | #define ZZDLGDEF_H\r | |
34 | \r | |
35 | #include "pcctscfg.h"\r | |
36 | \r | |
37 | #ifndef zzchar_t\r | |
38 | #ifdef ZZWCHAR_T\r | |
39 | #define zzchar_t wchar_t\r | |
40 | #else\r | |
41 | #define zzchar_t char\r | |
42 | #endif\r | |
43 | #endif\r | |
44 | \r | |
45 | struct zzdlg_state {\r | |
46 | FILE *stream;\r | |
47 | #ifdef __USE_PROTOS\r | |
48 | int (*func_ptr)(void);\r | |
49 | #else\r | |
50 | int (*func_ptr)();\r | |
51 | #endif\r | |
52 | zzchar_t *str;\r | |
53 | int auto_num;\r | |
54 | int add_erase;\r | |
55 | int lookc;\r | |
56 | int char_full;\r | |
57 | int begcol, endcol;\r | |
58 | int line;\r | |
59 | zzchar_t *lextext, *begexpr, *endexpr;\r | |
60 | int bufsize;\r | |
61 | int bufovf;\r | |
62 | zzchar_t *nextpos;\r | |
63 | int class_num;\r | |
64 | };\r | |
65 | \r | |
66 | extern zzchar_t *zzlextext; /* text of most recently matched token */\r | |
67 | extern zzchar_t *zzbegexpr; /* beginning of last reg expr recogn. */\r | |
68 | extern zzchar_t *zzendexpr; /* beginning of last reg expr recogn. */\r | |
69 | extern int zzbufsize; /* how long zzlextext is */\r | |
70 | extern int zzbegcol; /* column that first character of token is in*/\r | |
71 | extern int zzendcol; /* column that last character of token is in */\r | |
72 | extern int zzline; /* line current token is on */\r | |
73 | extern int zzreal_line; /* line of 1st portion of token that is not skipped */\r | |
74 | extern int zzchar; /* character to determine next state */\r | |
75 | extern int zzbufovf; /* indicates that buffer too small for text */\r | |
76 | #ifdef __USE_PROTOS\r | |
77 | extern void (*zzerr)(const char *);/* pointer to error reporting function */\r | |
78 | #else\r | |
79 | extern void (*zzerr)();\r | |
80 | #endif\r | |
81 | \r | |
82 | #ifdef USER_ZZMODE_STACK\r | |
83 | extern int zzauto;\r | |
84 | #endif\r | |
85 | \r | |
86 | #ifdef __USE_PROTOS\r | |
87 | extern void zzadvance(void);\r | |
88 | extern void zzskip(void); /* erase zzlextext, look for antoher token */\r | |
89 | extern void zzmore(void); /* keep zzlextext, look for another token */\r | |
90 | extern void zzmode(int k); /* switch to automaton 'k' */\r | |
91 | extern void zzrdstream(FILE *);/* what stream to read from */\r | |
92 | extern void zzclose_stream(void);/* close the current input stream */\r | |
93 | extern void zzrdfunc(int (*)(void));/* what function to get char from */\r | |
94 | extern void zzrdstr( zzchar_t * );\r | |
95 | extern void zzgettok(void); /* get next token */\r | |
96 | extern void zzreplchar(zzchar_t c);/* replace last recognized reg. expr. with\r | |
97 | a character */\r | |
98 | extern void zzreplstr(zzchar_t *s);/* replace last recognized reg. expr. with\r | |
99 | a string */\r | |
100 | extern void zzsave_dlg_state(struct zzdlg_state *);\r | |
101 | extern void zzrestore_dlg_state(struct zzdlg_state *);\r | |
102 | extern int zzerr_in(void);\r | |
103 | extern void zzerrstd(const char *);\r | |
104 | extern void zzerraction(void);\r | |
105 | \r | |
106 | #else\r | |
107 | \r | |
108 | extern void zzadvance();\r | |
109 | extern void zzskip(); /* erase zzlextext, look for antoher token */\r | |
110 | extern void zzmore(); /* keep zzlextext, look for another token */\r | |
111 | extern void zzmode(/*k*/); /* switch to automaton 'k' */\r | |
112 | extern void zzrdstream(); /* what stream to read from */\r | |
113 | extern void zzclose_stream();/* close the current input stream */\r | |
114 | extern void zzrdfunc(); /* what function to get char from */\r | |
115 | extern void zzrdstr();\r | |
116 | extern void zzgettok(); /* get next token */\r | |
117 | extern void zzreplchar(); /* replace last recognized reg. expr. with\r | |
118 | a character */\r | |
119 | extern void zzreplstr(); /* replace last recognized reg. expr. with\r | |
120 | a string */\r | |
121 | extern void zzsave_dlg_state();\r | |
122 | extern void zzrestore_dlg_state();\r | |
123 | extern int zzerr_in();\r | |
124 | extern void zzerrstd();\r | |
125 | extern void zzerraction();\r | |
126 | #endif\r | |
127 | \r | |
128 | #endif\r |