Next Previous Contents

9. Annotation Grammar

The style used in this chapter generally follows Kernighan and Ritchie, 1988. Non-terminal productions are given in italics, while terminals and literals are given in typewriter style. Productions prefixed with C_ should be understood as referring to corresponding elements of the C grammar. Ellipses connote comma-delimited sequences of one or more elements. Empty lines and whitespace between whole syntactic elements are ignored. Content within [italicized brackets] is optional, while [typewriter-style brackets] denote regular expressions. For brevity all qualifier and method literals are lumped into single production rules, even though each is not supported by every annotation. Only annotations whose grammars explicitly enumerate methods or qualifiers support such.

        annotation:

             argmap_annotation

             clear_annotation

             copy_annotation

             define_annotation

             ignore_annotation

             inlinec_annotation

             prototype_annotation

             rename_annotation

             retmap_annotation

             typedef_annotation

             undef_annotation

             vectorize_annotation

             novectorize_annotation

        argmap_annotation:

             #argmap ( method [,qualifier_list] ) parameter_list [( variable_declaration_list )]

                 code_fragment

             #end

        clear_annotation:

             #clear parameter_list

        copy_annotation:

             #copy parameter_list { parameter_list [,   ...] }

        define_annotation:

             #define C_identifier substitution_text

        ignore_annotation:

             #ignore

                 symbol_name_list

             #end

        inlinec_annotation:

             #inline_c [(init)]

                 C_translation_unit

             #end

        prototype_annotation:

             #prototype

                 function_prototype_list

             #end

        rename_annotation:

             #rename SLang_regular_expression C_identifier

        retmap_annotation:

             #retmap [(omit)]

                 code_fragment

             #end

        typedef_annotation:

             #typedef C_identifier C_identifier [;]

        undef_annotation:

             #undef C_identifier

        vectorize_annotation:

             #vectorize

                 vectorized_function_list

             #end

        novectorize_annotation:

             #novectorize

                 symbol_name_list

             #end

        code_fragment:

             statement_list

             { statement_list }

             { code_fragment }

        statement_list:

             statement

             statement_list statement

        statement:

             C_statement

             C_statement_with_SLIRP_substitutions

        parameter_list:

             parameter_expression

             ( parameter_expression ,   ... )

        qualifier_list:

             qualifier_expression

             qualifier_list ,   ...

        qualifier_expression:

             qualifier

             qualifier = qualifier_value

        variable_declaration_list:

             C_type_expression C_identifier

             variable_declaration_list ,   ...

        parameter_expression:

             C_type_expression

             C_type_expression C_identifier

        function_prototype_list:

             function_prototype

             function_prototype SLang_comment

             function_prototype function_prototype_list

        function_prototype:

             C_identifier ( parameter_expression [,   ...] ) ;

        vectorized_function_list:

             vectorized_function_specifier

             vectorized_function_specifier vectorized_function_list

        vectorized_function_specifier:

             function_prototype

             C_identifier

        symbol_name_list:

             C_identifier

             C_identifier SLang_comment

             C_identifier , symbol_name_list

             C_identifier symbol_name_list

        method: one of

             in out final ignore setup

        qualifier_value: one of

             [1-9]+

             SLang_array_index_expression

             C_string_literal

        qualifier: one of

             which omit usage


Next Previous Contents