requirement_terms

sbinding_header:=
requirements | requires srequirements ;
requirements | NAME requires srequirements ;
requirements | header scode_spec srequires_clause ;
requirements | body scode_spec srequires_clause ;
requirements | header = scode_spec srequires_clause ;
requirements | body = scode_spec srequires_clause ;
requirements | header sdeclname = scode_spec srequires_clause ;
requirements | body sdeclname = scode_spec srequires_clause ;
srequires_clause:=
requirements | requires srequirements
requirements | epsilonrreq_true

A requires clause is used to establish a dependency between a named C binding, particularly abstract types, and resources such as C code needed to define the subject of the binding, particularly C header files, so that the specified resource is loaded if, and only if, one of the dependent C bindings is used.

This not only makes it possible to minimise the header files read by the C++ compiler processing the output of Felix, but also to provide Felix libraries binding to C libraries which are not installed without breaking the compilation process, provided the library is not actually used.

The requirement mechanism is also responsible for triggering the emission of a run or link time resource requirements list which in turn is used to search for and link external C libraries, without user command line intervention.

Requirements may be polymorphic, in which case an instance for each combination of type variable instances is emitted.

Requirements can be named, and may depend on other requirements. Those dependencies may be recursive. Felix emits C code resources in order of writing, independently of the dependencies.

A resource which is C text to be emitted in the header or body file generated by Felix is known as a floating insertion.

The name of a requirement is sometimes called a tag name, however unlike C struct tags, tag names live in the same unified namespace as other declarations.

srequirement:=
requirements | squalified_name
requirements | property STRING
requirements | package scode_spec
requirements | body scode_spec
requirements | header scode_spec
srequirement_atom:=
requirements | srequirement
requirements | ( srequirements )
srequirement_and:=
requirements | srequirement_and and srequirement_atom
requirements | srequirement_atom
srequirement_or:=
requirements | srequirement_or or srequirement_and
requirements | srequirement_and
srequirements:=
requirements | srequirements , srequirement_or
requirements | srequirement_or