OpenCores
URL https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [compiler/] [src/] [vp_compiler/] [parser.tab.h] - Blame information for rev 216

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 216 diegovalve
 
2
/* A Bison parser, made by GNU Bison 2.4.1.  */
3
 
4
/* Skeleton interface for Bison LALR(1) parsers in C++
5
 
6
      Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
7
   Foundation, Inc.
8
 
9
   This program is free software: you can redistribute it and/or modify
10
   it under the terms of the GNU General Public License as published by
11
   the Free Software Foundation, either version 3 of the License, or
12
   (at your option) any later version.
13
 
14
   This program is distributed in the hope that it will be useful,
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
   GNU General Public License for more details.
18
 
19
   You should have received a copy of the GNU General Public License
20
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
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
/* "%code requires" blocks.  */
41
 
42
/* Line 35 of lalr1.cc  */
43
#line 36 "parser.y"
44
 
45
        #include <string>
46
        #include <sstream>
47
        #include <iomanip>
48
        #include <bitset>
49
        #include <map>
50
        #include "Instruction.h"
51
        #include <vector>
52
 
53
 
54
        // We want to return a string
55
        #define YYSTYPE std::string
56
 
57
 
58
                namespace Theia
59
                {
60
                        // Forward-declare the Scanner class; the Parser needs to be assigned a 
61
                        // Scanner, but the Scanner can't be declared without the Parser
62
                        class Scanner;
63
 
64
                        // We use a map to store the INI data
65
                        typedef std::map<std::string, std::map<std::string, std::string> > mapData;
66
 
67
 
68
 
69
 
70
 
71
                }
72
 
73
 
74
 
75
 
76
/* Line 35 of lalr1.cc  */
77
#line 78 "parser.tab.h"
78
 
79
 
80
#include <string>
81
#include <iostream>
82
#include "stack.hh"
83
 
84
 
85
/* Line 35 of lalr1.cc  */
86
#line 28 "parser.y"
87
namespace Theia {
88
 
89
/* Line 35 of lalr1.cc  */
90
#line 91 "parser.tab.h"
91
  class position;
92
  class location;
93
 
94
/* Line 35 of lalr1.cc  */
95
#line 28 "parser.y"
96
} // Theia
97
 
98
/* Line 35 of lalr1.cc  */
99
#line 100 "parser.tab.h"
100
 
101
#include "location.hh"
102
 
103
/* Enabling traces.  */
104
#ifndef YYDEBUG
105
# define YYDEBUG 0
106
#endif
107
 
108
/* Enabling verbose error messages.  */
109
#ifdef YYERROR_VERBOSE
110
# undef YYERROR_VERBOSE
111
# define YYERROR_VERBOSE 1
112
#else
113
# define YYERROR_VERBOSE 1
114
#endif
115
 
116
/* Enabling the token table.  */
117
#ifndef YYTOKEN_TABLE
118
# define YYTOKEN_TABLE 0
119
#endif
120
 
121
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
122
   If N is 0, then set CURRENT to the empty location which ends
123
   the previous symbol: RHS[0] (always defined).  */
124
 
125
#ifndef YYLLOC_DEFAULT
126
# define YYLLOC_DEFAULT(Current, Rhs, N)                \
127
do {                                                    \
128
  if (N)                                                \
129
    {                                                   \
130
      (Current).begin = (Rhs)[1].begin;                 \
131
      (Current).end   = (Rhs)[N].end;                   \
132
    }                                                   \
133
  else                                                  \
134
    {                                                   \
135
      (Current).begin = (Current).end = (Rhs)[0].end;    \
136
    }                                                   \
137
} while (false)
138
#endif
139
 
140
 
