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 230

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 230 diegovalve
     OUT = 305,
213
     IN = 306
214 216 diegovalve
   };
215
 
216
    };
217
    /// Token type.
218
    typedef token::yytokentype token_type;
219
 
220
    /// Build a parser object.
221
    Parser (Theia::Scanner &scanner_yyarg, std::map<std::string,unsigned int>  & mSymbolMap_yyarg, std::vector< Instruction > &mInstructions_yyarg, bool &mGenerateFixedPointArithmetic_yyarg);
222
    virtual ~Parser ();
223
 
224
    /// Parse.
225
    /// \returns  0 iff parsing succeeded.
226
    virtual int parse ();
227
 
228
#if YYDEBUG
229
    /// The current debugging stream.
230
    std::ostream& debug_stream () const;
231
    /// Set the current debugging stream.
232
    void set_debug_stream (std::ostream &);
233
 
234
    /// Type for debugging levels.
235
    typedef int debug_level_type;
236
    /// The current debugging level.
237
    debug_level_type debug_level () const;
238
    /// Set the current debugging level.
239
    void set_debug_level (debug_level_type l);
240
#endif
241
 
242
  private:
243
    /// Report a syntax error.
244
    /// \param loc    where the syntax error is found.
245
    /// \param msg    a description of the syntax error.
246
    virtual void error (const location_type& loc, const std::string& msg);
247
 
248
    /// Generate an error message.
249
    /// \param state   the state where the error occurred.
250
    /// \param tok     the lookahead token.
251
    virtual std::string yysyntax_error_ (int yystate, int tok);
252
 
253
#if YYDEBUG
254
    /// \brief Report a symbol value on the debug stream.
255
    /// \param yytype       The token type.
256
    /// \param yyvaluep     Its semantic value.
257
    /// \param yylocationp  Its location.
258
    virtual void yy_symbol_value_print_ (int yytype,
259
                                         const semantic_type* yyvaluep,
260
                                         const location_type* yylocationp);
261
    /// \brief Report a symbol on the debug stream.
262
    /// \param yytype       The token type.
263
    /// \param yyvaluep     Its semantic value.
264
    /// \param yylocationp  Its location.
265
    virtual void yy_symbol_print_ (int yytype,
266
                                   const semantic_type* yyvaluep,
267
                                   const location_type* yylocationp);
268
#endif
269
 
270
 
271
    /// State numbers.
272
    typedef int state_type;
273
    /// State stack type.
274
    typedef stack<state_type>    state_stack_type;
275
    /// Semantic value stack type.
276
    typedef stack<semantic_type> semantic_stack_type;
277
    /// location stack type.
278
    typedef stack<location_type> location_stack_type;
279
 
280
    /// The state stack.
281
    state_stack_type yystate_stack_;
282
    /// The semantic value stack.
283
    semantic_stack_type yysemantic_stack_;
284
    /// The location stack.
285
    location_stack_type yylocation_stack_;
286
 
287
    /// Internal symbol numbers.
288
    typedef unsigned char token_number_type;
289
    /* Tables.  */
290
    /// For a state, the index in \a yytable_ of its portion.
291
    static const short int yypact_[];
292
    static const signed char yypact_ninf_;
293
 
294
    /// For a state, default rule to reduce.
295
    /// Unless\a  yytable_ specifies something else to do.
296
    /// Zero means the default is an error.
297
    static const unsigned char yydefact_[];
298
 
299
    static const short int yypgoto_[];
300
    static const short int yydefgoto_[];
301
 
302
    /// What to do in a state.
303
    /// \a yytable_[yypact_[s]]: what to do in state \a s.
304
    /// - if positive, shift that token.
305
    /// - if negative, reduce the rule which number is the opposite.
306
    /// - if zero, do what YYDEFACT says.
307
    static const unsigned char yytable_[];
308
    static const signed char yytable_ninf_;
309
 
310
    static const short int yycheck_[];
311
 
312
    /// For a state, its accessing symbol.
313
    static const unsigned char yystos_[];
314
 
315
    /// For a rule, its LHS.
316
    static const unsigned char yyr1_[];
317
    /// For a rule, its RHS length.
318
    static const unsigned char yyr2_[];
319
 
320
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
321
    /// For a symbol, its name in clear.
322
    static const char* const yytname_[];
323
#endif
324
 
325
#if YYERROR_VERBOSE
326
    /// Convert the symbol name \a n to a form suitable for a diagnostic.
327
    virtual std::string yytnamerr_ (const char *n);
328
#endif
329
 
330
#if YYDEBUG
331
    /// A type to store symbol numbers and -1.
332
    typedef signed char rhs_number_type;
333
    /// A `-1'-separated list of the rules' RHS.
334
    static const rhs_number_type yyrhs_[];
335
    /// For each rule, the index of the first RHS symbol in \a yyrhs_.
336
    static const unsigned short int yyprhs_[];
337
    /// For each rule, its source line number.
338
    static const unsigned short int yyrline_[];
339
    /// For each scanner token number, its symbol number.
340
    static const unsigned short int yytoken_number_[];
341
    /// Report on the debug stream that the rule \a r is going to be reduced.
342
    virtual void yy_reduce_print_ (int r);
343
    /// Print the state stack on the debug stream.
344
    virtual void yystack_print_ ();
345
 
346
    /* Debugging.  */
347
    int yydebug_;
348
    std::ostream* yycdebug_;
349
#endif
350
 
351
    /// Convert a scanner token number \a t to a symbol number.
352
    token_number_type yytranslate_ (int t);
353
 
354
    /// \brief Reclaim the memory associated to a symbol.
355
    /// \param yymsg        Why this token is reclaimed.
356
    /// \param yytype       The symbol type.
357
    /// \param yyvaluep     Its semantic value.
358
    /// \param yylocationp  Its location.
359
    inline void yydestruct_ (const char* yymsg,
360
                             int yytype,
361
                             semantic_type* yyvaluep,
362
                             location_type* yylocationp);
363
 
364
    /// Pop \a n symbols the three stacks.
365
    inline void yypop_ (unsigned int n = 1);
366
 
367
    /* Constants.  */
368
    static const int yyeof_;
369
    /* LAST_ -- Last index in TABLE_.  */
370
    static const int yylast_;
371
    static const int yynnts_;
372
    static const int yyempty_;
373
    static const int yyfinal_;
374
    static const int yyterror_;
375
    static const int yyerrcode_;
376
    static const int yyntokens_;
377
    static const unsigned int yyuser_token_number_max_;
378
    static const token_number_type yyundef_token_;
379
 
380
    /* User arguments.  */
381
    Theia::Scanner &scanner;
382
    std::map<std::string,unsigned int>  & mSymbolMap;
383
    std::vector< Instruction > &mInstructions;
384
    bool &mGenerateFixedPointArithmetic;
385
  };
386
 
387
/* Line 35 of lalr1.cc  */
388
#line 28 "parser.y"
389
} // Theia
390
 
391
/* Line 35 of lalr1.cc  */
392 230 diegovalve
#line 393 "parser.tab.h"
393 216 diegovalve
 
394
 
395
 
396
#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.