fprime/Autocoders/schema/default/parameters_schema.rng

280 lines
9.4 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"></ref>
</start>
<define name = "parameters_root_define">
<element name = "parameters">
<!-- Attributes -->
<optional>
<attribute name = "parameter_base">
<a:documentation></a:documentation>
<ref name = "base_code_define"></ref>
</attribute>
</optional>
<optional>
<attribute name = "opcode_base">
<a:documentation></a:documentation>
<ref name = "base_code_define"></ref>
</attribute>
</optional>
<!-- Elements -->
<oneOrMore>
<ref name = "parameter_define"></ref>
</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"></ref>
</attribute>
<attribute name = "set_opcode">
<a:documentation>Opcode for setting the parameter.</a:documentation>
<ref name = "id_define"></ref>
</attribute>
<attribute name = "save_opcode">
<a:documentation>Opcode for saving the parameter.</a:documentation>
<ref name = "id_define"></ref>
</attribute>
<attribute name = "name">
<a:documentation>Parameter name</a:documentation>
<text></text>
</attribute>
<ref name = "data_type_and_default_define"></ref>
<!-- Elements -->
<optional>
<ref name = "comment_define"></ref>
</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"></ref>
</attribute>
<optional>
<attribute name = "default">
<text></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"></ref>
</optional>
</group>
<group>
<a:documentation>String pair.</a:documentation>
<attribute name = "data_type">
<value>string</value>
</attribute>
<optional>
<attribute name = "default">
<data type = "string"></data>
</attribute>
</optional>
<attribute name = "size">
<ref name = "positive_integer_define"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</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"></ref>
</attribute>
</optional>
</group>
</choice>
</define>
</grammar>