source: trunk/src/generated/easymesh-parser.h @ 2506

Last change on this file since 2506 was 2506, checked in by sam, 7 years ago

base: start removing occurrences of NULL on our long journey to nullptr.

File size: 9.9 KB
RevLine 
[2506]1/* A Bison parser, made by GNU Bison 2.5.  */
[1415]2
3/* Skeleton interface for Bison LALR(1) parsers in C++
4   
[2506]5      Copyright (C) 2002-2011 Free Software Foundation, Inc.
[1415]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 3 of the License, or
10   (at your option) 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, see <http://www.gnu.org/licenses/>.  */
19
20/* As a special exception, you may create a larger work that contains
21   part or all of the Bison parser skeleton and distribute that work
22   under terms of your choice, so long as that work isn't itself a
23   parser generator using the skeleton or a modified version thereof
24   as a parser skeleton.  Alternatively, if you modify or redistribute
25   the parser skeleton itself, you may (at your option) remove this
26   special exception, which will cause the skeleton and the resulting
27   Bison output files to be licensed under the GNU General Public
28   License without this special exception.
29   
30   This special exception was added by the Free Software Foundation in
31   version 2.2 of Bison.  */
32
33/* C++ LALR(1) parser skeleton written by Akim Demaille.  */
34
35#ifndef PARSER_HEADER_H
36# define PARSER_HEADER_H
37
38
39
40#include <string>
41#include <iostream>
42#include "stack.hh"
43#include "location.hh"
44
45/* Enabling traces.  */
46#ifndef YYDEBUG
[1418]47# define YYDEBUG 1
[1415]48#endif
49
50/* Enabling verbose error messages.  */
51#ifdef YYERROR_VERBOSE
52# undef YYERROR_VERBOSE
53# define YYERROR_VERBOSE 1
54#else
[1418]55# define YYERROR_VERBOSE 1
[1415]56#endif
57
58/* Enabling the token table.  */
59#ifndef YYTOKEN_TABLE
60# define YYTOKEN_TABLE 0
61#endif
62
63
[1510]64namespace lol {
[1415]65
[2506]66/* Line 35 of lalr1.cc  */
67#line 68 "generated/easymesh-parser.h"
[1415]68
69  /// A Bison parser.
[1510]70  class EasyMeshParser
[1415]71  {
72  public:
73    /// Symbol semantic values.
74#ifndef YYSTYPE
75    union semantic_type
76    {
77
[2506]78/* Line 35 of lalr1.cc  */
[1510]79#line 36 "easymesh/easymesh-parser.y"
[1415]80
81    float fval;
[1432]82    /* Can't use uin32_t here for some reason */
83    unsigned u32val;
[2152]84    struct { float f0, f1, f2, f3, f4, f5, f6, f7, f8, f9; } args;
[1415]85
86
87
[2506]88/* Line 35 of lalr1.cc  */
89#line 90 "generated/easymesh-parser.h"
[1415]90    };
91#else
92    typedef YYSTYPE semantic_type;
93#endif
94    /// Symbol locations.
95    typedef location location_type;
96    /// Tokens.
97    struct token
98    {
99      /* Tokens.  */
100   enum yytokentype {
101     T_END = 0,
[1442]102     T_COLOR = 258,
103     T_BGCOLOR = 259,
104     T_TRANSLATEX = 260,
105     T_ROTATEX = 261,
106     T_TAPERX = 262,
[2406]107     T_TWISTX = 263,
108     T_SHEARX = 264,
109     T_STRETCHX = 265,
110     T_BENDXY = 266,
111     T_BENDXZ = 267,
112     T_SCALEX = 268,
113     T_MIRRORX = 269,
114     T_TRANSLATEY = 270,
115     T_ROTATEY = 271,
116     T_TAPERY = 272,
117     T_TWISTY = 273,
118     T_SHEARY = 274,
119     T_STRETCHY = 275,
120     T_BENDYX = 276,
121     T_BENDYZ = 277,
122     T_SCALEY = 278,
123     T_MIRRORY = 279,
124     T_TRANSLATEZ = 280,
125     T_ROTATEZ = 281,
126     T_TAPERZ = 282,
127     T_TWISTZ = 283,
128     T_SHEARZ = 284,
129     T_STRETCHZ = 285,
130     T_BENDZX = 286,
131     T_BENDZY = 287,
132     T_SCALEZ = 288,
133     T_MIRRORZ = 289,
134     T_TRANSLATE = 290,
135     T_SCALE = 291,
136     T_TOGGLESCALEWINDING = 292,
137     T_RADIALJITTER = 293,
[2407]138     T_SPLITTRIANGLE = 294,
[2410]139     T_SMOOTHMESH = 295,
140     T_CSGUNION = 296,
141     T_CSGSUBSTRACT = 297,
142     T_CSGSUBSTRACTLOSS = 298,
143     T_CSGAND = 299,
144     T_CSGXOR = 300,
145     T_CHAMFER = 301,
146     T_CYLINDER = 302,
147     T_BOX = 303,
148     T_SMOOTHCHAMFBOX = 304,
149     T_FLATCHAMFBOX = 305,
150     T_SPHERE = 306,
151     T_CAPSULE = 307,
152     T_STAR = 308,
153     T_EXPANDEDSTAR = 309,
154     T_DISC = 310,
155     T_TRIANGLE = 311,
156     T_QUAD = 312,
157     T_COG = 313,
158     T_TORUS = 314,
159     T_ERROR = 315,
160     NUMBER = 316,
161     COLOR = 317
[1415]162   };
163
164    };
165    /// Token type.
166    typedef token::yytokentype token_type;
167
168    /// Build a parser object.
[1510]169    EasyMeshParser (class EasyMeshCompiler& mc_yyarg);
170    virtual ~EasyMeshParser ();
[1415]171
172    /// Parse.
173    /// \returns  0 iff parsing succeeded.
174    virtual int parse ();
175
176#if YYDEBUG
177    /// The current debugging stream.
178    std::ostream& debug_stream () const;
179    /// Set the current debugging stream.
180    void set_debug_stream (std::ostream &);
181
182    /// Type for debugging levels.
183    typedef int debug_level_type;
184    /// The current debugging level.
185    debug_level_type debug_level () const;
186    /// Set the current debugging level.
187    void set_debug_level (debug_level_type l);
188#endif
189
190  private:
191    /// Report a syntax error.
192    /// \param loc    where the syntax error is found.
193    /// \param msg    a description of the syntax error.
194    virtual void error (const location_type& loc, const std::string& msg);
195
196    /// Generate an error message.
197    /// \param state   the state where the error occurred.
198    /// \param tok     the lookahead token.
199    virtual std::string yysyntax_error_ (int yystate, int tok);
200
201#if YYDEBUG
202    /// \brief Report a symbol value on the debug stream.
203    /// \param yytype       The token type.
204    /// \param yyvaluep     Its semantic value.
205    /// \param yylocationp  Its location.
206    virtual void yy_symbol_value_print_ (int yytype,
207                                         const semantic_type* yyvaluep,
208                                         const location_type* yylocationp);
209    /// \brief Report a symbol on the debug stream.
210    /// \param yytype       The token type.
211    /// \param yyvaluep     Its semantic value.
212    /// \param yylocationp  Its location.
213    virtual void yy_symbol_print_ (int yytype,
214                                   const semantic_type* yyvaluep,
215                                   const location_type* yylocationp);
216#endif
217
218
219    /// State numbers.
220    typedef int state_type;
221    /// State stack type.
222    typedef stack<state_type>    state_stack_type;
223    /// Semantic value stack type.
224    typedef stack<semantic_type> semantic_stack_type;
225    /// location stack type.
226    typedef stack<location_type> location_stack_type;
227
228    /// The state stack.
229    state_stack_type yystate_stack_;
230    /// The semantic value stack.
231    semantic_stack_type yysemantic_stack_;
232    /// The location stack.
233    location_stack_type yylocation_stack_;
234
[2506]235    /// Whether the given \c yypact_ value indicates a defaulted state.
236    /// \param yyvalue   the value to check
237    static bool yy_pact_value_is_default_ (int yyvalue);
238
239    /// Whether the given \c yytable_ value indicates a syntax error.
240    /// \param yyvalue   the value to check
241    static bool yy_table_value_is_error_ (int yyvalue);
242
[1415]243    /// Internal symbol numbers.
244    typedef unsigned char token_number_type;
245    /* Tables.  */
246    /// For a state, the index in \a yytable_ of its portion.
247    static const signed char yypact_[];
248    static const signed char yypact_ninf_;
249
[2506]250    /// For a state, default reduction number.
[1415]251    /// Unless\a  yytable_ specifies something else to do.
252    /// Zero means the default is an error.
253    static const unsigned char yydefact_[];
254
[2404]255    static const short int yypgoto_[];
[2406]256    static const short int yydefgoto_[];
[1415]257
258    /// What to do in a state.
259    /// \a yytable_[yypact_[s]]: what to do in state \a s.
260    /// - if positive, shift that token.
261    /// - if negative, reduce the rule which number is the opposite.
262    /// - if zero, do what YYDEFACT says.
263    static const unsigned char yytable_[];
264    static const signed char yytable_ninf_;
265
[2406]266    static const short int yycheck_[];
[1415]267
268    /// For a state, its accessing symbol.
269    static const unsigned char yystos_[];
270
271    /// For a rule, its LHS.
272    static const unsigned char yyr1_[];
273    /// For a rule, its RHS length.
274    static const unsigned char yyr2_[];
275
276#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
277    /// For a symbol, its name in clear.
278    static const char* const yytname_[];
279#endif
280
[1418]281    /// Convert the symbol name \a n to a form suitable for a diagnostic.
[2506]282    static std::string yytnamerr_ (const char *n);
[1418]283
[1415]284#if YYDEBUG
285    /// A type to store symbol numbers and -1.
286    typedef signed char rhs_number_type;
287    /// A `-1'-separated list of the rules' RHS.
288    static const rhs_number_type yyrhs_[];
289    /// For each rule, the index of the first RHS symbol in \a yyrhs_.
290    static const unsigned char yyprhs_[];
291    /// For each rule, its source line number.
292    static const unsigned char yyrline_[];
293    /// For each scanner token number, its symbol number.
294    static const unsigned short int yytoken_number_[];
295    /// Report on the debug stream that the rule \a r is going to be reduced.
296    virtual void yy_reduce_print_ (int r);
297    /// Print the state stack on the debug stream.
298    virtual void yystack_print_ ();
299
300    /* Debugging.  */
301    int yydebug_;
302    std::ostream* yycdebug_;
303#endif
304
305    /// Convert a scanner token number \a t to a symbol number.
306    token_number_type yytranslate_ (int t);
307
308    /// \brief Reclaim the memory associated to a symbol.
309    /// \param yymsg        Why this token is reclaimed.
310    /// \param yytype       The symbol type.
311    /// \param yyvaluep     Its semantic value.
312    /// \param yylocationp  Its location.
313    inline void yydestruct_ (const char* yymsg,
314                             int yytype,
315                             semantic_type* yyvaluep,
316                             location_type* yylocationp);
317
318    /// Pop \a n symbols the three stacks.
319    inline void yypop_ (unsigned int n = 1);
320
321    /* Constants.  */
322    static const int yyeof_;
323    /* LAST_ -- Last index in TABLE_.  */
324    static const int yylast_;
325    static const int yynnts_;
326    static const int yyempty_;
327    static const int yyfinal_;
328    static const int yyterror_;
329    static const int yyerrcode_;
330    static const int yyntokens_;
331    static const unsigned int yyuser_token_number_max_;
332    static const token_number_type yyundef_token_;
333
334    /* User arguments.  */
[1510]335    class EasyMeshCompiler& mc;
[1415]336  };
337
[1510]338} // lol
[1415]339
[2506]340/* Line 35 of lalr1.cc  */
341#line 342 "generated/easymesh-parser.h"
[1415]342
343
344
345#endif /* ! defined PARSER_HEADER_H */
Note: See TracBrowser for help on using the repository browser.