~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/include/pgscript/parser.tab.hh

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* A Bison parser, made by GNU Bison 2.3.  */
 
2
 
 
3
/* Skeleton interface for Bison LALR(1) parsers in C++
 
4
 
 
5
   Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
6
 
 
7
   This program is free software; you can redistribute it and/or modify
 
8
   it under the terms of the GNU General Public License as published by
 
9
   the Free Software Foundation; either version 2, or (at your option)
 
10
   any later version.
 
11
 
 
12
   This program is distributed in the hope that it will be useful,
 
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
   GNU General Public License for more details.
 
16
 
 
17
   You should have received a copy of the GNU General Public License
 
18
   along with this program; if not, write to the Free Software
 
19
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
20
   Boston, MA 02110-1301, USA.  */
 
21
 
 
22
/* As a special exception, you may create a larger work that contains
 
23
   part or all of the Bison parser skeleton and distribute that work
 
24
   under terms of your choice, so long as that work isn't itself a
 
25
   parser generator using the skeleton or a modified version thereof
 
26
   as a parser skeleton.  Alternatively, if you modify or redistribute
 
27
   the parser skeleton itself, you may (at your option) remove this
 
28
   special exception, which will cause the skeleton and the resulting
 
29
   Bison output files to be licensed under the GNU General Public
 
30
   License without this special exception.
 
31
 
 
32
   This special exception was added by the Free Software Foundation in
 
33
   version 2.2 of Bison.  */
 
34
 
 
35
/* C++ LALR(1) parser skeleton written by Akim Demaille.  */
 
36
 
 
37
#ifndef PARSER_HEADER_H
 
38
# define PARSER_HEADER_H
 
39
 
 
40
#include <string>
 
41
#include <iostream>
 
42
#include "stack.hh"
 
43
 
 
44
namespace pgscript
 
45
{
 
46
  class position;
 
47
  class location;
 
48
}
 
49
 
 
50
/* First part of user declarations.  */
 
51
#line 1 "pgscript/pgsParser.yy"
 
52
 /*** C/C++ Declarations ***/
 
53
        
 
54
//////////////////////////////////////////////////////////////////////////
 
55
//
 
56
// pgScript - PostgreSQL Tools
 
57
// RCS-ID:      $Id: pgsParser.yy,v 1.6 2008/08/10 22:11:29 pgunittest Exp $
 
58
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
59
// This software is released under the BSD Licence
 
60
//
 
61
//////////////////////////////////////////////////////////////////////////
 
62
 
 
63
#include "pgscript/pgScript.h"
 
64
#include "pgscript/statements/pgsStatements.h"
 
65
#include "pgscript/expressions/pgsExpressions.h"
 
66
#include "pgscript/objects/pgsObjects.h"
 
67
#include "pgscript/utilities/pgsContext.h"
 
68
 
 
69
 
 
70
 
 
71
/* Line 35 of lalr1.cc.  */
 
72
#line 73 "pgscript/parser.tab.hh"
 
73
 
 
74
#include "location.hh"
 
75
 
 
76
/* Enabling traces.  */
 
77
#ifndef YYDEBUG
 
78
# define YYDEBUG 0
 
79
#endif
 
80
 
 
81
/* Enabling verbose error messages.  */
 
82
#ifdef YYERROR_VERBOSE
 
83
# undef YYERROR_VERBOSE
 
84
# define YYERROR_VERBOSE 1
 
85
#else
 
86
# define YYERROR_VERBOSE 1
 
87
#endif
 
88
 
 
89
/* Enabling the token table.  */
 
90
#ifndef YYTOKEN_TABLE
 
91
# define YYTOKEN_TABLE 0
 
92
#endif
 
93
 
 
94
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
 
95
   If N is 0, then set CURRENT to the empty location which ends
 
96
   the previous symbol: RHS[0] (always defined).  */
 
97
 
 
98
#ifndef YYLLOC_DEFAULT
 
99
# define YYLLOC_DEFAULT(Current, Rhs, N)                \
 
100
do {                                                    \
 
101
  if (N)                                                \
 
102
    {                                                   \
 
103
      (Current).begin = (Rhs)[1].begin;                 \
 
104
      (Current).end   = (Rhs)[N].end;                   \
 
105
    }                                                   \
 
106
  else                                                  \
 
107
    {                                                   \
 
108
      (Current).begin = (Current).end = (Rhs)[0].end;   \
 
109
    }                                                   \
 
110
} while (false)
 
