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

Last change on this file since 2410 was 2410, checked in by touky, 7 years ago

easymesh : Added SmoothMesh operation, works well with triangle, not well with a box.

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