-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr.c
125 lines (118 loc) · 3.69 KB
/
err.c
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
/*
* A n t l r S e t s / E r r o r F i l e H e a d e r
*
* Generated from: lego.g
*
* Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001
* Parr Research Corporation
* with Purdue University Electrical Engineering
* With AHPCRC, University of Minnesota
* ANTLR Version 1.33MR33
*/
#define ANTLR_VERSION 13333
#include "pcctscfg.h"
#include "pccts_stdio.h"
#include <string>
#include <iostream>
#include <map>
#include "Board.hpp"
using namespace std;
// struct to store information about tokens
typedef struct {
string kind;
string text;
} Attrib;
// function to fill token information (predeclaration)
void zzcr_attr(Attrib *attr, int type, char *text);
// fields for AST nodes
#define AST_FIELDS string kind; string text;
#include "ast.h"
// macro to create a new AST node (and function predeclaration)
#define zzcr_ast(as,attr,ttype,textt) as=createASTnode(attr,ttype,textt)
AST* createASTnode(Attrib* attr,int ttype, char *textt);
#define zzSET_SIZE 8
#include "antlr.h"
#include "ast.h"
#include "tokens.h"
#include "dlgdef.h"
#include "err.h"
ANTLRChar *zztokens[37]={
/* 00 */ "Invalid",
/* 01 */ "@",
/* 02 */ "NUM",
/* 03 */ "GRID",
/* 04 */ "PLACE",
/* 05 */ "POP",
/* 06 */ "AT",
/* 07 */ "MOVE",
/* 08 */ "PUSH",
/* 09 */ "WHILE",
/* 10 */ "FITS",
/* 11 */ "LPAR",
/* 12 */ "RPAR",
/* 13 */ "OB",
/* 14 */ "CB",
/* 15 */ "COMMA",
/* 16 */ "HEIGHT",
/* 17 */ "NORTH",
/* 18 */ "EAST",
/* 19 */ "SOUTH",
/* 20 */ "WEST",
/* 21 */ "DEF",
/* 22 */ "ENDEF",
/* 23 */ "CMP_LESS_EQUAL",
/* 24 */ "CMP_GRATER_EQUAL",
/* 25 */ "CMP_LESS",
/* 26 */ "CMP_GREATER",
/* 27 */ "CMP_EQUAL",
/* 28 */ "EQUAL",
/* 29 */ "AND",
/* 30 */ "OR",
/* 31 */ "PRINTBLOCK",
/* 32 */ "PRINTHEIGHT",
/* 33 */ "PRINT",
/* 34 */ "VAR",
/* 35 */ "TAB",
/* 36 */ "SPACE"
};
SetWordType zzerr1[8] = {0x82,0x42,0x61,0x90, 0x7,0x0,0x0,0x0};
SetWordType setwd1[37] = {0x0,0xfb,0x0,0x0,0x0,0x0,0x0,
0xf6,0x0,0xf6,0x0,0x0,0x0,0x0,0xf8,
0x0,0xf6,0x0,0x0,0x0,0x0,0xfa,0xf8,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0xf6,0xf6,0xf6,0xf6,0x0,0x0};
SetWordType zzerr2[8] = {0x0,0x0,0x1e,0x0, 0x0,0x0,0x0,0x0};
SetWordType zzerr3[8] = {0x14,0x8,0x0,0x0, 0x4,0x0,0x0,0x0};
SetWordType zzerr4[8] = {0x20,0x1,0x0,0x0, 0x0,0x0,0x0,0x0};
SetWordType setwd2[37] = {0x0,0xf7,0x8,0x0,0x0,0x0,0x0,
0xf7,0x0,0xf7,0x0,0x8,0x4,0x0,0xf7,
0x0,0xf7,0x0,0x0,0x0,0x0,0xf7,0xf7,
0x0,0x0,0x4,0x4,0x0,0x0,0x4,0x4,
0xf7,0xf7,0xf7,0xf7,0x0,0x0};
SetWordType zzerr5[8] = {0xa2,0x42,0x61,0x80, 0x7,0x0,0x0,0x0};
SetWordType zzerr6[8] = {0x20,0x1,0x0,0x0, 0x0,0x0,0x0,0x0};
SetWordType zzerr7[8] = {0xa2,0x43,0x61,0x80, 0x7,0x0,0x0,0x0};
SetWordType zzerr8[8] = {0x4,0x4,0x1,0x0, 0x0,0x0,0x0,0x0};
SetWordType setwd3[37] = {0x0,0x3b,0x40,0x0,0x0,0x4,0x0,
0x3b,0x4,0x3b,0x0,0x0,0x80,0x0,0x3b,
0x0,0x7b,0x0,0x0,0x0,0x0,0x3b,0x3b,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x3b,0x3b,0x3b,0x3b,0x0,0x0};
SetWordType zzerr9[8] = {0x4,0x4,0x1,0x0, 0x0,0x0,0x0,0x0};
SetWordType zzerr10[8] = {0x0,0x10,0x0,0x60, 0x0,0x0,0x0,0x0};
SetWordType zzerr11[8] = {0x4,0x0,0x1,0x0, 0x0,0x0,0x0,0x0};
SetWordType zzerr12[8] = {0x0,0x0,0x0,0x6, 0x0,0x0,0x0,0x0};
SetWordType zzerr13[8] = {0x4,0x0,0x1,0x0, 0x0,0x0,0x0,0x0};
SetWordType zzerr14[8] = {0x4,0x8,0x0,0x0, 0x4,0x0,0x0,0x0};
SetWordType setwd4[37] = {0x0,0x60,0x81,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x0,0x80,0x1e,0x0,0x0,
0x0,0x1,0x0,0x0,0x0,0x0,0x40,0x0,
0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x1e,
0x0,0x0,0x0,0x0,0x0,0x0};
SetWordType zzerr15[8] = {0x4,0x8,0x0,0x0, 0x0,0x0,0x0,0x0};
SetWordType zzerr16[8] = {0xe2,0xd3,0x61,0x80, 0x7,0x0,0x0,0x0};
SetWordType setwd5[37] = {0x0,0x7,0x0,0x0,0x0,0x7,0x7,
0x7,0x7,0x7,0x0,0x0,0x0,0x0,0x7,
0x7,0x7,0x0,0x0,0x0,0x0,0x7,0x7,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x7,0x7,0x7,0x7,0x0,0x0};