141
/* Line 35 of lalr1.cc  */
142
#line 28 "parser.y"
143
namespace Theia {
144
 
145
/* Line 35 of lalr1.cc  */
146
#line 147 "parser.tab.h"
147
 
148
  /// A Bison parser.
149
  class Parser
150
  {
151
  public:
152
    /// Symbol semantic values.
153
#ifndef YYSTYPE
154
    typedef int semantic_type;
155
#else
156
    typedef YYSTYPE semantic_type;
157
#endif
158
    /// Symbol locations.
159
    typedef location location_type;
160
    /// Tokens.
161
    struct token
162
    {
163
      /* Tokens.  */
164
   enum yytokentype {
165
     AUTO = 258,
166
     RETURN = 259,
167
     FUNCTION = 260,
168
     JMP = 261,
169
     EXIT = 262,
170
     EQUAL = 263,
171
     NOT_EQUAL = 264,
172
     GREATER_THAN = 265,
173
     LESS_THAN = 266,
174
     LESS_OR_EQUAL_THAN = 267,
175
     GREATER_OR_EQUAL_THAN = 268,
176
     IF = 269,
177
     ELSE = 270,
178
     OPEN_ROUND_BRACE = 271,
179
     CLOSE_ROUND_BRACE = 272,
180
     OPEN_BRACE = 273,
181
     CLOSE_BRACE = 274,
182
     ASSIGN = 275,
183
     DIV = 276,
184
     MUL = 277,
185
     ADD = 278,
186
     DECCONST = 279,
187
     HEXCONST = 280,
188
     BINCONST = 281,
189
     EOS = 282,
190
     DOT = 283,
191
     MINUS = 284,
192
     TK_X = 285,
193
     TK_Y = 286,
194
     TK_Z = 287,
195
     TK_N = 288,
196
     REG = 289,
197
     IDENTIFIER = 290,
198
     SQRT = 291,
199
     SCALE = 292,
200
     UNSCALE = 293,
201
     USING = 294,
202
     FIXED_POINT = 295,
203
     COMMA = 296,
204
     OPEN_SQUARE_BRACE = 297,
205
     CLOSE_SQUARE_BRACE = 298,
206
     WHILE = 299,
207
     ADD_EQ = 300,
208
     THREAD = 301,
209
     START = 302,
210
     BITWISE_AND = 303,
211
     BITWISE_OR = 304,
212
     OUT = 305
213
   };
214
 
215
    };
216
    /// Token type.
217
    typedef token::yytokentype token_type;
218
 
219
    /// Build a parser object.
220
    Parser (Theia::Scanner &scanner_yyarg, std::map<std::string,unsigned int>  & mSymbolMap_yyarg, std::vector< Instruction > &mInstructions_yyarg, bool &mGenerateFixedPointArithmetic_yyarg);
221
    virtual ~Parser ();
222
 
223
    /// Parse.
224
    /// \returns  0 iff parsing succeeded.
225
    virtual int parse ();
226
 
227
#if YYDEBUG
228
    /// The current debugging stream.
229
    std::ostream& debug_stream () const;
230
    /// Set the current debugging stream.
231
    void set_debug_stream (std::ostream &);
232
 
233
    /// Type for debugging levels.
234
    typedef int debug_level_type;
235
    /// The current debugging level.
236
    debug_level_type debug_level () const;
237
    /// Set the current debugging level.
238
    void set_debug_level (debug_level_type l);
239
#endif
240
 
241
  private:
242
    /// Report a syntax error.
243
    /// \param loc    where the syntax error is found.
244
    /// \param msg    a description of the syntax error.
245
    virtual void error (const location_type& loc, const std::string& msg);
246
 
247
    /// Generate an error message.
248
    /// \param state   the state where the error occurred.
249
    /// \param tok     the lookahead token.
250
    virtual std::string yysyntax_error_ (int yystate, int tok);
251
 
252
#if YYDEBUG
253
    /// \brief Report a symbol value on the debug stream.
254
    /// \param yytype       The token type.
255
    /// \param yyvaluep     Its semantic value.
256
    /// \param yylocationp  Its location.
257
    virtual void yy_symbol_value_print_ (int yytype,
258
                                         const semantic_type* yyvaluep,
259
                                         const location_type* yylocationp);
260
    /// \brief Report a symbol on the debug stream.
261
    /// \param yytype       The token type.
262
    /// \param yyvaluep     Its semantic value.
263
    /// \param yylocationp  Its location.
264
    virtual void yy_symbol_print_ (int yytype,
265
                                   const semantic_type* yyvaluep,
266
                                   const location_type* yylocationp);
267
#endif
268
 
269
 
270
    /// State numbers.
271
    typedef int state_type;
272
    /// State stack type.
273
    typedef stack<state_type>    state_stack_type;
274
    /// Semantic value stack type.
275
    typedef stack<semantic_type> semantic_stack_type;
276
    /// location stack type.
277
    typedef stack<location_type> location_stack_type;
278
 
279
    /// The state stack.
280
    state_stack_type yystate_stack_;
281
    /// The semantic value stack.
282
    semantic_stack_type yysemantic_stack_;
283
    /// The location stack.
284
    location_stack_type yylocation_stack_;
285
 
286
    /// Internal symbol numbers.
287
    typedef unsigned char token_number_type;
288
    /* Tables.  */
289
    /// For a state, the index in \a yytable_ of its portion.
290
    static const short int yypact_[];
291
    static const signed char yypact_ninf_;
292
 
293
    /// For a state, default rule to reduce.
294
    /// Unless\a  yytable_ specifies something else to do.
295
    /// Zero means the default is an error.
296
    static const unsigned char yydefact_[];
297
 
298
    static const short int yypgoto_[];
299
    static const short int yydefgoto_[];
300
 
301
    /// What to do in a state.
302
    /// \a yytable_[yypact_[s]]: what to do in state \a s.
303
    /// - if positive, shift that token.
304
    /// - if negative, reduce the rule which number is the opposite.
305
    /// - if zero, do what YYDEFACT says.
306
    static const unsigned char yytable_[];
307
    static const signed char yytable_ninf_;
308
 
309
    static const short int yycheck_[];
310
 
311
    /// For a state, its accessing symbol.
312
    static const unsigned char yystos_[];
313
 
314
    /// For a rule, its LHS.
315
    static const unsigned char yyr1_[];
316
    /// For a rule, its RHS length.
317
    static const unsigned char yyr2_[];
318
 
319
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
320
    /// For a symbol, its name in clear.
321
    static const char* const yytname_[];
322
#endif
323
 
324
#if YYERROR_VERBOSE
325
    /// Convert the symbol name \a n to a form suitable for a diagnostic.
326
    virtual std::string yytnamerr_ (const char *n);
327
#endif
328
 
329
#if YYDEBUG
330
    /// A type to store symbol numbers and -1.
331
    typedef signed char rhs_number_type;
332
    /// A `-1'-separated list of the rules' RHS.
333
    static const rhs_number_type yyrhs_[];
334
    /// For each rule, the index of the first RHS symbol in \a yyrhs_.
335
    static const unsigned short int yyprhs_[];
336
    /// For each rule, its source line number.
337
    static const unsigned short int yyrline_[];
338
    /// For each scanner token number, its symbol number.
339
    static const unsigned short int yytoken_number_[];
340
    /// Report on the debug stream that the rule \a r is going to be reduced.
341
    virtual void yy_reduce_print_ (int r);
342
    /// Print the state stack on the debug stream.
343
    virtual void yystack_print_ ();
344
 
345
    /* Debugging.  */
346
    int yydebug_;
347
    std::ostream* yycdebug_;
348
#endif
349
 
350
    /// Convert a scanner token number \a t to a symbol number.
351
    token_number_type yytranslate_ (int t);
352
 
353
    /// \brief Reclaim the memory associated to a symbol.
354
    /// \param yymsg        Why this token is reclaimed.
355
    /// \param yytype       The symbol type.
356
    /// \param yyvaluep     Its semantic value.
357
    /// \param yylocationp  Its location.
358
    inline void yydestruct_ (const char* yymsg,
359
                             int yytype,
360
                             semantic_type* yyvaluep,
361
                             location_type* yylocationp);
362
 
363
    /// Pop \a n symbols the three stacks.
364
    inline void yypop_ (unsigned int n = 1);
365
 
366
    /* Constants.  */
367
    static const int yyeof_;
368
    /* LAST_ -- Last index in TABLE_.  */
369
    static const int yylast_;
370
    static const int yynnts_;
371
    static const int yyempty_;
372
    static const int yyfinal_;
373
    static const int yyterror_;
374
    static const int yyerrcode_;
375
    static const int yyntokens_;
376
    static const unsigned int yyuser_token_number_max_;
377
    static const token_number_type yyundef_token_;
378
 
379
    /* User arguments.  */
380
    Theia::Scanner &scanner;
381
    std::map<std::string,unsigned int>  & mSymbolMap;
382
    std::vector< Instruction > &mInstructions;
383
    bool &mGenerateFixedPointArithmetic;
384
  };
385
 
386
/* Line 35 of lalr1.cc  */
387
#line 28 "parser.y"
388
} // Theia
389
 
390
/* Line 35 of lalr1.cc  */
391
#line 392 "parser.tab.h"
392
 
393
 
394
 
395
#endif /* ! defined PARSER_HEADER_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.