Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
blob: d281cffd66f60034cf8dba86f7b1e61a15e23b53 (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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Processes object file dependency graph
-->

<xsl:stylesheet version="2.0"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:lv="http://www.lovullo.com/rater"
  xmlns:dot="http://www.lovullo.com/calc/dot"
  xmlns:preproc="http://www.lovullo.com/rater/preproc">


<!--
  Entry point for object file DOT generation

  To render the graph, we first declare all nodes associated with all referenced
  symbols in the symbol tree (it's important to check against preproc:sym-deps,
  since it's likely that not all imported symbols are used); this allows setting
  attributes for the symbol nodes on the graph without having to worry about
  duplicate code later on.

  After that, we simply recurse through the dependency list and neighbor the
  nodes.
-->
<xsl:template match="lv:package[ preproc:sym-deps ]" priority="5">
  <xsl:apply-templates select="." mode="dot:head" />

  <xsl:variable name="sym-deps" select="preproc:sym-deps" />

  <!-- pre-style all referenced nodes (the symbol table is likely to contain
       references to symbols that were imported but not used) -->
  <xsl:apply-templates mode="dot:defnode" select="
      preproc:symtable/preproc:sym[
        @name=$sym-deps/preproc:sym-dep/preproc:sym-ref/@name
        or @name=$sym-deps/preproc:sym-dep/preproc:sym-ref/@parent
      ]
    " />

  <!-- output graph description -->
  <xsl:apply-templates select="preproc:sym-deps" mode="dot:depout" />

  <xsl:apply-templates select="." mode="dot:tail" />
</xsl:template>


</xsl:stylesheet>