slang_shader.syn

来自「Mesa is an open-source implementation of」· SYN 代码 · 共 1,616 行 · 第 1/5 页

SYN
1,616
字号
                                          | <__operator>                                          | <identifier>note: this is an extension to the standard language specification - normally slang disallows      operator and constructor prototypes and definitions*/function_decl_identifier    .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or    .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or    identifier .emit FUNCTION_ORDINARY;/*    <__operator>                        ::= "__operator" <overriden_op>note: this is an extension to the standard language specification - normally slang disallows      operator prototypes and definitions*/__operator    "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;/*    <overriden_op>                      ::= "="                                          | "+="                                          | "-="                                          | "*="                                          | "/="                                          | "%=" // reserved                                          | "<<=" // reserved                                          | ">>=" // reserved                                          | "&=" // reserved                                          | "^=" // reserved                                          | "|=" // reserved                                          | "^^"                                          | "|" // reserved                                          | "^" // reserved                                          | "&" // reserved                                          | "=="                                          | "!="                                          | "<"                                          | ">"                                          | "<="                                          | ">="                                          | "<<" // reserved                                          | ">>" // reserved                                          | "*"                                          | "/"                                          | "%" // reserved                                          | "++"                                          | "--"                                          | "+"                                          | "-"                                          | "~" // reserved                                          | "!"note: this is an extension to the standard language specification - normally slang disallows      operator prototypes and definitions*/overriden_operator    plusplus .emit OPERATOR_INCREMENT .or    plusequals .emit OPERATOR_ADDASSIGN .or    plus .emit OPERATOR_PLUS .or    minusminus .emit OPERATOR_DECREMENT .or    minusequals .emit OPERATOR_SUBASSIGN .or    minus .emit OPERATOR_MINUS .or    bang .emit OPERATOR_NOT .or    starequals .emit OPERATOR_MULASSIGN .or    star .emit OPERATOR_MULTIPLY .or    slashequals .emit OPERATOR_DIVASSIGN .or    slash .emit OPERATOR_DIVIDE .or    lessequals .emit OPERATOR_LESSEQUAL .or    /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/    /*lessless .emit OPERATOR_LSHIFT .or*/    less .emit OPERATOR_LESS .or    greaterequals .emit OPERATOR_GREATEREQUAL .or    /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/    /*greatergreater .emit OPERATOR_RSHIFT .or*/    greater .emit OPERATOR_GREATER .or    /*percentequals .emit OPERATOR_MODASSIGN .or*/    /*percent .emit OPERATOR_MODULUS .or*/    /*ampersandequals .emit OPERATOR_ANDASSIGN */    /*ampersand .emit OPERATOR_BITAND .or*/    /*barequals .emit OPERATOR_ORASSIGN .or*/    /*bar .emit OPERATOR_BITOR .or*/    /*tilde .emit OPERATOR_COMPLEMENT .or*/    /*caretequals .emit OPERATOR_XORASSIGN .or*/    caretcaret .emit OPERATOR_LOGICALXOR /*.or    caret .emit OPERATOR_BITXOR*/;/*    <parameter_declarator>              ::= <type_specifier> <identifier>                                          | <type_specifier> <identifier> "[" <constant_expression>                                            "]"*/parameter_declarator    parameter_declarator_nospace .or parameter_declarator_space;parameter_declarator_nospace    type_specifier_nospace .and identifier .and parameter_declarator_1;parameter_declarator_space    type_specifier_space .and space .and identifier .and parameter_declarator_1;parameter_declarator_1    parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or    .true .emit PARAMETER_ARRAY_NOT_PRESENT;parameter_declarator_2    lbracket .and constant_expression .and rbracket;/*    <parameter_declaration>             ::= <type_qualifier> <parameter_qualifier>                                            <parameter_declarator>                                          | <type_qualifier> <parameter_qualifier>                                            <parameter_type_specifier>                                          | <parameter_qualifier> <parameter_declarator>                                          | <parameter_qualifier> <parameter_type_specifier>*/parameter_declaration    parameter_declaration_1 .emit PARAMETER_NEXT;parameter_declaration_1    parameter_declaration_2 .or parameter_declaration_3;parameter_declaration_2    type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;parameter_declaration_3    parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;parameter_declaration_4    parameter_declarator .or parameter_type_specifier;/*    <parameter_qualifier>               ::= "in"                                          | "out"                                          | "inout"                                          | ""*/parameter_qualifier    parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;parameter_qualifier_1    parameter_qualifier_2 .and space;parameter_qualifier_2    "in" .emit PARAM_QUALIFIER_IN .or    "out" .emit PARAM_QUALIFIER_OUT .or    "inout" .emit PARAM_QUALIFIER_INOUT;/*    <parameter_type_specifier>          ::= <type_specifier>                                          | <type_specifier> "[" <constant_expression> "]"*/parameter_type_specifier    parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2;parameter_type_specifier_1    type_specifier_nospace .or type_specifier_space;parameter_type_specifier_2    parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or    .true .emit PARAMETER_ARRAY_NOT_PRESENT;parameter_type_specifier_3    lbracket .and constant_expression .and rbracket;/*    <init_declarator_list>              ::= <single_declaration>                                          | <init_declarator_list> "," <identifier>                                          | <init_declarator_list> "," <identifier> "[" "]"                                          | <init_declarator_list> "," <identifier> "["                                            <constant_expression> "]"                                          | <init_declarator_list> "," <identifier> "="                                            <initializer>*/init_declarator_list    single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and    .true .emit DECLARATOR_NONE;init_declarator_list_1    comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;init_declarator_list_2    init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;init_declarator_list_3    equals .and initializer .emit VARIABLE_INITIALIZER;init_declarator_list_4    lbracket .and init_declarator_list_5 .and rbracket;init_declarator_list_5    constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;/*    <single_declaration>                ::= <fully_specified_type>                                          | <fully_specified_type> <identifier>                                          | <fully_specified_type> <identifier> "[" "]"                                          | <fully_specified_type> <identifier> "["                                            <constant_expression> "]"                                          | <fully_specified_type> <identifier> "=" <initializer>*/single_declaration    single_declaration_nospace .or single_declaration_space;single_declaration_space    fully_specified_type_space .and single_declaration_space_1;single_declaration_nospace    fully_specified_type_nospace .and single_declaration_nospace_1;single_declaration_space_1    single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;single_declaration_nospace_1    single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;single_declaration_space_2    space .and identifier .and single_declaration_3;single_declaration_nospace_2    identifier .and single_declaration_3;single_declaration_3    single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;single_declaration_4    equals .and initializer .emit VARIABLE_INITIALIZER;single_declaration_5    lbracket .and single_declaration_6 .and rbracket;single_declaration_6    constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;/*    <fully_specified_type>              ::= <type_specifier>                                          | <type_qualifier> <type_specifier>                                          | <precision> <type_specifier>                                          | <type_qualifier> <precision> <type_specifier>*/fully_specified_type_space    fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;fully_specified_type_nospace    fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;fully_specified_type_optqual    fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE;fully_specified_type_qual    type_qualifier .and space;fully_specified_type_optprec    fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;fully_specified_type_prec    precision .and space;/*    <type_qualifier>                    ::= "const"                                          | "attribute" // Vertex only.                                          | "varying"                                          | "uniform"										  | "__fixed_output"										  | "__fixed_input"note: this is an extension to the standard language specification - normally slang disallows      __fixed_output and __fixed_input type qualifiers*/type_qualifier    "const" .emit TYPE_QUALIFIER_CONST .or    .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or    "varying" .emit TYPE_QUALIFIER_VARYING .or    "uniform" .emit TYPE_QUALIFIER_UNIFORM .or	.if (parsing_builtin != 0) "__fixed_output" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or	.if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT;/*    <type_specifier>                    ::= "void"                                          | "float"                                          | "int"                                          | "bool"                                          | "vec2"                                          | "vec3"                                          | "vec4"                                          | "bvec2"                                          | "bvec3"                                          | "bvec4"                                          | "ivec2"                                          | "ivec3"                                          | "ivec4"                                          | "mat2"                                          | "mat3"                                          | "mat4"                                          | "mat2x3"                                          | "mat3x2"                                          | "mat2x4"                                          | "mat4x2"                                          | "mat3x4"                                          | "mat4x3"                                          | "sampler1D"                                          | "sampler2D"                                          | "sampler3D"                                          | "samplerCube"                                          | "sampler1DShadow"                                          | "sampler2DShadow"					  | "sampler2DRect"					  | "sampler2DRectShadow"                                          | <struct_specifier>                                          | <type_name>*/type_specifier_space    "void" .emit TYPE_SPECIFIER_VOID .or    "float" .emit TYPE_SPECIFIER_FLOAT .or    "int" .emit TYPE_SPECIFIER_INT .or    "bool" .emit TYPE_SPECIFIER_BOOL .or    "vec2" .emit TYPE_SPECIFIER_VEC2 .or    "vec3" .emit TYPE_SPECIFIER_VEC3 .or    "vec4" .emit TYPE_SPECIFIER_VEC4 .or    "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or    "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or    "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or    "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or    "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or    "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or    "mat2" .emit TYPE_SPECIFIER_MAT2 .or    "mat3" .emit TYPE_SPECIFIER_MAT3 .or    "mat4" .emit TYPE_SPECIFIER_MAT4 .or    "mat2x3" .emit TYPE_SPECIFIER_MAT23 .or    "mat3x2" .emit TYPE_SPECIFIER_MAT32 .or    "mat2x4" .emit TYPE_SPECIFIER_MAT24 .or    "mat4x2" .emit TYPE_SPECIFIER_MAT42 .or    "mat3x4" .emit TYPE_SPECIFIER_MAT34 .or    "mat4x3" .emit TYPE_SPECIFIER_MAT43 .or    "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or    "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or    "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or    "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or    "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or    "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or    "sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or    "sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or    type_name .emit TYPE_SPECIFIER_TYPENAME;type_specifier_nospace    struct_specifier .emit TYPE_SPECIFIER_STRUCT;/*    <struct_specifier>                  ::= "struct" <identifier> "{" <struct_declaration_list> "}"                                          | "struct" "{" <struct_declaration_list> "}"*/struct_specifier    "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and    struct_declaration_list .and rbrace .emit FIELD_NONE;struct_specifier_1    struct_specifier_2 .or .true .emit '\0';struct_specifier_2

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?