slang_shader.syn

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

SYN
1,616
字号
    space .and identifier;/*    <struct_declaration_list>           ::= <struct_declaration>                                          | <struct_declaration_list> <struct_declaration>*/struct_declaration_list    struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;/*    <struct_declaration>                ::= <type_specifier> <struct_declarator_list> ";"*/struct_declaration    struct_declaration_nospace .or struct_declaration_space;struct_declaration_space    type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;struct_declaration_nospace    type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;/*    <struct_declarator_list>            ::= <struct_declarator>                                          | <struct_declarator_list> "," <struct_declarator>*/struct_declarator_list    struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;struct_declarator_list_1    comma .and struct_declarator;/*    <struct_declarator>                 ::= <identifier>                                          | <identifier> "[" <constant_expression> "]"*/struct_declarator    identifier .and struct_declarator_1;struct_declarator_1    struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;struct_declarator_2    lbracket .and constant_expression .and rbracket;/*    <initializer>                       ::= <assignment_expression>*/initializer    assignment_expression .and .true .emit OP_END;/*    <declaration_statement>             ::= <declaration>*/declaration_statement    declaration;/*    <statement>                         ::= <compound_statement>                                          | <simple_statement>*/statement    compound_statement .or simple_statement;statement_space    compound_statement .or statement_space_1;statement_space_1    space .and simple_statement;/*    <simple_statement>                  ::= <__asm_statement>                                          | <selection_statement>                                          | <iteration_statement>                                          | <jump_statement>                                          | <expression_statement>                                          | <declaration_statement>note: this is an extension to the standard language specification - normally slang disallows      use of __asm statements*/simple_statement    .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or    selection_statement .or    iteration_statement .or    jump_statement .or    expression_statement .emit OP_EXPRESSION .or    declaration_statement .emit OP_DECLARE;/*    <compound_statement>                ::= "{" "}"                                          | "{" <statement_list> "}"*/compound_statement    compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;compound_statement_1    compound_statement_2 .or compound_statement_3;compound_statement_2    lbrace .and rbrace;compound_statement_3    lbrace .and statement_list .and rbrace;/*    <statement_no_new_scope>            ::= <compound_statement_no_new_scope>                                          | <simple_statement>*/statement_no_new_scope    compound_statement_no_new_scope .or simple_statement;/*    <compound_statement_no_new_scope>   ::= "{" "}"                                          | "{" <statement_list> "}"*/compound_statement_no_new_scope    compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;compound_statement_no_new_scope_1    compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;compound_statement_no_new_scope_2    lbrace .and rbrace;compound_statement_no_new_scope_3    lbrace .and statement_list .and rbrace;/*    <statement_list>                    ::= <statement>                                          | <statement_list> <statement>*/statement_list    statement .and .loop statement;/*    <expression_statement>              ::= ";"                                          | <expression> ";"*/expression_statement    expression_statement_1 .or expression_statement_2;expression_statement_1    semicolon .emit OP_PUSH_VOID .emit OP_END;expression_statement_2    expression .and semicolon .emit OP_END;/*    <selection_statement>               ::= "if" "(" <expression> ")" <selection_rest_statement>*/selection_statement    "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and    rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;/*    <selection_rest_statement>          ::= <statement> "else" <statement>                                          | <statement>*/selection_rest_statement    statement .and selection_rest_statement_1;selection_rest_statement_1    selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;selection_rest_statement_2    "else" .and optional_space .and statement;/*    <condition>                         ::= <expression>                                          | <fully_specified_type> <identifier> "=" <initializer>note: if <condition_1> is executed, the emit format must match <declaration> emit format*/condition    condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or    condition_3 .emit OP_EXPRESSION;condition_1    condition_1_nospace .or condition_1_space;condition_1_nospace    fully_specified_type_nospace .and condition_2;condition_1_space    fully_specified_type_space .and space .and condition_2;condition_2    identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and    initializer .and .true .emit DECLARATOR_NONE;condition_3    expression .and .true .emit OP_END;/*    <iteration_statement>               ::= "while" "(" <condition> ")" <statement>                                          | "do" <statement> "while" "(" <expression> ")" ";"                                          | "for" "(" <for_init_statement> <for_rest_statement> ")"                                            <statement_no_new_scope>*/iteration_statement    iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;iteration_statement_1    "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and    rparen .error RPAREN_EXPECTED .and statement;iteration_statement_2    "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and    expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;iteration_statement_3    "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and    for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement_no_new_scope;/*    <for_init_statement>                ::= <expression_statement>                                          | <declaration_statement>*/for_init_statement    expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;/*    <conditionopt>                      ::= <condition>                                          | ""note: <conditionopt> is used only by "for" statement - if <condition> is ommitted, parser      simulates default behaviour, that is simulates "true" expression*/conditionopt    condition .or    .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END;/*    <for_rest_statement>                ::= <conditionopt> ";"                                          | <conditionopt> ";" <expression>*/for_rest_statement    conditionopt .and semicolon .and for_rest_statement_1;for_rest_statement_1    for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;for_rest_statement_2    expression .and .true .emit OP_END;/*    <jump_statement>                    ::= "continue" ";"                                          | "break" ";"                                          | "return" ";"                                          | "return" <expression> ";"                                          | "discard" ";" // Fragment shader only.*/jump_statement    jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or    .if (shader_type == 1) jump_statement_5;jump_statement_1    "continue" .and semicolon .emit OP_CONTINUE;jump_statement_2    "break" .and semicolon .emit OP_BREAK;jump_statement_3    "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;jump_statement_4    "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;jump_statement_5    "discard" .and semicolon .emit OP_DISCARD;/*    <__asm_statement>                   ::= "__asm" <identifier> <asm_arguments> ";"note: this is an extension to the standard language specification - normally slang disallows      __asm statements*/__asm_statement    "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;/*    <asm_arguments>                     ::= <asm_argument>                                          | <asm_arguments> "," <asm_argument>note: this is an extension to the standard language specification - normally slang disallows      __asm statements*/asm_arguments    asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;asm_arguments_1    comma .and asm_argument .and .true .emit OP_END;/*    <asm_argument>                      ::= <variable_identifier>                                          | <floatconstant>note: this is an extension to the standard language specification - normally slang disallows      __asm statements*/asm_argument    var_with_field .or    variable_identifier .or    floatconstant;var_with_field    variable_identifier .and dot .and field_selection .emit OP_FIELD;/* *  <translation_unit>                  ::= <external_declaration> *                                        | <translation_unit> <external_declaration> */translation_unit    optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and    .loop external_declaration .and optional_space .and    '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;/* *  <external_declaration>              ::= <function_definition> *                                        | <declaration> */external_declaration    precision_stmt .emit DEFAULT_PRECISION .or    invariant_stmt .emit INVARIANT_STMT .or    function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or    declaration .emit EXTERNAL_DECLARATION;/* * <precision_stmt>    ::= "precision" <precision> <prectype> */precision_stmt    "precision" .and space .and precision .error INVALID_PRECISION .and space .and prectype .error INVALID_PRECISION_TYPE .and semicolon;/* * <precision>           ::= "lowp" *                         | "mediump" *                         | "highp" */precision    "lowp" .emit PRECISION_LOW .or    "mediump" .emit PRECISION_MEDIUM .or    "highp" .emit PRECISION_HIGH;/* * <prectype> ::= "int" *              | "float" *              | "a sampler type" */prectype    "int" .emit TYPE_SPECIFIER_INT .or    "float" .emit TYPE_SPECIFIER_FLOAT .or    "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or    "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or    "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or

⌨️ 快捷键说明

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