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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
/**
* @file Token.hpp
* Defines class Token
*
* @since 14/07/2004 Turku
*/
#ifndef __Token__
#define __Token__
#include <string>
namespace Shell {
/**
* Different token types.
* @since 14/07/2004 Turku
*/
enum TokenType {
/** non-negative integer */
TT_INTEGER,
/** real written as a floating point number */
TT_REAL,
/** '(' */
TT_LPAR,
/** ')' */
TT_RPAR,
/** '[' */
TT_LBRA,
/** ']' */
TT_RBRA,
/** ',' */
TT_COMMA,
/** ':' */
TT_COLON,
/** '.' */
TT_DOT,
/** '&' */
TT_AND,
/** '~' */
TT_NOT,
/** '|' */
TT_OR,
/** '<=>' */
TT_IFF,
/** '=>' */
TT_IMP,
/** '<=' */
TT_REVERSE_IMP,
/** '<~>' */
TT_XOR,
/** '!' */
TT_FORALL,
/** '?' */
TT_EXISTS,
/** 'true' */
TT_TRUE,
/** 'false' */
TT_FALSE,
/** '++' */
TT_PP,
/** '--' */
TT_MM,
/** '=' */
TT_EQUAL,
/** '!=' */
TT_NEQ,
/** sequence of letters and digits beginning with a lower-case letter */
TT_NAME,
/** special tag for vampire(...) in the Vampire extension of the TPTP syntax */
TT_VAMPIRE,
/** sequence of letters and digits beginning with an upper-case letter */
TT_VAR,
/** input_formula */
TT_INPUT_FORMULA,
/** input_clause */
TT_INPUT_CLAUSE,
/** cnf in the TPTP syntax */
TT_CNF,
/** include */
TT_INCLUDE,
/** end-of-file */
TT_EOF,
// KIF token types
/** '\@...' */
TT_ROW_VARIABLE,
/** "..." */
TT_STRING,
/** '...' */
TT_QUOTED_STRING,
/** > */
TT_GREATER_THAN,
/** >= */
TT_GEQ,
/** < */
TT_LESS_THAN,
/** <= */
TT_LEQ,
/** /> */
TT_END_OF_EMPTY_TAG,
/** any text inside an XML element */
TT_TEXT,
/** </ */
TT_CLOSING_TAG,
/** built-in addition */
TT_PLUS,
/** built-in subtraction */
TT_MINUS,
/** used in Simplify */
TT_DISTINCT,
/** used in Simplify */
TT_LBLPOS,
/** used in Simplify */
TT_LBLNEG,
/** used in Simplify */
TT_LEMMA,
/** used in Simplify */
TT_PROOF,
/** used in Simplify */
TT_PUSH,
/** used in Simplify */
TT_POP,
/** used in Simplify */
TT_PATTERN,
/** used in Simplify */
TT_DEFPRED,
/** used in Simplify */
TT_DEFPREDMAP,
/** used in Simplify */
TT_PROMPTON,
/** used in Simplify */
TT_PROMPTOFF,
/** used in Simplify */
TT_ORDER,
/** used in Simplify */
TT_EXPLIES,
/** addConstant() in MathSat */
TT_ADD_CONSTANT,
/** addVariable() in MathSat */
TT_ADD_VARIABLE,
/** addDefVariable() in MathSat */
TT_ADD_DEF_VARIABLE,
/** addEqual() in MathSat */
TT_ADD_EQUAL,
/** addBitNot() in MathSat */
TT_ADD_BIT_NOT,
/** addBitAnd() in MathSat */
TT_ADD_BIT_AND,
/** addBitOr() in MathSat */
TT_ADD_BIT_OR,
/** addBitXor() in MathSat */
TT_ADD_BIT_XOR,
/** addLogicalNot() in MathSat */
TT_ADD_LOGICAL_NOT,
/** addLogicalAnd() in MathSat */
TT_ADD_LOGICAL_AND,
/** addLogicalOr() in MathSat */
TT_ADD_LOGICAL_OR,
/** addLogicalImplies() in MathSat */
TT_ADD_LOGICAL_IMPLIES,
/** addLessThan() in MathSat */
TT_ADD_LESS_THAN,
/** addLessEqual() in MathSat */
TT_ADD_LESS_EQUAL,
/** addGreaterThan() in MathSat */
TT_ADD_GREATER_THAN,
/** addGreaterEqual() in MathSat */
TT_ADD_GREATER_EQUAL,
/** addSub() in MathSat */
TT_ADD_SUB,
/** addSum() in MathSat */
TT_ADD_SUM,
/** addMul() in MathSat */
TT_ADD_MUL,
/** addDiv() in MathSat */
TT_ADD_DIV,
/** addMod() in MathSat */
TT_ADD_MOD,
/** addLShift() in MathSat */
TT_ADD_LSHIFT,
/** addRShift() in MathSat */
TT_ADD_RSHIFT,
/** addLShift1() in MathSat */
TT_ADD_LSHIFT1,
/** addRShift1() in MathSat */
TT_ADD_RSHIFT1,
/** addAssignment() in MathSat */
TT_ADD_ASSIGNMENT,
/** addConcatOp() in MathSat */
TT_ADD_CONCAT_OP,
/** addCondition() in MathSat */
TT_ADD_CONDITION,
/** addZeroExtension() in MathSat */
TT_ADD_ZERO_EXTENSION,
/** addSignExtension() in MathSat */
TT_ADD_SIGN_EXTENSION,
/** addDefUF() in MathSat */
TT_ADD_DEF_UF,
/** addUFArg() in MathSat */
TT_ADD_UF_ARG,
/** addUFTermArg() in MathSat */
TT_ADD_UF_TERM_ARG,
/** addLatch() in MathSat */
TT_ADD_LATCH,
/** addUFTerm() in MathSat */
TT_ADD_UF_TERM,
/** addAssumption() in MathSat */
TT_ADD_ASSUMPTION,
/** attributes, start with ":" in SMT */
TT_ATTRIBUTE,
/** arithmetic characters in SMT */
TT_ARITH,
/** Use values in SMT */
TT_USER
}; // TokenType
/**
* Class representing tokens.
*/
class Token
{
public:
TokenType tag;
std::string text;
int line;
int col;
static std::string toString (TokenType);
};
}
#endif // __Token__