Module glsl::writer::glsl [] [src]

A GLSL450 writer that takes a syntax tree and writes it as a plain raw GLSL String.

This module exports several functions that just transforms a part of a syntax tree into its raw GLSL String representation.

Important note: this module – and actually, any writer::* module – is not responsible in optimizing the syntax tree nor semantically check its validity. This is done in other stages of the compilation process.

In order to achieve that purpose, you could:

  • for each elements in the AST, return a String or Cow<str>;
  • insert the string representation via a formatter.

The second solution is better because it let the user handles the memory the way they want: they might just use a dynamic buffer that implements Write or simply pass a &mut String. It’s up to you.

Functions

show_array_spec
show_arrayed_identifier
show_assignment_op
show_binary_op
show_block
show_case_label
show_compound_statement
show_condition
show_declaration
show_expr
show_expression_statement
show_external_declaration
show_for_init_statement
show_for_rest_statement
show_fully_specified_type
show_function_definition
show_function_identifier
show_function_parameter_declaration
show_function_parameter_declarator
show_function_prototype
show_identifier
show_init_declarator_list
show_initializer
show_interpolation_qualifier
show_iteration_statement
show_jump_statement
show_layout_qualifier
show_layout_qualifier_spec
show_precision_qualifier
show_preprocessor
show_preprocessor_extension
show_preprocessor_version
show_selection_rest_statement
show_selection_statement
show_simple_statement
show_single_declaration
show_single_declaration_no_type
show_statement
show_storage_qualifier
show_struct
show_struct_field
show_struct_non_declaration
show_subroutine
show_switch_statement
show_translation_unit
show_type_name
show_type_qualifier
show_type_qualifier_spec
show_type_specifier
show_type_specifier_non_array
show_unary_op