1 <?xml version=
"1.0" encoding=
"iso-8859-1"?>
5 | make-opcode-def.xsl: Translates opcodes from the CIL-opcodes.xml into
6 | a spec compliant opcodes.def file
7 | Converted to XSLT from make-opcodes-def.pl
9 | See: Common Language Infrastructure (CLI) Part 5: Annexes
11 | Author: Sergey Chaban
13 | $Id: make-opcode-def.xsl,v 1.1 2001/07/13 01:04:23 miguel Exp $
18 <xsl:stylesheet version=
"1.0"
19 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
23 <xsl:output method=
"text"/>
26 <xsl:template match=
"/">
27 <xsl:apply-templates/>
28 <xsl:call-template name=
"print-trailer"/>
31 <xsl:template name=
"to-upper">
32 <xsl:param name=
"string"/>
33 <xsl:value-of select=
"translate($string,
34 'abcdefghijklmnopqrstuvwxyz.-',
35 'ABCDEFGHIJKLMNOPQRSTUVWXYZ__')"/>
39 <xsl:template name=
"get-flow">
40 <xsl:param name=
"flow" select=
"@flow"/>
43 test=
"contains('next call return branch meta cond-branch',$flow)">
44 <xsl:call-template name=
"to-upper">
45 <xsl:with-param name=
"string" select=
"$flow"/>
48 <xsl:otherwise><xsl:value-of select=
"'ERROR'"/></xsl:otherwise>
53 <xsl:template match=
"opdesc/opcode">
54 <xsl:variable name=
"uname">
55 <xsl:call-template name=
"to-upper">
56 <xsl:with-param name=
"string" select=
"@name"/>
59 <xsl:variable name=
"o1">
60 <xsl:call-template name=
"to-upper">
61 <xsl:with-param name=
"string" select=
"@o1"/>
64 <xsl:variable name=
"f">
65 <xsl:call-template name=
"get-flow"/>
67 <xsl:variable name=
"count"
68 select=
"number(not(contains($o1,'FF')))+1"/>OPDEF(CEE_
<xsl:value-of
69 select=
"concat($uname,', "',@name,'", ',
70 @input,', ',@output,', ',@args,', X, ',
71 $count,', ',@o1,', ',@o2,', ',$f
76 <xsl:template name=
"print-trailer">
78 #define _MONO_CIL_OPALIAS_DEFINED_
79 #define OPALIAS(a,s,r)
82 OPALIAS(CEE_BRNULL,
"brnull", CEE_BRFALSE)
83 OPALIAS(CEE_BRNULL_S,
"brnull.s", CEE_BRFALSE_S)
84 OPALIAS(CEE_BRZERO,
"brzero", CEE_BRFALSE)
85 OPALIAS(CEE_BRZERO_S,
"brzero.s", CEE_BRFALSE_S)
86 OPALIAS(CEE_BRINST,
"brinst", CEE_BRTRUE)
87 OPALIAS(CEE_BRINST_S,
"brinst.s", CEE_BRTRUE_S)
88 OPALIAS(CEE_LDIND_U8,
"ldind.u8", CEE_LDIND_I8)
89 OPALIAS(CEE_LDELEM_U8,
"ldelem.u8", CEE_LDELEM_I8)
90 OPALIAS(CEE_LDX_I4_MIX,
"ldc.i4.M1", CEE_LDC_I4_M1)
91 OPALIAS(CEE_ENDFAULT,
"endfault", CEE_ENDFINALLY)
93 #ifdef _MONO_CIL_OPALIAS_DEFINED_
95 #undef _MONO_CIL_OPALIAS_DEFINED_