glfx grammar

This is a simplified grammar of glfx files:

glfx:                   parameter* technique*

parameter:              ['param'] type name ['=' value] ';'

type:                   'float'
                        'vec2'
                        'vec3'
                        'vec4'
                        'texture1d'
                        'texture2d'
                        'texture3d'
                        'texturecube'
                        'vertex_shader'
                        'fragment_shader'
                        'program'

value:                  float
                        vec2_value
                        vec3_value
                        vec4_value
                        texture1d_value
                        texture2d_value
                        texture3d_value
                        texturecube_value
                        vertex_shader_value
                        fragment_shader_value
                        program_value

vec2_value:             (float, float)
vec3_value:             (float, float, float)
vec4_value:             (float, float, float, float)
texture1d_value:        'load_texture1d(' string ')'
texture2d_value:        'load_texture2d(' string ')'
texture3d_value:        'load_texture3d(' string ')'
texturecube_value:	    'load_texturecube(' string ')'
vertex_shader_value:    'compile_vertex_shader(' string ')'
fragment_shader_value:  'compile_fragment_shader(' string ')'
program:                'link_program(' [program_element ',']* program_element ')'

program_element:        vertex_shader_value
                        fragment_shader_value
                        'bind_uniform(' variable ',' string ')'
                        'bind_attrib(' int ',' string ')'

technique:              'technique' identifier '{' pass+ '}'

pass:                   'pass' '{' render_state* '}'

render_state:           state '=' state_value ';'
                        state '=' '<' name '>' ';'

SourceForge.net Logo