fprime/Autocoders/Python/schema/default/parameters_schema.rng
2021-05-27 16:21:51 -07:00

266 lines
8.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href="common_elements.rng"/>
<include href="common_types.rng"/>
<start>
<ref name="parameters_root_define"/>
</start>
<define name="parameters_root_define">
<element name="parameters">
<!-- Attributes -->
<optional>
<attribute name="parameter_base">
<ref name="base_code_define"/>
</attribute>
</optional>
<optional>
<attribute name="opcode_base">
<ref name="base_code_define"/>
</attribute>
</optional>
<!-- Elements -->
<oneOrMore>
<ref name="parameter_define"/>
</oneOrMore>
</element>
</define>
<define name="parameter_define">
<element name="parameter">
<a:documentation>Parameter definition.</a:documentation>
<!-- Attributes -->
<attribute name="id">
<a:documentation>ID of the attribute.</a:documentation>
<ref name="id_define"/>
</attribute>
<attribute name="set_opcode">
<a:documentation>Opcode for setting the parameter.</a:documentation>
<ref name="id_define"/>
</attribute>
<attribute name="save_opcode">
<a:documentation>Opcode for saving the parameter.</a:documentation>
<ref name="id_define"/>
</attribute>
<attribute name="name">
<a:documentation>Parameter name</a:documentation>
<text/>
</attribute>
<ref name="data_type_and_default_define"/>
<!-- Elements -->
<optional>
<ref name="comment_define"/>
</optional>
</element>
</define>
<define name="data_type_and_default_define">
<!-- If the data_type attribute isn't one that is explicitly specified, the default case will make it pass. -->
<a:documentation>Makes attribute pair choices to match data type with default value.</a:documentation>
<choice>
<group>
<a:documentation>Default pair.</a:documentation>
<attribute name="data_type">
<ref name="not_user_cpp_type_define"/>
</attribute>
<optional>
<attribute name="default">
<text/>
</attribute>
</optional>
</group>
<group>
<a:documentation>Enum pair.</a:documentation>
<attribute name="data_type">
<value>ENUM</value>
</attribute>
<optional>
<attribute name="default">
</attribute>
</optional>
<optional>
<ref name="enum_define"/>
</optional>
</group>
<group>
<a:documentation>String pair.</a:documentation>
<attribute name="data_type">
<value>string</value>
</attribute>
<optional>
<attribute name="default">
<data type="string"/>
</attribute>
</optional>
<attribute name="size">
<ref name="positive_integer_define"/>
</attribute>
</group>
<group>
<a:documentation>I8 pair.</a:documentation>
<attribute name="data_type">
<value>I8</value>
</attribute>
<optional>
<attribute name="default">
<ref name="I8_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>U8 pair.</a:documentation>
<attribute name="data_type">
<value>U8</value>
</attribute>
<optional>
<attribute name="default">
<ref name="U8_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>I16 pair.</a:documentation>
<attribute name="data_type">
<value>I16</value>
</attribute>
<optional>
<attribute name="default">
<ref name="I16_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>U16 pair.</a:documentation>
<attribute name="data_type">
<value>U16</value>
</attribute>
<optional>
<attribute name="default">
<ref name="U16_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>I32 pair.</a:documentation>
<attribute name="data_type">
<value>I32</value>
</attribute>
<optional>
<attribute name="default">
<ref name="I32_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>U32 pair.</a:documentation>
<attribute name="data_type">
<value>U32</value>
</attribute>
<optional>
<attribute name="default">
<ref name="U32_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>I64 pair.</a:documentation>
<attribute name="data_type">
<value>I64</value>
</attribute>
<optional>
<attribute name="default">
<ref name="I64_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>U64 pair.</a:documentation>
<attribute name="data_type">
<value>U64</value>
</attribute>
<optional>
<attribute name="default">
<ref name="U64_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>F32 pair.</a:documentation>
<attribute name="data_type">
<value>F32</value>
</attribute>
<optional>
<attribute name="default">
<ref name="F32_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>F64 pair.</a:documentation>
<attribute name="data_type">
<value>F64</value>
</attribute>
<optional>
<attribute name="default">
<ref name="F64_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>NATIVE_INT_TYPE pair.</a:documentation>
<attribute name="data_type">
<value>NATIVE_INT_TYPE</value>
</attribute>
<optional>
<attribute name="default">
<ref name="NATIVE_INT_TYPE_define"/>
</attribute>
</optional>
</group>
<group>
<a:documentation>NATIVE_UINT_TYPE pair.</a:documentation>
<attribute name="data_type">
<value>NATIVE_UINT_TYPE</value>
</attribute>
<optional>
<attribute name="default">
<ref name="NATIVE_UINT_TYPE_define"/>
</attribute>
</optional>
</group>
</choice>
</define>
</grammar>