-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathy.tab.h
226 lines (203 loc) · 5.42 KB
/
y.tab.h
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef Y_TAB_H
#define Y_TAB_H
#include "pexec.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct pptree_node pptree;
typedef union treedata {
pptree *tree;
char *str;
long i;
char c;
double f;
} treedata;
struct pptree_node {
int type;
treedata l1;
treedata l2;
};
pptree *new_pptree(int, treedata, treedata);
enum PPTYPES {
PPBLOCK, PPARR, PPTAB, PPOR, PPAND, PPLT, PPGT, PPLEQ, PPGEQ,
PPEQ, PPNEQ, PPBOR, PPBXOR, PPBAND, PPPLUS, PPMINUS, PPSHL, PPSHR, PPMULT,
PPDIV, PPMOD, PPNOT, PPLEN, PPUNM, PPMAX, PPBNOT, PPCALL, PPARRACC, PPTABACC,
PPLTABACC, PPSTRLIT, PPMETA, PPSUP, PPINTLIT, PPCHRLIT, PPFLTLIT, PPFUNC,
PPCODE, PPIDENT, PPUNDEF, PPFALSE, PPNULL, PPTRUE, PPARGC, PPARGV, PPRETC,
PPRETV, PPGLOBALS, PPLOCALS, PPEXPRLIST, PPASSLIST, PPASSPAIR, PPIF, PPUNLESS,
PPCOND, PPNONE, PPWHILE, PPUNTIL, PPDOW, PPDOU, PPFOR, PPIPAIR, PPFPAIR,
PPASSIGN, PPRETURN, PPRETURNVC, PPCALLVC, PPEXIT, PPEXITVC, PPBREAK,
PPCONTINUE, PPDO
};
void pp_write_stm(pptree *);
void pp_write_block(pptree *);
void pp_free_tree(pptree *);
int pp_assign(pptree *);
int pp_enumerate_assign(pptree *);
void pp_write_else(pptree *);
void pp_write_expr(pptree *);
void pp_encode_int(long);
void pp_encode_float(double);
int len_expr_list(pptree *);
void pp_write_argenum(pptree *);
int pp_write_callnum(pptree *);
void pp_write_tablit(pptree *);
void yyerror(char *);
extern int yylineno;
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
PUNDEF = 258,
PFALSE = 259,
PNULL = 260,
PTRUE = 261,
PARGC = 262,
PARGV = 263,
PRETC = 264,
PRETV = 265,
PAND = 266,
POR = 267,
PNOT = 268,
PGLOBAL = 269,
PGLOBALS = 270,
PLOCAL = 271,
PLOCALS = 272,
PEXTERN = 273,
PNORMAL = 274,
PFUNC = 275,
PCALLVC = 276,
PRETURNVC = 277,
PEXIT = 278,
PEXITVC = 279,
PRETURN = 280,
PWHILE = 281,
PUNLESS = 282,
PFOR = 283,
PIF = 284,
PELSE = 285,
PDO = 286,
PUNTIL = 287,
PEND = 288,
PIN = 289,
PBLOCK = 290,
PEOF = 291,
PERROR = 292,
PSUCCESS = 293,
PBREAK = 294,
PCONTINUE = 295,
PSTR = 296,
PIDENTIFIER = 297,
PINT = 298,
PFLT = 299,
PCHR = 300,
PNEQ = 301,
PEQ = 302,
PGEQ = 303,
PLEQ = 304,
PSHR = 305,
PSHL = 306,
PUNMINUS = 307,
PSUP = 308,
PMET = 309
};
#endif
/* Tokens. */
#define PUNDEF 258
#define PFALSE 259
#define PNULL 260
#define PTRUE 261
#define PARGC 262
#define PARGV 263
#define PRETC 264
#define PRETV 265
#define PAND 266
#define POR 267
#define PNOT 268
#define PGLOBAL 269
#define PGLOBALS 270
#define PLOCAL 271
#define PLOCALS 272
#define PEXTERN 273
#define PNORMAL 274
#define PFUNC 275
#define PCALLVC 276
#define PRETURNVC 277
#define PEXIT 278
#define PEXITVC 279
#define PRETURN 280
#define PWHILE 281
#define PUNLESS 282
#define PFOR 283
#define PIF 284
#define PELSE 285
#define PDO 286
#define PUNTIL 287
#define PEND 288
#define PIN 289
#define PBLOCK 290
#define PEOF 291
#define PERROR 292
#define PSUCCESS 293
#define PBREAK 294
#define PCONTINUE 295
#define PSTR 296
#define PIDENTIFIER 297
#define PINT 298
#define PFLT 299
#define PCHR 300
#define PNEQ 301
#define PEQ 302
#define PGEQ 303
#define PLEQ 304
#define PSHR 305
#define PSHL 306
#define PUNMINUS 307
#define PSUP 308
#define PMET 309
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
long intval;
char chrval;
double fltval;
char *strval;
pptree *pptval;
}
/* Line 1529 of yacc.c. */
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;
#endif