1 | <?xml version='1.0' encoding="UTF-8"?>
|
---|
2 | <xsl:stylesheet version="2.0"
|
---|
3 | xml:lang="en"
|
---|
4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
5 | xmlns:local="http://www.w3.org/2005/xquery-local-functions"
|
---|
6 | xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
---|
7 |
|
---|
8 | <xsl:variable name="className" as="xs:string" select="tokenAutomaton/@className"/>
|
---|
9 | <xsl:variable name="defaultToken" as="xs:string" select="tokenAutomaton/@defaultToken"/>
|
---|
10 | <xsl:variable name="tokens" as="element(token)+" select="tokenAutomaton/tokens/token"/>
|
---|
11 | <xsl:variable name="tokenEnum" as="xs:string" select="tokenAutomaton/@tokenEnum"/>
|
---|
12 |
|
---|
13 | <xsl:variable name="warningGenerated" as="xs:string">/* NOTE: This file is AUTO GENERATED by qautomaton2cpp.xsl. */
</xsl:variable>
|
---|
14 |
|
---|
15 | <xsl:template match="tokenAutomaton">
|
---|
16 |
|
---|
17 | <xsl:variable name="uniqueLengths" as="xs:integer+" select="distinct-values(tokens/token/string-length())"/>
|
---|
18 |
|
---|
19 | <xsl:result-document method="text" href="{@headerFile}">
|
---|
20 |
|
---|
21 | <xsl:variable name="includeGuardName" select="string(@includeGuardName)"/>
|
---|
22 |
|
---|
23 | <xsl:value-of select="boilerplate/prolog"/>
|
---|
24 |
|
---|
25 | <xsl:value-of select="$warningGenerated"/>
|
---|
26 |
|
---|
27 | <xsl:text>
#ifndef </xsl:text>
|
---|
28 | <xsl:value-of select="$includeGuardName"/>
|
---|
29 | <xsl:text>
#define </xsl:text>
|
---|
30 | <xsl:value-of select="$includeGuardName"/>
|
---|
31 | <xsl:text>

</xsl:text>
|
---|
32 |
|
---|
33 | <xsl:text>#include <QtCore/QString>
</xsl:text>
|
---|
34 | <xsl:text>
</xsl:text>
|
---|
35 | <xsl:text>QT_BEGIN_NAMESPACE
</xsl:text>
|
---|
36 | <xsl:text>
</xsl:text>
|
---|
37 |
|
---|
38 | <xsl:if test="@namespace">
|
---|
39 | <xsl:text>namespace </xsl:text>
|
---|
40 | <xsl:value-of select="@namespace"/>
|
---|
|
---|