2015-03-18 11:31:47 -04:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<package xmlns="http://www.lovullo.com/rater"
|
2013-02-13 09:27:33 -05:00
|
|
|
xmlns:c="http://www.lovullo.com/calc"
|
|
|
|
core="true"
|
|
|
|
desc="Base features">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- magic variable that will contain the result of a classification (this
|
|
|
|
definition exists to simplify validations (its symbol is Xi because it
|
|
|
|
looks like a sideways array) -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<const name="_CMATCH_" type="boolean" desc="Set indicating indexes of classification matches" sym="\Xi">
|
|
|
|
<item value="0" desc="Dummy value; this set is populated upon entering each rate block" />
|
|
|
|
</const>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<const name="NEGATE" value="-1" type="float" desc="Negate a value" sym="-" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
<!-- useful where constants are required -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<const name="ZERO" value="0.00" type="float" desc="Zero value" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
<!-- the runtime is responsible for automatically populating these fields with meaningful values -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<const name="__DATE_YEAR__" value="0" type="integer" desc="Current year" sym="\widehat{D^\gamma}" magic="true" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<typedef name="integer" desc="Any value in the set of integers" sym="\mathbb{I}">
|
|
|
|
<base-type />
|
|
|
|
</typedef>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
<!-- real number -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<typedef name="float" desc="Any real number (represented as a float)" sym="\mathbb{R}">
|
|
|
|
<base-type />
|
|
|
|
</typedef>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<typedef name="boolean" desc="Boolean values">
|
|
|
|
<enum type="integer">
|
|
|
|
<item name="TRUE" value="1" desc="True" />
|
|
|
|
<item name="FALSE" value="0" desc="False" />
|
|
|
|
</enum>
|
|
|
|
</typedef>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
<!-- does not have much practical use outside of the core -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<typedef name="empty" desc="Empty set" sym="\emptyset">
|
|
|
|
<base-type />
|
|
|
|
</typedef>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
Useful in certain circumstances. Don't judge.
|
|
|
|
-->
|
2015-03-18 11:31:47 -04:00
|
|
|
<classify as="always" keep="true" yields="alwaysTrue" desc="Always true" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<template name="_todo_" desc="A simple TODO :)">
|
|
|
|
<param name="@desc@" desc="TODO desc">
|
|
|
|
<text>TODO</text>
|
|
|
|
</param>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<param name="@hide@" desc="Whether to hide content by stripping
|
2013-02-13 09:27:33 -05:00
|
|
|
it entriely from the output" />
|
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<unless name="@hide@">
|
2013-02-13 09:27:33 -05:00
|
|
|
<c:const value="0" type="integer" desc="@desc@" />
|
2015-03-18 11:31:47 -04:00
|
|
|
</unless>
|
|
|
|
</template>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<template name="_ignore_" desc="Simply removes all child nodes (as if it was commented out)">
|
|
|
|
<param name="@values@" desc="Nodes to comment out" />
|
|
|
|
<param name="@desc@" desc="Description" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
<!-- nothing -->
|
2015-03-18 11:31:47 -04:00
|
|
|
</template>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<template name="_fail-on-empty_" desc="Fail on rate lookup failure">
|
|
|
|
<param name="@values@" desc="Optional conditions to include in match" />
|
|
|
|
<param name="@name@" desc="Data to check (scalar, vector or otherwise)" />
|
|
|
|
<param name="@when@" desc="Conditional check (optional)" />
|
|
|
|
<param name="@class@" desc="Conditional class check" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<param name="@as@" desc="Classifier name">
|
|
|
|
<text>-err-empty-</text>
|
|
|
|
<param-value name="@name@" lower="true" />
|
|
|
|
</param>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<param name="@desc@" desc="Description">
|
|
|
|
<param-value name="@name@" />
|
|
|
|
<text> is empty</text>
|
|
|
|
</param>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<param name="@classyields@" desc="Classification yield to match on">
|
|
|
|
<param-class-to-yields name="@class@" />
|
|
|
|
</param>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
<!-- default to external to ensure that calculations do not wind up in the
|
|
|
|
classifier -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<param name="@external@" desc="External classification">
|
|
|
|
<text>true</text>
|
|
|
|
</param>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<classify as="@as@" desc="@desc@" external="@external@" terminate="true">
|
2013-02-13 09:27:33 -05:00
|
|
|
<!-- include any option conditions -->
|
2015-03-18 11:31:47 -04:00
|
|
|
<param-copy name="@values@" />
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<if name="@when@">
|
|
|
|
<match on="@when@" value="TRUE" />
|
|
|
|
</if>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<if name="@class@">
|
|
|
|
<match on="@classyields@" value="TRUE" />
|
|
|
|
</if>
|
2013-02-13 09:27:33 -05:00
|
|
|
|
2015-03-18 11:31:47 -04:00
|
|
|
<match on="@name@" value="ZERO" />
|
|
|
|
</classify>
|
|
|
|
</template>
|
|
|
|
</package>
|
2013-02-13 09:27:33 -05:00
|
|
|
|