Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
blob: 868d590e1bcb28beb21bb20519a1fd0697d8729d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0"?>
<!--
  Copyright (C) 2017 R-T Specialty, LLC.

  This file is part of tame-core.

  tame-core is free software: you can redistribute it and/or modify it
  under the terms of the GNU General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<package xmlns="http://www.lovullo.com/rater"
         xmlns:c="http://www.lovullo.com/calc"
         core="true"
         desc="Extern Definition">

  Externs are symbols that are expected to be defined by package importers
    before linking.
  Rather than explicitly declaring extern symbols,
    these templates provide more human-readable abstractions.


  Note that when defining extern classifications with
    \ref{_classify-extern_},
      if specifying a yield,
      the dimensionality is~$1$ unless otherwise provided.

  <template name="_classify-extern_"
            desc="Define extern for classification">
    <param name="@as@" desc="Extern classification name" />

    <param name="@yields@" desc="Extern classification yield">
      <text></text>
    </param>

    <!-- default assumption is a vector -->
    <param name="@dim@" desc="Extern classification yield dimensions">
      <text>1</text>
    </param>

    <extern name=":class:{@as@}" type="class" dim="0"
            yields="@yields@" />

    <if name="@yields@">
      <extern name="@yields@" type="cgen" dim="@dim@"
              parent=":class:{@as@}" />
    </if>
  </template>


  <template name="_rate-each-extern_"
            desc="Define extern for rate-each">
    <param name="@generates@" desc="Extern generator name" />
    <param name="@yields@"    desc="Extern yield name" />

    <if name="@generates@">
      <extern name="@generates@" type="gen" dtype="float" dim="1" />
    </if>

    <if name="@yields@">
      <extern name="@yields@" type="rate" dtype="float" dim="0" />
    </if>
  </template>


  <template name="_rate-extern_"
            desc="Define extern for rate">
    <param name="@yields@" desc="Extern yield name" />

    <extern name="@yields@" type="rate" dtype="float" dim="0" />
  </template>
</package>