111
#endif
 
112
 
 
113
namespace pgscript
 
114
{
 
115
 
 
116
  /// A Bison parser.
 
117
  class pgsParser
 
118
  {
 
119
  public:
 
120
    /// Symbol semantic values.
 
121
#ifndef YYSTYPE
 
122
    union semantic_type
 
123
#line 106 "pgscript/pgsParser.yy"
 
124
{
 
125
        const wxString * str;
 
126
        int integer;
 
127
        pgsExpression * expr;
 
128
        pgsStmt * stmt;
 
129
        pgsStmtList * stmt_list;
 
130
}
 
131
/* Line 35 of lalr1.cc.  */
 
132
#line 133 "pgscript/parser.tab.hh"
 
133
        ;
 
134
#else
 
135
    typedef YYSTYPE semantic_type;
 
136
#endif
 
137
    /// Symbol locations.
 
138
    typedef location location_type;
 
139
    /// Tokens.
 
140
    struct token
 
141
    {
 
142
      /* Tokens.  */
 
143
   enum yytokentype {
 
144
     PGS_END = 0,
 
145
     PGS_WHILE = 258,
 
146
     PGS_BREAK = 259,
 
147
     PGS_RETURN = 260,
 
148
     PGS_CONTINUE = 261,
 
149
     PGS_IF = 262,
 
150
     PGS_ELSE = 263,
 
151
     PGS_WAITFOR = 264,
 
152
     PGS_AS = 265,
 
153
     PGS_OPEN = 266,
 
154
     PGS_CLOSE = 267,
 
155
     PGS_ASSERT = 268,
 
156
     PGS_PRINT = 269,
 
157
     PGS_LOG = 270,
 
158
     PGS_CNT_COLUMNS = 271,
 
159
     PGS_CNT_LINES = 272,
 
160
     PGS_TRIM = 273,
 
161
     PGS_RM_LINE = 274,
 
162
     PGS_CAST = 275,
 
163
     PGS_RECORD = 276,
 
164
     PGS_INTEGER = 277,
 
165
     PGS_REAL = 278,
 
166
     PGS_STRING = 279,
 
167
     PGS_REGEX = 280,
 
168
     PGS_FILE = 281,
 
169
     PGS_DATE = 282,
 
170
     PGS_TIME = 283,
 
171
     PGS_DATE_TIME = 284,
 
172
     PGS_REFERENCE = 285,
 
173
     PGS_LE_OP = 286,
 
174
     PGS_GE_OP = 287,
 
175
     PGS_EQ_OP = 288,
 
176
     PGS_AE_OP = 289,
 
177
     PGS_NE_OP = 290,
 
178
     PGS_AND_OP = 291,
 
179
     PGS_OR_OP = 292,
 
180
     PGS_NOT_OP = 293,
 
181
     PGS_UNKNOWN = 294,
 
182
     PGS_SET_ASSIGN = 295,
 
183
     PGS_DECLARE_ASSGN = 296,
 
184
     PGS_ABORT = 297,
 
185
     PGS_ALTER = 298,
 
186
     PGS_ANALYZE = 299,
 
187
     PGS_BEGIN = 300,
 
188
     PGS_CHECKPOINT = 301,
 
189
     PGS_CLOSE_ST = 302,
 
190
     PGS_CLUSTER = 303,
 
191
     PGS_COMMENT = 304,
 
192
     PGS_COMMIT = 305,
 
193
     PGS_COPY = 306,
 
194
     PGS_CREATE = 307,
 
195
     PGS_DEALLOCATE = 308,
 
196
     PGS_DECLARE = 309,
 
197
     PGS_DELETE = 310,
 
198
     PGS_DISCARD = 311,
 
199
     PGS_DROP = 312,
 
200
     PGS_END_ST = 313,
 
201
     PGS_EXECUTE = 314,
 
202
     PGS_EXPLAIN = 315,
 
203
     PGS_FETCH = 316,
 
204
     PGS_GRANT = 317,
 
205
     PGS_INSERT = 318,
 
206
     PGS_LISTEN = 319,
 
207
     PGS_LOAD = 320,
 
208
     PGS_LOCK = 321,
 
209
     PGS_MOVE = 322,
 
210
     PGS_NOTIFY = 323,
 
211
     PGS_PREPARE = 324,
 
212
     PGS_REASSIGN = 325,
 
213
     PGS_REINDEX = 326,
 
214
     PGS_RELEASE = 327,
 
215
     PGS_RESET = 328,
 
216
     PGS_REVOKE = 329,
 
217
     PGS_ROLLBACK = 330,
 
218
     PGS_SAVEPOINT = 331,
 
219
     PGS_SELECT = 332,
 
220
     PGS_SET = 333,
 
221
     PGS_SHOW = 334,
 
222
     PGS_START = 335,
 
223
     PGS_TRUNCATE = 336,
 
224
     PGS_UNLISTEN = 337,
 
225
     PGS_UPDATE = 338,
 
226
     PGS_VACUUM = 339,
 
227
     PGS_VALUES = 340,
 
228
     PGS_IDENTIFIER = 341,
 
229
     PGS_VAL_INT = 342,
 
230
     PGS_VAL_REAL = 343,
 
231
     PGS_VAL_STR = 344
 
232
   };
 
233
 
 
234
    };
 
235
    /// Token type.
 
236
    typedef token::yytokentype token_type;
 
237
 
 
238
    /// Build a parser object.
 
239
    pgsParser (class pgsDriver & driver_yyarg);
 
240
    virtual ~pgsParser ();
 
241
 
 
242
    /// Parse.
 
243
    /// \returns  0 iff parsing succeeded.
 
244
    virtual int parse ();
 
245
 
 
246
    /// The current debugging stream.
 
247
    std::ostream& debug_stream () const;
 
248
    /// Set the current debugging stream.
 
249
    void set_debug_stream (std::ostream &);
 
250
 
 
251
    /// Type for debugging levels.
 
252
    typedef int debug_level_type;
 
253
    /// The current debugging level.
 
254
    debug_level_type debug_level () const;
 
255
    /// Set the current debugging level.
 
256
    void set_debug_level (debug_level_type l);
 
257
 
 
258
  private:
 
259
    /// Report a syntax error.
 
260
    /// \param loc    where the syntax error is found.
 
261
    /// \param msg    a description of the syntax error.
 
262
    virtual void error (const location_type& loc, const std::string& msg);
 
263
 
 
264
    /// Generate an error message.
 
265
    /// \param state   the state where the error occurred.
 
266
    /// \param tok     the look-ahead token.
 
267
    virtual std::string yysyntax_error_ (int yystate, int tok);
 
268
 
 
269
#if YYDEBUG
 
270
    /// \brief Report a symbol value on the debug stream.
 
271
    /// \param yytype       The token type.
 
272
    /// \param yyvaluep     Its semantic value.
 
273
    /// \param yylocationp  Its location.
 
274
    virtual void yy_symbol_value_print_ (int yytype,
 
275
                                         const semantic_type* yyvaluep,
 
276
                                         const location_type* yylocationp);
 
277
    /// \brief Report a symbol on the debug stream.
 
278
    /// \param yytype       The token type.
 
279
    /// \param yyvaluep     Its semantic value.
 
280
    /// \param yylocationp  Its location.
 
281
    virtual void yy_symbol_print_ (int yytype,
 
282
                                   const semantic_type* yyvaluep,
 
283
                                   const location_type* yylocationp);
 
284
#endif /* ! YYDEBUG */
 
285
 
 
286
 
 
287
    /// State numbers.
 
288
    typedef int state_type;
 
289
    /// State stack type.
 
290
    typedef stack<state_type>    state_stack_type;
 
291
    /// Semantic value stack type.
 
292
    typedef stack<semantic_type> semantic_stack_type;
 
293
    /// location stack type.
 
294
    typedef stack<location_type> location_stack_type;
 
295
 
 
296
    /// The state stack.
 
297
    state_stack_type yystate_stack_;
 
298
    /// The semantic value stack.
 
299
    semantic_stack_type yysemantic_stack_;
 
300
    /// The location stack.
 
301
    location_stack_type yylocation_stack_;
 
302
 
 
303
    /// Internal symbol numbers.
 
304
    typedef unsigned char token_number_type;
 
305
    /* Tables.  */
 
306
    /// For a state, the index in \a yytable_ of its portion.
 
307
    static const short int yypact_[];
 
308
    static const signed char yypact_ninf_;
 
309
 
 
310
    /// For a state, default rule to reduce.
 
311
    /// Unless\a  yytable_ specifies something else to do.
 
312
    /// Zero means the default is an error.
 
313
    static const unsigned char yydefact_[];
 
314
 
 
315
    static const short int yypgoto_[];
 
316
    static const short int yydefgoto_[];
 
317
 
 
318
    /// What to do in a state.
 
319
    /// \a yytable_[yypact_[s]]: what to do in state \a s.
 
320
    /// - if positive, shift that token.
 
321
    /// - if negative, reduce the rule which number is the opposite.
 
322
    /// - if zero, do what YYDEFACT says.
 
323
    static const unsigned short int yytable_[];
 
324
    static const signed char yytable_ninf_;
 
325
 
 
326
    static const short int yycheck_[];
 
327
 
 
328
    /// For a state, its accessing symbol.
 
329
    static const unsigned char yystos_[];
 
330
 
 
331
    /// For a rule, its LHS.
 
332
    static const unsigned char yyr1_[];
 
333
    /// For a rule, its RHS length.
 
334
    static const unsigned char yyr2_[];
 
335
 
 
336
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 
337
    /// For a symbol, its name in clear.
 
338
    static const char* const yytname_[];
 
339
#endif
 
340
 
 
341
#if YYERROR_VERBOSE
 
342
    /// Convert the symbol name \a n to a form suitable for a diagnostic.
 
343
    virtual std::string yytnamerr_ (const char *n);
 
344
#endif
 
345
 
 
346
#if YYDEBUG
 
347
    /// A type to store symbol numbers and -1.
 
348
    typedef short int rhs_number_type;
 
349
    /// A `-1'-separated list of the rules' RHS.
 
350
    static const rhs_number_type yyrhs_[];
 
351
    /// For each rule, the index of the first RHS symbol in \a yyrhs_.
 
352
    static const unsigned short int yyprhs_[];
 
353
    /// For each rule, its source line number.
 
354
    static const unsigned short int yyrline_[];
 
355
    /// For each scanner token number, its symbol number.
 
356
    static const unsigned short int yytoken_number_[];
 
357
    /// Report on the debug stream that the rule \a r is going to be reduced.
 
358
    virtual void yy_reduce_print_ (int r);
 
359
    /// Print the state stack on the debug stream.
 
360
    virtual void yystack_print_ ();
 
361
#endif
 
362
 
 
363
    /// Convert a scanner token number \a t to a symbol number.
 
364
    token_number_type yytranslate_ (int t);
 
365
 
 
366
    /// \brief Reclaim the memory associated to a symbol.
 
367
    /// \param yymsg        Why this token is reclaimed.
 
368
    /// \param yytype       The symbol type.
 
369
    /// \param yyvaluep     Its semantic value.
 
370
    /// \param yylocationp  Its location.
 
371
    inline void yydestruct_ (const char* yymsg,
 
372
                             int yytype,
 
373
                             semantic_type* yyvaluep,
 
374
                             location_type* yylocationp);
 
375
 
 
376
    /// Pop \a n symbols the three stacks.
 
377
    inline void yypop_ (unsigned int n = 1);
 
378
 
 
379
    /* Constants.  */
 
380
    static const int yyeof_;
 
381
    /* LAST_ -- Last index in TABLE_.  */
 
382
    static const int yylast_;
 
383
    static const int yynnts_;
 
384
    static const int yyempty_;
 
385
    static const int yyfinal_;
 
386
    static const int yyterror_;
 
387
    static const int yyerrcode_;
 
388
    static const int yyntokens_;
 
389
    static const unsigned int yyuser_token_number_max_;
 
390
    static const token_number_type yyundef_token_;
 
391
 
 
392
    /* Debugging.  */
 
393
    int yydebug_;
 
394
    std::ostream* yycdebug_;
 
395
 
 
396
 
 
397
    /* User arguments.  */
 
398
    class pgsDriver & driver;
 
399
  };
 
400
}
 
401
 
 
402
 
 
403
#endif /* ! defined PARSER_HEADER_H */