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

Last change on this file since 2779 was 2779, checked in by sam, 6 years ago

base: disable exceptions in Bison-generated parsers.

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