-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlang-c.xsl
51 lines (44 loc) · 1.86 KB
/
lang-c.xsl
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
xmlns:thi="http://thi.ng/">
<xsl:output method="text"/>
<xsl:variable name="lcommentPrefix" select="'// '"/>
<xsl:variable name="lcommentSuffix" select="''"/>
<xsl:variable
name="bcommentPrefix"
select="'/****************************************************************'"/>
<xsl:variable name="bcommentLPrefix" select="' * '"/>
<xsl:variable
name="bcommentSuffix"
select="' ****************************************************************/'"/>
<xsl:variable name="definePrefix" select="'#define '"/>
<xsl:variable name="defineSuffix" select="''"/>
<xsl:variable name="sep" select="'_'"/>
<xsl:function name="thi:lang-prologue">
<xsl:text>#ifndef _CMSIS_SVD_H
#define _CMSIS_SVD_H

</xsl:text>
</xsl:function>
<xsl:function name="thi:lang-epilogue">
<xsl:text>#endif
</xsl:text>
</xsl:function>
<xsl:function name="thi:lang-def">
<xsl:param name="sym" as="xs:string"/>
<xsl:param name="val"/>
<xsl:value-of select="concat('#define ',thi:lang-symbolname($sym),' ',$val)"/>
</xsl:function>
<xsl:function name="thi:lang-symbolname">
<xsl:param name="body" as="xs:string"/>
<xsl:value-of select="$body"/>
</xsl:function>
<xsl:function name="thi:lang-expr">
<xsl:param name="op" as="xs:string"/>
<xsl:param name="lhs"/>
<xsl:param name="rhs"/>
<xsl:value-of select="concat('(',$lhs,' ',$op,' ',$rhs,')')"/>
</xsl:function>
<xsl:include href="common.xsl"/>
</xsl:stylesheet>