@@ -47,7 +47,7 @@ | |||
%token T_TRANSLATEX T_ROTATEX T_TAPERX T_SCALEX T_MIRRORX | |||
%token T_TRANSLATEY T_ROTATEY T_TAPERY T_SCALEY T_MIRRORY | |||
%token T_TRANSLATEZ T_ROTATEZ T_TAPERZ T_SCALEZ T_MIRRORZ | |||
%token T_TRANSLATE T_SCALE | |||
%token T_TRANSLATE T_SCALE T_TOGGLESCALEWINDING | |||
%token T_CHAMFER | |||
%token T_CYLINDER T_BOX T_SMOOTHCHAMFBOX T_FLATCHAMFBOX T_SPHERE T_CAPSULE | |||
@@ -134,6 +134,7 @@ transform_command: | |||
| T_MIRRORX { mc.m_mesh.MirrorX(); } | |||
| T_MIRRORY { mc.m_mesh.MirrorY(); } | |||
| T_MIRRORZ { mc.m_mesh.MirrorZ(); } | |||
| T_TOGGLESCALEWINDING { mc.m_mesh.ToggleScaleWinding(); } | |||
; | |||
primitive_command: | |||
@@ -66,6 +66,7 @@ sx { return token::T_SCALEX; } | |||
sy { return token::T_SCALEY; } | |||
sz { return token::T_SCALEZ; } | |||
s { return token::T_SCALE; } | |||
tsw { return token::T_TOGGLESCALEWINDING; } | |||
mx { return token::T_MIRRORX; } | |||
my { return token::T_MIRRORY; } | |||
mz { return token::T_MIRRORZ; } | |||
@@ -41,7 +41,7 @@ namespace lol | |||
{ | |||
EasyMesh::EasyMesh() | |||
: m_color(0), m_color2(0) | |||
: m_color(0), m_color2(0), m_ignore_winding_on_scale(0) | |||
{ | |||
m_cursors.Push(0, 0); | |||
} | |||
@@ -130,6 +130,11 @@ void EasyMesh::Render(mat4 const &model, float damage) | |||
m_gpu.vdecl->Unbind(); | |||
} | |||
void EasyMesh::ToggleScaleWinding() | |||
{ | |||
m_ignore_winding_on_scale = !m_ignore_winding_on_scale; | |||
} | |||
void EasyMesh::SetCurColor(vec4 const &color) | |||
{ | |||
m_color = color; | |||
@@ -320,7 +325,7 @@ void EasyMesh::Scale(vec3 const &s) | |||
} | |||
/* Flip winding if the scaling involves mirroring */ | |||
if (s.x * s.y * s.z < 0) | |||
if (!m_ignore_winding_on_scale && s.x * s.y * s.z < 0) | |||
{ | |||
for (int i = m_cursors.Last().m2; i < m_indices.Count(); i += 3) | |||
{ | |||
@@ -35,6 +35,7 @@ public: | |||
void OpenBrace(); | |||
void CloseBrace(); | |||
void ToggleScaleWinding(); | |||
void SetCurColor(vec4 const &color); | |||
void SetCurColor2(vec4 const &color); | |||
@@ -93,6 +94,7 @@ private: | |||
Array<uint16_t> m_indices; | |||
Array<vec3, vec3, vec4> m_vert; | |||
Array<int, int> m_cursors; | |||
bool m_ignore_winding_on_scale; | |||
/* FIXME: put this in a separate class so that we can copy meshes. */ | |||
struct | |||
@@ -1,8 +1,8 @@ | |||
/* A Bison parser, made by GNU Bison 2.5. */ | |||
/* A Bison parser, made by GNU Bison 2.4.2. */ | |||
/* Skeleton interface for Bison LALR(1) parsers in C++ | |||
Copyright (C) 2002-2011 Free Software Foundation, Inc. | |||
Copyright (C) 2002-2010 Free Software Foundation, Inc. | |||
This program is free software: you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
@@ -40,6 +40,20 @@ | |||
#include <string> | |||
#include <iostream> | |||
#include "stack.hh" | |||
namespace lol { | |||
/* Line 34 of lalr1.cc */ | |||
#line 49 "generated/easymesh-parser.h" | |||
class position; | |||
class location; | |||
} // lol | |||
/* Line 34 of lalr1.cc */ | |||
#line 56 "generated/easymesh-parser.h" | |||
#include "location.hh" | |||
/* Enabling traces. */ | |||
@@ -60,11 +74,30 @@ | |||
# define YYTOKEN_TABLE 0 | |||
#endif | |||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |||
If N is 0, then set CURRENT to the empty location which ends | |||
the previous symbol: RHS[0] (always defined). */ | |||
#ifndef YYLLOC_DEFAULT | |||
# define YYLLOC_DEFAULT(Current, Rhs, N) \ | |||
do { \ | |||
if (N) \ | |||
{ \ | |||
(Current).begin = (Rhs)[1].begin; \ | |||
(Current).end = (Rhs)[N].end; \ | |||
} \ | |||
else \ | |||
{ \ | |||
(Current).begin = (Current).end = (Rhs)[0].end; \ | |||
} \ | |||
} while (false) | |||
#endif | |||
namespace lol { | |||
/* Line 35 of lalr1.cc */ | |||
#line 68 "generated/easymesh-parser.h" | |||
/* Line 34 of lalr1.cc */ | |||
#line 101 "generated/easymesh-parser.h" | |||
/// A Bison parser. | |||
class EasyMeshParser | |||
@@ -75,7 +108,7 @@ namespace lol { | |||
union semantic_type | |||
{ | |||
/* Line 35 of lalr1.cc */ | |||
/* Line 34 of lalr1.cc */ | |||
#line 36 "easymesh/easymesh-parser.y" | |||
float fval; | |||
@@ -85,8 +118,8 @@ namespace lol { | |||
/* Line 35 of lalr1.cc */ | |||
#line 90 "generated/easymesh-parser.h" | |||
/* Line 34 of lalr1.cc */ | |||
#line 123 "generated/easymesh-parser.h" | |||
}; | |||
#else | |||
typedef YYSTYPE semantic_type; | |||
@@ -118,23 +151,24 @@ namespace lol { | |||
T_MIRRORZ = 274, | |||
T_TRANSLATE = 275, | |||
T_SCALE = 276, | |||
T_CHAMFER = 277, | |||
T_CYLINDER = 278, | |||
T_BOX = 279, | |||
T_SMOOTHCHAMFBOX = 280, | |||
T_FLATCHAMFBOX = 281, | |||
T_SPHERE = 282, | |||
T_CAPSULE = 283, | |||
T_STAR = 284, | |||
T_EXPANDEDSTAR = 285, | |||
T_DISC = 286, | |||
T_TRIANGLE = 287, | |||
T_QUAD = 288, | |||
T_COG = 289, | |||
T_TORUS = 290, | |||
T_ERROR = 291, | |||
NUMBER = 292, | |||
COLOR = 293 | |||
T_TOGGLESCALEWINDING = 277, | |||
T_CHAMFER = 278, | |||
T_CYLINDER = 279, | |||
T_BOX = 280, | |||
T_SMOOTHCHAMFBOX = 281, | |||
T_FLATCHAMFBOX = 282, | |||
T_SPHERE = 283, | |||
T_CAPSULE = 284, | |||
T_STAR = 285, | |||
T_EXPANDEDSTAR = 286, | |||
T_DISC = 287, | |||
T_TRIANGLE = 288, | |||
T_QUAD = 289, | |||
T_COG = 290, | |||
T_TORUS = 291, | |||
T_ERROR = 292, | |||
NUMBER = 293, | |||
COLOR = 294 | |||
}; | |||
}; | |||
@@ -208,14 +242,6 @@ namespace lol { | |||
/// The location stack. | |||
location_stack_type yylocation_stack_; | |||
/// Whether the given \c yypact_ value indicates a defaulted state. | |||
/// \param yyvalue the value to check | |||
static bool yy_pact_value_is_default_ (int yyvalue); | |||
/// Whether the given \c yytable_ value indicates a syntax error. | |||
/// \param yyvalue the value to check | |||
static bool yy_table_value_is_error_ (int yyvalue); | |||
/// Internal symbol numbers. | |||
typedef unsigned char token_number_type; | |||
/* Tables. */ | |||
@@ -223,7 +249,7 @@ namespace lol { | |||
static const signed char yypact_[]; | |||
static const signed char yypact_ninf_; | |||
/// For a state, default reduction number. | |||
/// For a state, default rule to reduce. | |||
/// Unless\a yytable_ specifies something else to do. | |||
/// Zero means the default is an error. | |||
static const unsigned char yydefact_[]; | |||
@@ -254,8 +280,10 @@ namespace lol { | |||
static const char* const yytname_[]; | |||
#endif | |||
#if YYERROR_VERBOSE | |||
/// Convert the symbol name \a n to a form suitable for a diagnostic. | |||
static std::string yytnamerr_ (const char *n); | |||
virtual std::string yytnamerr_ (const char *n); | |||
#endif | |||
#if YYDEBUG | |||
/// A type to store symbol numbers and -1. | |||
@@ -313,8 +341,8 @@ namespace lol { | |||
} // lol | |||
/* Line 35 of lalr1.cc */ | |||
#line 318 "generated/easymesh-parser.h" | |||
/* Line 34 of lalr1.cc */ | |||
#line 346 "generated/easymesh-parser.h" | |||
@@ -330,8 +330,8 @@ typedef unsigned char YY_CHAR; | |||
*yy_cp = '\0'; \ | |||
(yy_c_buf_p) = yy_cp; | |||
#define YY_NUM_RULES 45 | |||
#define YY_END_OF_BUFFER 46 | |||
#define YY_NUM_RULES 46 | |||
#define YY_END_OF_BUFFER 47 | |||
/* This struct is not used in this scanner, | |||
but its presence is necessary. */ | |||
struct yy_trans_info | |||
@@ -339,16 +339,16 @@ struct yy_trans_info | |||
flex_int32_t yy_verify; | |||
flex_int32_t yy_nxt; | |||
}; | |||
static yyconst flex_int16_t yy_accept[73] = | |||
static yyconst flex_int16_t yy_accept[75] = | |||
{ 0, | |||
0, 0, 46, 44, 43, 42, 44, 44, 39, 44, | |||
38, 40, 41, 44, 44, 44, 44, 17, 7, 0, | |||
0, 38, 38, 0, 21, 22, 25, 0, 0, 28, | |||
29, 32, 3, 18, 19, 20, 8, 9, 10, 1, | |||
14, 15, 16, 0, 4, 5, 6, 0, 0, 38, | |||
0, 24, 26, 0, 0, 0, 33, 2, 11, 12, | |||
13, 34, 23, 27, 30, 31, 35, 0, 36, 0, | |||
37, 0 | |||
0, 0, 47, 45, 44, 43, 45, 45, 40, 45, | |||
39, 41, 42, 45, 45, 45, 45, 17, 7, 0, | |||
0, 39, 39, 0, 22, 23, 26, 0, 0, 29, | |||
30, 33, 3, 19, 20, 21, 8, 9, 10, 1, | |||
14, 15, 16, 0, 0, 4, 5, 6, 0, 0, | |||
39, 0, 25, 27, 0, 0, 0, 34, 2, 11, | |||
12, 13, 18, 35, 24, 28, 31, 32, 36, 0, | |||
37, 0, 38, 0 | |||
} ; | |||
static yyconst flex_int32_t yy_ec[256] = | |||
@@ -365,8 +365,8 @@ static yyconst flex_int32_t yy_ec[256] = | |||
11, 1, 12, 1, 1, 1, 13, 14, 15, 16, | |||
17, 18, 19, 20, 1, 1, 1, 1, 21, 1, | |||
22, 23, 24, 25, 26, 27, 1, 1, 1, 28, | |||
29, 30, 1, 1, 1, 1, 1, 1, 1, 1, | |||
22, 23, 24, 25, 26, 27, 1, 1, 28, 29, | |||
30, 31, 1, 1, 1, 1, 1, 1, 1, 1, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
@@ -383,71 +383,76 @@ static yyconst flex_int32_t yy_ec[256] = | |||
1, 1, 1, 1, 1 | |||
} ; | |||
static yyconst flex_int32_t yy_meta[31] = | |||
static yyconst flex_int32_t yy_meta[32] = | |||
{ 0, | |||
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, | |||
1, 1, 2, 2, 2, 2, 2, 2, 1, 1, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1 | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
1 | |||
} ; | |||
static yyconst flex_int16_t yy_base[81] = | |||
static yyconst flex_int16_t yy_base[83] = | |||
{ 0, | |||
0, 0, 99, 100, 100, 100, 0, 24, 26, 90, | |||
28, 100, 100, 32, 77, 11, 14, 36, 24, 0, | |||
88, 53, 59, 66, 100, 49, 100, 69, 79, 100, | |||
58, 71, 100, 100, 100, 100, 100, 100, 100, 78, | |||
100, 100, 100, 49, 100, 100, 100, 0, 83, 82, | |||
66, 100, 100, 74, 73, 66, 100, 100, 100, 100, | |||
100, 0, 100, 100, 100, 100, 0, 0, 0, 0, | |||
100, 100, 83, 82, 81, 80, 78, 73, 55, 53 | |||
0, 0, 102, 103, 103, 103, 0, 25, 27, 93, | |||
29, 103, 103, 33, 80, 11, 14, 23, 48, 0, | |||
91, 48, 54, 61, 103, 57, 103, 72, 82, 103, | |||
57, 74, 103, 103, 103, 103, 103, 103, 103, 81, | |||
103, 103, 103, 52, 66, 103, 103, 103, 0, 85, | |||
84, 68, 103, 103, 76, 75, 68, 103, 103, 103, | |||
103, 103, 103, 0, 103, 103, 103, 103, 0, 0, | |||
0, 0, 103, 103, 85, 84, 83, 82, 73, 71, | |||
66, 61 | |||
} ; | |||
static yyconst flex_int16_t yy_def[81] = | |||
static yyconst flex_int16_t yy_def[83] = | |||
{ 0, | |||
72, 1, 72, 72, 72, 72, 73, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 74, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 75, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 76, 72, 72, 72, 72, 77, 78, 79, 80, | |||
72, 0, 72, 72, 72, 72, 72, 72, 72, 72 | |||
74, 1, 74, 74, 74, 74, 75, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 76, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 77, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 78, 74, 74, 74, 74, 79, 80, | |||
81, 82, 74, 0, 74, 74, 74, 74, 74, 74, | |||
74, 74 | |||
} ; | |||
static yyconst flex_int16_t yy_nxt[131] = | |||
static yyconst flex_int16_t yy_nxt[135] = | |||
{ 0, | |||
4, 5, 6, 7, 8, 9, 10, 11, 4, 4, | |||
12, 13, 14, 4, 15, 4, 4, 4, 4, 4, | |||
16, 4, 4, 4, 17, 18, 19, 4, 4, 4, | |||
21, 22, 21, 22, 21, 22, 44, 24, 34, 35, | |||
36, 37, 38, 39, 24, 25, 26, 27, 28, 29, | |||
40, 45, 46, 47, 71, 30, 70, 31, 32, 21, | |||
22, 51, 24, 41, 42, 43, 23, 52, 24, 24, | |||
49, 49, 55, 50, 69, 24, 59, 60, 61, 68, | |||
56, 67, 62, 48, 20, 66, 65, 64, 63, 50, | |||
50, 58, 57, 54, 53, 23, 33, 23, 72, 3, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72 | |||
4, 21, 22, 21, 22, 21, 22, 40, 24, 34, | |||
35, 36, 37, 38, 39, 24, 25, 26, 27, 28, | |||
29, 41, 42, 43, 21, 22, 30, 24, 31, 32, | |||
44, 23, 73, 24, 24, 50, 50, 72, 51, 52, | |||
24, 56, 71, 45, 70, 53, 46, 47, 48, 57, | |||
60, 61, 62, 69, 64, 49, 20, 68, 67, 66, | |||
65, 51, 51, 63, 59, 58, 55, 54, 23, 33, | |||
23, 74, 3, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74 | |||
} ; | |||
static yyconst flex_int16_t yy_chk[131] = | |||
static yyconst flex_int16_t yy_chk[135] = | |||
{ 0, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |||
8, 8, 9, 9, 11, 11, 19, 11, 16, 16, | |||
16, 17, 17, 17, 11, 14, 14, 14, 14, 14, | |||
18, 19, 19, 19, 80, 14, 79, 14, 14, 22, | |||
22, 26, 22, 18, 18, 18, 23, 26, 23, 22, | |||
24, 24, 31, 24, 78, 23, 44, 44, 44, 77, | |||
31, 76, 75, 74, 73, 56, 55, 54, 51, 50, | |||
49, 40, 32, 29, 28, 21, 15, 10, 3, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72, | |||
72, 72, 72, 72, 72, 72, 72, 72, 72, 72 | |||
1, 8, 8, 9, 9, 11, 11, 18, 11, 16, | |||
16, 16, 17, 17, 17, 11, 14, 14, 14, 14, | |||
14, 18, 18, 18, 22, 22, 14, 22, 14, 14, | |||
19, 23, 82, 23, 22, 24, 24, 81, 24, 26, | |||
23, 31, 80, 19, 79, 26, 19, 19, 19, 31, | |||
44, 44, 44, 78, 77, 76, 75, 57, 56, 55, | |||
52, 51, 50, 45, 40, 32, 29, 28, 21, 15, | |||
10, 3, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74, 74, 74, 74, 74, 74, 74, | |||
74, 74, 74, 74 | |||
} ; | |||
/* The intent behind this definition is that it'll catch | |||
@@ -496,7 +501,7 @@ typedef lol::EasyMeshParser::token_type token_type; | |||
#define yyterminate() return token::T_END | |||
#define YY_NO_UNISTD_H | |||
#define YY_USER_ACTION yylloc->columns(yyleng); | |||
#line 500 "generated/easymesh-scanner.cpp" | |||
#line 505 "generated/easymesh-scanner.cpp" | |||
#define INITIAL 0 | |||
@@ -609,7 +614,7 @@ YY_DECL | |||
yylloc->step(); | |||
#line 613 "generated/easymesh-scanner.cpp" | |||
#line 618 "generated/easymesh-scanner.cpp" | |||
if ( !(yy_init) ) | |||
{ | |||
@@ -662,13 +667,13 @@ yy_match: | |||
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |||
{ | |||
yy_current_state = (int) yy_def[yy_current_state]; | |||
if ( yy_current_state >= 73 ) | |||
if ( yy_current_state >= 75 ) | |||
yy_c = yy_meta[(unsigned int) yy_c]; | |||
} | |||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |||
++yy_cp; | |||
} | |||
while ( yy_current_state != 72 ); | |||
while ( yy_current_state != 74 ); | |||
yy_cp = (yy_last_accepting_cpos); | |||
yy_current_state = (yy_last_accepting_state); | |||
@@ -776,86 +781,91 @@ YY_RULE_SETUP | |||
case 18: | |||
YY_RULE_SETUP | |||
#line 69 "easymesh/easymesh-scanner.l" | |||
{ return token::T_MIRRORX; } | |||
{ return token::T_TOGGLESCALEWINDING; } | |||
YY_BREAK | |||
case 19: | |||
YY_RULE_SETUP | |||
#line 70 "easymesh/easymesh-scanner.l" | |||
{ return token::T_MIRRORY; } | |||
{ return token::T_MIRRORX; } | |||
YY_BREAK | |||
case 20: | |||
YY_RULE_SETUP | |||
#line 71 "easymesh/easymesh-scanner.l" | |||
{ return token::T_MIRRORZ; } | |||
{ return token::T_MIRRORY; } | |||
YY_BREAK | |||
case 21: | |||
YY_RULE_SETUP | |||
#line 73 "easymesh/easymesh-scanner.l" | |||
{ return token::T_BOX; } | |||
#line 72 "easymesh/easymesh-scanner.l" | |||
{ return token::T_MIRRORZ; } | |||
YY_BREAK | |||
case 22: | |||
YY_RULE_SETUP | |||
#line 74 "easymesh/easymesh-scanner.l" | |||
{ return token::T_CYLINDER; } | |||
{ return token::T_BOX; } | |||
YY_BREAK | |||
case 23: | |||
YY_RULE_SETUP | |||
#line 75 "easymesh/easymesh-scanner.l" | |||
{ return token::T_CAPSULE; } | |||
{ return token::T_CYLINDER; } | |||
YY_BREAK | |||
case 24: | |||
YY_RULE_SETUP | |||
#line 76 "easymesh/easymesh-scanner.l" | |||
{ return token::T_COG; } | |||
{ return token::T_CAPSULE; } | |||
YY_BREAK | |||
case 25: | |||
YY_RULE_SETUP | |||
#line 77 "easymesh/easymesh-scanner.l" | |||
{ return token::T_DISC; } | |||
{ return token::T_COG; } | |||
YY_BREAK | |||
case 26: | |||
YY_RULE_SETUP | |||
#line 78 "easymesh/easymesh-scanner.l" | |||
{ return token::T_EXPANDEDSTAR; } | |||
{ return token::T_DISC; } | |||
YY_BREAK | |||
case 27: | |||
YY_RULE_SETUP | |||
#line 79 "easymesh/easymesh-scanner.l" | |||
{ return token::T_FLATCHAMFBOX; } | |||
{ return token::T_EXPANDEDSTAR; } | |||
YY_BREAK | |||
case 28: | |||
YY_RULE_SETUP | |||
#line 80 "easymesh/easymesh-scanner.l" | |||
{ return token::T_QUAD; } | |||
{ return token::T_FLATCHAMFBOX; } | |||
YY_BREAK | |||
case 29: | |||
YY_RULE_SETUP | |||
#line 81 "easymesh/easymesh-scanner.l" | |||
{ return token::T_STAR; } | |||
{ return token::T_QUAD; } | |||
YY_BREAK | |||
case 30: | |||
YY_RULE_SETUP | |||
#line 82 "easymesh/easymesh-scanner.l" | |||
{ return token::T_SMOOTHCHAMFBOX; } | |||
{ return token::T_STAR; } | |||
YY_BREAK | |||
case 31: | |||
YY_RULE_SETUP | |||
#line 83 "easymesh/easymesh-scanner.l" | |||
{ return token::T_SPHERE; } | |||
{ return token::T_SMOOTHCHAMFBOX; } | |||
YY_BREAK | |||
case 32: | |||
YY_RULE_SETUP | |||
#line 84 "easymesh/easymesh-scanner.l" | |||
{ return token::T_TRIANGLE; } | |||
{ return token::T_SPHERE; } | |||
YY_BREAK | |||
case 33: | |||
YY_RULE_SETUP | |||
#line 85 "easymesh/easymesh-scanner.l" | |||
{ return token::T_TORUS; } | |||
{ return token::T_TRIANGLE; } | |||
YY_BREAK | |||
case 34: | |||
YY_RULE_SETUP | |||
#line 87 "easymesh/easymesh-scanner.l" | |||
#line 86 "easymesh/easymesh-scanner.l" | |||
{ return token::T_TORUS; } | |||
YY_BREAK | |||
case 35: | |||
YY_RULE_SETUP | |||
#line 88 "easymesh/easymesh-scanner.l" | |||
{ | |||
uint32_t tmp = std::strtol(yytext + 1, NULL, 16); | |||
yylval->u32val = 0x11000000u * (tmp >> 8) | |||
@@ -864,9 +874,9 @@ YY_RULE_SETUP | |||
| 0x000000ffu; | |||
return token::COLOR; } | |||
YY_BREAK | |||
case 35: | |||
case 36: | |||
YY_RULE_SETUP | |||
#line 94 "easymesh/easymesh-scanner.l" | |||
#line 95 "easymesh/easymesh-scanner.l" | |||
{ | |||
uint32_t tmp = std::strtol(yytext + 1, NULL, 16); | |||
yylval->u32val = 0x11000000u * (tmp >> 12) | |||
@@ -875,64 +885,64 @@ YY_RULE_SETUP | |||
| 0x00000011u * (tmp & 0xf); | |||
return token::COLOR; } | |||
YY_BREAK | |||
case 36: | |||
case 37: | |||
YY_RULE_SETUP | |||
#line 101 "easymesh/easymesh-scanner.l" | |||
#line 102 "easymesh/easymesh-scanner.l" | |||
{ | |||
yylval->u32val = 0xffu | |||
| 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16); | |||
return token::COLOR; } | |||
YY_BREAK | |||
case 37: | |||
case 38: | |||
YY_RULE_SETUP | |||
#line 105 "easymesh/easymesh-scanner.l" | |||
#line 106 "easymesh/easymesh-scanner.l" | |||
{ | |||
yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16); | |||
return token::COLOR; } | |||
YY_BREAK | |||
case 38: | |||
case 39: | |||
YY_RULE_SETUP | |||
#line 108 "easymesh/easymesh-scanner.l" | |||
#line 109 "easymesh/easymesh-scanner.l" | |||
{ | |||
yylval->fval = std::atof(yytext); return token::NUMBER; } | |||
YY_BREAK | |||
case 39: | |||
YY_RULE_SETUP | |||
#line 110 "easymesh/easymesh-scanner.l" | |||
{ return token_type('-'); } | |||
YY_BREAK | |||
case 40: | |||
YY_RULE_SETUP | |||
#line 111 "easymesh/easymesh-scanner.l" | |||
{ return token_type('['); } | |||
{ return token_type('-'); } | |||
YY_BREAK | |||
case 41: | |||
YY_RULE_SETUP | |||
#line 112 "easymesh/easymesh-scanner.l" | |||
{ return token_type(']'); } | |||
{ return token_type('['); } | |||
YY_BREAK | |||
case 42: | |||
YY_RULE_SETUP | |||
#line 113 "easymesh/easymesh-scanner.l" | |||
{ /* ignore this */ } | |||
{ return token_type(']'); } | |||
YY_BREAK | |||
case 43: | |||
/* rule 43 can match eol */ | |||
YY_RULE_SETUP | |||
#line 114 "easymesh/easymesh-scanner.l" | |||
{ /* ignore this */ } | |||
YY_BREAK | |||
case 44: | |||
/* rule 44 can match eol */ | |||
YY_RULE_SETUP | |||
#line 115 "easymesh/easymesh-scanner.l" | |||
{ return token::T_ERROR; } | |||
{ /* ignore this */ } | |||
YY_BREAK | |||
case 45: | |||
YY_RULE_SETUP | |||
#line 117 "easymesh/easymesh-scanner.l" | |||
#line 116 "easymesh/easymesh-scanner.l" | |||
{ return token::T_ERROR; } | |||
YY_BREAK | |||
case 46: | |||
YY_RULE_SETUP | |||
#line 118 "easymesh/easymesh-scanner.l" | |||
ECHO; | |||
YY_BREAK | |||
#line 936 "generated/easymesh-scanner.cpp" | |||
#line 946 "generated/easymesh-scanner.cpp" | |||
case YY_STATE_EOF(INITIAL): | |||
yyterminate(); | |||
@@ -1314,7 +1324,7 @@ int yyFlexLexer::yy_get_next_buffer() | |||
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |||
{ | |||
yy_current_state = (int) yy_def[yy_current_state]; | |||
if ( yy_current_state >= 73 ) | |||
if ( yy_current_state >= 75 ) | |||
yy_c = yy_meta[(unsigned int) yy_c]; | |||
} | |||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |||
@@ -1342,11 +1352,11 @@ int yyFlexLexer::yy_get_next_buffer() | |||
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |||
{ | |||
yy_current_state = (int) yy_def[yy_current_state]; | |||
if ( yy_current_state >= 73 ) | |||
if ( yy_current_state >= 75 ) | |||
yy_c = yy_meta[(unsigned int) yy_c]; | |||
} | |||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |||
yy_is_jam = (yy_current_state == 72); | |||
yy_is_jam = (yy_current_state == 74); | |||
return yy_is_jam ? 0 : yy_current_state; | |||
} | |||
@@ -1833,7 +1843,7 @@ void EasyMeshfree (void * ptr ) | |||
#define YYTABLES_NAME "yytables" | |||
#line 117 "easymesh/easymesh-scanner.l" | |||
#line 118 "easymesh/easymesh-scanner.l" | |||
@@ -1,8 +1,8 @@ | |||
/* A Bison parser, made by GNU Bison 2.5. */ | |||
/* A Bison parser, made by GNU Bison 2.4.2. */ | |||
/* Locations for Bison parsers in C++ | |||
Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. | |||
Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. | |||
This program is free software: you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
@@ -1,8 +1,8 @@ | |||
/* A Bison parser, made by GNU Bison 2.5. */ | |||
/* A Bison parser, made by GNU Bison 2.4.2. */ | |||
/* Skeleton implementation for Bison LALR(1) parsers in C++ | |||
Copyright (C) 2002-2011 Free Software Foundation, Inc. | |||
Copyright (C) 2002-2010 Free Software Foundation, Inc. | |||
This program is free software: you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
@@ -35,7 +35,7 @@ | |||
/* First part of user declarations. */ | |||
/* Line 293 of lalr1.cc */ | |||
/* Line 310 of lalr1.cc */ | |||
#line 1 "gpu/lolfx-parser.y" | |||
// | |||
@@ -58,7 +58,7 @@ | |||
/* Line 293 of lalr1.cc */ | |||
/* Line 310 of lalr1.cc */ | |||
#line 63 "generated/lolfx-parser.cpp" | |||
@@ -66,7 +66,7 @@ | |||
/* User implementation prologue. */ | |||
/* Line 299 of lalr1.cc */ | |||
/* Line 316 of lalr1.cc */ | |||
#line 241 "gpu/lolfx-parser.y" | |||
#include "gpu/lolfx-compiler.h" | |||
@@ -75,7 +75,7 @@ | |||
#define yylex mc.m_lexer->lex | |||
/* Line 299 of lalr1.cc */ | |||
/* Line 316 of lalr1.cc */ | |||
#line 80 "generated/lolfx-parser.cpp" | |||
#ifndef YY_ | |||
@@ -90,26 +90,6 @@ | |||
# endif | |||
#endif | |||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |||
If N is 0, then set CURRENT to the empty location which ends | |||
the previous symbol: RHS[0] (always defined). */ | |||
#define YYRHSLOC(Rhs, K) ((Rhs)[K]) | |||
#ifndef YYLLOC_DEFAULT | |||
# define YYLLOC_DEFAULT(Current, Rhs, N) \ | |||
do \ | |||
if (N) \ | |||
{ \ | |||
(Current).begin = YYRHSLOC (Rhs, 1).begin; \ | |||
(Current).end = YYRHSLOC (Rhs, N).end; \ | |||
} \ | |||
else \ | |||
{ \ | |||
(Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ | |||
} \ | |||
while (false) | |||
#endif | |||
/* Suppress unused-variable warnings by "using" E. */ | |||
#define YYUSE(e) ((void) (e)) | |||
@@ -161,8 +141,9 @@ do { \ | |||
namespace lol { | |||
/* Line 382 of lalr1.cc */ | |||
#line 166 "generated/lolfx-parser.cpp" | |||
/* Line 379 of lalr1.cc */ | |||
#line 146 "generated/lolfx-parser.cpp" | |||
#if YYERROR_VERBOSE | |||
/* Return YYSTR after stripping away unnecessary quotes and | |||
backslashes, so that it's suitable for yyerror. The heuristic is | |||
@@ -201,6 +182,7 @@ namespace lol { | |||
return yystr; | |||
} | |||
#endif | |||
/// Build a parser object. | |||
LolFxParser::LolFxParser (class LolFxCompiler& mc_yyarg) | |||
@@ -301,18 +283,6 @@ namespace lol { | |||
} | |||
#endif | |||
inline bool | |||
LolFxParser::yy_pact_value_is_default_ (int yyvalue) | |||
{ | |||
return yyvalue == yypact_ninf_; | |||
} | |||
inline bool | |||
LolFxParser::yy_table_value_is_error_ (int yyvalue) | |||
{ | |||
return yyvalue == yytable_ninf_; | |||
} | |||
int | |||
LolFxParser::parse () | |||
{ | |||
@@ -334,7 +304,7 @@ namespace lol { | |||
/// Location of the lookahead. | |||
location_type yylloc; | |||
/// The locations where the error started and ended. | |||
location_type yyerror_range[3]; | |||
location_type yyerror_range[2]; | |||
/// $$. | |||
semantic_type yyval; | |||
@@ -372,7 +342,7 @@ namespace lol { | |||
/* Try to take a decision without lookahead. */ | |||
yyn = yypact_[yystate]; | |||
if (yy_pact_value_is_default_ (yyn)) | |||
if (yyn == yypact_ninf_) | |||
goto yydefault; | |||
/* Read a lookahead token. */ | |||
@@ -405,8 +375,8 @@ namespace lol { | |||
yyn = yytable_[yyn]; | |||
if (yyn <= 0) | |||
{ | |||
if (yy_table_value_is_error_ (yyn)) | |||
goto yyerrlab; | |||
if (yyn == 0 || yyn == yytable_ninf_) | |||
goto yyerrlab; | |||
yyn = -yyn; | |||
goto yyreduce; | |||
} | |||
@@ -462,57 +432,46 @@ namespace lol { | |||
{ | |||
case 202: | |||
/* Line 690 of lalr1.cc */ | |||
/* Line 677 of lalr1.cc */ | |||
#line 728 "gpu/lolfx-parser.y" | |||
{ std::cout << "New tech " << std::endl; } | |||
break; | |||
case 203: | |||
/* Line 690 of lalr1.cc */ | |||
/* Line 677 of lalr1.cc */ | |||
#line 736 "gpu/lolfx-parser.y" | |||
{ std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } | |||
break; | |||
case 204: | |||
/* Line 690 of lalr1.cc */ | |||
/* Line 677 of lalr1.cc */ | |||
#line 737 "gpu/lolfx-parser.y" | |||
{ std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } | |||
break; | |||
case 207: | |||
/* Line 690 of lalr1.cc */ | |||
/* Line 677 of lalr1.cc */ | |||
#line 750 "gpu/lolfx-parser.y" | |||
{ std::cout << "New pass " << std::endl; } | |||
break; | |||
case 226: | |||
/* Line 690 of lalr1.cc */ | |||
/* Line 677 of lalr1.cc */ | |||
#line 786 "gpu/lolfx-parser.y" | |||
{ std::cout << "new shader" << std::endl; } | |||
break; | |||
/* Line 690 of lalr1.cc */ | |||
#line 502 "generated/lolfx-parser.cpp" | |||
/* Line 677 of lalr1.cc */ | |||
#line 472 "generated/lolfx-parser.cpp" | |||
default: | |||
break; | |||
} | |||
/* User semantic actions sometimes alter yychar, and that requires | |||
that yytoken be updated with the new translation. We take the | |||
approach of translating immediately before every use of yytoken. | |||
One alternative is translating here after every semantic action, | |||
but that translation would be missed if the semantic action | |||
invokes YYABORT, YYACCEPT, or YYERROR immediately after altering | |||
yychar. In the case of YYABORT or YYACCEPT, an incorrect | |||
destructor might then be invoked immediately. In the case of | |||
YYERROR, subsequent parser actions might lead to an incorrect | |||
destructor call or verbose syntax error message before the | |||
lookahead is translated. */ | |||
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); | |||
yypop_ (yylen); | |||
@@ -536,20 +495,14 @@ namespace lol { | |||
| yyerrlab -- here on detecting error | | |||
`------------------------------------*/ | |||
yyerrlab: | |||
/* Make sure we have latest lookahead translation. See comments at | |||
user semantic actions for why this is necessary. */ | |||
yytoken = yytranslate_ (yychar); | |||
/* If not already recovering from an error, report this error. */ | |||
if (!yyerrstatus_) | |||
{ | |||
++yynerrs_; | |||
if (yychar == yyempty_) | |||
yytoken = yyempty_; | |||
error (yylloc, yysyntax_error_ (yystate, yytoken)); | |||
} | |||
yyerror_range[1] = yylloc; | |||
yyerror_range[0] = yylloc; | |||
if (yyerrstatus_ == 3) | |||
{ | |||
/* If just tried and failed to reuse lookahead token after an | |||
@@ -584,7 +537,7 @@ namespace lol { | |||
if (false) | |||
goto yyerrorlab; | |||
yyerror_range[1] = yylocation_stack_[yylen - 1]; | |||
yyerror_range[0] = yylocation_stack_[yylen - 1]; | |||
/* Do not reclaim the symbols of the rule which action triggered | |||
this YYERROR. */ | |||
yypop_ (yylen); | |||
@@ -601,7 +554,7 @@ namespace lol { | |||
for (;;) | |||
{ | |||
yyn = yypact_[yystate]; | |||
if (!yy_pact_value_is_default_ (yyn)) | |||
if (yyn != yypact_ninf_) | |||
{ | |||
yyn += yyterror_; | |||
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) | |||
@@ -616,7 +569,7 @@ namespace lol { | |||
if (yystate_stack_.height () == 1) | |||
YYABORT; | |||
yyerror_range[1] = yylocation_stack_[0]; | |||
yyerror_range[0] = yylocation_stack_[0]; | |||
yydestruct_ ("Error: popping", | |||
yystos_[yystate], | |||
&yysemantic_stack_[0], &yylocation_stack_[0]); | |||
@@ -625,10 +578,10 @@ namespace lol { | |||
YY_STACK_PRINT (); | |||
} | |||
yyerror_range[2] = yylloc; | |||
yyerror_range[1] = yylloc; | |||
// Using YYLLOC is tempting, but would change the location of | |||
// the lookahead. YYLOC is available though. | |||
YYLLOC_DEFAULT (yyloc, yyerror_range, 2); | |||
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); | |||
yysemantic_stack_.push (yylval); | |||
yylocation_stack_.push (yyloc); | |||
@@ -651,13 +604,7 @@ namespace lol { | |||
yyreturn: | |||
if (yychar != yyempty_) | |||
{ | |||
/* Make sure we have latest lookahead translation. See comments | |||
at user semantic actions for why this is necessary. */ | |||
yytoken = yytranslate_ (yychar); | |||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, | |||
&yylloc); | |||
} | |||
yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); | |||
/* Do not reclaim the symbols of the rule which action triggered | |||
this YYABORT or YYACCEPT. */ | |||
@@ -676,97 +623,51 @@ namespace lol { | |||
// Generate an error message. | |||
std::string | |||
LolFxParser::yysyntax_error_ (int yystate, int yytoken) | |||
LolFxParser::yysyntax_error_ (int yystate, int tok) | |||
{ | |||
std::string yyres; | |||
// Number of reported tokens (one for the "unexpected", one per | |||
// "expected"). | |||
size_t yycount = 0; | |||
// Its maximum. | |||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |||
// Arguments of yyformat. | |||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |||
/* There are many possibilities here to consider: | |||
- If this state is a consistent state with a default action, then | |||
the only way this function was invoked is if the default action | |||
is an error action. In that case, don't check for expected | |||
tokens because there are none. | |||
- The only way there can be no lookahead present (in yytoken) is | |||
if this state is a consistent state with a default action. | |||
Thus, detecting the absence of a lookahead is sufficient to | |||
determine that there is no unexpected or expected token to | |||
report. In that case, just report a simple "syntax error". | |||
- Don't assume there isn't a lookahead just because this state is | |||
a consistent state with a default action. There might have | |||
been a previous inconsistent state, consistent state with a | |||
non-default action, or user semantic action that manipulated | |||
yychar. | |||
- Of course, the expected token list depends on states to have | |||
correct lookahead information, and it depends on the parser not | |||
to perform extra reductions after fetching a lookahead from the | |||
scanner and before detecting a syntax error. Thus, state | |||
merging (from LALR or IELR) and default reductions corrupt the | |||
expected token list. However, the list is correct for | |||
canonical LR with one exception: it will still contain any | |||
token that will not be accepted due to an error action in a | |||
later state. | |||
*/ | |||
if (yytoken != yyempty_) | |||
{ | |||
yyarg[yycount++] = yytname_[yytoken]; | |||
int yyn = yypact_[yystate]; | |||
if (!yy_pact_value_is_default_ (yyn)) | |||
{ | |||
/* Start YYX at -YYN if negative to avoid negative indexes in | |||
YYCHECK. In other words, skip the first -YYN actions for | |||
this state because they are default actions. */ | |||
int yyxbegin = yyn < 0 ? -yyn : 0; | |||
/* Stay within bounds of both yycheck and yytname. */ | |||
int yychecklim = yylast_ - yyn + 1; | |||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; | |||
for (int yyx = yyxbegin; yyx < yyxend; ++yyx) | |||
if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ | |||
&& !yy_table_value_is_error_ (yytable_[yyx + yyn])) | |||
{ | |||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |||
{ | |||
yycount = 1; | |||
break; | |||
} | |||
else | |||
yyarg[yycount++] = yytname_[yyx]; | |||
} | |||
} | |||
} | |||
char const* yyformat = 0; | |||
switch (yycount) | |||
std::string res; | |||
YYUSE (yystate); | |||
#if YYERROR_VERBOSE | |||
int yyn = yypact_[yystate]; | |||
if (yypact_ninf_ < yyn && yyn <= yylast_) | |||
{ | |||
#define YYCASE_(N, S) \ | |||
case N: \ | |||
yyformat = S; \ | |||
break | |||
YYCASE_(0, YY_("syntax error")); | |||
YYCASE_(1, YY_("syntax error, unexpected %s")); | |||
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |||
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |||
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |||
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |||
#undef YYCASE_ | |||
/* Start YYX at -YYN if negative to avoid negative indexes in | |||
YYCHECK. */ | |||
int yyxbegin = yyn < 0 ? -yyn : 0; | |||
/* Stay within bounds of both yycheck and yytname. */ | |||
int yychecklim = yylast_ - yyn + 1; | |||
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; | |||
int count = 0; | |||
for (int x = yyxbegin; x < yyxend; ++x) | |||
if (yycheck_[x + yyn] == x && x != yyterror_) | |||
++count; | |||
// FIXME: This method of building the message is not compatible | |||
// with internationalization. It should work like yacc.c does it. | |||
// That is, first build a string that looks like this: | |||
// "syntax error, unexpected %s or %s or %s" | |||
// Then, invoke YY_ on this string. | |||
// Finally, use the string as a format to output | |||
// yytname_[tok], etc. | |||
// Until this gets fixed, this message appears in English only. | |||
res = "syntax error, unexpected "; | |||
res += yytnamerr_ (yytname_[tok]); | |||
if (count < 5) | |||
{ | |||
count = 0; | |||
for (int x = yyxbegin; x < yyxend; ++x) | |||
if (yycheck_[x + yyn] == x && x != yyterror_) | |||
{ | |||
res += (!count++) ? ", expecting " : " or "; | |||
res += yytnamerr_ (yytname_[x]); | |||
} | |||
} | |||
} | |||
// Argument number. | |||
size_t yyi = 0; | |||
for (char const* yyp = yyformat; *yyp; ++yyp) | |||
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) | |||
{ | |||
yyres += yytnamerr_ (yyarg[yyi++]); | |||
++yyp; | |||
} | |||
else | |||
yyres += *yyp; | |||
return yyres; | |||
else | |||
#endif | |||
res = YY_("syntax error"); | |||
return res; | |||
} | |||
@@ -845,9 +746,9 @@ namespace lol { | |||
-68, -559, -559, -559, -559 | |||
}; | |||
/* YYDEFACT[S] -- default reduction number in state S. Performed when | |||
YYTABLE doesn't specify something else to do. Zero means the | |||
default is an error. */ | |||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE | |||
doesn't specify something else to do. Zero means the default is an | |||
error. */ | |||
const unsigned short int | |||
LolFxParser::yydefact_[] = | |||
{ | |||
@@ -954,7 +855,7 @@ namespace lol { | |||
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |||
positive, shift that token. If negative, reduce the rule which | |||
number is the opposite. If YYTABLE_NINF_, syntax error. */ | |||
number is the opposite. If zero, do what YYDEFACT says. */ | |||
const short int LolFxParser::yytable_ninf_ = -323; | |||
const short int | |||
LolFxParser::yytable_[] = | |||
@@ -3890,11 +3791,11 @@ namespace lol { | |||
} // lol | |||
/* Line 1136 of lalr1.cc */ | |||
#line 3895 "generated/lolfx-parser.cpp" | |||
/* Line 1053 of lalr1.cc */ | |||
#line 3796 "generated/lolfx-parser.cpp" | |||
/* Line 1138 of lalr1.cc */ | |||
/* Line 1055 of lalr1.cc */ | |||
#line 1298 "gpu/lolfx-parser.y" | |||
@@ -1,8 +1,8 @@ | |||
/* A Bison parser, made by GNU Bison 2.5. */ | |||
/* A Bison parser, made by GNU Bison 2.4.2. */ | |||
/* Skeleton interface for Bison LALR(1) parsers in C++ | |||
Copyright (C) 2002-2011 Free Software Foundation, Inc. | |||
Copyright (C) 2002-2010 Free Software Foundation, Inc. | |||
This program is free software: you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
@@ -40,6 +40,20 @@ | |||
#include <string> | |||
#include <iostream> | |||
#include "stack.hh" | |||
namespace lol { | |||
/* Line 34 of lalr1.cc */ | |||
#line 49 "generated/lolfx-parser.h" | |||
class position; | |||
class location; | |||
} // lol | |||
/* Line 34 of lalr1.cc */ | |||
#line 56 "generated/lolfx-parser.h" | |||
#include "location.hh" | |||
/* Enabling traces. */ | |||
@@ -60,11 +74,30 @@ | |||
# define YYTOKEN_TABLE 0 | |||
#endif | |||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |||
If N is 0, then set CURRENT to the empty location which ends | |||
the previous symbol: RHS[0] (always defined). */ | |||
#ifndef YYLLOC_DEFAULT | |||
# define YYLLOC_DEFAULT(Current, Rhs, N) \ | |||
do { \ | |||
if (N) \ | |||
{ \ | |||
(Current).begin = (Rhs)[1].begin; \ | |||
(Current).end = (Rhs)[N].end; \ | |||
} \ | |||
else \ | |||
{ \ | |||
(Current).begin = (Current).end = (Rhs)[0].end; \ | |||
} \ | |||
} while (false) | |||
#endif | |||
namespace lol { | |||
/* Line 35 of lalr1.cc */ | |||
#line 68 "generated/lolfx-parser.h" | |||
/* Line 34 of lalr1.cc */ | |||
#line 101 "generated/lolfx-parser.h" | |||
/// A Bison parser. | |||
class LolFxParser | |||
@@ -75,7 +108,7 @@ namespace lol { | |||
union semantic_type | |||
{ | |||
/* Line 35 of lalr1.cc */ | |||
/* Line 34 of lalr1.cc */ | |||
#line 34 "gpu/lolfx-parser.y" | |||
int ival; | |||
@@ -85,8 +118,8 @@ namespace lol { | |||
/* Line 35 of lalr1.cc */ | |||
#line 90 "generated/lolfx-parser.h" | |||
/* Line 34 of lalr1.cc */ | |||
#line 123 "generated/lolfx-parser.h" | |||
}; | |||
#else | |||
typedef YYSTYPE semantic_type; | |||
@@ -607,14 +640,6 @@ namespace lol { | |||
/// The location stack. | |||
location_stack_type yylocation_stack_; | |||
/// Whether the given \c yypact_ value indicates a defaulted state. | |||
/// \param yyvalue the value to check | |||
static bool yy_pact_value_is_default_ (int yyvalue); | |||
/// Whether the given \c yytable_ value indicates a syntax error. | |||
/// \param yyvalue the value to check | |||
static bool yy_table_value_is_error_ (int yyvalue); | |||
/// Internal symbol numbers. | |||
typedef unsigned short int token_number_type; | |||
/* Tables. */ | |||
@@ -622,7 +647,7 @@ namespace lol { | |||
static const short int yypact_[]; | |||
static const short int yypact_ninf_; | |||
/// For a state, default reduction number. | |||
/// For a state, default rule to reduce. | |||
/// Unless\a yytable_ specifies something else to do. | |||
/// Zero means the default is an error. | |||
static const unsigned short int yydefact_[]; | |||
@@ -653,8 +678,10 @@ namespace lol { | |||
static const char* const yytname_[]; | |||
#endif | |||
#if YYERROR_VERBOSE | |||
/// Convert the symbol name \a n to a form suitable for a diagnostic. | |||
static std::string yytnamerr_ (const char *n); | |||
virtual std::string yytnamerr_ (const char *n); | |||
#endif | |||
#if YYDEBUG | |||
/// A type to store symbol numbers and -1. | |||
@@ -712,8 +739,8 @@ namespace lol { | |||
} // lol | |||
/* Line 35 of lalr1.cc */ | |||
#line 717 "generated/lolfx-parser.h" | |||
/* Line 34 of lalr1.cc */ | |||
#line 744 "generated/lolfx-parser.h" | |||
@@ -1,8 +1,8 @@ | |||
/* A Bison parser, made by GNU Bison 2.5. */ | |||
/* A Bison parser, made by GNU Bison 2.4.2. */ | |||
/* Positions for Bison parsers in C++ | |||
Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. | |||
Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc. | |||
This program is free software: you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
@@ -1,8 +1,8 @@ | |||
/* A Bison parser, made by GNU Bison 2.5. */ | |||
/* A Bison parser, made by GNU Bison 2.4.2. */ | |||
/* Stack handling for Bison parsers in C++ | |||
Copyright (C) 2002-2011 Free Software Foundation, Inc. | |||
Copyright (C) 2002-2010 Free Software Foundation, Inc. | |||
This program is free software: you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
@@ -38,7 +38,7 @@ | |||
namespace lol { | |||
/* Line 1149 of lalr1.cc */ | |||
/* Line 1066 of lalr1.cc */ | |||
#line 43 "generated/stack.hh" | |||
template <class T, class S = std::deque<T> > | |||
class stack | |||
@@ -128,7 +128,7 @@ namespace lol { | |||
} // lol | |||
/* Line 1235 of lalr1.cc */ | |||
/* Line 1152 of lalr1.cc */ | |||
#line 133 "generated/stack.hh" | |||
#endif // not BISON_STACK_HH[]dnl | |||
@@ -116,12 +116,12 @@ public: | |||
//MeshRand << "[sc#daa afcb2 2 2 -.1]"; | |||
//MeshRand << "[sc#ada afcb2 2 2 -.1]"; | |||
//MeshRand << "[sc#aad afcb2 2 2 -.1]"; | |||
MeshRand << "[sc#add afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#dad afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#dda afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#daa afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#ada afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#aad afcb1.7 1.7 1.7 0][sc#000 afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#add afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#dad afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#dda afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#daa afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#ada afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
MeshRand << "[sc#aad afcb1.7 1.7 1.7 0][sc#000 tsw afcb1.9 1.9 1.9 0 sx-1 sy-1 sz-1]"; | |||
int SphereLimit = MeshRand.Count(); | |||