diff --git a/test/data/mesh-buffer.txt b/test/data/mesh-buffer.txt index 2272845d..bb95940d 100644 --- a/test/data/mesh-buffer.txt +++ b/test/data/mesh-buffer.txt @@ -1,16 +1,22 @@ -addlight 0.0 position (1 -1 1) color #fff -addlight 0.0 position (-1 -1 -1) color #fff -clearcolor #000 +addlight 0 position (4 -4 0) color #fff +addlight 1 position (0 0 6) color #bfb +clearcolor #d0d +showgizmo true +showlight true + +//SCENE SETUP END + //addlight 0.0 position (1 0 1) color #0ff //addlight 0.0 position (-0.2 -1 -0.5) color (.0 .2 .5 1) //custom setmesh "sc#f00 ab 2 ty 1.5 ab 2" + custom setmesh " -tqw +//tqw //CMD TEST -//sc#0f0 ab 1 +sc#0f0 ab 5 //sc#0f0 afcb 1 -.2 //sc#0f0 acg 8 1 1 1 2 2 1.5 1.5 -.4 //sc#0f0 as 6 1 2 @@ -19,13 +25,17 @@ tqw //sc#0f0 aq 1 //splt 2 smth 4 0 1 -//[sc#0f0 ac 3 .5 .4 0 false false true ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 .1 false false true ty .5 dup [ rz 90 ry 90 scv#00f dup [ ry 90 scv#f00 ] ] ] -//[sc#fff ab 1 tx 2] +//[sc#0f0 ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 ty .5 dup [ rz 90 ry 90 scv#00f dup [ ry 90 scv#f00 ] ] ] +//[sc#fff ab .1] + +//[sc#0f0 ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 ty .5 dup[rz 90 ry 90 scv#00f dup[ry 90 scv#f00]]][sc#fff ab .1] //[sc#fff ab 1 tx .5 ty .5] //[sc#fff ab 1 tx -.5 ty -.5] +//[sc#fff ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 ty .5 [ad 3 .1 sy -1] ty 1] + //smth 3 1 1 smth 8 0 1 //[sc#fff loop 4 [ [loop 4 [ab 1 tx 2]] tz 2]] @@ -40,8 +50,6 @@ tqw " - - //splt 0 //test //[sc#f8f ab 1 splt 4 twy 90] diff --git a/test/generated/scenesetup-parser.cpp b/test/generated/scenesetup-parser.cpp index 6c171858..8789e84e 100644 --- a/test/generated/scenesetup-parser.cpp +++ b/test/generated/scenesetup-parser.cpp @@ -67,7 +67,7 @@ /* User implementation prologue. */ /* Line 316 of lalr1.cc */ -#line 75 "scenesetup-parser.y" +#line 76 "scenesetup-parser.y" #include "../scenesetup-compiler.h" @@ -435,49 +435,49 @@ namespace lol { YY_REDUCE_PRINT (yyn); switch (yyn) { - case 11: + case 12: /* Line 677 of lalr1.cc */ -#line 114 "scenesetup-parser.y" +#line 116 "scenesetup-parser.y" { uc.m_sstp.m_lights << new Light(); uc.m_last_cmd = "ADDLIGHT"; } break; - case 12: + case 13: /* Line 677 of lalr1.cc */ -#line 115 "scenesetup-parser.y" +#line 117 "scenesetup-parser.y" { uc.m_sstp.m_lights << new Light(); uc.m_last_cmd = "ADDLIGHT"; uc.m_sstp.m_lights.Last()->SetPosition(vec4(vec3::zero, (yysemantic_stack_[(2) - (2)].fval))); } break; - case 13: + case 14: /* Line 677 of lalr1.cc */ -#line 120 "scenesetup-parser.y" +#line 122 "scenesetup-parser.y" { if (uc.m_last_cmd == "ADDLIGHT") uc.m_sstp.m_lights.Last()->SetPosition(vec4(vec3((yysemantic_stack_[(2) - (2)].vval)[0], (yysemantic_stack_[(2) - (2)].vval)[1], (yysemantic_stack_[(2) - (2)].vval)[2]), uc.m_sstp.m_lights.Last()->GetPosition().w)); } break; - case 14: + case 15: /* Line 677 of lalr1.cc */ -#line 122 "scenesetup-parser.y" +#line 124 "scenesetup-parser.y" { if (uc.m_last_cmd == "ADDLIGHT") { /* */ } } break; - case 15: + case 16: /* Line 677 of lalr1.cc */ -#line 124 "scenesetup-parser.y" +#line 126 "scenesetup-parser.y" { if (uc.m_last_cmd == "ADDLIGHT") uc.m_sstp.m_lights.Last()->SetColor(vec4((yysemantic_stack_[(2) - (2)].vval)[0], (yysemantic_stack_[(2) - (2)].vval)[1], (yysemantic_stack_[(2) - (2)].vval)[2], (yysemantic_stack_[(2) - (2)].vval)[3])); } break; - case 16: + case 17: /* Line 677 of lalr1.cc */ -#line 126 "scenesetup-parser.y" +#line 128 "scenesetup-parser.y" { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); ivec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); vec4 vv = vec4(v) * (1.f / 255.f); @@ -485,133 +485,175 @@ namespace lol { uc.m_sstp.m_lights.Last()->SetColor(vv); } break; - case 17: + case 18: /* Line 677 of lalr1.cc */ -#line 131 "scenesetup-parser.y" +#line 136 "scenesetup-parser.y" { uc.m_sstp.m_clear_color = vec4((yysemantic_stack_[(2) - (2)].vval)[0], (yysemantic_stack_[(2) - (2)].vval)[1], (yysemantic_stack_[(2) - (2)].vval)[2], (yysemantic_stack_[(2) - (2)].vval)[3]); } break; - case 18: + case 19: + +/* Line 677 of lalr1.cc */ +#line 137 "scenesetup-parser.y" + { uc.m_sstp.m_clear_color = vec4((yysemantic_stack_[(5) - (2)].vval)[0], (yysemantic_stack_[(5) - (2)].vval)[1], (yysemantic_stack_[(5) - (2)].vval)[2], 1.f); } + break; + + case 20: /* Line 677 of lalr1.cc */ -#line 132 "scenesetup-parser.y" +#line 138 "scenesetup-parser.y" { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); ivec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); uc.m_sstp.m_clear_color = vec4(v) * (1.f / 255.f); } break; - case 19: + case 21: /* Line 677 of lalr1.cc */ -#line 137 "scenesetup-parser.y" +#line 140 "scenesetup-parser.y" + { uc.m_sstp.m_show_gizmo = (yysemantic_stack_[(2) - (2)].bval); } + break; + + case 22: + +/* Line 677 of lalr1.cc */ +#line 141 "scenesetup-parser.y" + { uc.m_sstp.m_show_lights = (yysemantic_stack_[(2) - (2)].bval); } + break; + + case 23: + +/* Line 677 of lalr1.cc */ +#line 145 "scenesetup-parser.y" { uc.m_sstp.m_custom_cmd.Push((yysemantic_stack_[(3) - (2)].svval), (yysemantic_stack_[(3) - (3)].sval)); } break; - case 20: + case 24: /* Line 677 of lalr1.cc */ -#line 143 "scenesetup-parser.y" +#line 151 "scenesetup-parser.y" { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } break; - case 21: + case 25: /* Line 677 of lalr1.cc */ -#line 144 "scenesetup-parser.y" +#line 152 "scenesetup-parser.y" { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } break; - case 22: + case 26: /* Line 677 of lalr1.cc */ -#line 145 "scenesetup-parser.y" +#line 153 "scenesetup-parser.y" { (yyval.fval) = (float)(yysemantic_stack_[(1) - (1)].ival); } break; - case 23: + case 27: /* Line 677 of lalr1.cc */ -#line 146 "scenesetup-parser.y" +#line 154 "scenesetup-parser.y" { (yyval.fval) = -(float)(yysemantic_stack_[(2) - (2)].ival); } break; - case 24: + case 28: /* Line 677 of lalr1.cc */ -#line 150 "scenesetup-parser.y" +#line 158 "scenesetup-parser.y" { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); } break; - case 25: + case 29: /* Line 677 of lalr1.cc */ -#line 151 "scenesetup-parser.y" +#line 159 "scenesetup-parser.y" { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); } break; - case 26: + case 30: /* Line 677 of lalr1.cc */ -#line 152 "scenesetup-parser.y" +#line 160 "scenesetup-parser.y" { (yyval.ival) = (int)(yysemantic_stack_[(1) - (1)].fval); } break; - case 27: + case 31: /* Line 677 of lalr1.cc */ -#line 153 "scenesetup-parser.y" +#line 161 "scenesetup-parser.y" { (yyval.ival) = -(int)(yysemantic_stack_[(2) - (2)].fval); } break; - case 28: + case 32: /* Line 677 of lalr1.cc */ -#line 158 "scenesetup-parser.y" +#line 166 "scenesetup-parser.y" { (yyval.vval)[0] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[2] = (yysemantic_stack_[(3) - (2)].fval); } break; - case 29: + case 33: /* Line 677 of lalr1.cc */ -#line 159 "scenesetup-parser.y" +#line 167 "scenesetup-parser.y" { (yyval.vval)[0] = (yysemantic_stack_[(5) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(5) - (3)].fval); (yyval.vval)[2] = (yysemantic_stack_[(5) - (4)].fval); } break; - case 30: + case 34: /* Line 677 of lalr1.cc */ -#line 168 "scenesetup-parser.y" +#line 176 "scenesetup-parser.y" { (yyval.vval)[0] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[2] = (yysemantic_stack_[(3) - (2)].fval); (yyval.vval)[3] = (yysemantic_stack_[(3) - (2)].fval); } break; - case 31: + case 35: /* Line 677 of lalr1.cc */ -#line 169 "scenesetup-parser.y" +#line 177 "scenesetup-parser.y" { (yyval.vval)[0] = (yysemantic_stack_[(6) - (2)].fval); (yyval.vval)[1] = (yysemantic_stack_[(6) - (3)].fval); (yyval.vval)[2] = (yysemantic_stack_[(6) - (4)].fval); (yyval.vval)[3] = (yysemantic_stack_[(6) - (5)].fval); } break; - case 32: + case 36: /* Line 677 of lalr1.cc */ -#line 180 "scenesetup-parser.y" - { (yyval.svval) = (yysemantic_stack_[(1) - (1)].svval); } +#line 182 "scenesetup-parser.y" + { (yyval.bval) = (yysemantic_stack_[(1) - (1)].bval); } break; - case 33: + case 37: + +/* Line 677 of lalr1.cc */ +#line 183 "scenesetup-parser.y" + { (yyval.bval) = !!(yysemantic_stack_[(1) - (1)].ival); } + break; + + case 38: /* Line 677 of lalr1.cc */ #line 184 "scenesetup-parser.y" + { (yyval.bval) = !!(yysemantic_stack_[(1) - (1)].fval); } + break; + + case 39: + +/* Line 677 of lalr1.cc */ +#line 188 "scenesetup-parser.y" + { (yyval.svval) = (yysemantic_stack_[(1) - (1)].svval); } + break; + + case 40: + +/* Line 677 of lalr1.cc */ +#line 192 "scenesetup-parser.y" { String t = (yysemantic_stack_[(1) - (1)].sval); t.Replace('"', ' ', true); free((yysemantic_stack_[(1) - (1)].sval)); (yyval.sval) = strdup((const char *)t.C()); } break; - case 34: + case 41: /* Line 677 of lalr1.cc */ -#line 188 "scenesetup-parser.y" +#line 196 "scenesetup-parser.y" { String t = (yysemantic_stack_[(2) - (1)].sval); t += (yysemantic_stack_[(2) - (2)].sval); t.Replace('"', ' ', true); @@ -623,7 +665,7 @@ namespace lol { /* Line 677 of lalr1.cc */ -#line 627 "generated/scenesetup-parser.cpp" +#line 669 "generated/scenesetup-parser.cpp" default: break; } @@ -828,16 +870,17 @@ namespace lol { /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const signed char SceneSetupParser::yypact_ninf_ = -18; + const signed char SceneSetupParser::yypact_ninf_ = -20; const signed char SceneSetupParser::yypact_[] = { - 30, 8, -13, -13, -6, -2, 3, 1, 26, 30, - 30, -18, -18, -18, -18, -18, -18, 12, -18, 8, - -18, -18, -18, 8, -18, -18, -18, -18, 14, -18, - -18, -18, -18, -18, -18, 12, -18, -18, -8, -4, - 14, -18, -18, -18, -18, 8, -18, 8, -18, 13, - 8, -18, 21, -18 + 38, 4, -18, -18, -7, 14, 16, 16, -10, 15, + 21, 38, 38, -20, -20, -20, -20, -20, -20, -20, + 6, -20, 4, -20, -20, -20, 4, -20, -20, -20, + -20, -20, -20, -20, -20, -20, 7, -20, -20, -20, + -20, -20, -20, 6, -20, -20, -9, -5, 18, 7, + -20, -20, -20, -20, 4, -20, 4, -18, -20, 10, + 4, -20, -20, 17, -20 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -846,28 +889,29 @@ namespace lol { const unsigned char SceneSetupParser::yydefact_[] = { - 0, 11, 0, 0, 0, 0, 0, 0, 0, 3, - 5, 6, 8, 9, 10, 20, 22, 0, 12, 0, - 13, 14, 16, 0, 15, 18, 17, 32, 0, 1, - 2, 4, 7, 20, 22, 0, 21, 23, 0, 0, - 33, 19, 21, 23, 28, 0, 30, 0, 34, 0, - 0, 29, 0, 31 + 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 5, 6, 8, 9, 10, 11, 24, 26, + 0, 13, 0, 14, 15, 17, 0, 16, 20, 18, + 38, 37, 36, 21, 22, 39, 0, 1, 2, 4, + 7, 24, 26, 0, 25, 27, 0, 0, 0, 40, + 23, 25, 27, 32, 0, 34, 0, 0, 41, 0, + 0, 19, 33, 0, 35 }; /* YYPGOTO[NTERM-NUM]. */ const signed char SceneSetupParser::yypgoto_[] = { - -18, -18, 22, -18, -18, 31, -18, -18, -18, -17, - 7, 40, 39, -18, 5 + -20, -20, 25, -20, -20, 27, -20, -20, -20, -20, + -20, -19, 8, -3, 35, 43, -20, 3 }; /* YYDEFGOTO[NTERM-NUM]. */ const signed char SceneSetupParser::yydefgoto_[] = { - -1, 7, 8, 9, 10, 11, 12, 13, 14, 18, - 37, 20, 24, 28, 41 + -1, 9, 10, 11, 12, 13, 14, 15, 16, 48, + 17, 21, 45, 23, 27, 33, 36, 50 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -877,22 +921,24 @@ namespace lol { const unsigned char SceneSetupParser::yytable_[] = { - 36, 29, 38, 15, 16, 19, 39, 15, 16, 17, - 22, 44, 23, 17, 25, 46, 23, 27, 42, 15, - 16, 45, 47, 33, 34, 17, 30, 40, 49, 35, - 50, 31, 51, 52, 1, 2, 3, 4, 5, 6, - 53, 32, 43, 21, 26, 48 + 24, 44, 22, 46, 18, 19, 35, 47, 18, 19, + 20, 25, 53, 26, 20, 37, 55, 18, 19, 41, + 42, 38, 49, 20, 51, 43, 57, 54, 56, 30, + 31, 62, 28, 32, 26, 59, 39, 60, 64, 40, + 29, 63, 1, 2, 3, 4, 5, 6, 7, 8, + 34, 52, 58, 0, 61 }; /* YYCHECK. */ - const unsigned char + const signed char SceneSetupParser::yycheck_[] = { - 17, 0, 19, 11, 12, 18, 23, 11, 12, 17, - 16, 19, 18, 17, 16, 19, 18, 14, 35, 11, - 12, 38, 39, 11, 12, 17, 0, 13, 45, 17, - 47, 9, 19, 50, 4, 5, 6, 7, 8, 9, - 19, 10, 35, 3, 5, 40 + 3, 20, 20, 22, 13, 14, 16, 26, 13, 14, + 19, 18, 21, 20, 19, 0, 21, 13, 14, 13, + 14, 0, 15, 19, 43, 19, 8, 46, 47, 13, + 14, 21, 18, 17, 20, 54, 11, 56, 21, 12, + 5, 60, 4, 5, 6, 7, 8, 9, 10, 11, + 7, 43, 49, -1, 57 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -900,12 +946,13 @@ namespace lol { const unsigned char SceneSetupParser::yystos_[] = { - 0, 4, 5, 6, 7, 8, 9, 21, 22, 23, - 24, 25, 26, 27, 28, 11, 12, 17, 29, 18, - 31, 31, 16, 18, 32, 16, 32, 14, 33, 0, - 0, 22, 25, 11, 12, 17, 29, 30, 29, 29, - 13, 34, 29, 30, 19, 29, 19, 29, 34, 29, - 29, 19, 29, 19 + 0, 4, 5, 6, 7, 8, 9, 10, 11, 23, + 24, 25, 26, 27, 28, 29, 30, 32, 13, 14, + 19, 33, 20, 35, 35, 18, 20, 36, 18, 36, + 13, 14, 17, 37, 37, 16, 38, 0, 0, 24, + 27, 13, 14, 19, 33, 34, 33, 33, 31, 15, + 39, 33, 34, 21, 33, 21, 33, 8, 39, 33, + 33, 35, 21, 33, 21 }; #if YYDEBUG @@ -915,7 +962,8 @@ namespace lol { SceneSetupParser::yytoken_number_[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 45, 40, 41 + 265, 266, 267, 268, 269, 270, 271, 272, 273, 45, + 40, 41 }; #endif @@ -923,10 +971,11 @@ namespace lol { const unsigned char SceneSetupParser::yyr1_[] = { - 0, 20, 21, 22, 22, 23, 24, 24, 25, 25, - 25, 26, 26, 27, 27, 27, 27, 27, 27, 28, - 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, - 32, 32, 33, 34, 34 + 0, 22, 23, 24, 24, 25, 26, 26, 27, 27, + 27, 27, 28, 28, 29, 29, 29, 29, 31, 30, + 30, 30, 30, 32, 33, 33, 33, 33, 34, 34, + 34, 34, 35, 35, 36, 36, 37, 37, 37, 38, + 39, 39 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -934,9 +983,10 @@ namespace lol { SceneSetupParser::yyr2_[] = { 0, 2, 2, 1, 2, 1, 1, 2, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, - 1, 2, 1, 2, 1, 2, 1, 2, 3, 5, - 3, 6, 1, 1, 2 + 1, 1, 1, 2, 2, 2, 2, 2, 0, 5, + 2, 2, 2, 3, 1, 2, 1, 2, 1, 2, + 1, 2, 3, 5, 3, 6, 1, 1, 1, 1, + 1, 2 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE @@ -947,11 +997,12 @@ namespace lol { { "T_END", "error", "$undefined", "T_COLOR", "T_ADDLIGHT", "T_OBJPOSITION", "T_OBJLOOKAT", "T_OBJCOLOR", "T_CLEARCOLOR", - "T_CUSTOMCMD", "T_ERROR", "F_NUMBER", "I_NUMBER", "STRING", "STRING_VAR", - "BOOLEAN", "COLOR", "'-'", "'('", "')'", "$accept", "sstp_description", - "sstp_expression_list", "sstp_expression", "sstp_command_list", - "sstp_command", "light_command", "setup_command", "custom_command", "fv", - "iv", "v3", "v4", "svv", "sv", 0 + "T_SHOWGIZMO", "T_SHOWLIGHT", "T_CUSTOMCMD", "T_ERROR", "F_NUMBER", + "I_NUMBER", "STRING", "STRING_VAR", "BOOLEAN", "COLOR", "'-'", "'('", + "')'", "$accept", "sstp_description", "sstp_expression_list", + "sstp_expression", "sstp_command_list", "sstp_command", "light_command", + "setup_command", "scene_command", "$@1", "custom_command", "fv", "iv", + "v3", "v4", "bv", "svv", "sv", 0 }; #endif @@ -960,16 +1011,18 @@ namespace lol { const SceneSetupParser::rhs_number_type SceneSetupParser::yyrhs_[] = { - 21, 0, -1, 22, 0, -1, 23, -1, 23, 22, - -1, 24, -1, 25, -1, 24, 25, -1, 26, -1, - 27, -1, 28, -1, 4, -1, 4, 29, -1, 5, - 31, -1, 6, 31, -1, 7, 32, -1, 7, 16, - -1, 8, 32, -1, 8, 16, -1, 9, 33, 34, - -1, 11, -1, 17, 29, -1, 12, -1, 17, 30, - -1, 12, -1, 17, 30, -1, 11, -1, 17, 29, - -1, 18, 29, 19, -1, 18, 29, 29, 29, 19, - -1, 18, 29, 19, -1, 18, 29, 29, 29, 29, - 19, -1, 14, -1, 13, -1, 13, 34, -1 + 23, 0, -1, 24, 0, -1, 25, -1, 25, 24, + -1, 26, -1, 27, -1, 26, 27, -1, 28, -1, + 29, -1, 30, -1, 32, -1, 4, -1, 4, 33, + -1, 5, 35, -1, 6, 35, -1, 7, 36, -1, + 7, 18, -1, -1, 8, 36, 31, 8, 35, -1, + 8, 18, -1, 9, 37, -1, 10, 37, -1, 11, + 38, 39, -1, 13, -1, 19, 33, -1, 14, -1, + 19, 34, -1, 14, -1, 19, 34, -1, 13, -1, + 19, 33, -1, 20, 33, 21, -1, 20, 33, 33, + 33, 21, -1, 20, 33, 21, -1, 20, 33, 33, + 33, 33, 21, -1, 17, -1, 14, -1, 13, -1, + 16, -1, 15, -1, 15, 39, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -978,19 +1031,21 @@ namespace lol { SceneSetupParser::yyprhs_[] = { 0, 0, 3, 6, 8, 11, 13, 15, 18, 20, - 22, 24, 26, 29, 32, 35, 38, 41, 44, 47, - 51, 53, 56, 58, 61, 63, 66, 68, 71, 75, - 81, 85, 92, 94, 96 + 22, 24, 26, 28, 31, 34, 37, 40, 43, 44, + 50, 53, 56, 59, 63, 65, 68, 70, 73, 75, + 78, 80, 83, 87, 93, 97, 104, 106, 108, 110, + 112, 114 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned char SceneSetupParser::yyrline_[] = { - 0, 90, 90, 94, 95, 99, 103, 104, 108, 109, - 110, 114, 115, 120, 122, 124, 126, 131, 132, 137, - 143, 144, 145, 146, 150, 151, 152, 153, 158, 159, - 168, 169, 180, 184, 188 + 0, 91, 91, 95, 96, 100, 104, 105, 109, 110, + 111, 112, 116, 117, 122, 124, 126, 128, 136, 136, + 138, 140, 141, 145, 151, 152, 153, 154, 158, 159, + 160, 161, 166, 167, 176, 177, 182, 183, 184, 188, + 192, 196 }; // Print the state stack on the debug stream. @@ -1034,7 +1089,7 @@ namespace lol { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 18, 19, 2, 2, 2, 17, 2, 2, 2, 2, + 20, 21, 2, 2, 2, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1057,7 +1112,7 @@ namespace lol { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16 + 15, 16, 17, 18 }; if ((unsigned int) t <= yyuser_token_number_max_) return translate_table[t]; @@ -1066,26 +1121,26 @@ namespace lol { } const int SceneSetupParser::yyeof_ = 0; - const int SceneSetupParser::yylast_ = 45; - const int SceneSetupParser::yynnts_ = 15; + const int SceneSetupParser::yylast_ = 54; + const int SceneSetupParser::yynnts_ = 18; const int SceneSetupParser::yyempty_ = -2; - const int SceneSetupParser::yyfinal_ = 29; + const int SceneSetupParser::yyfinal_ = 37; const int SceneSetupParser::yyterror_ = 1; const int SceneSetupParser::yyerrcode_ = 256; - const int SceneSetupParser::yyntokens_ = 20; + const int SceneSetupParser::yyntokens_ = 22; - const unsigned int SceneSetupParser::yyuser_token_number_max_ = 271; + const unsigned int SceneSetupParser::yyuser_token_number_max_ = 273; const SceneSetupParser::token_number_type SceneSetupParser::yyundef_token_ = 2; } // lol /* Line 1053 of lalr1.cc */ -#line 1085 "generated/scenesetup-parser.cpp" +#line 1140 "generated/scenesetup-parser.cpp" /* Line 1055 of lalr1.cc */ -#line 196 "scenesetup-parser.y" +#line 204 "scenesetup-parser.y" void lol::SceneSetupParser::error(const SceneSetupParser::location_type& l, diff --git a/test/generated/scenesetup-parser.h b/test/generated/scenesetup-parser.h index fb7e3e15..77f8c1bb 100644 --- a/test/generated/scenesetup-parser.h +++ b/test/generated/scenesetup-parser.h @@ -143,14 +143,16 @@ namespace lol { T_OBJLOOKAT = 261, T_OBJCOLOR = 262, T_CLEARCOLOR = 263, - T_CUSTOMCMD = 264, - T_ERROR = 265, - F_NUMBER = 266, - I_NUMBER = 267, - STRING = 268, - STRING_VAR = 269, - BOOLEAN = 270, - COLOR = 271 + T_SHOWGIZMO = 264, + T_SHOWLIGHT = 265, + T_CUSTOMCMD = 266, + T_ERROR = 267, + F_NUMBER = 268, + I_NUMBER = 269, + STRING = 270, + STRING_VAR = 271, + BOOLEAN = 272, + COLOR = 273 }; }; @@ -247,7 +249,7 @@ namespace lol { static const unsigned char yytable_[]; static const signed char yytable_ninf_; - static const unsigned char yycheck_[]; + static const signed char yycheck_[]; /// For a state, its accessing symbol. static const unsigned char yystos_[]; @@ -324,7 +326,7 @@ namespace lol { } // lol /* Line 34 of lalr1.cc */ -#line 328 "generated/scenesetup-parser.h" +#line 330 "generated/scenesetup-parser.h" diff --git a/test/generated/scenesetup-parser.output b/test/generated/scenesetup-parser.output index 35e001c5..07992d18 100644 --- a/test/generated/scenesetup-parser.output +++ b/test/generated/scenesetup-parser.output @@ -1,39 +1,33 @@ Nonterminals useless in grammar iv3 - bv Terminals unused in grammar T_COLOR T_ERROR - BOOLEAN Rules useless in grammar - 34 iv3: '(' iv ')' - 35 | '(' iv iv iv ')' - - 36 bv: BOOLEAN - 37 | I_NUMBER - 38 | F_NUMBER + 41 iv3: '(' iv ')' + 42 | '(' iv iv iv ')' Rules useless in parser due to conflicts - 23 iv: I_NUMBER - 24 | '-' iv - 25 | F_NUMBER - 26 | '-' fv + 27 iv: I_NUMBER + 28 | '-' iv + 29 | F_NUMBER + 30 | '-' fv -State 10 conflicts: 6 shift/reduce -State 33 conflicts: 11 reduce/reduce -State 34 conflicts: 11 reduce/reduce -State 42 conflicts: 11 reduce/reduce -State 43 conflicts: 11 reduce/reduce +State 12 conflicts: 8 shift/reduce +State 41 conflicts: 13 reduce/reduce +State 42 conflicts: 13 reduce/reduce +State 51 conflicts: 13 reduce/reduce +State 52 conflicts: 13 reduce/reduce Grammar @@ -52,97 +46,115 @@ Grammar 7 sstp_command: light_command 8 | setup_command - 9 | custom_command + 9 | scene_command + 10 | custom_command + + 11 light_command: T_ADDLIGHT + 12 | T_ADDLIGHT fv + + 13 setup_command: T_OBJPOSITION v3 + 14 | T_OBJLOOKAT v3 + 15 | T_OBJCOLOR v4 + 16 | T_OBJCOLOR COLOR - 10 light_command: T_ADDLIGHT - 11 | T_ADDLIGHT fv + 17 $@1: /* empty */ - 12 setup_command: T_OBJPOSITION v3 - 13 | T_OBJLOOKAT v3 - 14 | T_OBJCOLOR v4 - 15 | T_OBJCOLOR COLOR - 16 | T_CLEARCOLOR v4 - 17 | T_CLEARCOLOR COLOR + 18 scene_command: T_CLEARCOLOR v4 $@1 T_CLEARCOLOR v3 + 19 | T_CLEARCOLOR COLOR + 20 | T_SHOWGIZMO bv + 21 | T_SHOWLIGHT bv - 18 custom_command: T_CUSTOMCMD svv sv + 22 custom_command: T_CUSTOMCMD svv sv - 19 fv: F_NUMBER - 20 | '-' fv - 21 | I_NUMBER - 22 | '-' iv + 23 fv: F_NUMBER + 24 | '-' fv + 25 | I_NUMBER + 26 | '-' iv - 23 iv: I_NUMBER - 24 | '-' iv - 25 | F_NUMBER - 26 | '-' fv + 27 iv: I_NUMBER + 28 | '-' iv + 29 | F_NUMBER + 30 | '-' fv - 27 v3: '(' fv ')' - 28 | '(' fv fv fv ')' + 31 v3: '(' fv ')' + 32 | '(' fv fv fv ')' - 29 v4: '(' fv ')' - 30 | '(' fv fv fv fv ')' + 33 v4: '(' fv ')' + 34 | '(' fv fv fv fv ')' - 31 svv: STRING_VAR + 35 bv: BOOLEAN + 36 | I_NUMBER + 37 | F_NUMBER - 32 sv: STRING - 33 | STRING sv + 38 svv: STRING_VAR + + 39 sv: STRING + 40 | STRING sv Terminals, with rules where they appear T_END (0) 0 1 -'(' (40) 27 28 29 30 -')' (41) 27 28 29 30 -'-' (45) 20 22 24 26 +'(' (40) 31 32 33 34 +')' (41) 31 32 33 34 +'-' (45) 24 26 28 30 error (256) T_COLOR (258) -T_ADDLIGHT (259) 10 11 -T_OBJPOSITION (260) 12 -T_OBJLOOKAT (261) 13 -T_OBJCOLOR (262) 14 15 -T_CLEARCOLOR (263) 16 17 -T_CUSTOMCMD (264) 18 -T_ERROR (265) -F_NUMBER (266) 19 25 -I_NUMBER (267) 21 23 -STRING (268) 32 33 -STRING_VAR (269) 31 -BOOLEAN (270) -COLOR (271) 15 17 +T_ADDLIGHT (259) 11 12 +T_OBJPOSITION (260) 13 +T_OBJLOOKAT (261) 14 +T_OBJCOLOR (262) 15 16 +T_CLEARCOLOR (263) 18 19 +T_SHOWGIZMO (264) 20 +T_SHOWLIGHT (265) 21 +T_CUSTOMCMD (266) 22 +T_ERROR (267) +F_NUMBER (268) 23 29 37 +I_NUMBER (269) 25 27 36 +STRING (270) 39 40 +STRING_VAR (271) 38 +BOOLEAN (272) 35 +COLOR (273) 16 19 Nonterminals, with rules where they appear -$accept (20) +$accept (22) on left: 0 -sstp_description (21) +sstp_description (23) on left: 1, on right: 0 -sstp_expression_list (22) +sstp_expression_list (24) on left: 2 3, on right: 1 3 -sstp_expression (23) +sstp_expression (25) on left: 4, on right: 2 3 -sstp_command_list (24) +sstp_command_list (26) on left: 5 6, on right: 4 6 -sstp_command (25) - on left: 7 8 9, on right: 5 6 -light_command (26) - on left: 10 11, on right: 7 -setup_command (27) - on left: 12 13 14 15 16 17, on right: 8 -custom_command (28) - on left: 18, on right: 9 -fv (29) - on left: 19 20 21 22, on right: 11 20 26 27 28 29 30 -iv (30) - on left: 23 24 25 26, on right: 22 24 -v3 (31) - on left: 27 28, on right: 12 13 -v4 (32) - on left: 29 30, on right: 14 16 -svv (33) - on left: 31, on right: 18 -sv (34) - on left: 32 33, on right: 18 33 +sstp_command (27) + on left: 7 8 9 10, on right: 5 6 +light_command (28) + on left: 11 12, on right: 7 +setup_command (29) + on left: 13 14 15 16, on right: 8 +scene_command (30) + on left: 18 19 20 21, on right: 9 +$@1 (31) + on left: 17, on right: 18 +custom_command (32) + on left: 22, on right: 10 +fv (33) + on left: 23 24 25 26, on right: 12 24 30 31 32 33 34 +iv (34) + on left: 27 28 29 30, on right: 26 28 +v3 (35) + on left: 31 32, on right: 13 14 18 +v4 (36) + on left: 33 34, on right: 15 18 +bv (37) + on left: 35 36 37, on right: 20 21 +svv (38) + on left: 38, on right: 22 +sv (39) + on left: 39 40, on right: 22 40 state 0 @@ -154,97 +166,122 @@ state 0 T_OBJLOOKAT shift, and go to state 3 T_OBJCOLOR shift, and go to state 4 T_CLEARCOLOR shift, and go to state 5 - T_CUSTOMCMD shift, and go to state 6 + T_SHOWGIZMO shift, and go to state 6 + T_SHOWLIGHT shift, and go to state 7 + T_CUSTOMCMD shift, and go to state 8 - sstp_description go to state 7 - sstp_expression_list go to state 8 - sstp_expression go to state 9 - sstp_command_list go to state 10 - sstp_command go to state 11 - light_command go to state 12 - setup_command go to state 13 - custom_command go to state 14 + sstp_description go to state 9 + sstp_expression_list go to state 10 + sstp_expression go to state 11 + sstp_command_list go to state 12 + sstp_command go to state 13 + light_command go to state 14 + setup_command go to state 15 + scene_command go to state 16 + custom_command go to state 17 state 1 - 10 light_command: T_ADDLIGHT . - 11 | T_ADDLIGHT . fv + 11 light_command: T_ADDLIGHT . + 12 | T_ADDLIGHT . fv - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 - $default reduce using rule 10 (light_command) + $default reduce using rule 11 (light_command) - fv go to state 18 + fv go to state 21 state 2 - 12 setup_command: T_OBJPOSITION . v3 + 13 setup_command: T_OBJPOSITION . v3 - '(' shift, and go to state 19 + '(' shift, and go to state 22 - v3 go to state 20 + v3 go to state 23 state 3 - 13 setup_command: T_OBJLOOKAT . v3 + 14 setup_command: T_OBJLOOKAT . v3 - '(' shift, and go to state 19 + '(' shift, and go to state 22 - v3 go to state 21 + v3 go to state 24 state 4 - 14 setup_command: T_OBJCOLOR . v4 - 15 | T_OBJCOLOR . COLOR + 15 setup_command: T_OBJCOLOR . v4 + 16 | T_OBJCOLOR . COLOR - COLOR shift, and go to state 22 - '(' shift, and go to state 23 + COLOR shift, and go to state 25 + '(' shift, and go to state 26 - v4 go to state 24 + v4 go to state 27 state 5 - 16 setup_command: T_CLEARCOLOR . v4 - 17 | T_CLEARCOLOR . COLOR + 18 scene_command: T_CLEARCOLOR . v4 $@1 T_CLEARCOLOR v3 + 19 | T_CLEARCOLOR . COLOR - COLOR shift, and go to state 25 - '(' shift, and go to state 23 + COLOR shift, and go to state 28 + '(' shift, and go to state 26 - v4 go to state 26 + v4 go to state 29 state 6 - 18 custom_command: T_CUSTOMCMD . svv sv + 20 scene_command: T_SHOWGIZMO . bv - STRING_VAR shift, and go to state 27 + F_NUMBER shift, and go to state 30 + I_NUMBER shift, and go to state 31 + BOOLEAN shift, and go to state 32 - svv go to state 28 + bv go to state 33 state 7 - 0 $accept: sstp_description . T_END + 21 scene_command: T_SHOWLIGHT . bv + + F_NUMBER shift, and go to state 30 + I_NUMBER shift, and go to state 31 + BOOLEAN shift, and go to state 32 - T_END shift, and go to state 29 + bv go to state 34 state 8 - 1 sstp_description: sstp_expression_list . T_END + 22 custom_command: T_CUSTOMCMD . svv sv + + STRING_VAR shift, and go to state 35 - T_END shift, and go to state 30 + svv go to state 36 state 9 + 0 $accept: sstp_description . T_END + + T_END shift, and go to state 37 + + +state 10 + + 1 sstp_description: sstp_expression_list . T_END + + T_END shift, and go to state 38 + + +state 11 + 2 sstp_expression_list: sstp_expression . 3 | sstp_expression . sstp_expression_list @@ -253,20 +290,23 @@ state 9 T_OBJLOOKAT shift, and go to state 3 T_OBJCOLOR shift, and go to state 4 T_CLEARCOLOR shift, and go to state 5 - T_CUSTOMCMD shift, and go to state 6 + T_SHOWGIZMO shift, and go to state 6 + T_SHOWLIGHT shift, and go to state 7 + T_CUSTOMCMD shift, and go to state 8 $default reduce using rule 2 (sstp_expression_list) - sstp_expression_list go to state 31 - sstp_expression go to state 9 - sstp_command_list go to state 10 - sstp_command go to state 11 - light_command go to state 12 - setup_command go to state 13 - custom_command go to state 14 + sstp_expression_list go to state 39 + sstp_expression go to state 11 + sstp_command_list go to state 12 + sstp_command go to state 13 + light_command go to state 14 + setup_command go to state 15 + scene_command go to state 16 + custom_command go to state 17 -state 10 +state 12 4 sstp_expression: sstp_command_list . 6 sstp_command_list: sstp_command_list . sstp_command @@ -276,465 +316,553 @@ state 10 T_OBJLOOKAT shift, and go to state 3 T_OBJCOLOR shift, and go to state 4 T_CLEARCOLOR shift, and go to state 5 - T_CUSTOMCMD shift, and go to state 6 + T_SHOWGIZMO shift, and go to state 6 + T_SHOWLIGHT shift, and go to state 7 + T_CUSTOMCMD shift, and go to state 8 T_ADDLIGHT [reduce using rule 4 (sstp_expression)] T_OBJPOSITION [reduce using rule 4 (sstp_expression)] T_OBJLOOKAT [reduce using rule 4 (sstp_expression)] T_OBJCOLOR [reduce using rule 4 (sstp_expression)] T_CLEARCOLOR [reduce using rule 4 (sstp_expression)] + T_SHOWGIZMO [reduce using rule 4 (sstp_expression)] + T_SHOWLIGHT [reduce using rule 4 (sstp_expression)] T_CUSTOMCMD [reduce using rule 4 (sstp_expression)] $default reduce using rule 4 (sstp_expression) - sstp_command go to state 32 - light_command go to state 12 - setup_command go to state 13 - custom_command go to state 14 + sstp_command go to state 40 + light_command go to state 14 + setup_command go to state 15 + scene_command go to state 16 + custom_command go to state 17 -state 11 +state 13 5 sstp_command_list: sstp_command . $default reduce using rule 5 (sstp_command_list) -state 12 +state 14 7 sstp_command: light_command . $default reduce using rule 7 (sstp_command) -state 13 +state 15 8 sstp_command: setup_command . $default reduce using rule 8 (sstp_command) -state 14 - - 9 sstp_command: custom_command . - - $default reduce using rule 9 (sstp_command) - - -state 15 - - 19 fv: F_NUMBER . - - $default reduce using rule 19 (fv) - - state 16 - 21 fv: I_NUMBER . + 9 sstp_command: scene_command . - $default reduce using rule 21 (fv) + $default reduce using rule 9 (sstp_command) state 17 - 20 fv: '-' . fv - 22 | '-' . iv + 10 sstp_command: custom_command . - F_NUMBER shift, and go to state 33 - I_NUMBER shift, and go to state 34 - '-' shift, and go to state 35 - - fv go to state 36 - iv go to state 37 + $default reduce using rule 10 (sstp_command) state 18 - 11 light_command: T_ADDLIGHT fv . + 23 fv: F_NUMBER . - $default reduce using rule 11 (light_command) + $default reduce using rule 23 (fv) state 19 - 27 v3: '(' . fv ')' - 28 | '(' . fv fv fv ')' + 25 fv: I_NUMBER . - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 - - fv go to state 38 + $default reduce using rule 25 (fv) state 20 - 12 setup_command: T_OBJPOSITION v3 . + 24 fv: '-' . fv + 26 | '-' . iv + + F_NUMBER shift, and go to state 41 + I_NUMBER shift, and go to state 42 + '-' shift, and go to state 43 - $default reduce using rule 12 (setup_command) + fv go to state 44 + iv go to state 45 state 21 - 13 setup_command: T_OBJLOOKAT v3 . + 12 light_command: T_ADDLIGHT fv . - $default reduce using rule 13 (setup_command) + $default reduce using rule 12 (light_command) state 22 - 15 setup_command: T_OBJCOLOR COLOR . + 31 v3: '(' . fv ')' + 32 | '(' . fv fv fv ')' - $default reduce using rule 15 (setup_command) + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + fv go to state 46 -state 23 - 29 v4: '(' . fv ')' - 30 | '(' . fv fv fv fv ')' +state 23 - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 + 13 setup_command: T_OBJPOSITION v3 . - fv go to state 39 + $default reduce using rule 13 (setup_command) state 24 - 14 setup_command: T_OBJCOLOR v4 . + 14 setup_command: T_OBJLOOKAT v3 . $default reduce using rule 14 (setup_command) state 25 - 17 setup_command: T_CLEARCOLOR COLOR . + 16 setup_command: T_OBJCOLOR COLOR . - $default reduce using rule 17 (setup_command) + $default reduce using rule 16 (setup_command) state 26 - 16 setup_command: T_CLEARCOLOR v4 . + 33 v4: '(' . fv ')' + 34 | '(' . fv fv fv fv ')' - $default reduce using rule 16 (setup_command) + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + + fv go to state 47 state 27 - 31 svv: STRING_VAR . + 15 setup_command: T_OBJCOLOR v4 . - $default reduce using rule 31 (svv) + $default reduce using rule 15 (setup_command) state 28 - 18 custom_command: T_CUSTOMCMD svv . sv + 19 scene_command: T_CLEARCOLOR COLOR . - STRING shift, and go to state 40 - - sv go to state 41 + $default reduce using rule 19 (scene_command) state 29 - 0 $accept: sstp_description T_END . + 18 scene_command: T_CLEARCOLOR v4 . $@1 T_CLEARCOLOR v3 - $default accept + $default reduce using rule 17 ($@1) + + $@1 go to state 48 state 30 - 1 sstp_description: sstp_expression_list T_END . + 37 bv: F_NUMBER . - $default reduce using rule 1 (sstp_description) + $default reduce using rule 37 (bv) state 31 - 3 sstp_expression_list: sstp_expression sstp_expression_list . + 36 bv: I_NUMBER . - $default reduce using rule 3 (sstp_expression_list) + $default reduce using rule 36 (bv) state 32 - 6 sstp_command_list: sstp_command_list sstp_command . + 35 bv: BOOLEAN . - $default reduce using rule 6 (sstp_command_list) + $default reduce using rule 35 (bv) state 33 - 19 fv: F_NUMBER . - 25 iv: F_NUMBER . - - T_END reduce using rule 19 (fv) - T_END [reduce using rule 25 (iv)] - T_ADDLIGHT reduce using rule 19 (fv) - T_ADDLIGHT [reduce using rule 25 (iv)] - T_OBJPOSITION reduce using rule 19 (fv) - T_OBJPOSITION [reduce using rule 25 (iv)] - T_OBJLOOKAT reduce using rule 19 (fv) - T_OBJLOOKAT [reduce using rule 25 (iv)] - T_OBJCOLOR reduce using rule 19 (fv) - T_OBJCOLOR [reduce using rule 25 (iv)] - T_CLEARCOLOR reduce using rule 19 (fv) - T_CLEARCOLOR [reduce using rule 25 (iv)] - T_CUSTOMCMD reduce using rule 19 (fv) - T_CUSTOMCMD [reduce using rule 25 (iv)] - F_NUMBER reduce using rule 19 (fv) - F_NUMBER [reduce using rule 25 (iv)] - I_NUMBER reduce using rule 19 (fv) - I_NUMBER [reduce using rule 25 (iv)] - '-' reduce using rule 19 (fv) - '-' [reduce using rule 25 (iv)] - ')' reduce using rule 19 (fv) - ')' [reduce using rule 25 (iv)] - $default reduce using rule 19 (fv) + 20 scene_command: T_SHOWGIZMO bv . + + $default reduce using rule 20 (scene_command) state 34 - 21 fv: I_NUMBER . - 23 iv: I_NUMBER . - - T_END reduce using rule 21 (fv) - T_END [reduce using rule 23 (iv)] - T_ADDLIGHT reduce using rule 21 (fv) - T_ADDLIGHT [reduce using rule 23 (iv)] - T_OBJPOSITION reduce using rule 21 (fv) - T_OBJPOSITION [reduce using rule 23 (iv)] - T_OBJLOOKAT reduce using rule 21 (fv) - T_OBJLOOKAT [reduce using rule 23 (iv)] - T_OBJCOLOR reduce using rule 21 (fv) - T_OBJCOLOR [reduce using rule 23 (iv)] - T_CLEARCOLOR reduce using rule 21 (fv) - T_CLEARCOLOR [reduce using rule 23 (iv)] - T_CUSTOMCMD reduce using rule 21 (fv) - T_CUSTOMCMD [reduce using rule 23 (iv)] - F_NUMBER reduce using rule 21 (fv) - F_NUMBER [reduce using rule 23 (iv)] - I_NUMBER reduce using rule 21 (fv) - I_NUMBER [reduce using rule 23 (iv)] - '-' reduce using rule 21 (fv) - '-' [reduce using rule 23 (iv)] - ')' reduce using rule 21 (fv) - ')' [reduce using rule 23 (iv)] - $default reduce using rule 21 (fv) + 21 scene_command: T_SHOWLIGHT bv . + $default reduce using rule 21 (scene_command) -state 35 - 20 fv: '-' . fv - 22 | '-' . iv - 24 iv: '-' . iv - 26 | '-' . fv +state 35 - F_NUMBER shift, and go to state 33 - I_NUMBER shift, and go to state 34 - '-' shift, and go to state 35 + 38 svv: STRING_VAR . - fv go to state 42 - iv go to state 43 + $default reduce using rule 38 (svv) state 36 - 20 fv: '-' fv . + 22 custom_command: T_CUSTOMCMD svv . sv + + STRING shift, and go to state 49 - $default reduce using rule 20 (fv) + sv go to state 50 state 37 - 22 fv: '-' iv . + 0 $accept: sstp_description T_END . - $default reduce using rule 22 (fv) + $default accept state 38 - 27 v3: '(' fv . ')' - 28 | '(' fv . fv fv ')' - - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 - ')' shift, and go to state 44 + 1 sstp_description: sstp_expression_list T_END . - fv go to state 45 + $default reduce using rule 1 (sstp_description) state 39 - 29 v4: '(' fv . ')' - 30 | '(' fv . fv fv fv ')' - - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 - ')' shift, and go to state 46 + 3 sstp_expression_list: sstp_expression sstp_expression_list . - fv go to state 47 + $default reduce using rule 3 (sstp_expression_list) state 40 - 32 sv: STRING . - 33 | STRING . sv - - STRING shift, and go to state 40 - - $default reduce using rule 32 (sv) + 6 sstp_command_list: sstp_command_list sstp_command . - sv go to state 48 + $default reduce using rule 6 (sstp_command_list) state 41 - 18 custom_command: T_CUSTOMCMD svv sv . - - $default reduce using rule 18 (custom_command) + 23 fv: F_NUMBER . + 29 iv: F_NUMBER . + + T_END reduce using rule 23 (fv) + T_END [reduce using rule 29 (iv)] + T_ADDLIGHT reduce using rule 23 (fv) + T_ADDLIGHT [reduce using rule 29 (iv)] + T_OBJPOSITION reduce using rule 23 (fv) + T_OBJPOSITION [reduce using rule 29 (iv)] + T_OBJLOOKAT reduce using rule 23 (fv) + T_OBJLOOKAT [reduce using rule 29 (iv)] + T_OBJCOLOR reduce using rule 23 (fv) + T_OBJCOLOR [reduce using rule 29 (iv)] + T_CLEARCOLOR reduce using rule 23 (fv) + T_CLEARCOLOR [reduce using rule 29 (iv)] + T_SHOWGIZMO reduce using rule 23 (fv) + T_SHOWGIZMO [reduce using rule 29 (iv)] + T_SHOWLIGHT reduce using rule 23 (fv) + T_SHOWLIGHT [reduce using rule 29 (iv)] + T_CUSTOMCMD reduce using rule 23 (fv) + T_CUSTOMCMD [reduce using rule 29 (iv)] + F_NUMBER reduce using rule 23 (fv) + F_NUMBER [reduce using rule 29 (iv)] + I_NUMBER reduce using rule 23 (fv) + I_NUMBER [reduce using rule 29 (iv)] + '-' reduce using rule 23 (fv) + '-' [reduce using rule 29 (iv)] + ')' reduce using rule 23 (fv) + ')' [reduce using rule 29 (iv)] + $default reduce using rule 23 (fv) state 42 - 20 fv: '-' fv . - 26 iv: '-' fv . - - T_END reduce using rule 20 (fv) - T_END [reduce using rule 26 (iv)] - T_ADDLIGHT reduce using rule 20 (fv) - T_ADDLIGHT [reduce using rule 26 (iv)] - T_OBJPOSITION reduce using rule 20 (fv) - T_OBJPOSITION [reduce using rule 26 (iv)] - T_OBJLOOKAT reduce using rule 20 (fv) - T_OBJLOOKAT [reduce using rule 26 (iv)] - T_OBJCOLOR reduce using rule 20 (fv) - T_OBJCOLOR [reduce using rule 26 (iv)] - T_CLEARCOLOR reduce using rule 20 (fv) - T_CLEARCOLOR [reduce using rule 26 (iv)] - T_CUSTOMCMD reduce using rule 20 (fv) - T_CUSTOMCMD [reduce using rule 26 (iv)] - F_NUMBER reduce using rule 20 (fv) - F_NUMBER [reduce using rule 26 (iv)] - I_NUMBER reduce using rule 20 (fv) - I_NUMBER [reduce using rule 26 (iv)] - '-' reduce using rule 20 (fv) - '-' [reduce using rule 26 (iv)] - ')' reduce using rule 20 (fv) - ')' [reduce using rule 26 (iv)] - $default reduce using rule 20 (fv) + 25 fv: I_NUMBER . + 27 iv: I_NUMBER . + + T_END reduce using rule 25 (fv) + T_END [reduce using rule 27 (iv)] + T_ADDLIGHT reduce using rule 25 (fv) + T_ADDLIGHT [reduce using rule 27 (iv)] + T_OBJPOSITION reduce using rule 25 (fv) + T_OBJPOSITION [reduce using rule 27 (iv)] + T_OBJLOOKAT reduce using rule 25 (fv) + T_OBJLOOKAT [reduce using rule 27 (iv)] + T_OBJCOLOR reduce using rule 25 (fv) + T_OBJCOLOR [reduce using rule 27 (iv)] + T_CLEARCOLOR reduce using rule 25 (fv) + T_CLEARCOLOR [reduce using rule 27 (iv)] + T_SHOWGIZMO reduce using rule 25 (fv) + T_SHOWGIZMO [reduce using rule 27 (iv)] + T_SHOWLIGHT reduce using rule 25 (fv) + T_SHOWLIGHT [reduce using rule 27 (iv)] + T_CUSTOMCMD reduce using rule 25 (fv) + T_CUSTOMCMD [reduce using rule 27 (iv)] + F_NUMBER reduce using rule 25 (fv) + F_NUMBER [reduce using rule 27 (iv)] + I_NUMBER reduce using rule 25 (fv) + I_NUMBER [reduce using rule 27 (iv)] + '-' reduce using rule 25 (fv) + '-' [reduce using rule 27 (iv)] + ')' reduce using rule 25 (fv) + ')' [reduce using rule 27 (iv)] + $default reduce using rule 25 (fv) state 43 - 22 fv: '-' iv . - 24 iv: '-' iv . - - T_END reduce using rule 22 (fv) - T_END [reduce using rule 24 (iv)] - T_ADDLIGHT reduce using rule 22 (fv) - T_ADDLIGHT [reduce using rule 24 (iv)] - T_OBJPOSITION reduce using rule 22 (fv) - T_OBJPOSITION [reduce using rule 24 (iv)] - T_OBJLOOKAT reduce using rule 22 (fv) - T_OBJLOOKAT [reduce using rule 24 (iv)] - T_OBJCOLOR reduce using rule 22 (fv) - T_OBJCOLOR [reduce using rule 24 (iv)] - T_CLEARCOLOR reduce using rule 22 (fv) - T_CLEARCOLOR [reduce using rule 24 (iv)] - T_CUSTOMCMD reduce using rule 22 (fv) - T_CUSTOMCMD [reduce using rule 24 (iv)] - F_NUMBER reduce using rule 22 (fv) - F_NUMBER [reduce using rule 24 (iv)] - I_NUMBER reduce using rule 22 (fv) - I_NUMBER [reduce using rule 24 (iv)] - '-' reduce using rule 22 (fv) - '-' [reduce using rule 24 (iv)] - ')' reduce using rule 22 (fv) - ')' [reduce using rule 24 (iv)] - $default reduce using rule 22 (fv) + 24 fv: '-' . fv + 26 | '-' . iv + 28 iv: '-' . iv + 30 | '-' . fv + + F_NUMBER shift, and go to state 41 + I_NUMBER shift, and go to state 42 + '-' shift, and go to state 43 + + fv go to state 51 + iv go to state 52 state 44 - 27 v3: '(' fv ')' . + 24 fv: '-' fv . - $default reduce using rule 27 (v3) + $default reduce using rule 24 (fv) state 45 - 28 v3: '(' fv fv . fv ')' + 26 fv: '-' iv . - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 - - fv go to state 49 + $default reduce using rule 26 (fv) state 46 - 29 v4: '(' fv ')' . + 31 v3: '(' fv . ')' + 32 | '(' fv . fv fv ')' + + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + ')' shift, and go to state 53 - $default reduce using rule 29 (v4) + fv go to state 54 state 47 - 30 v4: '(' fv fv . fv fv ')' + 33 v4: '(' fv . ')' + 34 | '(' fv . fv fv fv ')' - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + ')' shift, and go to state 55 - fv go to state 50 + fv go to state 56 state 48 - 33 sv: STRING sv . + 18 scene_command: T_CLEARCOLOR v4 $@1 . T_CLEARCOLOR v3 - $default reduce using rule 33 (sv) + T_CLEARCOLOR shift, and go to state 57 state 49 - 28 v3: '(' fv fv fv . ')' + 39 sv: STRING . + 40 | STRING . sv - ')' shift, and go to state 51 + STRING shift, and go to state 49 + $default reduce using rule 39 (sv) -state 50 + sv go to state 58 - 30 v4: '(' fv fv fv . fv ')' - F_NUMBER shift, and go to state 15 - I_NUMBER shift, and go to state 16 - '-' shift, and go to state 17 +state 50 - fv go to state 52 + 22 custom_command: T_CUSTOMCMD svv sv . + $default reduce using rule 22 (custom_command) -state 51 - 28 v3: '(' fv fv fv ')' . +state 51 - $default reduce using rule 28 (v3) + 24 fv: '-' fv . + 30 iv: '-' fv . + + T_END reduce using rule 24 (fv) + T_END [reduce using rule 30 (iv)] + T_ADDLIGHT reduce using rule 24 (fv) + T_ADDLIGHT [reduce using rule 30 (iv)] + T_OBJPOSITION reduce using rule 24 (fv) + T_OBJPOSITION [reduce using rule 30 (iv)] + T_OBJLOOKAT reduce using rule 24 (fv) + T_OBJLOOKAT [reduce using rule 30 (iv)] + T_OBJCOLOR reduce using rule 24 (fv) + T_OBJCOLOR [reduce using rule 30 (iv)] + T_CLEARCOLOR reduce using rule 24 (fv) + T_CLEARCOLOR [reduce using rule 30 (iv)] + T_SHOWGIZMO reduce using rule 24 (fv) + T_SHOWGIZMO [reduce using rule 30 (iv)] + T_SHOWLIGHT reduce using rule 24 (fv) + T_SHOWLIGHT [reduce using rule 30 (iv)] + T_CUSTOMCMD reduce using rule 24 (fv) + T_CUSTOMCMD [reduce using rule 30 (iv)] + F_NUMBER reduce using rule 24 (fv) + F_NUMBER [reduce using rule 30 (iv)] + I_NUMBER reduce using rule 24 (fv) + I_NUMBER [reduce using rule 30 (iv)] + '-' reduce using rule 24 (fv) + '-' [reduce using rule 30 (iv)] + ')' reduce using rule 24 (fv) + ')' [reduce using rule 30 (iv)] + $default reduce using rule 24 (fv) state 52 - 30 v4: '(' fv fv fv fv . ')' - - ')' shift, and go to state 53 + 26 fv: '-' iv . + 28 iv: '-' iv . + + T_END reduce using rule 26 (fv) + T_END [reduce using rule 28 (iv)] + T_ADDLIGHT reduce using rule 26 (fv) + T_ADDLIGHT [reduce using rule 28 (iv)] + T_OBJPOSITION reduce using rule 26 (fv) + T_OBJPOSITION [reduce using rule 28 (iv)] + T_OBJLOOKAT reduce using rule 26 (fv) + T_OBJLOOKAT [reduce using rule 28 (iv)] + T_OBJCOLOR reduce using rule 26 (fv) + T_OBJCOLOR [reduce using rule 28 (iv)] + T_CLEARCOLOR reduce using rule 26 (fv) + T_CLEARCOLOR [reduce using rule 28 (iv)] + T_SHOWGIZMO reduce using rule 26 (fv) + T_SHOWGIZMO [reduce using rule 28 (iv)] + T_SHOWLIGHT reduce using rule 26 (fv) + T_SHOWLIGHT [reduce using rule 28 (iv)] + T_CUSTOMCMD reduce using rule 26 (fv) + T_CUSTOMCMD [reduce using rule 28 (iv)] + F_NUMBER reduce using rule 26 (fv) + F_NUMBER [reduce using rule 28 (iv)] + I_NUMBER reduce using rule 26 (fv) + I_NUMBER [reduce using rule 28 (iv)] + '-' reduce using rule 26 (fv) + '-' [reduce using rule 28 (iv)] + ')' reduce using rule 26 (fv) + ')' [reduce using rule 28 (iv)] + $default reduce using rule 26 (fv) state 53 - 30 v4: '(' fv fv fv fv ')' . + 31 v3: '(' fv ')' . + + $default reduce using rule 31 (v3) + + +state 54 + + 32 v3: '(' fv fv . fv ')' + + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + + fv go to state 59 + + +state 55 + + 33 v4: '(' fv ')' . + + $default reduce using rule 33 (v4) + + +state 56 + + 34 v4: '(' fv fv . fv fv ')' + + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + + fv go to state 60 + + +state 57 + + 18 scene_command: T_CLEARCOLOR v4 $@1 T_CLEARCOLOR . v3 + + '(' shift, and go to state 22 + + v3 go to state 61 + + +state 58 + + 40 sv: STRING sv . + + $default reduce using rule 40 (sv) + + +state 59 + + 32 v3: '(' fv fv fv . ')' + + ')' shift, and go to state 62 + + +state 60 + + 34 v4: '(' fv fv fv . fv ')' + + F_NUMBER shift, and go to state 18 + I_NUMBER shift, and go to state 19 + '-' shift, and go to state 20 + + fv go to state 63 + + +state 61 + + 18 scene_command: T_CLEARCOLOR v4 $@1 T_CLEARCOLOR v3 . + + $default reduce using rule 18 (scene_command) + + +state 62 + + 32 v3: '(' fv fv fv ')' . + + $default reduce using rule 32 (v3) + + +state 63 + + 34 v4: '(' fv fv fv fv . ')' + + ')' shift, and go to state 64 + + +state 64 + + 34 v4: '(' fv fv fv fv ')' . - $default reduce using rule 30 (v4) + $default reduce using rule 34 (v4) diff --git a/test/generated/scenesetup-scanner.cpp b/test/generated/scenesetup-scanner.cpp index a83f23bf..ed87b03f 100644 --- a/test/generated/scenesetup-scanner.cpp +++ b/test/generated/scenesetup-scanner.cpp @@ -330,8 +330,8 @@ typedef unsigned char YY_CHAR; *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 24 -#define YY_END_OF_BUFFER 25 +#define YY_NUM_RULES 27 +#define YY_END_OF_BUFFER 28 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -339,17 +339,19 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[87] = +static yyconst flex_int16_t yy_accept[101] = { 0, - 0, 0, 25, 23, 22, 21, 23, 23, 19, 20, - 23, 18, 23, 23, 14, 23, 23, 23, 23, 23, - 23, 23, 0, 15, 0, 0, 14, 13, 17, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, - 17, 16, 16, 16, 16, 16, 16, 16, 16, 7, - 0, 13, 16, 16, 16, 16, 16, 16, 16, 11, - 8, 16, 16, 4, 16, 12, 16, 16, 0, 16, - 16, 6, 3, 16, 9, 16, 16, 16, 0, 1, - 16, 2, 10, 16, 5, 0 + 0, 0, 28, 26, 25, 24, 26, 26, 22, 23, + 26, 21, 26, 26, 17, 26, 26, 26, 26, 26, + 26, 26, 26, 0, 18, 0, 0, 17, 16, 20, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 0, 0, 20, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 10, 0, 16, 19, 19, 19, 19, 19, + 19, 19, 19, 14, 11, 19, 19, 4, 19, 15, + 19, 19, 19, 19, 0, 19, 19, 8, 3, 19, + 19, 19, 12, 19, 19, 19, 19, 19, 0, 1, + 19, 2, 19, 19, 13, 19, 6, 7, 5, 0 + } ; static yyconst flex_int32_t yy_ec[256] = @@ -366,8 +368,8 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 16, 1, 17, 13, 18, 19, 20, 21, 22, 23, 24, 15, 25, 26, 27, 28, - 29, 30, 15, 31, 32, 33, 34, 15, 15, 15, - 15, 15, 1, 1, 1, 1, 1, 1, 1, 1, + 29, 30, 15, 31, 32, 33, 34, 15, 35, 15, + 15, 36, 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, @@ -384,86 +386,92 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[35] = +static yyconst flex_int32_t yy_meta[37] = { 0, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4, 5, 5, 3, 3, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3 + 3, 3, 3, 3, 3, 3 } ; -static yyconst flex_int16_t yy_base[98] = +static yyconst flex_int16_t yy_base[112] = { 0, - 0, 0, 127, 128, 128, 128, 122, 0, 128, 128, - 25, 26, 113, 113, 29, 0, 104, 14, 105, 92, - 91, 88, 114, 128, 0, 105, 32, 33, 0, 0, - 97, 95, 88, 81, 86, 82, 78, 75, 0, 42, - 0, 82, 90, 77, 72, 72, 78, 78, 81, 0, - 88, 87, 74, 66, 65, 66, 74, 76, 59, 0, - 0, 69, 72, 0, 62, 0, 55, 63, 0, 63, - 56, 0, 0, 55, 0, 35, 37, 24, 0, 0, - 20, 0, 128, 15, 0, 128, 54, 56, 59, 61, - 66, 68, 70, 72, 74, 76, 78 - + 0, 0, 142, 143, 143, 143, 137, 0, 143, 143, + 27, 28, 128, 128, 31, 0, 119, 16, 120, 107, + 106, 111, 102, 128, 143, 0, 119, 34, 35, 0, + 0, 111, 109, 102, 95, 100, 96, 92, 94, 88, + 0, 44, 0, 95, 103, 90, 85, 85, 91, 91, + 79, 93, 0, 100, 99, 86, 78, 77, 78, 86, + 88, 71, 32, 0, 0, 81, 84, 0, 74, 0, + 67, 75, 74, 73, 0, 73, 66, 0, 0, 65, + 57, 70, 0, 58, 64, 61, 61, 49, 0, 0, + 38, 0, 28, 18, 143, 17, 0, 0, 0, 143, + + 58, 60, 63, 65, 70, 72, 74, 76, 78, 80, + 82 } ; -static yyconst flex_int16_t yy_def[98] = +static yyconst flex_int16_t yy_def[112] = { 0, - 86, 1, 86, 86, 86, 86, 87, 88, 86, 86, - 86, 86, 86, 86, 86, 89, 89, 89, 89, 89, - 89, 89, 87, 86, 90, 86, 86, 86, 91, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 92, 86, - 91, 89, 89, 89, 89, 89, 89, 89, 89, 93, - 86, 86, 89, 89, 89, 89, 89, 89, 89, 89, - 94, 89, 89, 89, 89, 89, 89, 89, 95, 89, - 89, 89, 89, 89, 96, 89, 89, 89, 97, 89, - 89, 89, 86, 89, 89, 0, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86 - + 100, 1, 100, 100, 100, 100, 101, 102, 100, 100, + 100, 100, 100, 100, 100, 103, 103, 103, 103, 103, + 103, 103, 103, 101, 100, 104, 100, 100, 100, 105, + 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, + 106, 100, 105, 103, 103, 103, 103, 103, 103, 103, + 103, 103, 107, 100, 100, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 108, 103, 103, 103, 103, 103, + 103, 103, 103, 103, 109, 103, 103, 103, 103, 103, + 103, 103, 110, 103, 103, 103, 103, 103, 111, 103, + 103, 103, 103, 103, 100, 103, 103, 103, 103, 0, + + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100 } ; -static yyconst flex_int16_t yy_nxt[163] = +static yyconst flex_int16_t yy_nxt[180] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 4, 17, 18, 16, 16, 19, 16, 16, 16, 16, 20, 16, 16, 16, 21, - 16, 16, 22, 16, 26, 26, 27, 27, 26, 32, - 27, 26, 33, 27, 28, 85, 40, 34, 84, 51, - 51, 82, 40, 52, 23, 23, 23, 23, 23, 25, - 25, 30, 81, 30, 39, 39, 41, 80, 41, 41, - 41, 50, 50, 61, 61, 69, 69, 75, 75, 79, - 79, 83, 83, 78, 77, 76, 74, 73, 72, 71, - 70, 68, 67, 66, 65, 64, 63, 62, 52, 52, - - 60, 59, 58, 57, 56, 55, 54, 53, 49, 48, - 47, 46, 45, 44, 43, 42, 28, 24, 38, 37, - 36, 35, 31, 29, 28, 24, 86, 3, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86 + 16, 22, 23, 16, 16, 16, 27, 27, 28, 28, + 27, 33, 28, 27, 34, 28, 29, 99, 42, 35, + 98, 54, 54, 73, 42, 55, 97, 74, 24, 24, + 24, 24, 24, 26, 26, 31, 96, 31, 41, 41, + 43, 94, 43, 43, 43, 53, 53, 65, 65, 75, + 75, 83, 83, 89, 89, 95, 95, 93, 92, 91, + 90, 88, 87, 86, 85, 84, 82, 81, 80, 79, + + 78, 77, 76, 72, 71, 70, 69, 68, 67, 66, + 55, 55, 64, 63, 62, 61, 60, 59, 58, 57, + 56, 52, 51, 50, 49, 48, 47, 46, 45, 44, + 29, 25, 40, 39, 38, 37, 36, 32, 30, 29, + 25, 100, 3, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100 } ; -static yyconst flex_int16_t yy_chk[163] = +static yyconst flex_int16_t yy_chk[180] = { 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, - 1, 1, 1, 1, 11, 12, 11, 12, 15, 18, - 15, 27, 18, 27, 28, 84, 28, 18, 81, 40, - 40, 78, 28, 40, 87, 87, 87, 87, 87, 88, - 88, 89, 77, 89, 90, 90, 91, 76, 91, 91, - 91, 92, 92, 93, 93, 94, 94, 95, 95, 96, - 96, 97, 97, 74, 71, 70, 68, 67, 65, 63, - 62, 59, 58, 57, 56, 55, 54, 53, 52, 51, - - 49, 48, 47, 46, 45, 44, 43, 42, 38, 37, - 36, 35, 34, 33, 32, 31, 26, 23, 22, 21, - 20, 19, 17, 14, 13, 7, 3, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, - 86, 86 + 1, 1, 1, 1, 1, 1, 11, 12, 11, 12, + 15, 18, 15, 28, 18, 28, 29, 96, 29, 18, + 94, 42, 42, 63, 29, 42, 93, 63, 101, 101, + 101, 101, 101, 102, 102, 103, 91, 103, 104, 104, + 105, 88, 105, 105, 105, 106, 106, 107, 107, 108, + 108, 109, 109, 110, 110, 111, 111, 87, 86, 85, + 84, 82, 81, 80, 77, 76, 74, 73, 72, 71, + + 69, 67, 66, 62, 61, 60, 59, 58, 57, 56, + 55, 54, 52, 51, 50, 49, 48, 47, 46, 45, + 44, 40, 39, 38, 37, 36, 35, 34, 33, 32, + 27, 24, 23, 22, 21, 20, 19, 17, 14, 13, + 7, 3, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 100 } ; /* The intent behind this definition is that it'll catch @@ -512,7 +520,7 @@ typedef lol::SceneSetupParser::token_type token_type; #define yyterminate() return token::T_END #define YY_NO_UNISTD_H #define YY_USER_ACTION yylloc->columns(yyleng); -#line 516 "generated/scenesetup-scanner.cpp" +#line 524 "generated/scenesetup-scanner.cpp" #define INITIAL 0 @@ -624,7 +632,7 @@ YY_DECL yylloc->step(); -#line 628 "generated/scenesetup-scanner.cpp" +#line 636 "generated/scenesetup-scanner.cpp" if ( !(yy_init) ) { @@ -677,13 +685,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 >= 87 ) + if ( yy_current_state >= 101 ) 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 != 86 ); + while ( yy_current_state != 100 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -731,13 +739,28 @@ YY_RULE_SETUP case 6: YY_RULE_SETUP #line 56 "scenesetup-scanner.l" +{ return token::T_SHOWGIZMO; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 57 "scenesetup-scanner.l" +{ return token::T_SHOWLIGHT; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 58 "scenesetup-scanner.l" +{ return token::T_CUSTOMCMD; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 60 "scenesetup-scanner.l" { return token::T_CUSTOMCMD; } YY_BREAK /* ======= BASE COLOR TYPES ========================================= */ /* COLOR */ -case 7: +case 10: YY_RULE_SETUP -#line 60 "scenesetup-scanner.l" +#line 64 "scenesetup-scanner.l" { uint32_t tmp = std::strtol(yytext + 1, nullptr, 16); yylval->u32val = 0x11000000u * (tmp >> 8) @@ -746,9 +769,9 @@ YY_RULE_SETUP | 0x000000ffu; return token::COLOR; } YY_BREAK -case 8: +case 11: YY_RULE_SETUP -#line 67 "scenesetup-scanner.l" +#line 71 "scenesetup-scanner.l" { uint32_t tmp = std::strtol(yytext + 1, nullptr, 16); yylval->u32val = 0x11000000u * (tmp >> 12) @@ -757,106 +780,106 @@ YY_RULE_SETUP | 0x00000011u * (tmp & 0xf); return token::COLOR; } YY_BREAK -case 9: +case 12: YY_RULE_SETUP -#line 74 "scenesetup-scanner.l" +#line 78 "scenesetup-scanner.l" { yylval->u32val = 0xffu | 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16); return token::COLOR; } YY_BREAK -case 10: +case 13: YY_RULE_SETUP -#line 78 "scenesetup-scanner.l" +#line 82 "scenesetup-scanner.l" { yylval->u32val = (uint32_t)std::strtol(yytext + 1, nullptr, 16); return token::COLOR; } YY_BREAK /* ======= BASE DATA TYPES ========================================= */ /* BOOL */ -case 11: +case 14: YY_RULE_SETUP -#line 84 "scenesetup-scanner.l" +#line 88 "scenesetup-scanner.l" { yylval->bval = true; return token::BOOLEAN; } YY_BREAK -case 12: +case 15: YY_RULE_SETUP -#line 85 "scenesetup-scanner.l" +#line 89 "scenesetup-scanner.l" { yylval->bval = false; return token::BOOLEAN; } YY_BREAK /* FLOAT */ -case 13: +case 16: YY_RULE_SETUP -#line 87 "scenesetup-scanner.l" +#line 91 "scenesetup-scanner.l" { yylval->fval = (float)std::atof(yytext); return token::F_NUMBER; } YY_BREAK /* INT */ -case 14: +case 17: YY_RULE_SETUP -#line 90 "scenesetup-scanner.l" +#line 94 "scenesetup-scanner.l" { yylval->ival = std::atoi(yytext); return token::I_NUMBER; } YY_BREAK /* STRING */ -case 15: -/* rule 15 can match eol */ +case 18: +/* rule 18 can match eol */ YY_RULE_SETUP -#line 93 "scenesetup-scanner.l" +#line 97 "scenesetup-scanner.l" { yylval->sval = strdup(yytext); return token::STRING; } YY_BREAK /* STRING VAR */ -case 16: +case 19: YY_RULE_SETUP -#line 96 "scenesetup-scanner.l" +#line 100 "scenesetup-scanner.l" { yylval->svval = strdup(yytext); return token::STRING_VAR; } YY_BREAK /* ======= COMMENTS ======= */ -case 17: +case 20: YY_RULE_SETUP -#line 100 "scenesetup-scanner.l" +#line 104 "scenesetup-scanner.l" { /* ignore this */ } YY_BREAK /* Semantics tokens */ -case 18: +case 21: YY_RULE_SETUP -#line 103 "scenesetup-scanner.l" +#line 107 "scenesetup-scanner.l" { return token_type('-'); } YY_BREAK -case 19: +case 22: YY_RULE_SETUP -#line 104 "scenesetup-scanner.l" +#line 108 "scenesetup-scanner.l" { return token_type('('); } YY_BREAK -case 20: +case 23: YY_RULE_SETUP -#line 105 "scenesetup-scanner.l" +#line 109 "scenesetup-scanner.l" { return token_type(')'); } YY_BREAK -case 21: +case 24: YY_RULE_SETUP -#line 106 "scenesetup-scanner.l" +#line 110 "scenesetup-scanner.l" { /* ignore this */ } YY_BREAK -case 22: -/* rule 22 can match eol */ +case 25: +/* rule 25 can match eol */ YY_RULE_SETUP -#line 107 "scenesetup-scanner.l" +#line 111 "scenesetup-scanner.l" { /* ignore this */ } YY_BREAK -case 23: +case 26: YY_RULE_SETUP -#line 108 "scenesetup-scanner.l" +#line 112 "scenesetup-scanner.l" { return token::T_ERROR; } YY_BREAK -case 24: +case 27: YY_RULE_SETUP -#line 110 "scenesetup-scanner.l" +#line 114 "scenesetup-scanner.l" ECHO; YY_BREAK -#line 860 "generated/scenesetup-scanner.cpp" +#line 883 "generated/scenesetup-scanner.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1238,7 +1261,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 >= 87 ) + if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1266,11 +1289,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 >= 87 ) + if ( yy_current_state >= 101 ) 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 == 86); + yy_is_jam = (yy_current_state == 100); return yy_is_jam ? 0 : yy_current_state; } @@ -1757,7 +1780,7 @@ void SceneSetupfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 110 "scenesetup-scanner.l" +#line 114 "scenesetup-scanner.l" diff --git a/test/meshviewer.cpp b/test/meshviewer.cpp index acaaaa46..bb412a4b 100644 --- a/test/meshviewer.cpp +++ b/test/meshviewer.cpp @@ -25,12 +25,12 @@ using namespace lol; static int const TEXTURE_WIDTH = 256; #define R_M 1.f -#define DEFAULT_WIDTH (770.f * R_M) -#define DEFAULT_HEIGHT (200.f * R_M) +#define DEFAULT_WIDTH (1200.f * R_M) +#define DEFAULT_HEIGHT (400.f * R_M) #define WIDTH ((float)Video::GetSize().x) #define HEIGHT ((float)Video::GetSize().y) #define SCREEN_W (10.f / WIDTH) -#define SCREEN_LIMIT 1.1f +#define SCREEN_LIMIT 1.4f #define RATIO_HW (HEIGHT / WIDTH) #define RATIO_WH (WIDTH / HEIGHT) @@ -111,12 +111,13 @@ enum MVMouseAxisList #define ALL_FEATURES 1 #define NO_SC_SETUP 0 -enum MessageType +enum GizmoType { - MSG_IN, - MSG_OUT, + GZ_Editor = 0, + GZ_LightPos, + GZ_LightDir, - MSG_MAX + GZ_MAX }; struct LightData @@ -147,8 +148,16 @@ public: m_camera = nullptr; m_controller = nullptr; + //Compile ref meshes + m_gizmos << new EasyMesh(); + m_gizmos.Last()->Compile("[sc#0f0 ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 ty .5 dup[rz 90 ry 90 scv#00f dup[ry 90 scv#f00]]][sc#fff ab .1]"); + m_gizmos << new EasyMesh(); + m_gizmos.Last()->Compile("[sc#666 acap 1 .5 .5 ty -.5 sc#fff asph 2 1]"); + m_gizmos << new EasyMesh(); + m_gizmos.Last()->Compile("[sc#fff ac 3 .5 .4 0 ty .25 [ad 3 .4 sy -1] ty .5 ac 3 1 .1 ty .5 [ad 3 .1 sy -1] ty 1 rz 90 ry 90]"); + // Mesh Setup - m_render_max = vec2(-.9f, 6.1f); + m_render_max = vec2(-.9f, 4.1f); m_mesh_id = 0; m_mesh_id1 = 0.f; m_default_texture = nullptr; @@ -282,9 +291,9 @@ public: m_meshes.Push(em); } #else - m_ssetup->Compile(" addlight 0.0 position (4 -1 -4) color (.0 .2 .5 1)" - " addlight 0.0 position (8 2 6) color #ffff"); -// " custom setmesh \"sc#fff ab 1\"" + m_ssetup->Compile("addlight 0.0 position (4 -1 -4) color (.0 .2 .5 1) " + "addlight 0.0 position (8 2 6) color #ffff " + "showgizmo true "); m_ssetup->Startup(); #endif //NO_SC_SETUP for (int i = 0; i < m_ssetup->m_lights.Count(); ++i) @@ -319,6 +328,12 @@ public: } #endif //NO_NACL_EM + //Compute render mesh count + float a_j = lol::abs(m_render_max[1]); + float i_m = m_hist_scale_mesh.x; + float i_trans = a_j - ((a_j * a_j * i_m * i_m + a_j * i_m) * .5f); + m_render_max[1] = a_j * ((RATIO_WH * 1.f) / ((i_trans != 0.f)?(i_trans):(RATIO_WH))) - RATIO_HW * .3f; + //Mesh Change #if NO_NACL_EM m_mesh_id = clamp(m_mesh_id + ((int)KeyPressed(KEY_MESH_PREV) - (int)KeyPressed(KEY_MESH_NEXT)), 0, m_meshes.Count() - 1); @@ -497,7 +512,7 @@ public: //Message Service //-- String mesh(""); - int u = 4; + int u = 1; while (u-- > 0 && MessageService::FetchFirst(MessageBucket::AppIn, mesh)) { int o = 1; @@ -549,20 +564,24 @@ public: } //Check the custom cmd even if we don't have new messages. - for (int i = 0; m_ssetup && i < m_ssetup->m_custom_cmd.Count(); ++i) + int o = 1; + while (o-- > 0) { - if (m_ssetup->m_custom_cmd[i].m1 == "setmesh") + for (int i = 0; m_ssetup && i < m_ssetup->m_custom_cmd.Count(); ++i) { - //Create a new mesh - EasyMesh* em = new EasyMesh(); - if (em->Compile(m_ssetup->m_custom_cmd[i].m2.C())) + if (m_ssetup->m_custom_cmd[i].m1 == "setmesh") { - if (m_mesh_id == m_meshes.Count() - 1) - m_mesh_id++; - m_meshes.Push(em); + //Create a new mesh + EasyMesh* em = new EasyMesh(); + if (em->Compile(m_ssetup->m_custom_cmd[i].m2.C())) + { + if (m_mesh_id == m_meshes.Count() - 1) + m_mesh_id++; + m_meshes.Push(em); + } + else + delete(em); } - else - delete(em); } } m_ssetup->m_custom_cmd.Empty(); @@ -643,8 +662,24 @@ public: g_renderer->SetClearColor(m_ssetup->m_clear_color); + for (int i = 0; i < m_gizmos.Count(); ++i) + { + if (m_gizmos[i]->GetMeshState() == MeshRender::NeedConvert) + m_gizmos[i]->MeshConvert(); + else + break; + } + vec3 x = vec3(1.f,0.f,0.f); vec3 y = vec3(0.f,1.f,0.f); + mat4 save_proj = m_camera->GetProjection(); + //Y object Offset + mat4 mat_obj_offset = mat4::translate(x * m_screen_offset.x + y * m_screen_offset.y) * + //Mesh Pos Offset + mat4::translate((x * m_pos_mesh.x * RATIO_HW + y * m_pos_mesh.y) * 2.f * (1.f + .5f * m_zoom_mesh / SCREEN_LIMIT)); + //Align right meshes + mat4 mat_align = mat4::translate(x - x * RATIO_HW); + mat4 mat_gizmo = mat_obj_offset * mat_align * save_proj; for (int i = 0; i < m_meshes.Count(); i++) { { @@ -659,7 +694,6 @@ public: #endif //WITH_TEXTURE } #if ALL_FEATURES - mat4 save_proj = m_camera->GetProjection(); float j = -(float)(m_meshes.Count() - (i + 1)) + (-m_mesh_id1 + (float)(m_meshes.Count() - 1)); if (m_mesh_id1 - m_render_max[0] > (float)i && m_mesh_id1 - m_render_max[1] < (float)i && @@ -668,19 +702,14 @@ public: float a_j = lol::abs(j); float i_trans = (a_j * a_j * m_hist_scale_mesh.x + a_j * m_hist_scale_mesh.x) * .5f; float i_scale = clamp(1.f - (m_hist_scale_mesh.y * (m_mesh_id1 - (float)i)), 0.f, 1.f); - mat4 new_proj = - //Y object Offset - mat4::translate(x * m_screen_offset.x + y * m_screen_offset.y) * - //Mesh Pos Offset - mat4::translate((x * m_pos_mesh.x * RATIO_HW + y * m_pos_mesh.y) * 2.f * (1.f + .5f * m_zoom_mesh / SCREEN_LIMIT)) * - //Mesh count offset - mat4::translate(x * RATIO_HW * 2.f * (j + i_trans)) * - //Align right meshes - mat4::translate(x - x * RATIO_HW) * - //Mesh count scale - mat4::scale(vec3(vec2(i_scale), 1.f)) * - //Camera projection - save_proj; + + //Mesh count offset + mat4 mat_count_offset = mat4::translate(x * RATIO_HW * 2.f * (j + i_trans)); + //Mesh count scale + mat4 mat_count_scale = mat4::scale(vec3(vec2(i_scale), 1.f)); + + //Camera projection + mat4 new_proj = mat_obj_offset * mat_count_offset * mat_align * mat_count_scale * save_proj; m_camera->SetProjection(new_proj); //#if NO_NACL_EM m_meshes[i]->Render(m_mat); @@ -693,6 +722,33 @@ public: #endif //ALL_FEATURES } } + if (m_ssetup) + { + m_camera->SetProjection(mat_gizmo); + if (m_ssetup->m_show_gizmo) + m_gizmos[GZ_Editor]->Render(m_mat); + + if (m_ssetup->m_show_lights) + { + for (int k = 0; k < m_ssetup->m_lights.Count(); ++k) + { + Light* tmp = m_ssetup->m_lights[k]; + mat4 world = mat4::translate(tmp->GetPosition().xyz); + mat4 local = mat4::translate((inverse(m_mat) * world).v3.xyz); + //dir light + if (tmp->GetPosition().w == 0.f) + { + m_gizmos[GZ_LightPos]->Render(m_mat * inverse(local)); + m_gizmos[GZ_LightDir]->Render(inverse(world) * inverse(mat4::lookat(vec3::zero, -tmp->GetPosition().xyz, vec3::axis_y))); + } + else //point light + { + m_gizmos[GZ_LightPos]->Render(m_mat * local); + } + } + } + m_camera->SetProjection(save_proj); + } } private: @@ -730,6 +786,7 @@ private: int m_mesh_id; float m_mesh_id1; Array m_meshes; + Array m_gizmos; //File data String m_file_name; diff --git a/test/meshviewer.index.html b/test/meshviewer.index.html index ed3542fb..8027eefd 100644 --- a/test/meshviewer.index.html +++ b/test/meshviewer.index.html @@ -110,7 +110,7 @@ progress::-webkit-progress-value g_code_id = 0; g_code_base[0] = "//This is a comment\nsc#f8f afcb 1 1 1 0"; - g_code_base[1] = "//This is a comment\naddlight 0.0 position (4 -1 -4) color (.0 .2 .5 1)\naddlight 0.0 position (8 2 6) color #ffff"; + g_code_base[1] = "//This is a comment\naddlight 0.0 position (4 -1 -4) color (.0 .2 .5 1)\naddlight 0.0 position (8 2 6) color #ffff\nshowgizmo true\nshowlight true"; function machinchose() { return 'test machin '; } function GetTextAreaCodeSrc() { return g_txtarea_code_src; } diff --git a/test/scenesetup-parser.y b/test/scenesetup-parser.y index 7ca47aa4..5b7d38bf 100644 --- a/test/scenesetup-parser.y +++ b/test/scenesetup-parser.y @@ -47,6 +47,7 @@ %token T_COLOR %token T_ADDLIGHT T_OBJPOSITION T_OBJLOOKAT T_OBJCOLOR T_CLEARCOLOR +%token T_SHOWGIZMO T_SHOWLIGHT %token T_CUSTOMCMD %token T_END 0 @@ -107,6 +108,7 @@ sstp_command_list: sstp_command: light_command | setup_command + | scene_command | custom_command ; @@ -128,9 +130,15 @@ setup_command: vec4 vv = vec4(v) * (1.f / 255.f); if (uc.m_last_cmd == "ADDLIGHT") uc.m_sstp.m_lights.Last()->SetColor(vv); } - | T_CLEARCOLOR v4 { uc.m_sstp.m_clear_color = vec4($2[0], $2[1], $2[2], $2[3]); } + ; + +scene_command: + T_CLEARCOLOR v4 { uc.m_sstp.m_clear_color = vec4($2[0], $2[1], $2[2], $2[3]); } + T_CLEARCOLOR v3 { uc.m_sstp.m_clear_color = vec4($2[0], $2[1], $2[2], 1.f); } | T_CLEARCOLOR COLOR { uint32_t x = $2; ivec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff); uc.m_sstp.m_clear_color = vec4(v) * (1.f / 255.f); } + | T_SHOWGIZMO bv { uc.m_sstp.m_show_gizmo = $2; } + | T_SHOWLIGHT bv { uc.m_sstp.m_show_lights = $2; } ; custom_command: diff --git a/test/scenesetup-scanner.l b/test/scenesetup-scanner.l index 4ce349b1..16eda4e7 100644 --- a/test/scenesetup-scanner.l +++ b/test/scenesetup-scanner.l @@ -53,6 +53,10 @@ lookat { return token::T_OBJLOOKAT; } color { return token::T_OBJCOLOR; } clearcolor { return token::T_CLEARCOLOR; } +showgizmo { return token::T_SHOWGIZMO; } +showlight { return token::T_SHOWLIGHT; } +custom { return token::T_CUSTOMCMD; } + custom { return token::T_CUSTOMCMD; } %{ /* ======= BASE COLOR TYPES ========================================= */ %} diff --git a/test/scenesetup.cpp b/test/scenesetup.cpp index 7061d301..6ae82ce7 100644 --- a/test/scenesetup.cpp +++ b/test/scenesetup.cpp @@ -25,6 +25,8 @@ namespace lol SceneSetup::SceneSetup() { m_clear_color = vec4(vec3::zero, 1.f); + m_show_gizmo = true; + m_show_lights = true; } //---- diff --git a/test/scenesetup.h b/test/scenesetup.h index 24092c2d..e2ac1a3d 100644 --- a/test/scenesetup.h +++ b/test/scenesetup.h @@ -42,6 +42,8 @@ public: vec4 m_clear_color; Array m_lights; Array m_custom_cmd; + bool m_show_gizmo; + bool m_show_lights; }; } /* namespace lol */ diff --git a/test/scenesetupdictionnary.js b/test/scenesetupdictionnary.js index d4b98a62..db1faa01 100644 --- a/test/scenesetupdictionnary.js +++ b/test/scenesetupdictionnary.js @@ -16,4 +16,6 @@ CmdType(["addlight"], "Add a light to the scene.\nUse other commands after thi CmdType(["position"], "Set a position.\nWhen put after a light, sets its position.", [CmdArg("vec3", "pos")]); CmdType(["color"], "Set a color.", [CmdArg("color", "color")]); CmdType(["clearcolor"], "Sets the color used for screen clearing.", [CmdArg("color", "color")]); +CmdType(["showgizmo"], "If true, show the axis gizmo.", [CmdArg("bool", "show")]); +CmdType(["showlight"], "If true, show the light locations.", [CmdArg("bool", "show")]);