slang syntax conforming spec rev. 1.10.59
authorMichal Krol <mjkrol@gmail.org>
Fri, 29 Oct 2004 17:09:40 +0000 (17:09 +0000)
committerMichal Krol <mjkrol@gmail.org>
Fri, 29 Oct 2004 17:09:40 +0000 (17:09 +0000)
src/mesa/shader/slang_shader.syn [new file with mode: 0644]
src/mesa/shader/slang_shader_syn.h [new file with mode: 0644]

diff --git a/src/mesa/shader/slang_shader.syn b/src/mesa/shader/slang_shader.syn
new file mode 100644 (file)
index 0000000..4aa0339
--- /dev/null
@@ -0,0 +1,1499 @@
+/*\r
+ * Mesa 3-D graphics library\r
+ * Version:  6.2\r
+ *\r
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included\r
+ * in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\r
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\r
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ */\r
+\r
+/*\r
+ * \file slang_shader.syn\r
+ * slang shader syntax\r
+ * \author Michal Krol\r
+ */\r
+\r
+/*\r
+ * usage:\r
+ *   syn2c slang_shader.syn > slang_shader_syn.h\r
+ *\r
+ * when modifying or extending this file, several things must be taken into consideration:\r
+ * - when adding new operators that were marked as reserved in the initial specification,\r
+ *   one must only uncomment particular lines of code that refer to operators being added;\r
+ * - when adding new shader target, one must reserve new value for shader_type register and\r
+ *   use it in .if constructs for symbols that are exclusive for that shader;\r
+ * - some symbols mimic output of other symbols - the best example is the "for" construct:\r
+ *   expression "for (foo(); ; bar())" is seen as "for (foo(); true; bar())" by the output\r
+ *   processor - hence, special care must be taken when rearranging output of essential symbols;\r
+ * - order of single-quoted tokens does matter in alternatives - so do not parse "<" operator\r
+ *   before "<<" and "<<" before "<<=";\r
+ * - all double-quoted tokens are internally preprocessed to eliminate problems with parsing\r
+ *   strings that are prefixes of other strings, like "sampler1D" and "sampler1DShadow";\r
+ */\r
+\r
+.syntax translation_unit;\r
+\r
+/* revision number - increment after each change affecting emitted output */\r
+.emtcode REVISION                                   1\r
+\r
+/* external declaration */\r
+.emtcode EXTERNAL_NULL                              0\r
+.emtcode EXTERNAL_FUNCTION_DEFINITION               1\r
+.emtcode EXTERNAL_DECLARATION                       2\r
+\r
+/* declaration */\r
+.emtcode DECLARATION_FUNCTION_PROTOTYPE             1\r
+.emtcode DECLARATION_INIT_DECLARATOR_LIST           2\r
+\r
+/* function type */\r
+.emtcode FUNCTION_ORDINARY                          0\r
+.emtcode FUNCTION_CONSTRUCTOR                       1\r
+.emtcode FUNCTION_OPERATOR                          2\r
+\r
+/* operator type */\r
+.emtcode OPERATOR_ASSIGN                            1\r
+.emtcode OPERATOR_ADDASSIGN                         2\r
+.emtcode OPERATOR_SUBASSIGN                         3\r
+.emtcode OPERATOR_MULASSIGN                         4\r
+.emtcode OPERATOR_DIVASSIGN                         5\r
+/*.emtcode OPERATOR_MODASSIGN                         6*/\r
+/*.emtcode OPERATOR_LSHASSIGN                         7*/\r
+/*.emtcode OPERATOR_RSHASSIGN                         8*/\r
+/*.emtcode OPERATOR_ORASSIGN                          9*/\r
+/*.emtcode OPERATOR_XORASSIGN                         10*/\r
+/*.emtcode OPERATOR_ANDASSIGN                         11*/\r
+.emtcode OPERATOR_LOGICALXOR                        12\r
+/*.emtcode OPERATOR_BITOR                             13*/\r
+/*.emtcode OPERATOR_BITXOR                            14*/\r
+/*.emtcode OPERATOR_BITAND                            15*/\r
+.emtcode OPERATOR_EQUAL                             16\r
+.emtcode OPERATOR_NOTEQUAL                          17\r
+.emtcode OPERATOR_LESS                              18\r
+.emtcode OPERATOR_GREATER                           19\r
+.emtcode OPERATOR_LESSEQUAL                         20\r
+.emtcode OPERATOR_GREATEREQUAL                      21\r
+/*.emtcode OPERATOR_LSHIFT                            22*/\r
+/*.emtcode OPERATOR_RSHIFT                            23*/\r
+.emtcode OPERATOR_MULTIPLY                          24\r
+.emtcode OPERATOR_DIVIDE                            25\r
+/*.emtcode OPERATOR_MODULUS                           26*/\r
+.emtcode OPERATOR_INCREMENT                         27\r
+.emtcode OPERATOR_DECREMENT                         28\r
+.emtcode OPERATOR_PLUS                              29\r
+.emtcode OPERATOR_MINUS                             30\r
+/*.emtcode OPERATOR_COMPLEMENT                        31*/\r
+.emtcode OPERATOR_NOT                               32\r
+\r
+/* init declarator list */\r
+.emtcode DECLARATOR_NONE                            0\r
+.emtcode DECLARATOR_NEXT                            1\r
+\r
+/* variable declaration */\r
+.emtcode VARIABLE_NONE                              0\r
+.emtcode VARIABLE_IDENTIFIER                        1\r
+.emtcode VARIABLE_INITIALIZER                       2\r
+.emtcode VARIABLE_ARRAY_EXPLICIT                    3\r
+.emtcode VARIABLE_ARRAY_UNKNOWN                     4\r
+\r
+/* type qualifier */\r
+.emtcode TYPE_QUALIFIER_NONE                        0\r
+.emtcode TYPE_QUALIFIER_CONST                       1\r
+.emtcode TYPE_QUALIFIER_ATTRIBUTE                   2\r
+.emtcode TYPE_QUALIFIER_VARYING                     3\r
+.emtcode TYPE_QUALIFIER_UNIFORM                     4\r
+\r
+/* type specifier */\r
+.emtcode TYPE_SPECIFIER_VOID                        0\r
+.emtcode TYPE_SPECIFIER_BOOL                        1\r
+.emtcode TYPE_SPECIFIER_BVEC2                       2\r
+.emtcode TYPE_SPECIFIER_BVEC3                       3\r
+.emtcode TYPE_SPECIFIER_BVEC4                       4\r
+.emtcode TYPE_SPECIFIER_INT                         5\r
+.emtcode TYPE_SPECIFIER_IVEC2                       6\r
+.emtcode TYPE_SPECIFIER_IVEC3                       7\r
+.emtcode TYPE_SPECIFIER_IVEC4                       8\r
+.emtcode TYPE_SPECIFIER_FLOAT                       9\r
+.emtcode TYPE_SPECIFIER_VEC2                        10\r
+.emtcode TYPE_SPECIFIER_VEC3                        11\r
+.emtcode TYPE_SPECIFIER_VEC4                        12\r
+.emtcode TYPE_SPECIFIER_MAT2                        13\r
+.emtcode TYPE_SPECIFIER_MAT3                        14\r
+.emtcode TYPE_SPECIFIER_MAT4                        15\r
+.emtcode TYPE_SPECIFIER_SAMPLER1D                   16\r
+.emtcode TYPE_SPECIFIER_SAMPLER2D                   17\r
+.emtcode TYPE_SPECIFIER_SAMPLER3D                   18\r
+.emtcode TYPE_SPECIFIER_SAMPLERCUBE                 19\r
+.emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW             20\r
+.emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW             21\r
+.emtcode TYPE_SPECIFIER_STRUCT                      22\r
+.emtcode TYPE_SPECIFIER_TYPENAME                    23\r
+\r
+/* structure field */\r
+.emtcode FIELD_NONE                                 0\r
+.emtcode FIELD_NEXT                                 1\r
+.emtcode FIELD_ARRAY                                2\r
+\r
+/* operation */\r
+.emtcode OP_END                                     0\r
+.emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE                1\r
+.emtcode OP_BLOCK_BEGIN_NEW_SCOPE                   2\r
+.emtcode OP_DECLARE                                 3\r
+.emtcode OP_ASM                                     4\r
+.emtcode OP_BREAK                                   5\r
+.emtcode OP_CONTINUE                                6\r
+.emtcode OP_DISCARD                                 7\r
+.emtcode OP_RETURN                                  8\r
+.emtcode OP_EXPRESSION                              9\r
+.emtcode OP_IF                                      10\r
+.emtcode OP_WHILE                                   11\r
+.emtcode OP_DO                                      12\r
+.emtcode OP_FOR                                     13\r
+.emtcode OP_PUSH_VOID                               14\r
+.emtcode OP_PUSH_BOOL                               15\r
+.emtcode OP_PUSH_INT                                16\r
+.emtcode OP_PUSH_FLOAT                              17\r
+.emtcode OP_PUSH_IDENTIFIER                         18\r
+.emtcode OP_SEQUENCE                                19\r
+.emtcode OP_ASSIGN                                  20\r
+.emtcode OP_ADDASSIGN                               21\r
+.emtcode OP_SUBASSIGN                               22\r
+.emtcode OP_MULASSIGN                               23\r
+.emtcode OP_DIVASSIGN                               24\r
+/*.emtcode OP_MODASSIGN                               25*/\r
+/*.emtcode OP_LSHASSIGN                               26*/\r
+/*.emtcode OP_RSHASSIGN                               27*/\r
+/*.emtcode OP_ORASSIGN                                28*/\r
+/*.emtcode OP_XORASSIGN                               29*/\r
+/*.emtcode OP_ANDASSIGN                               30*/\r
+.emtcode OP_SELECT                                  31\r
+.emtcode OP_LOGICALOR                               32\r
+.emtcode OP_LOGICALXOR                              33\r
+.emtcode OP_LOGICALAND                              34\r
+/*.emtcode OP_BITOR                                   35*/\r
+/*.emtcode OP_BITXOR                                  36*/\r
+/*.emtcode OP_BITAND                                  37*/\r
+.emtcode OP_EQUAL                                   38\r
+.emtcode OP_NOTEQUAL                                39\r
+.emtcode OP_LESS                                    40\r
+.emtcode OP_GREATER                                 41\r
+.emtcode OP_LESSEQUAL                               42\r
+.emtcode OP_GREATEREQUAL                            43\r
+/*.emtcode OP_LSHIFT                                  44*/\r
+/*.emtcode OP_RSHIFT                                  45*/\r
+.emtcode OP_ADD                                     46\r
+.emtcode OP_SUBTRACT                                47\r
+.emtcode OP_MULTIPLY                                48\r
+.emtcode OP_DIVIDE                                  49\r
+/*.emtcode OP_MODULUS                                 50*/\r
+.emtcode OP_PREINCREMENT                            51\r
+.emtcode OP_PREDECREMENT                            52\r
+.emtcode OP_PLUS                                    53\r
+.emtcode OP_MINUS                                   54\r
+/*.emtcode OP_COMPLEMENT                              55*/\r
+.emtcode OP_NOT                                     56\r
+.emtcode OP_SUBSCRIPT                               57\r
+.emtcode OP_CALL                                    58\r
+.emtcode OP_FIELD                                   59\r
+.emtcode OP_POSTINCREMENT                           60\r
+.emtcode OP_POSTDECREMENT                           61\r
+\r
+/* parameter qualifier */\r
+.emtcode PARAM_QUALIFIER_IN                         0\r
+.emtcode PARAM_QUALIFIER_OUT                        1\r
+.emtcode PARAM_QUALIFIER_INOUT                      2\r
+\r
+/* function parameter */\r
+.emtcode PARAMETER_NONE                             0\r
+.emtcode PARAMETER_NEXT                             1\r
+\r
+/* function parameter array presence */\r
+.emtcode PARAMETER_ARRAY_NOT_PRESENT                0\r
+.emtcode PARAMETER_ARRAY_PRESENT                    1\r
+\r
+.errtext INVALID_EXTERNAL_DECLARATION               "error 2001: invalid external declaration"\r
+.errtext INVALID_OPERATOR_OVERRIDE                  "error 2002: invalid operator override"\r
+.errtext LBRACE_EXPECTED                            "error 2003: '{' expected but '$err_token$' found"\r
+.errtext LPAREN_EXPECTED                            "error 2004: '(' expected but '$err_token$' found"\r
+.errtext RPAREN_EXPECTED                            "error 2005: ')' expected but '$err_token$' found"\r
+\r
+/* tells whether the shader that is being parsed is a built-in shader or not */\r
+/*   0 - normal behaviour */\r
+/*   1 - accepts constructor and operator definitions and __asm statements */\r
+/* the implementation will set it to 1 when compiling internal built-in shaders */\r
+.regbyte parsing_builtin                            0\r
+\r
+/* holds the type of shader that is being parsed, possible values are listed below */\r
+/*   FRAGMENT_SHADER            1 */\r
+/*   VERTEX_SHADER              2 */\r
+/* shader type is set by the caller before parsing */\r
+.regbyte shader_type                                0\r
+\r
+/*\r
+    <variable_identifier>               ::= <identifier>\r
+*/\r
+variable_identifier\r
+    identifier .emit OP_PUSH_IDENTIFIER;\r
+\r
+/*\r
+    <primary_expression>                ::= <variable_identifier>\r
+                                          | <intconstant>\r
+                                          | <floatconstant>\r
+                                          | <boolconstant>\r
+                                          | "(" <expression> ")"\r
+*/\r
+primary_expression\r
+    floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\r
+primary_expression_1\r
+    lparen .and expression .and rparen;\r
+\r
+/*\r
+    <postfix_expression>                ::= <primary_expression>\r
+                                          | <postfix_expression> "[" <integer_expression> "]"\r
+                                          | <function_call>\r
+                                          | <postfix_expression> "." <field_selection>\r
+                                          | <postfix_expression> "++"\r
+                                          | <postfix_expression> "--"\r
+*/\r
+postfix_expression\r
+    postfix_expression_1 .and .loop postfix_expression_2;\r
+postfix_expression_1\r
+    function_call .or primary_expression;\r
+postfix_expression_2\r
+    postfix_expression_3 .or postfix_expression_4 .or\r
+    plusplus .emit OP_POSTINCREMENT .or\r
+    minusminus .emit OP_POSTDECREMENT;\r
+postfix_expression_3\r
+    lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\r
+postfix_expression_4\r
+    dot .and field_selection .emit OP_FIELD;\r
+\r
+/*\r
+    <integer_expression>                ::= <expression>\r
+*/\r
+integer_expression\r
+    expression;\r
+\r
+/*\r
+    <function_call>                     ::= <function_call_generic>\r
+*/\r
+function_call\r
+    function_call_generic .emit OP_CALL .and .true .emit OP_END;\r
+\r
+/*\r
+    <function_call_generic>             ::= <function_call_header_with_parameters> ")"\r
+                                          | <function_call_header_no_parameters> ")"\r
+*/\r
+function_call_generic\r
+    function_call_generic_1 .or function_call_generic_2;\r
+function_call_generic_1\r
+    function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\r
+function_call_generic_2\r
+    function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\r
+\r
+/*\r
+    <function_call_header_no_parameters>::= <function_call_header> "void"\r
+                                          | <function_call_header>\r
+*/\r
+function_call_header_no_parameters\r
+    function_call_header .and function_call_header_no_parameters_1;\r
+function_call_header_no_parameters_1\r
+    "void" .or .true;\r
+\r
+/*\r
+    <function_call_header_with_parameters>::= <function_call_header> <assignment_expression>\r
+                                            | <function_call_header_with_parameters> ","\r
+                                              <assignment_expression>\r
+*/\r
+function_call_header_with_parameters\r
+    function_call_header .and assignment_expression .and .true .emit OP_END .and\r
+    .loop function_call_header_with_parameters_1;\r
+function_call_header_with_parameters_1\r
+    comma .and assignment_expression .and .true .emit OP_END;\r
+\r
+/*\r
+    <function_call_header>              ::= <function_identifier> "("\r
+*/\r
+function_call_header\r
+    function_identifier .and lparen;\r
+\r
+/*\r
+    <function_identifier>               ::= <constructor_identifier>\r
+                                          | <identifier>\r
+\r
+note: <constructor_identifier> has been deleted\r
+*/\r
+function_identifier\r
+    identifier;\r
+\r
+/*\r
+    <unary_expression>                  ::= <postfix_expression>\r
+                                          | "++" <unary_expression>\r
+                                          | "--" <unary_expression>\r
+                                          | <unary_operator> <unary_expression>\r
+\r
+    <unary_operator>                    ::= "+"\r
+                                          | "-"\r
+                                          | "!"\r
+                                          | "~" // reserved\r
+*/\r
+unary_expression\r
+    postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\r
+    unary_expression_4 .or unary_expression_5/* .or unary_expression_6*/;\r
+unary_expression_1\r
+    plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\r
+unary_expression_2\r
+    minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\r
+unary_expression_3\r
+    plus .and unary_expression .and .true .emit OP_PLUS;\r
+unary_expression_4\r
+    minus .and unary_expression .and .true .emit OP_MINUS;\r
+unary_expression_5\r
+    bang .and unary_expression .and .true .emit OP_NOT;\r
+/*unary_expression_6\r
+    tilde .and unary_expression .and .true .emit OP_COMPLEMENT;*/\r
+\r
+/*\r
+    <multiplicative_expression>         ::= <unary_expression>\r
+                                          | <multiplicative_expression> "*" <unary_expression>\r
+                                          | <multiplicative_expression> "/" <unary_expression>\r
+                                          | <multiplicative_expression> "%" <unary_expression> // reserved\r
+*/\r
+multiplicative_expression\r
+    unary_expression .and .loop multiplicative_expression_1;\r
+multiplicative_expression_1\r
+    multiplicative_expression_2 .or multiplicative_expression_3/* .or multiplicative_expression_4*/;\r
+multiplicative_expression_2\r
+    star .and unary_expression .and .true .emit OP_MULTIPLY;\r
+multiplicative_expression_3\r
+    slash .and unary_expression .and .true .emit OP_DIVIDE;\r
+/*multiplicative_expression_4\r
+    percent .and unary_expression .and .true .emit OP_MODULUS;*/\r
+\r
+/*\r
+    <additive_expression>               ::= <multiplicative_expression>\r
+                                          | <additive_expression> "+" <multiplicative_expression>\r
+                                          | <additive_expression> "-" <multiplicative_expression>\r
+*/\r
+additive_expression\r
+    multiplicative_expression .and .loop additive_expression_1;\r
+additive_expression_1\r
+    additive_expression_2 .or additive_expression_3;\r
+additive_expression_2\r
+    plus .and multiplicative_expression .and .true .emit OP_ADD;\r
+additive_expression_3\r
+    minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\r
+\r
+/*\r
+    <shift_expression>                  ::= <additive_expression>\r
+                                          | <shift_expression> "<<" <additive_expression> // reserved\r
+                                          | <shift_expression> ">>" <additive_expression> // reserved\r
+*/\r
+shift_expression\r
+    additive_expression/* .and .loop shift_expression_1*/;\r
+/*shift_expression_1\r
+    shift_expression_2 .or shift_expression_3;*/\r
+/*shift_expression_2\r
+    lessless .and additive_expression .and .true .emit OP_LSHIFT;*/\r
+/*shift_expression_3\r
+    greatergreater .and additive_expression .and .true .emit OP_RSHIFT;*/\r
+\r
+/*\r
+    <relational_expression>             ::= <shift_expression>\r
+                                          | <relational_expression> "<" <shift_expression>\r
+                                          | <relational_expression> ">" <shift_expression>\r
+                                          | <relational_expression> "<=" <shift_expression>\r
+                                          | <relational_expression> ">=" <shift_expression>\r
+*/\r
+relational_expression\r
+    shift_expression .and .loop relational_expression_1;\r
+relational_expression_1\r
+    relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\r
+    relational_expression_5;\r
+relational_expression_2\r
+    lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\r
+relational_expression_3\r
+    greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\r
+relational_expression_4\r
+    less .and shift_expression .and .true .emit OP_LESS;\r
+relational_expression_5\r
+    greater .and shift_expression .and .true .emit OP_GREATER;\r
+\r
+/*\r
+    <equality_expression>               ::= <relational_expression>\r
+                                          | <equality_expression> "==" <relational_expression>\r
+                                          | <equality_expression> "!=" <relational_expression>\r
+*/\r
+equality_expression\r
+    relational_expression .and .loop equality_expression_1;\r
+equality_expression_1\r
+    equality_expression_2 .or equality_expression_3;\r
+equality_expression_2\r
+    equalsequals .and relational_expression .and .true .emit OP_EQUAL;\r
+equality_expression_3\r
+    bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\r
+\r
+/*\r
+    <and_expression>                    ::= <equality_expression>\r
+                                          | <and_expression> "&" <equality_expression> // reserved\r
+*/\r
+and_expression\r
+    equality_expression/* .and .loop and_expression_1*/;\r
+/*and_expression_1\r
+    ampersand .and equality_expression .and .true .emit OP_BITAND;*/\r
+\r
+/*\r
+    <exclusive_or_expression>           ::= <and_expression>\r
+                                          | <exclusive_or_expression> "^" <and_expression> // reserved\r
+*/\r
+exclusive_or_expression\r
+    and_expression/* .and .loop exclusive_or_expression_1*/;\r
+/*exclusive_or_expression_1\r
+    caret .and and_expression .and .true .emit OP_BITXOR;*/\r
+\r
+/*\r
+    <inclusive_or_expression>           ::= <exclusive_or_expression>\r
+                                          | <inclusive_or_expression> "|" <exclusive_or_expression> // reserved\r
+*/\r
+inclusive_or_expression\r
+    exclusive_or_expression/* .and .loop inclusive_or_expression_1*/;\r
+/*inclusive_or_expression_1\r
+    bar .and exclusive_or_expression .and .true .emit OP_BITOR;*/\r
+\r
+/*\r
+    <logical_and_expression>            ::= <inclusive_or_expression>\r
+                                          | <logical_and_expression> "&&" <inclusive_or_expression>\r
+*/\r
+logical_and_expression\r
+    inclusive_or_expression .and .loop logical_and_expression_1;\r
+logical_and_expression_1\r
+    ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\r
+\r
+/*\r
+    <logical_xor_expression>            ::= <logical_and_expression>\r
+                                          | <logical_xor_expression> "^^" <logical_and_expression>\r
+*/\r
+logical_xor_expression\r
+    logical_and_expression .and .loop logical_xor_expression_1;\r
+logical_xor_expression_1\r
+    caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\r
+\r
+/*\r
+    <logical_or_expression>             ::= <logical_xor_expression>\r
+                                          | <logical_or_expression> "||" <logical_xor_expression>\r
+*/\r
+logical_or_expression\r
+    logical_xor_expression .and .loop logical_or_expression_1;\r
+logical_or_expression_1\r
+    barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\r
+\r
+/*\r
+    <conditional_expression>            ::= <logical_or_expression>\r
+                                          | <logical_or_expression> "?" <expression> ":"\r
+                                            <conditional_expression>\r
+*/\r
+conditional_expression\r
+    logical_or_expression .and .loop conditional_expression_1;\r
+conditional_expression_1\r
+    question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\r
+\r
+/*\r
+    <assignment_expression>             ::= <conditional_expression>\r
+                                          | <unary_expression> <assignment_operator>\r
+                                            <assignment_expression>\r
+\r
+    <assignment_operator>               ::= "="\r
+                                          | "*="\r
+                                          | "/="\r
+                                          | "+="\r
+                                          | "-="\r
+                                          | "%=" // reserved\r
+                                          | "<<=" // reserved\r
+                                          | ">>=" // reserved\r
+                                          | "&=" // reserved\r
+                                          | "^=" // reserved\r
+                                          | "|=" // reserved\r
+*/\r
+assignment_expression\r
+    assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\r
+    assignment_expression_4 .or assignment_expression_5/* .or assignment_expression_6 .or\r
+    assignment_expression_7 .or assignment_expression_8 .or assignment_expression_9 .or\r
+    assignment_expression_10 .or assignment_expression_11*/ .or conditional_expression;\r
+assignment_expression_1\r
+    unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\r
+assignment_expression_2\r
+    unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\r
+assignment_expression_3\r
+    unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\r
+assignment_expression_4\r
+    unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\r
+assignment_expression_5\r
+    unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\r
+/*assignment_expression_6\r
+    unary_expression .and percentequals .and assignment_expression .and .true .emit OP_MODASSIGN;*/\r
+/*assignment_expression_7\r
+    unary_expression .and lesslessequals .and assignment_expression .and .true .emit OP_LSHASSIGN;*/\r
+/*assignment_expression_8\r
+    unary_expression .and greatergreaterequals .and assignment_expression .and\r
+    .true .emit OP_RSHASSIGN;*/\r
+/*assignment_expression_9\r
+    unary_expression .and ampersandequals .and assignment_expression .and .true .emit OP_ANDASSIGN;*/\r
+/*assignment_expression_10\r
+    unary_expression .and caretequals .and assignment_expression .and .true .emit OP_XORASSIGN;*/\r
+/*assignment_expression_11\r
+    unary_expression .and barequals .and assignment_expression .and .true .emit OP_ORASSIGN;*/\r
+\r
+/*\r
+    <expression>                        ::= <assignment_expression>\r
+                                          | <expression> "," <assignment_expression>\r
+*/\r
+expression\r
+    assignment_expression .and .loop expression_1;\r
+expression_1\r
+    comma .and assignment_expression .and .true .emit OP_SEQUENCE;\r
+\r
+/*\r
+    <constant_expression>               ::= <conditional_expression>\r
+*/\r
+constant_expression\r
+    conditional_expression .and .true .emit OP_END;\r
+\r
+/*\r
+    <declaration>                       ::= <function_prototype> ";"\r
+                                          | <init_declarator_list> ";"\r
+*/\r
+declaration\r
+    declaration_1 .or declaration_2;\r
+declaration_1\r
+    function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\r
+declaration_2\r
+    init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\r
+\r
+/*\r
+    <function_prototype>                ::= <function_declarator> ")"\r
+*/\r
+function_prototype\r
+    function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\r
+\r
+/*\r
+    <function_declarator>               ::= <function_header>\r
+                                          | <function_header_with_parameters>\r
+*/\r
+function_declarator\r
+    function_header_with_parameters .or function_header;\r
+\r
+/*\r
+    <function_header_with_parameters>   ::= <function_header> <parameter_declaration>\r
+                                          | <function_header_with_parameters> ","\r
+                                            <parameter_declaration>\r
+*/\r
+function_header_with_parameters\r
+    function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\r
+function_header_with_parameters_1\r
+    comma .and parameter_declaration;\r
+\r
+/*\r
+    <function_header>                   ::= <fully_specified_type> <identifier> "("\r
+*/\r
+function_header\r
+    function_header_nospace .or function_header_space;\r
+function_header_space\r
+    fully_specified_type_space .and space .and function_decl_identifier .and lparen;\r
+function_header_nospace\r
+    fully_specified_type_nospace .and function_decl_identifier .and lparen;\r
+\r
+/*\r
+    <function_decl_identifier>          ::= "__constructor"\r
+                                          | <__operator>\r
+                                          | <identifier>\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+      operator and constructor prototypes and definitions\r
+*/\r
+function_decl_identifier\r
+    .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\r
+    .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or\r
+    identifier .emit FUNCTION_ORDINARY;\r
+\r
+/*\r
+    <__operator>                        ::= "__operator" <overriden_op>\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+      operator prototypes and definitions\r
+*/\r
+__operator\r
+    "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\r
+\r
+/*\r
+    <overriden_op>                      ::= "="\r
+                                          | "+="\r
+                                          | "-="\r
+                                          | "*="\r
+                                          | "/="\r
+                                          | "%=" // reserved\r
+                                          | "<<=" // reserved\r
+                                          | ">>=" // reserved\r
+                                          | "&=" // reserved\r
+                                          | "^=" // reserved\r
+                                          | "|=" // reserved\r
+                                          | "^^"\r
+                                          | "|" // reserved\r
+                                          | "^" // reserved\r
+                                          | "&" // reserved\r
+                                          | "=="\r
+                                          | "!="\r
+                                          | "<"\r
+                                          | ">"\r
+                                          | "<="\r
+                                          | ">="\r
+                                          | "<<" // reserved\r
+                                          | ">>" // reserved\r
+                                          | "*"\r
+                                          | "/"\r
+                                          | "%" // reserved\r
+                                          | "++"\r
+                                          | "--"\r
+                                          | "+"\r
+                                          | "-"\r
+                                          | "~" // reserved\r
+                                          | "!"\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+      operator prototypes and definitions\r
+*/\r
+overriden_operator\r
+    plusplus .emit OPERATOR_INCREMENT .or\r
+    plusequals .emit OPERATOR_ADDASSIGN .or\r
+    plus .emit OPERATOR_PLUS .or\r
+    minusminus .emit OPERATOR_DECREMENT .or\r
+    minusequals .emit OPERATOR_SUBASSIGN .or\r
+    minus .emit OPERATOR_MINUS .or\r
+    bangequals .emit OPERATOR_NOTEQUAL .or\r
+    bang .emit OPERATOR_NOT .or\r
+    starequals .emit OPERATOR_MULASSIGN .or\r
+    star .emit OPERATOR_MULTIPLY .or\r
+    slashequals .emit OPERATOR_DIVASSIGN .or\r
+    slash .emit OPERATOR_DIVIDE .or\r
+    lessequals .emit OPERATOR_LESSEQUAL .or\r
+    /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/\r
+    /*lessless .emit OPERATOR_LSHIFT .or*/\r
+    less .emit OPERATOR_LESS .or\r
+    greaterequals .emit OPERATOR_GREATEREQUAL .or\r
+    /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/\r
+    /*greatergreater .emit OPERATOR_RSHIFT .or*/\r
+    greater .emit OPERATOR_GREATER .or\r
+    equalsequals .emit OPERATOR_EQUAL .or\r
+    equals .emit OPERATOR_ASSIGN .or\r
+    /*percentequals .emit OPERATOR_MODASSIGN .or*/\r
+    /*percent .emit OPERATOR_MODULUS .or*/\r
+    /*ampersandequals .emit OPERATOR_ANDASSIGN */\r
+    /*ampersand .emit OPERATOR_BITAND .or*/\r
+    /*barequals .emit OPERATOR_ORASSIGN .or*/\r
+    /*bar .emit OPERATOR_BITOR .or*/\r
+    /*tilde .emit OPERATOR_COMPLEMENT .or*/\r
+    /*caretequals .emit OPERATOR_XORASSIGN .or*/\r
+    caretcaret .emit OPERATOR_LOGICALXOR /*.or\r
+    caret .emit OPERATOR_BITXOR*/;\r
+\r
+/*\r
+    <parameter_declarator>              ::= <type_specifier> <identifier>\r
+                                          | <type_specifier> <identifier> "[" <constant_expression>\r
+                                            "]"\r
+*/\r
+parameter_declarator\r
+    parameter_declarator_nospace .or parameter_declarator_space;\r
+parameter_declarator_nospace\r
+    type_specifier_nospace .and identifier .and parameter_declarator_1;\r
+parameter_declarator_space\r
+    type_specifier_space .and space .and identifier .and parameter_declarator_1;\r
+parameter_declarator_1\r
+    parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\r
+    .true .emit PARAMETER_ARRAY_NOT_PRESENT;\r
+parameter_declarator_2\r
+    lbracket .and constant_expression .and rbracket;\r
+\r
+/*\r
+    <parameter_declaration>             ::= <type_qualifier> <parameter_qualifier>\r
+                                            <parameter_declarator>\r
+                                          | <type_qualifier> <parameter_qualifier>\r
+                                            <parameter_type_specifier>\r
+                                          | <parameter_qualifier> <parameter_declarator>\r
+                                          | <parameter_qualifier> <parameter_type_specifier>\r
+*/\r
+parameter_declaration\r
+    parameter_declaration_1 .emit PARAMETER_NEXT;\r
+parameter_declaration_1\r
+    parameter_declaration_2 .or parameter_declaration_3;\r
+parameter_declaration_2\r
+    type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\r
+parameter_declaration_3\r
+    parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\r
+parameter_declaration_4\r
+    parameter_declarator .or parameter_type_specifier;\r
+\r
+/*\r
+    <parameter_qualifier>               ::= "in"\r
+                                          | "out"\r
+                                          | "inout"\r
+                                          | ""\r
+*/\r
+parameter_qualifier\r
+    parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\r
+parameter_qualifier_1\r
+    parameter_qualifier_2 .and space;\r
+parameter_qualifier_2\r
+    "in" .emit PARAM_QUALIFIER_IN .or\r
+    "out" .emit PARAM_QUALIFIER_OUT .or\r
+    "inout" .emit PARAM_QUALIFIER_INOUT;\r
+\r
+/*\r
+    <parameter_type_specifier>          ::= <type_specifier>\r
+                                          | <type_specifier> "[" <constant_expression> "]"\r
+*/\r
+parameter_type_specifier\r
+    parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2;\r
+parameter_type_specifier_1\r
+    type_specifier_nospace .or type_specifier_space;\r
+parameter_type_specifier_2\r
+    parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\r
+    .true .emit PARAMETER_ARRAY_NOT_PRESENT;\r
+parameter_type_specifier_3\r
+    lbracket .and constant_expression .and rbracket;\r
+\r
+/*\r
+    <init_declarator_list>              ::= <single_declaration>\r
+                                          | <init_declarator_list> "," <identifier>\r
+                                          | <init_declarator_list> "," <identifier> "[" "]"\r
+                                          | <init_declarator_list> "," <identifier> "["\r
+                                            <constant_expression> "]"\r
+                                          | <init_declarator_list> "," <identifier> "="\r
+                                            <initializer>\r
+*/\r
+init_declarator_list\r
+    single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\r
+    .true .emit DECLARATOR_NONE;\r
+init_declarator_list_1\r
+    comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\r
+init_declarator_list_2\r
+    init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\r
+init_declarator_list_3\r
+    equals .and initializer .emit VARIABLE_INITIALIZER;\r
+init_declarator_list_4\r
+    lbracket .and init_declarator_list_5 .and rbracket;\r
+init_declarator_list_5\r
+    constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\r
+\r
+/*\r
+    <single_declaration>                ::= <fully_specified_type>\r
+                                          | <fully_specified_type> <identifier>\r
+                                          | <fully_specified_type> <identifier> "[" "]"\r
+                                          | <fully_specified_type> <identifier> "["\r
+                                            <constant_expression> "]"\r
+                                          | <fully_specified_type> <identifier> "=" <initializer>\r
+*/\r
+single_declaration\r
+    single_declaration_nospace .or single_declaration_space;\r
+single_declaration_space\r
+    fully_specified_type_space .and single_declaration_space_1;\r
+single_declaration_nospace\r
+    fully_specified_type_nospace .and single_declaration_nospace_1;\r
+single_declaration_space_1\r
+    single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\r
+single_declaration_nospace_1\r
+    single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\r
+single_declaration_space_2\r
+    space .and identifier .and single_declaration_3;\r
+single_declaration_nospace_2\r
+    identifier .and single_declaration_3;\r
+single_declaration_3\r
+    single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\r
+single_declaration_4\r
+    equals .and initializer .emit VARIABLE_INITIALIZER;\r
+single_declaration_5\r
+    lbracket .and single_declaration_6 .and rbracket;\r
+single_declaration_6\r
+    constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\r
+\r
+/*\r
+    <fully_specified_type>              ::= <type_specifier>\r
+                                          | <type_qualifier> <type_specifier>\r
+*/\r
+fully_specified_type_space\r
+    fully_specified_type_1 .and type_specifier_space;\r
+fully_specified_type_nospace\r
+    fully_specified_type_1 .and type_specifier_nospace;\r
+fully_specified_type_1\r
+    fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\r
+fully_specified_type_2\r
+    type_qualifier .and space;\r
+\r
+/*\r
+    <type_qualifier>                    ::= "const"\r
+                                          | "attribute" // Vertex only.\r
+                                          | "varying"\r
+                                          | "uniform"\r
+*/\r
+type_qualifier\r
+    "const" .emit TYPE_QUALIFIER_CONST .or\r
+    .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or\r
+    "varying" .emit TYPE_QUALIFIER_VARYING .or\r
+    "uniform" .emit TYPE_QUALIFIER_UNIFORM;\r
+\r
+/*\r
+    <type_specifier>                    ::= "void"\r
+                                          | "float"\r
+                                          | "int"\r
+                                          | "bool"\r
+                                          | "vec2"\r
+                                          | "vec3"\r
+                                          | "vec4"\r
+                                          | "bvec2"\r
+                                          | "bvec3"\r
+                                          | "bvec4"\r
+                                          | "ivec2"\r
+                                          | "ivec3"\r
+                                          | "ivec4"\r
+                                          | "mat2"\r
+                                          | "mat3"\r
+                                          | "mat4"\r
+                                          | "sampler1D"\r
+                                          | "sampler2D"\r
+                                          | "sampler3D"\r
+                                          | "samplerCube"\r
+                                          | "sampler1DShadow"\r
+                                          | "sampler2DShadow"\r
+                                          | <struct_specifier>\r
+                                          | <type_name>\r
+*/\r
+type_specifier_space\r
+    "void" .emit TYPE_SPECIFIER_VOID .or\r
+    "float" .emit TYPE_SPECIFIER_FLOAT .or\r
+    "int" .emit TYPE_SPECIFIER_INT .or\r
+    "bool" .emit TYPE_SPECIFIER_BOOL .or\r
+    "vec2" .emit TYPE_SPECIFIER_VEC2 .or\r
+    "vec3" .emit TYPE_SPECIFIER_VEC3 .or\r
+    "vec4" .emit TYPE_SPECIFIER_VEC4 .or\r
+    "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or\r
+    "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or\r
+    "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or\r
+    "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or\r
+    "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or\r
+    "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or\r
+    "mat2" .emit TYPE_SPECIFIER_MAT2 .or\r
+    "mat3" .emit TYPE_SPECIFIER_MAT3 .or\r
+    "mat4" .emit TYPE_SPECIFIER_MAT4 .or\r
+    "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or\r
+    "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or\r
+    "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or\r
+    "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\r
+    "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\r
+    "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\r
+    type_name .emit TYPE_SPECIFIER_TYPENAME;\r
+type_specifier_nospace\r
+    struct_specifier .emit TYPE_SPECIFIER_STRUCT;\r
+\r
+/*\r
+    <struct_specifier>                  ::= "struct" <identifier> "{" <struct_declaration_list> "}"\r
+                                          | "struct" "{" <struct_declaration_list> "}"\r
+*/\r
+struct_specifier\r
+    "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\r
+    struct_declaration_list .and rbrace .emit FIELD_NONE;\r
+struct_specifier_1\r
+    struct_specifier_2 .or .true .emit '\0';\r
+struct_specifier_2\r
+    space .and identifier;\r
+\r
+/*\r
+    <struct_declaration_list>           ::= <struct_declaration>\r
+                                          | <struct_declaration_list> <struct_declaration>\r
+*/\r
+struct_declaration_list\r
+    struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\r
+\r
+/*\r
+    <struct_declaration>                ::= <type_specifier> <struct_declarator_list> ";"\r
+*/\r
+struct_declaration\r
+    struct_declaration_nospace .or struct_declaration_space;\r
+struct_declaration_space\r
+    type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\r
+struct_declaration_nospace\r
+    type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\r
+\r
+/*\r
+    <struct_declarator_list>            ::= <struct_declarator>\r
+                                          | <struct_declarator_list> "," <struct_declarator>\r
+*/\r
+struct_declarator_list\r
+    struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\r
+struct_declarator_list_1\r
+    comma .and struct_declarator;\r
+\r
+/*\r
+    <struct_declarator>                 ::= <identifier>\r
+                                          | <identifier> "[" <constant_expression> "]"\r
+*/\r
+struct_declarator\r
+    identifier .and struct_declarator_1;\r
+struct_declarator_1\r
+    struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\r
+struct_declarator_2\r
+    lbracket .and constant_expression .and rbracket;\r
+\r
+/*\r
+    <initializer>                       ::= <assignment_expression>\r
+*/\r
+initializer\r
+    assignment_expression .and .true .emit OP_END;\r
+\r
+/*\r
+    <declaration_statement>             ::= <declaration>\r
+*/\r
+declaration_statement\r
+    declaration;\r
+\r
+/*\r
+    <statement>                         ::= <compound_statement>\r
+                                          | <simple_statement>\r
+*/\r
+statement\r
+    compound_statement .or simple_statement;\r
+statement_space\r
+    compound_statement .or statement_space_1;\r
+statement_space_1\r
+    space .and simple_statement;\r
+\r
+/*\r
+    <simple_statement>                  ::= <__asm_statement>\r
+                                          | <selection_statement>\r
+                                          | <iteration_statement>\r
+                                          | <jump_statement>\r
+                                          | <expression_statement>\r
+                                          | <declaration_statement>\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+      use of __asm statements\r
+*/\r
+simple_statement\r
+    .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\r
+    selection_statement .or\r
+    iteration_statement .or\r
+    jump_statement .or\r
+    expression_statement .emit OP_EXPRESSION .or\r
+    declaration_statement .emit OP_DECLARE;\r
+\r
+/*\r
+    <compound_statement>                ::= "{" "}"\r
+                                          | "{" <statement_list> "}"\r
+*/\r
+compound_statement\r
+    compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\r
+compound_statement_1\r
+    compound_statement_2 .or compound_statement_3;\r
+compound_statement_2\r
+    lbrace .and rbrace;\r
+compound_statement_3\r
+    lbrace .and statement_list .and rbrace;\r
+\r
+/*\r
+    <statement_no_new_scope>            ::= <compound_statement_no_new_scope>\r
+                                          | <simple_statement>\r
+*/\r
+statement_no_new_scope\r
+    compound_statement_no_new_scope .or simple_statement;\r
+\r
+/*\r
+    <compound_statement_no_new_scope>   ::= "{" "}"\r
+                                          | "{" <statement_list> "}"\r
+*/\r
+compound_statement_no_new_scope\r
+    compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\r
+compound_statement_no_new_scope_1\r
+    compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\r
+compound_statement_no_new_scope_2\r
+    lbrace .and rbrace;\r
+compound_statement_no_new_scope_3\r
+    lbrace .and statement_list .and rbrace;\r
+\r
+/*\r
+    <statement_list>                    ::= <statement>\r
+                                          | <statement_list> <statement>\r
+*/\r
+statement_list\r
+    statement .and .loop statement;\r
+\r
+/*\r
+    <expression_statement>              ::= ";"\r
+                                          | <expression> ";"\r
+*/\r
+expression_statement\r
+    expression_statement_1 .or expression_statement_2;\r
+expression_statement_1\r
+    semicolon .emit OP_PUSH_VOID .emit OP_END;\r
+expression_statement_2\r
+    expression .and semicolon .emit OP_END;\r
+\r
+/*\r
+    <selection_statement>               ::= "if" "(" <expression> ")" <selection_rest_statement>\r
+*/\r
+selection_statement\r
+    "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\r
+    rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\r
+\r
+/*\r
+    <selection_rest_statement>          ::= <statement> "else" <statement>\r
+                                          | <statement>\r
+*/\r
+selection_rest_statement\r
+    statement .and selection_rest_statement_1;\r
+selection_rest_statement_1\r
+    selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\r
+selection_rest_statement_2\r
+    "else" .and optional_space .and statement;\r
+\r
+/*\r
+    <condition>                         ::= <expression>\r
+                                          | <fully_specified_type> <identifier> "=" <initializer>\r
+\r
+note: if <condition_1> is executed, the emit format must match <declaration> emit format\r
+*/\r
+condition\r
+    condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\r
+    condition_3 .emit OP_EXPRESSION;\r
+condition_1\r
+    condition_1_nospace .or condition_1_space;\r
+condition_1_nospace\r
+    fully_specified_type_nospace .and condition_2;\r
+condition_1_space\r
+    fully_specified_type_space .and space .and condition_2;\r
+condition_2\r
+    identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\r
+    initializer .and .true .emit DECLARATOR_NONE;\r
+condition_3\r
+    expression .and .true .emit OP_END;\r
+\r
+/*\r
+    <iteration_statement>               ::= "while" "(" <condition> ")" <statement_no_new_scope>\r
+                                          | "do" <statement> "while" "(" <expression> ")" ";"\r
+                                          | "for" "(" <for_init_statement> <for_rest_statement> ")"\r
+                                            <statement_no_new_scope>\r
+*/\r
+iteration_statement\r
+    iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\r
+iteration_statement_1\r
+    "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\r
+    rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\r
+iteration_statement_2\r
+    "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and\r
+    expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\r
+iteration_statement_3\r
+    "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\r
+    for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\r
+\r
+/*\r
+    <for_init_statement>                ::= <expression_statement>\r
+                                          | <declaration_statement>\r
+*/\r
+for_init_statement\r
+    expression_statement .or declaration_statement;\r
+\r
+/*\r
+    <conditionopt>                      ::= <condition>\r
+                                          | ""\r
+\r
+note: <conditionopt> is used only by "for" statement - if <condition> is ommitted, parser\r
+      simulates default behaviour, that is simulates "true" expression\r
+*/\r
+conditionopt\r
+    condition .or\r
+    .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END;\r
+\r
+/*\r
+    <for_rest_statement>                ::= <conditionopt> ";"\r
+                                          | <conditionopt> ";" <expression>\r
+*/\r
+for_rest_statement\r
+    conditionopt .and semicolon .and for_rest_statement_1;\r
+for_rest_statement_1\r
+    for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\r
+for_rest_statement_2\r
+    expression .and .true .emit OP_END;\r
+\r
+/*\r
+    <jump_statement>                    ::= "continue" ";"\r
+                                          | "break" ";"\r
+                                          | "return" ";"\r
+                                          | "return" <expression> ";"\r
+                                          | "discard" ";" // Fragment shader only.\r
+*/\r
+jump_statement\r
+    jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\r
+    .if (shader_type == 1) jump_statement_5;\r
+jump_statement_1\r
+    "continue" .and semicolon .emit OP_CONTINUE;\r
+jump_statement_2\r
+    "break" .and semicolon .emit OP_BREAK;\r
+jump_statement_3\r
+    "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\r
+jump_statement_4\r
+    "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\r
+jump_statement_5\r
+    "discard" .and semicolon .emit OP_DISCARD;\r
+\r
+/*\r
+    <__asm_statement>                   ::= "__asm" <identifier> <asm_arguments> ";"\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+      __asm statements\r
+*/\r
+__asm_statement\r
+    "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\r
+\r
+/*\r
+    <asm_arguments>                     ::= <identifier>\r
+                                          | <asm_arguments> "," <identifier>\r
+\r
+note: this is an extension to the standard language specification - normally slang disallows\r
+      __asm statements\r
+*/\r
+asm_arguments\r
+    variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;\r
+asm_arguments_1\r
+    comma .and variable_identifier .and .true .emit OP_END;\r
+\r
+/*\r
+    <translation_unit>                  ::= <external_declaration>\r
+                                          | <translation_unit> <external_declaration>\r
+*/\r
+translation_unit\r
+    optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\r
+    .loop external_declaration .and optional_space .and\r
+    '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\r
+\r
+/*\r
+    <external_declaration>              ::= <function_definition>\r
+                                          | <declaration>\r
+*/\r
+external_declaration\r
+    function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\r
+    declaration .emit EXTERNAL_DECLARATION;\r
+\r
+/*\r
+    <function_definition>               :: <function_prototype> <compound_statement_no_new_scope>\r
+*/\r
+function_definition\r
+    function_prototype .and compound_statement_no_new_scope;\r
+\r
+/* helper rulez, not part of the official language syntax */\r
+\r
+digit_oct\r
+    '0'-'7';\r
+\r
+digit_dec\r
+    '0'-'9';\r
+\r
+digit_hex\r
+    '0'-'9' .or 'A'-'F' .or 'a'-'f';\r
+\r
+id_character_first\r
+    'a'-'z' .or 'A'-'Z' .or '_';\r
+\r
+id_character_next\r
+    id_character_first .or digit_dec;\r
+\r
+identifier\r
+    id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0';\r
+\r
+float\r
+    float_1 .or float_2;\r
+float_1\r
+    float_fractional_constant .and float_optional_exponent_part;\r
+float_2\r
+    float_digit_sequence .and .true .emit '\0' .and float_exponent_part;\r
+\r
+float_fractional_constant\r
+    float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\r
+float_fractional_constant_1\r
+    float_digit_sequence .and '.' .and float_digit_sequence;\r
+float_fractional_constant_2\r
+    float_digit_sequence .and '.' .and .true .emit '\0';\r
+float_fractional_constant_3\r
+    '.' .emit '\0' .and float_digit_sequence;\r
+\r
+float_optional_exponent_part\r
+    float_exponent_part .or .true .emit '\0';\r
+\r
+float_digit_sequence\r
+    digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0';\r
+\r
+float_exponent_part\r
+    float_exponent_part_1 .or float_exponent_part_2;\r
+float_exponent_part_1\r
+    'e' .and float_optional_sign .and float_digit_sequence;\r
+float_exponent_part_2\r
+    'E' .and float_optional_sign .and float_digit_sequence;\r
+\r
+float_optional_sign\r
+    float_sign .or .true;\r
+\r
+float_sign\r
+    '+' .or '-' .emit '-';\r
+\r
+integer\r
+    integer_hex .or integer_oct .or integer_dec;\r
+\r
+integer_hex\r
+    '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\r
+    .true .emit '\0';\r
+integer_hex_1\r
+    'x' .or 'X';\r
+\r
+integer_oct\r
+    '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\0';\r
+\r
+integer_dec\r
+    digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0';\r
+\r
+boolean\r
+    "true" .emit 2 .emit '1' .emit '\0' .or\r
+    "false" .emit 2 .emit '0' .emit '\0';\r
+\r
+type_name\r
+    identifier;\r
+\r
+field_selection\r
+    identifier;\r
+\r
+floatconstant\r
+    float .emit OP_PUSH_FLOAT;\r
+\r
+intconstant\r
+    integer .emit OP_PUSH_INT;\r
+\r
+boolconstant\r
+    boolean .emit OP_PUSH_BOOL;\r
+\r
+optional_space\r
+    .loop single_space;\r
+\r
+space\r
+    single_space .and .loop single_space;\r
+\r
+single_space\r
+    white_char .or c_style_comment_block .or cpp_style_comment_block;\r
+\r
+white_char\r
+    ' ' .or '\t' .or new_line .or '\v' .or '\f';\r
+\r
+new_line\r
+    cr_lf .or lf_cr .or '\n' .or '\r';\r
+\r
+cr_lf\r
+    '\r' .and '\n';\r
+\r
+lf_cr\r
+    '\n' .and '\r';\r
+\r
+c_style_comment_block\r
+    '/' .and '*' .and c_style_comment_rest;\r
+\r
+c_style_comment_rest\r
+    .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\r
+c_style_comment_rest_1\r
+    c_style_comment_end .or c_style_comment_rest_2;\r
+c_style_comment_rest_2\r
+    '*' .and c_style_comment_rest;\r
+\r
+c_style_comment_char_no_star\r
+    '\x2B'-'\xFF' .or '\x01'-'\x29';\r
+\r
+c_style_comment_end\r
+    '*' .and '/';\r
+\r
+cpp_style_comment_block\r
+    '/' .and '/' .and cpp_style_comment_block_1;\r
+cpp_style_comment_block_1\r
+    cpp_style_comment_block_2 .or cpp_style_comment_block_3;\r
+cpp_style_comment_block_2\r
+    .loop cpp_style_comment_char .and new_line;\r
+cpp_style_comment_block_3\r
+    .loop cpp_style_comment_char;\r
+\r
+cpp_style_comment_char\r
+    '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C';\r
+\r
+/* lexical rulez */\r
+\r
+/*ampersand\r
+    optional_space .and '&' .and optional_space;*/\r
+\r
+ampersandampersand\r
+    optional_space .and '&' .and '&' .and optional_space;\r
+\r
+/*ampersandequals\r
+    optional_space .and '&' .and '=' .and optional_space;*/\r
+\r
+/*bar\r
+    optional_space .and '|' .and optional_space;*/\r
+\r
+barbar\r
+    optional_space .and '|' .and '|' .and optional_space;\r
+\r
+/*barequals\r
+    optional_space .and '|' .and '=' .and optional_space;*/\r
+\r
+bang\r
+    optional_space .and '!' .and optional_space;\r
+\r
+bangequals\r
+    optional_space .and '!' .and '=' .and optional_space;\r
+\r
+/*caret\r
+    optional_space .and '^' .and optional_space;*/\r
+\r
+caretcaret\r
+    optional_space .and '^' .and '^' .and optional_space;\r
+\r
+/*caretequals\r
+    optional_space .and '^' .and '=' .and optional_space;*/\r
+\r
+colon\r
+    optional_space .and ':' .and optional_space;\r
+\r
+comma\r
+    optional_space .and ',' .and optional_space;\r
+\r
+dot\r
+    optional_space .and '.' .and optional_space;\r
+\r
+equals\r
+    optional_space .and '=' .and optional_space;\r
+\r
+equalsequals\r
+    optional_space .and '=' .and '=' .and optional_space;\r
+\r
+greater\r
+    optional_space .and '>' .and optional_space;\r
+\r
+greaterequals\r
+    optional_space .and '>' .and '=' .and optional_space;\r
+\r
+/*greatergreater\r
+    optional_space .and '>' .and '>' .and optional_space;*/\r
+\r
+/*greatergreaterequals\r
+    optional_space .and '>' .and '>' .and '=' .and optional_space;*/\r
+\r
+lbrace\r
+    optional_space .and '{' .and optional_space;\r
+\r
+lbracket\r
+    optional_space .and '[' .and optional_space;\r
+\r
+less\r
+    optional_space .and '<' .and optional_space;\r
+\r
+lessequals\r
+    optional_space .and '<' .and '=' .and optional_space;\r
+\r
+/*lessless\r
+    optional_space .and '<' .and '<' .and optional_space;*/\r
+\r
+/*lesslessequals\r
+    optional_space .and '<' .and '<' .and '=' .and optional_space;*/\r
+\r
+lparen\r
+    optional_space .and '(' .and optional_space;\r
+\r
+minus\r
+    optional_space .and '-' .and optional_space;\r
+\r
+minusequals\r
+    optional_space .and '-' .and '=' .and optional_space;\r
+\r
+minusminus\r
+    optional_space .and '-' .and '-' .and optional_space;\r
+\r
+/*percent\r
+    optional_space .and '%' .and optional_space;*/\r
+\r
+/*percentequals\r
+    optional_space .and '%' .and '=' .and optional_space;*/\r
+\r
+plus\r
+    optional_space .and '+' .and optional_space;\r
+\r
+plusequals\r
+    optional_space .and '+' .and '=' .and optional_space;\r
+\r
+plusplus\r
+    optional_space .and '+' .and '+' .and optional_space;\r
+\r
+question\r
+    optional_space .and '?' .and optional_space;\r
+\r
+rbrace\r
+    optional_space .and '}' .and optional_space;\r
+\r
+rbracket\r
+    optional_space .and ']' .and optional_space;\r
+\r
+rparen\r
+    optional_space .and ')' .and optional_space;\r
+\r
+semicolon\r
+    optional_space .and ';' .and optional_space;\r
+\r
+slash\r
+    optional_space .and '/' .and optional_space;\r
+\r
+slashequals\r
+    optional_space .and '/' .and '=' .and optional_space;\r
+\r
+star\r
+    optional_space .and '*' .and optional_space;\r
+\r
+starequals\r
+    optional_space .and '*' .and '=' .and optional_space;\r
+\r
+/*tilde\r
+    optional_space .and '~' .and optional_space;*/\r
+\r
+/* string rulez - these are used internally by the parser when parsing quoted strings */\r
+\r
+.string string_lexer;\r
+\r
+string_lexer\r
+    lex_first_identifier_character .and .loop lex_next_identifier_character;\r
+\r
+lex_first_identifier_character\r
+    'a'-'z' .or 'A'-'Z' .or '_';\r
+\r
+lex_next_identifier_character\r
+    'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\r
+\r
+/* error rulez - these are used by error messages */\r
+\r
+err_token\r
+    '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\r
+    '-' .or '+' .or '=' .or '|' .or '\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '"' .or\r
+    '\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\r
+\r
+err_identifier\r
+    id_character_first .and .loop id_character_next;\r
+\r
diff --git a/src/mesa/shader/slang_shader_syn.h b/src/mesa/shader/slang_shader_syn.h
new file mode 100644 (file)
index 0000000..d3415cf
--- /dev/null
@@ -0,0 +1,754 @@
+".syntax translation_unit;\n"\r
+".emtcode REVISION 1\n"\r
+".emtcode EXTERNAL_NULL 0\n"\r
+".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n"\r
+".emtcode EXTERNAL_DECLARATION 2\n"\r
+".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n"\r
+".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n"\r
+".emtcode FUNCTION_ORDINARY 0\n"\r
+".emtcode FUNCTION_CONSTRUCTOR 1\n"\r
+".emtcode FUNCTION_OPERATOR 2\n"\r
+".emtcode OPERATOR_ASSIGN 1\n"\r
+".emtcode OPERATOR_ADDASSIGN 2\n"\r
+".emtcode OPERATOR_SUBASSIGN 3\n"\r
+".emtcode OPERATOR_MULASSIGN 4\n"\r
+".emtcode OPERATOR_DIVASSIGN 5\n"\r
+".emtcode OPERATOR_LOGICALXOR 12\n"\r
+".emtcode OPERATOR_EQUAL 16\n"\r
+".emtcode OPERATOR_NOTEQUAL 17\n"\r
+".emtcode OPERATOR_LESS 18\n"\r
+".emtcode OPERATOR_GREATER 19\n"\r
+".emtcode OPERATOR_LESSEQUAL 20\n"\r
+".emtcode OPERATOR_GREATEREQUAL 21\n"\r
+".emtcode OPERATOR_MULTIPLY 24\n"\r
+".emtcode OPERATOR_DIVIDE 25\n"\r
+".emtcode OPERATOR_INCREMENT 27\n"\r
+".emtcode OPERATOR_DECREMENT 28\n"\r
+".emtcode OPERATOR_PLUS 29\n"\r
+".emtcode OPERATOR_MINUS 30\n"\r
+".emtcode OPERATOR_NOT 32\n"\r
+".emtcode DECLARATOR_NONE 0\n"\r
+".emtcode DECLARATOR_NEXT 1\n"\r
+".emtcode VARIABLE_NONE 0\n"\r
+".emtcode VARIABLE_IDENTIFIER 1\n"\r
+".emtcode VARIABLE_INITIALIZER 2\n"\r
+".emtcode VARIABLE_ARRAY_EXPLICIT 3\n"\r
+".emtcode VARIABLE_ARRAY_UNKNOWN 4\n"\r
+".emtcode TYPE_QUALIFIER_NONE 0\n"\r
+".emtcode TYPE_QUALIFIER_CONST 1\n"\r
+".emtcode TYPE_QUALIFIER_ATTRIBUTE 2\n"\r
+".emtcode TYPE_QUALIFIER_VARYING 3\n"\r
+".emtcode TYPE_QUALIFIER_UNIFORM 4\n"\r
+".emtcode TYPE_SPECIFIER_VOID 0\n"\r
+".emtcode TYPE_SPECIFIER_BOOL 1\n"\r
+".emtcode TYPE_SPECIFIER_BVEC2 2\n"\r
+".emtcode TYPE_SPECIFIER_BVEC3 3\n"\r
+".emtcode TYPE_SPECIFIER_BVEC4 4\n"\r
+".emtcode TYPE_SPECIFIER_INT 5\n"\r
+".emtcode TYPE_SPECIFIER_IVEC2 6\n"\r
+".emtcode TYPE_SPECIFIER_IVEC3 7\n"\r
+".emtcode TYPE_SPECIFIER_IVEC4 8\n"\r
+".emtcode TYPE_SPECIFIER_FLOAT 9\n"\r
+".emtcode TYPE_SPECIFIER_VEC2 10\n"\r
+".emtcode TYPE_SPECIFIER_VEC3 11\n"\r
+".emtcode TYPE_SPECIFIER_VEC4 12\n"\r
+".emtcode TYPE_SPECIFIER_MAT2 13\n"\r
+".emtcode TYPE_SPECIFIER_MAT3 14\n"\r
+".emtcode TYPE_SPECIFIER_MAT4 15\n"\r
+".emtcode TYPE_SPECIFIER_SAMPLER1D 16\n"\r
+".emtcode TYPE_SPECIFIER_SAMPLER2D 17\n"\r
+".emtcode TYPE_SPECIFIER_SAMPLER3D 18\n"\r
+".emtcode TYPE_SPECIFIER_SAMPLERCUBE 19\n"\r
+".emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20\n"\r
+".emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21\n"\r
+".emtcode TYPE_SPECIFIER_STRUCT 22\n"\r
+".emtcode TYPE_SPECIFIER_TYPENAME 23\n"\r
+".emtcode FIELD_NONE 0\n"\r
+".emtcode FIELD_NEXT 1\n"\r
+".emtcode FIELD_ARRAY 2\n"\r
+".emtcode OP_END 0\n"\r
+".emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1\n"\r
+".emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2\n"\r
+".emtcode OP_DECLARE 3\n"\r
+".emtcode OP_ASM 4\n"\r
+".emtcode OP_BREAK 5\n"\r
+".emtcode OP_CONTINUE 6\n"\r
+".emtcode OP_DISCARD 7\n"\r
+".emtcode OP_RETURN 8\n"\r
+".emtcode OP_EXPRESSION 9\n"\r
+".emtcode OP_IF 10\n"\r
+".emtcode OP_WHILE 11\n"\r
+".emtcode OP_DO 12\n"\r
+".emtcode OP_FOR 13\n"\r
+".emtcode OP_PUSH_VOID 14\n"\r
+".emtcode OP_PUSH_BOOL 15\n"\r
+".emtcode OP_PUSH_INT 16\n"\r
+".emtcode OP_PUSH_FLOAT 17\n"\r
+".emtcode OP_PUSH_IDENTIFIER 18\n"\r
+".emtcode OP_SEQUENCE 19\n"\r
+".emtcode OP_ASSIGN 20\n"\r
+".emtcode OP_ADDASSIGN 21\n"\r
+".emtcode OP_SUBASSIGN 22\n"\r
+".emtcode OP_MULASSIGN 23\n"\r
+".emtcode OP_DIVASSIGN 24\n"\r
+".emtcode OP_SELECT 31\n"\r
+".emtcode OP_LOGICALOR 32\n"\r
+".emtcode OP_LOGICALXOR 33\n"\r
+".emtcode OP_LOGICALAND 34\n"\r
+".emtcode OP_EQUAL 38\n"\r
+".emtcode OP_NOTEQUAL 39\n"\r
+".emtcode OP_LESS 40\n"\r
+".emtcode OP_GREATER 41\n"\r
+".emtcode OP_LESSEQUAL 42\n"\r
+".emtcode OP_GREATEREQUAL 43\n"\r
+".emtcode OP_ADD 46\n"\r
+".emtcode OP_SUBTRACT 47\n"\r
+".emtcode OP_MULTIPLY 48\n"\r
+".emtcode OP_DIVIDE 49\n"\r
+".emtcode OP_PREINCREMENT 51\n"\r
+".emtcode OP_PREDECREMENT 52\n"\r
+".emtcode OP_PLUS 53\n"\r
+".emtcode OP_MINUS 54\n"\r
+".emtcode OP_NOT 56\n"\r
+".emtcode OP_SUBSCRIPT 57\n"\r
+".emtcode OP_CALL 58\n"\r
+".emtcode OP_FIELD 59\n"\r
+".emtcode OP_POSTINCREMENT 60\n"\r
+".emtcode OP_POSTDECREMENT 61\n"\r
+".emtcode PARAM_QUALIFIER_IN 0\n"\r
+".emtcode PARAM_QUALIFIER_OUT 1\n"\r
+".emtcode PARAM_QUALIFIER_INOUT 2\n"\r
+".emtcode PARAMETER_NONE 0\n"\r
+".emtcode PARAMETER_NEXT 1\n"\r
+".emtcode PARAMETER_ARRAY_NOT_PRESENT 0\n"\r
+".emtcode PARAMETER_ARRAY_PRESENT 1\n"\r
+".errtext INVALID_EXTERNAL_DECLARATION \"error 2001: invalid external declaration\"\n"\r
+".errtext INVALID_OPERATOR_OVERRIDE \"error 2002: invalid operator override\"\n"\r
+".errtext LBRACE_EXPECTED \"error 2003: '{' expected but '$err_token$' found\"\n"\r
+".errtext LPAREN_EXPECTED \"error 2004: '(' expected but '$err_token$' found\"\n"\r
+".errtext RPAREN_EXPECTED \"error 2005: ')' expected but '$err_token$' found\"\n"\r
+".regbyte parsing_builtin 0\n"\r
+".regbyte shader_type 0\n"\r
+"variable_identifier\n"\r
+" identifier .emit OP_PUSH_IDENTIFIER;\n"\r
+"primary_expression\n"\r
+" floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\n"\r
+"primary_expression_1\n"\r
+" lparen .and expression .and rparen;\n"\r
+"postfix_expression\n"\r
+" postfix_expression_1 .and .loop postfix_expression_2;\n"\r
+"postfix_expression_1\n"\r
+" function_call .or primary_expression;\n"\r
+"postfix_expression_2\n"\r
+" postfix_expression_3 .or postfix_expression_4 .or\n"\r
+" plusplus .emit OP_POSTINCREMENT .or\n"\r
+" minusminus .emit OP_POSTDECREMENT;\n"\r
+"postfix_expression_3\n"\r
+" lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\n"\r
+"postfix_expression_4\n"\r
+" dot .and field_selection .emit OP_FIELD;\n"\r
+"integer_expression\n"\r
+" expression;\n"\r
+"function_call\n"\r
+" function_call_generic .emit OP_CALL .and .true .emit OP_END;\n"\r
+"function_call_generic\n"\r
+" function_call_generic_1 .or function_call_generic_2;\n"\r
+"function_call_generic_1\n"\r
+" function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\n"\r
+"function_call_generic_2\n"\r
+" function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\n"\r
+"function_call_header_no_parameters\n"\r
+" function_call_header .and function_call_header_no_parameters_1;\n"\r
+"function_call_header_no_parameters_1\n"\r
+" \"void\" .or .true;\n"\r
+"function_call_header_with_parameters\n"\r
+" function_call_header .and assignment_expression .and .true .emit OP_END .and\n"\r
+" .loop function_call_header_with_parameters_1;\n"\r
+"function_call_header_with_parameters_1\n"\r
+" comma .and assignment_expression .and .true .emit OP_END;\n"\r
+"function_call_header\n"\r
+" function_identifier .and lparen;\n"\r
+"function_identifier\n"\r
+" identifier;\n"\r
+"unary_expression\n"\r
+" postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n"\r
+" unary_expression_4 .or unary_expression_5;\n"\r
+"unary_expression_1\n"\r
+" plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\n"\r
+"unary_expression_2\n"\r
+" minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\n"\r
+"unary_expression_3\n"\r
+" plus .and unary_expression .and .true .emit OP_PLUS;\n"\r
+"unary_expression_4\n"\r
+" minus .and unary_expression .and .true .emit OP_MINUS;\n"\r
+"unary_expression_5\n"\r
+" bang .and unary_expression .and .true .emit OP_NOT;\n"\r
+"multiplicative_expression\n"\r
+" unary_expression .and .loop multiplicative_expression_1;\n"\r
+"multiplicative_expression_1\n"\r
+" multiplicative_expression_2 .or multiplicative_expression_3;\n"\r
+"multiplicative_expression_2\n"\r
+" star .and unary_expression .and .true .emit OP_MULTIPLY;\n"\r
+"multiplicative_expression_3\n"\r
+" slash .and unary_expression .and .true .emit OP_DIVIDE;\n"\r
+"additive_expression\n"\r
+" multiplicative_expression .and .loop additive_expression_1;\n"\r
+"additive_expression_1\n"\r
+" additive_expression_2 .or additive_expression_3;\n"\r
+"additive_expression_2\n"\r
+" plus .and multiplicative_expression .and .true .emit OP_ADD;\n"\r
+"additive_expression_3\n"\r
+" minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n"\r
+"shift_expression\n"\r
+" additive_expression;\n"\r
+"relational_expression\n"\r
+" shift_expression .and .loop relational_expression_1;\n"\r
+"relational_expression_1\n"\r
+" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n"\r
+" relational_expression_5;\n"\r
+"relational_expression_2\n"\r
+" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n"\r
+"relational_expression_3\n"\r
+" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n"\r
+"relational_expression_4\n"\r
+" less .and shift_expression .and .true .emit OP_LESS;\n"\r
+"relational_expression_5\n"\r
+" greater .and shift_expression .and .true .emit OP_GREATER;\n"\r
+"equality_expression\n"\r
+" relational_expression .and .loop equality_expression_1;\n"\r
+"equality_expression_1\n"\r
+" equality_expression_2 .or equality_expression_3;\n"\r
+"equality_expression_2\n"\r
+" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n"\r
+"equality_expression_3\n"\r
+" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n"\r
+"and_expression\n"\r
+" equality_expression;\n"\r
+"exclusive_or_expression\n"\r
+" and_expression;\n"\r
+"inclusive_or_expression\n"\r
+" exclusive_or_expression;\n"\r
+"logical_and_expression\n"\r
+" inclusive_or_expression .and .loop logical_and_expression_1;\n"\r
+"logical_and_expression_1\n"\r
+" ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\n"\r
+"logical_xor_expression\n"\r
+" logical_and_expression .and .loop logical_xor_expression_1;\n"\r
+"logical_xor_expression_1\n"\r
+" caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\n"\r
+"logical_or_expression\n"\r
+" logical_xor_expression .and .loop logical_or_expression_1;\n"\r
+"logical_or_expression_1\n"\r
+" barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\n"\r
+"conditional_expression\n"\r
+" logical_or_expression .and .loop conditional_expression_1;\n"\r
+"conditional_expression_1\n"\r
+" question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\n"\r
+"assignment_expression\n"\r
+" assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\n"\r
+" assignment_expression_4 .or assignment_expression_5 .or conditional_expression;\n"\r
+"assignment_expression_1\n"\r
+" unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\n"\r
+"assignment_expression_2\n"\r
+" unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\n"\r
+"assignment_expression_3\n"\r
+" unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\n"\r
+"assignment_expression_4\n"\r
+" unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\n"\r
+"assignment_expression_5\n"\r
+" unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\n"\r
+"expression\n"\r
+" assignment_expression .and .loop expression_1;\n"\r
+"expression_1\n"\r
+" comma .and assignment_expression .and .true .emit OP_SEQUENCE;\n"\r
+"constant_expression\n"\r
+" conditional_expression .and .true .emit OP_END;\n"\r
+"declaration\n"\r
+" declaration_1 .or declaration_2;\n"\r
+"declaration_1\n"\r
+" function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\n"\r
+"declaration_2\n"\r
+" init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\n"\r
+"function_prototype\n"\r
+" function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n"\r
+"function_declarator\n"\r
+" function_header_with_parameters .or function_header;\n"\r
+"function_header_with_parameters\n"\r
+" function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\n"\r
+"function_header_with_parameters_1\n"\r
+" comma .and parameter_declaration;\n"\r
+"function_header\n"\r
+" function_header_nospace .or function_header_space;\n"\r
+"function_header_space\n"\r
+" fully_specified_type_space .and space .and function_decl_identifier .and lparen;\n"\r
+"function_header_nospace\n"\r
+" fully_specified_type_nospace .and function_decl_identifier .and lparen;\n"\r
+"function_decl_identifier\n"\r
+" .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\n"\r
+" .if (parsing_builtin != 0) \"__constructor\" .emit FUNCTION_CONSTRUCTOR .or\n"\r
+" identifier .emit FUNCTION_ORDINARY;\n"\r
+"__operator\n"\r
+" \"__operator\" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\n"\r
+"overriden_operator\n"\r
+" plusplus .emit OPERATOR_INCREMENT .or\n"\r
+" plusequals .emit OPERATOR_ADDASSIGN .or\n"\r
+" plus .emit OPERATOR_PLUS .or\n"\r
+" minusminus .emit OPERATOR_DECREMENT .or\n"\r
+" minusequals .emit OPERATOR_SUBASSIGN .or\n"\r
+" minus .emit OPERATOR_MINUS .or\n"\r
+" bangequals .emit OPERATOR_NOTEQUAL .or\n"\r
+" bang .emit OPERATOR_NOT .or\n"\r
+" starequals .emit OPERATOR_MULASSIGN .or\n"\r
+" star .emit OPERATOR_MULTIPLY .or\n"\r
+" slashequals .emit OPERATOR_DIVASSIGN .or\n"\r
+" slash .emit OPERATOR_DIVIDE .or\n"\r
+" lessequals .emit OPERATOR_LESSEQUAL .or\n"\r
+" \n"\r
+" \n"\r
+" less .emit OPERATOR_LESS .or\n"\r
+" greaterequals .emit OPERATOR_GREATEREQUAL .or\n"\r
+" \n"\r
+" \n"\r
+" greater .emit OPERATOR_GREATER .or\n"\r
+" equalsequals .emit OPERATOR_EQUAL .or\n"\r
+" equals .emit OPERATOR_ASSIGN .or\n"\r
+" \n"\r
+" \n"\r
+" \n"\r
+" \n"\r
+" \n"\r
+" \n"\r
+" \n"\r
+" \n"\r
+" caretcaret .emit OPERATOR_LOGICALXOR ;\n"\r
+"parameter_declarator\n"\r
+" parameter_declarator_nospace .or parameter_declarator_space;\n"\r
+"parameter_declarator_nospace\n"\r
+" type_specifier_nospace .and identifier .and parameter_declarator_1;\n"\r
+"parameter_declarator_space\n"\r
+" type_specifier_space .and space .and identifier .and parameter_declarator_1;\n"\r
+"parameter_declarator_1\n"\r
+" parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\n"\r
+" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n"\r
+"parameter_declarator_2\n"\r
+" lbracket .and constant_expression .and rbracket;\n"\r
+"parameter_declaration\n"\r
+" parameter_declaration_1 .emit PARAMETER_NEXT;\n"\r
+"parameter_declaration_1\n"\r
+" parameter_declaration_2 .or parameter_declaration_3;\n"\r
+"parameter_declaration_2\n"\r
+" type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\n"\r
+"parameter_declaration_3\n"\r
+" parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n"\r
+"parameter_declaration_4\n"\r
+" parameter_declarator .or parameter_type_specifier;\n"\r
+"parameter_qualifier\n"\r
+" parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n"\r
+"parameter_qualifier_1\n"\r
+" parameter_qualifier_2 .and space;\n"\r
+"parameter_qualifier_2\n"\r
+" \"in\" .emit PARAM_QUALIFIER_IN .or\n"\r
+" \"out\" .emit PARAM_QUALIFIER_OUT .or\n"\r
+" \"inout\" .emit PARAM_QUALIFIER_INOUT;\n"\r
+"parameter_type_specifier\n"\r
+" parameter_type_specifier_1 .and .true .emit '\\0' .and parameter_type_specifier_2;\n"\r
+"parameter_type_specifier_1\n"\r
+" type_specifier_nospace .or type_specifier_space;\n"\r
+"parameter_type_specifier_2\n"\r
+" parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\n"\r
+" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n"\r
+"parameter_type_specifier_3\n"\r
+" lbracket .and constant_expression .and rbracket;\n"\r
+"init_declarator_list\n"\r
+" single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\n"\r
+" .true .emit DECLARATOR_NONE;\n"\r
+"init_declarator_list_1\n"\r
+" comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\n"\r
+"init_declarator_list_2\n"\r
+" init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\n"\r
+"init_declarator_list_3\n"\r
+" equals .and initializer .emit VARIABLE_INITIALIZER;\n"\r
+"init_declarator_list_4\n"\r
+" lbracket .and init_declarator_list_5 .and rbracket;\n"\r
+"init_declarator_list_5\n"\r
+" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"\r
+"single_declaration\n"\r
+" single_declaration_nospace .or single_declaration_space;\n"\r
+"single_declaration_space\n"\r
+" fully_specified_type_space .and single_declaration_space_1;\n"\r
+"single_declaration_nospace\n"\r
+" fully_specified_type_nospace .and single_declaration_nospace_1;\n"\r
+"single_declaration_space_1\n"\r
+" single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n"\r
+"single_declaration_nospace_1\n"\r
+" single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n"\r
+"single_declaration_space_2\n"\r
+" space .and identifier .and single_declaration_3;\n"\r
+"single_declaration_nospace_2\n"\r
+" identifier .and single_declaration_3;\n"\r
+"single_declaration_3\n"\r
+" single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\n"\r
+"single_declaration_4\n"\r
+" equals .and initializer .emit VARIABLE_INITIALIZER;\n"\r
+"single_declaration_5\n"\r
+" lbracket .and single_declaration_6 .and rbracket;\n"\r
+"single_declaration_6\n"\r
+" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n"\r
+"fully_specified_type_space\n"\r
+" fully_specified_type_1 .and type_specifier_space;\n"\r
+"fully_specified_type_nospace\n"\r
+" fully_specified_type_1 .and type_specifier_nospace;\n"\r
+"fully_specified_type_1\n"\r
+" fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\n"\r
+"fully_specified_type_2\n"\r
+" type_qualifier .and space;\n"\r
+"type_qualifier\n"\r
+" \"const\" .emit TYPE_QUALIFIER_CONST .or\n"\r
+" .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n"\r
+" \"varying\" .emit TYPE_QUALIFIER_VARYING .or\n"\r
+" \"uniform\" .emit TYPE_QUALIFIER_UNIFORM;\n"\r
+"type_specifier_space\n"\r
+" \"void\" .emit TYPE_SPECIFIER_VOID .or\n"\r
+" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n"\r
+" \"int\" .emit TYPE_SPECIFIER_INT .or\n"\r
+" \"bool\" .emit TYPE_SPECIFIER_BOOL .or\n"\r
+" \"vec2\" .emit TYPE_SPECIFIER_VEC2 .or\n"\r
+" \"vec3\" .emit TYPE_SPECIFIER_VEC3 .or\n"\r
+" \"vec4\" .emit TYPE_SPECIFIER_VEC4 .or\n"\r
+" \"bvec2\" .emit TYPE_SPECIFIER_BVEC2 .or\n"\r
+" \"bvec3\" .emit TYPE_SPECIFIER_BVEC3 .or\n"\r
+" \"bvec4\" .emit TYPE_SPECIFIER_BVEC4 .or\n"\r
+" \"ivec2\" .emit TYPE_SPECIFIER_IVEC2 .or\n"\r
+" \"ivec3\" .emit TYPE_SPECIFIER_IVEC3 .or\n"\r
+" \"ivec4\" .emit TYPE_SPECIFIER_IVEC4 .or\n"\r
+" \"mat2\" .emit TYPE_SPECIFIER_MAT2 .or\n"\r
+" \"mat3\" .emit TYPE_SPECIFIER_MAT3 .or\n"\r
+" \"mat4\" .emit TYPE_SPECIFIER_MAT4 .or\n"\r
+" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n"\r
+" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n"\r
+" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n"\r
+" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n"\r
+" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n"\r
+" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n"\r
+" type_name .emit TYPE_SPECIFIER_TYPENAME;\n"\r
+"type_specifier_nospace\n"\r
+" struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n"\r
+"struct_specifier\n"\r
+" \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n"\r
+" struct_declaration_list .and rbrace .emit FIELD_NONE;\n"\r
+"struct_specifier_1\n"\r
+" struct_specifier_2 .or .true .emit '\\0';\n"\r
+"struct_specifier_2\n"\r
+" space .and identifier;\n"\r
+"struct_declaration_list\n"\r
+" struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\n"\r
+"struct_declaration\n"\r
+" struct_declaration_nospace .or struct_declaration_space;\n"\r
+"struct_declaration_space\n"\r
+" type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n"\r
+"struct_declaration_nospace\n"\r
+" type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n"\r
+"struct_declarator_list\n"\r
+" struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\n"\r
+"struct_declarator_list_1\n"\r
+" comma .and struct_declarator;\n"\r
+"struct_declarator\n"\r
+" identifier .and struct_declarator_1;\n"\r
+"struct_declarator_1\n"\r
+" struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\n"\r
+"struct_declarator_2\n"\r
+" lbracket .and constant_expression .and rbracket;\n"\r
+"initializer\n"\r
+" assignment_expression .and .true .emit OP_END;\n"\r
+"declaration_statement\n"\r
+" declaration;\n"\r
+"statement\n"\r
+" compound_statement .or simple_statement;\n"\r
+"statement_space\n"\r
+" compound_statement .or statement_space_1;\n"\r
+"statement_space_1\n"\r
+" space .and simple_statement;\n"\r
+"simple_statement\n"\r
+" .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n"\r
+" selection_statement .or\n"\r
+" iteration_statement .or\n"\r
+" jump_statement .or\n"\r
+" expression_statement .emit OP_EXPRESSION .or\n"\r
+" declaration_statement .emit OP_DECLARE;\n"\r
+"compound_statement\n"\r
+" compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\n"\r
+"compound_statement_1\n"\r
+" compound_statement_2 .or compound_statement_3;\n"\r
+"compound_statement_2\n"\r
+" lbrace .and rbrace;\n"\r
+"compound_statement_3\n"\r
+" lbrace .and statement_list .and rbrace;\n"\r
+"statement_no_new_scope\n"\r
+" compound_statement_no_new_scope .or simple_statement;\n"\r
+"compound_statement_no_new_scope\n"\r
+" compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\n"\r
+"compound_statement_no_new_scope_1\n"\r
+" compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\n"\r
+"compound_statement_no_new_scope_2\n"\r
+" lbrace .and rbrace;\n"\r
+"compound_statement_no_new_scope_3\n"\r
+" lbrace .and statement_list .and rbrace;\n"\r
+"statement_list\n"\r
+" statement .and .loop statement;\n"\r
+"expression_statement\n"\r
+" expression_statement_1 .or expression_statement_2;\n"\r
+"expression_statement_1\n"\r
+" semicolon .emit OP_PUSH_VOID .emit OP_END;\n"\r
+"expression_statement_2\n"\r
+" expression .and semicolon .emit OP_END;\n"\r
+"selection_statement\n"\r
+" \"if\" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\n"\r
+" rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\n"\r
+"selection_rest_statement\n"\r
+" statement .and selection_rest_statement_1;\n"\r
+"selection_rest_statement_1\n"\r
+" selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\n"\r
+"selection_rest_statement_2\n"\r
+" \"else\" .and optional_space .and statement;\n"\r
+"condition\n"\r
+" condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\n"\r
+" condition_3 .emit OP_EXPRESSION;\n"\r
+"condition_1\n"\r
+" condition_1_nospace .or condition_1_space;\n"\r
+"condition_1_nospace\n"\r
+" fully_specified_type_nospace .and condition_2;\n"\r
+"condition_1_space\n"\r
+" fully_specified_type_space .and space .and condition_2;\n"\r
+"condition_2\n"\r
+" identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\n"\r
+" initializer .and .true .emit DECLARATOR_NONE;\n"\r
+"condition_3\n"\r
+" expression .and .true .emit OP_END;\n"\r
+"iteration_statement\n"\r
+" iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\n"\r
+"iteration_statement_1\n"\r
+" \"while\" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\n"\r
+" rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"\r
+"iteration_statement_2\n"\r
+" \"do\" .emit OP_DO .and statement_space .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n"\r
+" expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n"\r
+"iteration_statement_3\n"\r
+" \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n"\r
+" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;\n"\r
+"for_init_statement\n"\r
+" expression_statement .or declaration_statement;\n"\r
+"conditionopt\n"\r
+" condition .or\n"\r
+" .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\\0' .emit OP_END;\n"\r
+"for_rest_statement\n"\r
+" conditionopt .and semicolon .and for_rest_statement_1;\n"\r
+"for_rest_statement_1\n"\r
+" for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\n"\r
+"for_rest_statement_2\n"\r
+" expression .and .true .emit OP_END;\n"\r
+"jump_statement\n"\r
+" jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\n"\r
+" .if (shader_type == 1) jump_statement_5;\n"\r
+"jump_statement_1\n"\r
+" \"continue\" .and semicolon .emit OP_CONTINUE;\n"\r
+"jump_statement_2\n"\r
+" \"break\" .and semicolon .emit OP_BREAK;\n"\r
+"jump_statement_3\n"\r
+" \"return\" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\n"\r
+"jump_statement_4\n"\r
+" \"return\" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\n"\r
+"jump_statement_5\n"\r
+" \"discard\" .and semicolon .emit OP_DISCARD;\n"\r
+"__asm_statement\n"\r
+" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n"\r
+"asm_arguments\n"\r
+" variable_identifier .and .true .emit OP_END .and .loop asm_arguments_1;\n"\r
+"asm_arguments_1\n"\r
+" comma .and variable_identifier .and .true .emit OP_END;\n"\r
+"translation_unit\n"\r
+" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n"\r
+" .loop external_declaration .and optional_space .and\n"\r
+" '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n"\r
+"external_declaration\n"\r
+" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n"\r
+" declaration .emit EXTERNAL_DECLARATION;\n"\r
+"function_definition\n"\r
+" function_prototype .and compound_statement_no_new_scope;\n"\r
+"digit_oct\n"\r
+" '0'-'7';\n"\r
+"digit_dec\n"\r
+" '0'-'9';\n"\r
+"digit_hex\n"\r
+" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n"\r
+"id_character_first\n"\r
+" 'a'-'z' .or 'A'-'Z' .or '_';\n"\r
+"id_character_next\n"\r
+" id_character_first .or digit_dec;\n"\r
+"identifier\n"\r
+" id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\\0';\n"\r
+"float\n"\r
+" float_1 .or float_2;\n"\r
+"float_1\n"\r
+" float_fractional_constant .and float_optional_exponent_part;\n"\r
+"float_2\n"\r
+" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part;\n"\r
+"float_fractional_constant\n"\r
+" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n"\r
+"float_fractional_constant_1\n"\r
+" float_digit_sequence .and '.' .and float_digit_sequence;\n"\r
+"float_fractional_constant_2\n"\r
+" float_digit_sequence .and '.' .and .true .emit '\\0';\n"\r
+"float_fractional_constant_3\n"\r
+" '.' .emit '\\0' .and float_digit_sequence;\n"\r
+"float_optional_exponent_part\n"\r
+" float_exponent_part .or .true .emit '\\0';\n"\r
+"float_digit_sequence\n"\r
+" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"\r
+"float_exponent_part\n"\r
+" float_exponent_part_1 .or float_exponent_part_2;\n"\r
+"float_exponent_part_1\n"\r
+" 'e' .and float_optional_sign .and float_digit_sequence;\n"\r
+"float_exponent_part_2\n"\r
+" 'E' .and float_optional_sign .and float_digit_sequence;\n"\r
+"float_optional_sign\n"\r
+" float_sign .or .true;\n"\r
+"float_sign\n"\r
+" '+' .or '-' .emit '-';\n"\r
+"integer\n"\r
+" integer_hex .or integer_oct .or integer_dec;\n"\r
+"integer_hex\n"\r
+" '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\n"\r
+" .true .emit '\\0';\n"\r
+"integer_hex_1\n"\r
+" 'x' .or 'X';\n"\r
+"integer_oct\n"\r
+" '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\\0';\n"\r
+"integer_dec\n"\r
+" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n"\r
+"boolean\n"\r
+" \"true\" .emit 2 .emit '1' .emit '\\0' .or\n"\r
+" \"false\" .emit 2 .emit '0' .emit '\\0';\n"\r
+"type_name\n"\r
+" identifier;\n"\r
+"field_selection\n"\r
+" identifier;\n"\r
+"floatconstant\n"\r
+" float .emit OP_PUSH_FLOAT;\n"\r
+"intconstant\n"\r
+" integer .emit OP_PUSH_INT;\n"\r
+"boolconstant\n"\r
+" boolean .emit OP_PUSH_BOOL;\n"\r
+"optional_space\n"\r
+" .loop single_space;\n"\r
+"space\n"\r
+" single_space .and .loop single_space;\n"\r
+"single_space\n"\r
+" white_char .or c_style_comment_block .or cpp_style_comment_block;\n"\r
+"white_char\n"\r
+" ' ' .or '\\t' .or new_line .or '\\v' .or '\\f';\n"\r
+"new_line\n"\r
+" cr_lf .or lf_cr .or '\\n' .or '\\r';\n"\r
+"cr_lf\n"\r
+" '\\r' .and '\\n';\n"\r
+"lf_cr\n"\r
+" '\\n' .and '\\r';\n"\r
+"c_style_comment_block\n"\r
+" '/' .and '*' .and c_style_comment_rest;\n"\r
+"c_style_comment_rest\n"\r
+" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n"\r
+"c_style_comment_rest_1\n"\r
+" c_style_comment_end .or c_style_comment_rest_2;\n"\r
+"c_style_comment_rest_2\n"\r
+" '*' .and c_style_comment_rest;\n"\r
+"c_style_comment_char_no_star\n"\r
+" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n"\r
+"c_style_comment_end\n"\r
+" '*' .and '/';\n"\r
+"cpp_style_comment_block\n"\r
+" '/' .and '/' .and cpp_style_comment_block_1;\n"\r
+"cpp_style_comment_block_1\n"\r
+" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n"\r
+"cpp_style_comment_block_2\n"\r
+" .loop cpp_style_comment_char .and new_line;\n"\r
+"cpp_style_comment_block_3\n"\r
+" .loop cpp_style_comment_char;\n"\r
+"cpp_style_comment_char\n"\r
+" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n"\r
+"ampersandampersand\n"\r
+" optional_space .and '&' .and '&' .and optional_space;\n"\r
+"barbar\n"\r
+" optional_space .and '|' .and '|' .and optional_space;\n"\r
+"bang\n"\r
+" optional_space .and '!' .and optional_space;\n"\r
+"bangequals\n"\r
+" optional_space .and '!' .and '=' .and optional_space;\n"\r
+"caretcaret\n"\r
+" optional_space .and '^' .and '^' .and optional_space;\n"\r
+"colon\n"\r
+" optional_space .and ':' .and optional_space;\n"\r
+"comma\n"\r
+" optional_space .and ',' .and optional_space;\n"\r
+"dot\n"\r
+" optional_space .and '.' .and optional_space;\n"\r
+"equals\n"\r
+" optional_space .and '=' .and optional_space;\n"\r
+"equalsequals\n"\r
+" optional_space .and '=' .and '=' .and optional_space;\n"\r
+"greater\n"\r
+" optional_space .and '>' .and optional_space;\n"\r
+"greaterequals\n"\r
+" optional_space .and '>' .and '=' .and optional_space;\n"\r
+"lbrace\n"\r
+" optional_space .and '{' .and optional_space;\n"\r
+"lbracket\n"\r
+" optional_space .and '[' .and optional_space;\n"\r
+"less\n"\r
+" optional_space .and '<' .and optional_space;\n"\r
+"lessequals\n"\r
+" optional_space .and '<' .and '=' .and optional_space;\n"\r
+"lparen\n"\r
+" optional_space .and '(' .and optional_space;\n"\r
+"minus\n"\r
+" optional_space .and '-' .and optional_space;\n"\r
+"minusequals\n"\r
+" optional_space .and '-' .and '=' .and optional_space;\n"\r
+"minusminus\n"\r
+" optional_space .and '-' .and '-' .and optional_space;\n"\r
+"plus\n"\r
+" optional_space .and '+' .and optional_space;\n"\r
+"plusequals\n"\r
+" optional_space .and '+' .and '=' .and optional_space;\n"\r
+"plusplus\n"\r
+" optional_space .and '+' .and '+' .and optional_space;\n"\r
+"question\n"\r
+" optional_space .and '?' .and optional_space;\n"\r
+"rbrace\n"\r
+" optional_space .and '}' .and optional_space;\n"\r
+"rbracket\n"\r
+" optional_space .and ']' .and optional_space;\n"\r
+"rparen\n"\r
+" optional_space .and ')' .and optional_space;\n"\r
+"semicolon\n"\r
+" optional_space .and ';' .and optional_space;\n"\r
+"slash\n"\r
+" optional_space .and '/' .and optional_space;\n"\r
+"slashequals\n"\r
+" optional_space .and '/' .and '=' .and optional_space;\n"\r
+"star\n"\r
+" optional_space .and '*' .and optional_space;\n"\r
+"starequals\n"\r
+" optional_space .and '*' .and '=' .and optional_space;\n"\r
+".string string_lexer;\n"\r
+"string_lexer\n"\r
+" lex_first_identifier_character .and .loop lex_next_identifier_character;\n"\r
+"lex_first_identifier_character\n"\r
+" 'a'-'z' .or 'A'-'Z' .or '_';\n"\r
+"lex_next_identifier_character\n"\r
+" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n"\r
+"err_token\n"\r
+" '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\n"\r
+" '-' .or '+' .or '=' .or '|' .or '\\\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '\"' .or\n"\r
+" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n"\r
+"err_identifier\n"\r
+" id_character_first .and .loop id_character_next;\n"\r
+""
\ No newline at end of file