InfiniSQL
v0.1.2-alpha
Massive Scale Transaction Processing
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Larxer.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Mark Travis <mtravis15432+src@gmail.com>
3
* All rights reserved. No warranty, explicit or implicit, provided.
4
*
5
* This file is part of InfiniSQL(tm).
6
7
* InfiniSQL is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License version 3
9
* as published by the Free Software Foundation.
10
*
11
* InfiniSQL is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with InfiniSQL. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
29
#ifndef INFINISQLLARXER_H
30
#define INFINISQLLARXER_H
31
32
#include "
larx.h
"
33
#include "
Asts.h
"
34
#include "
gch.h
"
35
#include "
defs.h
"
36
49
class
Larxer
50
{
51
public
:
56
enum
stacktypes_e
57
{
58
TYPE_NONE
= 0,
59
TYPE_IDENTIFIER
= 1,
60
TYPE_SUBQUERY
= 2,
61
TYPE_NOT
= 3,
62
TYPE_ISNULL
= 4,
63
TYPE_eq
= 5,
64
TYPE_ne
= 6,
65
TYPE_lt
= 7,
66
TYPE_gt
= 8,
67
TYPE_lte
= 9,
68
TYPE_gte
= 10,
69
TYPE_COMPARISON
= 11,
70
TYPE_ISTRUE
= 12,
71
TYPE_ISFALSE
= 13,
72
TYPE_ISUNKNOWN
= 14,
73
TYPE_INTVAL
= 15,
74
TYPE_FLOATVAL
= 16,
75
TYPE_PARAMETER
= 17,
76
TYPE_STRINGVAL
= 18,
77
TYPE_concat
= 19,
78
TYPE_addition
= 20,
79
TYPE_subtraction
= 21,
80
TYPE_multiplication
= 22,
81
TYPE_division
= 23,
82
TYPE_exponent
= 24,
83
TYPE_uminus
= 25,
84
TYPE_ASC
= 26,
85
TYPE_DESC
= 27,
86
TYPE_ORDERBY
= 28,
87
TYPE_FORUPDATE
= 29,
88
TYPE_HAVING
= 30,
89
TYPE_GROUPBY
= 31,
90
TYPE_WHERE
= 32,
91
TYPE_AVG
= 33,
92
TYPE_COUNT
= 34,
93
TYPE_MAX
= 35,
94
TYPE_MIN
= 36,
95
TYPE_SUM
= 37,
96
TYPE_ASTERISK
= 38,
97
TYPE_DISTINCT
= 39,
98
TYPE_ALL
= 40,
99
TYPE_BETWEEN
= 41,
100
TYPE_BETWEENEXPRESSIONS
= 42,
101
TYPE_IN
= 43,
102
TYPE_LIKE
= 44,
103
TYPE_EXISTS
= 45,
104
TYPE_UNIQUE
= 46,
105
TYPE_assignment
= 47,
106
TYPE_AND
= 48,
107
TYPE_OR
= 49,
108
TYPE_SELECT
= 50,
109
TYPE_INSERT
= 51,
110
TYPE_UPDATE
= 52,
111
TYPE_DELETE
= 53,
112
TYPE_COLUMNS
= 55,
113
TYPE_EXPRESSION
= 56,
114
TYPE_FROM
= 57,
115
TYPE_search_condition
= 58,
116
TYPE_SORTSPECIFICATION
= 59,
117
TYPE_AGGREGATE
= 60,
118
TYPE_operator
= 61,
119
TYPE_operand
= 62,
120
TYPE_inobject
= 63,
121
TYPE_BEGIN
= 64,
122
TYPE_COMMIT
= 65,
123
TYPE_ROLLBACK
= 66,
124
TYPE_SET
= 67,
125
TYPE_storedprocedure
= 68,
126
TYPE_inbegin
= 69,
127
TYPE_NOLOCK
= 70
128
};
129
134
struct
stackmember_s
135
{
136
stacktypes_e
type
;
137
std::string
val
;
138
};
139
140
151
Larxer
(
char
*instr,
class
TransactionAgent
*
taPtr
,
class
Schema
*schemaPtr);
152
virtual
~Larxer
();
153
161
void
pushstack
(
stacktypes_e
type);
170
void
pushstack
(
stacktypes_e
type, int64_t val);
179
void
pushstack
(
stacktypes_e
type,
long
double
val);
188
void
pushstack
(
stacktypes_e
type,
const
char
*val);
197
void
pushstack
(
stacktypes_e
type,
string
&val);
203
void
pushoperand
(
char
operandtype);
210
void
pushoperand
(
char
operandtype, int64_t val);
217
void
pushoperand
(
char
operandtype,
long
double
val);
224
void
pushoperand
(
char
operandtype,
const
char
*val);
231
void
pushaggregate
(
char
aggregatetype,
const
char
*val);
237
stackmember_s
popstack
();
245
int64_t
getintval
(
string
&val);
253
long
double
getfloatval
(
string
&val);
260
void
eatstack
(
class
TransactionAgent
*
taPtr
,
class
Schema
*schemaPtr);
265
void
printstack
();
266
272
void
consumeSelect
(
string
&columns);
277
void
consumeInsert
();
282
void
consumeUpdate
();
287
void
consumeDelete
();
292
void
consumeStoredProcedure
();
299
class
Ast
*
consumeExpression
();
306
int64_t
consumeSubquery
();
311
void
consumeInobject
();
317
void
consumeColumns
(int64_t numcolumns);
322
void
consumeFrom
();
327
void
consumeWhere
();
332
void
consumeGroupby
();
337
void
consumeHaving
();
342
void
consumeOrderby
();
343
344
std::stack<stackmember_s>
parsedStack
;
345
class
Statement::query_s
*
currentQuery
;
346
class
Statement
*
statementPtr
;
347
};
348
349
#endif
/* INFINISQLLARXER_H */
infinisqld
Larxer.h
Generated on Tue Dec 24 2013 06:05:45 for InfiniSQL by
1.8.4