[llvm-commits] [hlvm] r38041 - /hlvm/trunk/hlvm/Reader/XML/HLVM.rng
Reid Spencer
reid at x10sys.com
Sat Jul 7 16:59:14 PDT 2007
Author: reid
Date: Sat Jul 7 18:59:13 2007
New Revision: 38041
URL: http://llvm.org/viewvc/llvm-project?rev=38041&view=rev
Log:
Get the RNG validation errors out of this schema so it can be used.
Modified:
hlvm/trunk/hlvm/Reader/XML/HLVM.rng
Modified: hlvm/trunk/hlvm/Reader/XML/HLVM.rng
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Reader/XML/HLVM.rng?rev=38041&r1=38040&r2=38041&view=diff
==============================================================================
--- hlvm/trunk/hlvm/Reader/XML/HLVM.rng (original)
+++ hlvm/trunk/hlvm/Reader/XML/HLVM.rng Sat Jul 7 18:59:13 2007
@@ -38,10 +38,10 @@
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns ="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/annotation/1.0"
- ns="http://hlvm.org/src/hlvm/Reader/XML/HLVMAST.rng">
+ ns="http://hlvm.org/src/hlvm/Reader/XML/HLVM.rng">
<start>
- <ref name="bundle.elem"/>
+ <ref name="HLVM.elem"/>
</start>
<!-- PATTERN DEFINITIONS FOR DATA TYPES -->
@@ -141,9 +141,16 @@
</attribute>
</define>
+ <!-- HLVM PATTERN -->
+ <define name="HLVM.elem">
+ <element name="hlvm">
+ <ref name="Bundle.elem"/>
+ </element>
+ </define>
+
<!--BUNDLES PATTERN -->
- <define name="bundle.elem">
+ <define name="Bundle.elem">
<element name="bundle">
<ref name="bundle.pat"/>
</element>
@@ -155,18 +162,14 @@
<zeroOrMore>
<ref name="import.elem"/>
</zeroOrMore>
- <oneOrMore>
+ <zeroOrMore>
<interleave>
- <ref name="bundle.elem"/>
- <ref name="class.elem"/>
- <ref name="function.elem"/>
- <ref name="interface.elem"/>
- <ref name="program.elem"/>
- <ref name="signature.elem"/>
- <ref name="type.elem"/>
- <ref name="variable.elem"/>
+ <ref name="Bundle.elem"/>
+ <ref name="Function.elem"/>
+ <ref name="Type.pat"/>
+ <ref name="Variable.elem"/>
</interleave>
- </oneOrMore>
+ </zeroOrMore>
</define>
<define name="import.elem">
@@ -193,27 +196,22 @@
<ref name="Vector.elem"/>
<ref name="Structure.elem"/>
<ref name="Signature.elem"/>
- <ref name="Opaque.elem"/>
</choice>
</define>
<define name="Alias.elem">
- <element name="Alias">
+ <element name="alias">
<ref name="Named_Element.pat"/>
<attribute name="renames"><ref name="Identifier.type"/></attribute>
</element>
- <ref name="Alias.ext"/>
</define>
- <define name="Alias.ext" combine="choice"><empty/></define>
-
<define name="Atom.elem">
- <element name="Atom">
+ <element name="atom">
<ref name="Named_Element.pat"/>
<attribute name="is">
<ref name="Intrinsic_Atoms.type"/>
</attribute>
- <ref name="Atom.ext"/>
</element>
</define>
@@ -235,10 +233,8 @@
</choice>
</define>
- <define name="Atom.ext" combine="choice"><empty/></define>
-
<define name="Enumeration.elem">
- <element name="Enum">
+ <element name="enum">
<ref name="Named_Element.pat"/>
<oneOrMore>
<element name="value">
@@ -246,46 +242,34 @@
<ref name="Constant.pat"/>
</element>
</oneOrMore>
- <ref name="Enumeration.ext"/>
</element>
</define>
- <define name="Enumeration.ext" combine="choice"><empty/></define>
-
<define name="Pointer.elem">
- <element name="Pointer">
+ <element name="pointer">
<ref name="Named_Element.pat"/>
<attribute name="to"><ref name="Identifier.type"/></attribute>
- <ref name="Pointer.ext"/>
</element>
</define>
- <define name="Pointer.ext" combine="choice"><empty/></define>
-
<define name="Vector.elem">
- <element name="Vector">
+ <element name="vector">
<ref name="Named_Element.pat"/>
<attribute name="length"><data type="nonNegativeInteger"/></attribute>
<attribute name="of">
<ref name="Intrinsic_Atoms.type"/>
</attribute>
- <ref name="Vector.ext"/>
</element>
</define>
- <define name="Vector.ext" combine="choice"><empty/></define>
-
<define name="Array.elem">
- <element name="Array">
+ <element name="array">
<ref name="Named_Element.pat"/>
<attribute name="length"><data type="nonNegativeInteger"/></attribute>
<attribute name="of"><ref name="Identifier.type"/></attribute>
- <ref name="Array.ext"/>
</element>
</define>
- <define name="Array.ext" combine="choice"><empty/></define>
-
<define name="Structure.elem">
<element name="structure">
<ref name="Named_Element.pat"/>
@@ -297,7 +281,7 @@
</element>
</define>
- <define name="signature.elem">
+ <define name="Signature.elem">
<element name="signature">
<ref name="Named_Element.pat"/>
<attribute name="result"><ref name="Identifier.type"/></attribute>
@@ -312,22 +296,17 @@
</element>
</define>
- <define name="Signature.ext" combine="choice"><empty/></define>
-
<define name="Opaque.elem">
- <element name="Opaque">
+ <element name="opaque">
<ref name="Named_Element.pat"/>
<empty/>
</element>
- <ref name="Opaque.ext"/>
</define>
- <define name="Opaque.ext" combine="choice"><empty/></define>
-
<!--PATTERNS FOR VARIABLES-->
<define name="Variable.elem">
- <element name="Var">
+ <element name="var">
<ref name="Named_Typed_Element.pat"/>
<optional>
<choice>
@@ -347,7 +326,6 @@
<ref name="Linkage.type"/>
</attribute>
</optional>
- <ref name="Variable.ext"/>
</element>
</define>
@@ -361,12 +339,10 @@
</choice>
</define>
- <define name="Variable.ext" combine="choice"><empty/></define>
-
<!--PATTERNS FOR FUNCTIONS -->
<define name="Function.elem">
- <element name="Function">
+ <element name="function">
<ref name="Named_Typed_Element.pat"/>
<optional>
<attribute name="symbol"><ref name="Identifier.type"/></attribute>
@@ -377,17 +353,11 @@
<zeroOrMore>
<element name="var">
<ref name="Named_Typed_Element.pat"/>
- <optional>
- <attribute name="gc">
- <ref name="Boolean.type"/>
- </attribute>
- </optional>
</element>
</zeroOrMore>
<zeroOrMore>
<ref name="Block.elem"/>
</zeroOrMore>
- <ref name="Function.ext"/>
</element>
</define>
@@ -396,329 +366,13 @@
<optional>
<attribute name="label"><ref name="Identifier.type"/></attribute>
</optional>
- <zeroOrMore>
- <choice>
- <ref name="Binary_Operators.pat"/>
- <ref name="Bitwise_Operators.pat"/>
- <ref name="Memory_Accessors.pat"/>
- <ref name="Other_Instructions.pat"/>
- </choice>
- </zeroOrMore>
- <ref name="Terminators.pat"/>
- </element>
- </define>
-
- <define name="Function.ext" combine="choice"><empty/></define>
-
- <!-- PATTERNS FOR INSTRUCTIONS -->
-
- <define name="Binary_Operators.pat">
- <choice>
- <ref name="Add.elem"/>
- <ref name="Subtract.elem"/>
- <ref name="Multiply.elem"/>
- <ref name="Divide.elem"/>
- <ref name="Remainder.elem"/>
- <ref name="Equal.elem"/>
- <ref name="NotEqual.elem"/>
- <ref name="GreaterThan.elem"/>
- <ref name="GreaterEqual.elem"/>
- <ref name="LessThan.elem"/>
- <ref name="LessEqual.elem"/>
- </choice>
- </define>
-
- <define name="Bitwise_Operators.pat">
- <choice>
- <ref name="And.elem"/>
- <ref name="Or.elem"/>
- <ref name="Xor.elem"/>
- <ref name="ShiftLeft.elem"/>
- <ref name="ShiftRight.elem"/>
- </choice>
- </define>
-
- <define name="Memory_Accessors.pat">
- <choice>
- <ref name="Get.elem"/>
- <ref name="Put.elem"/>
- <ref name="Alloca.elem"/>
- <ref name="Malloc.elem"/>
- <ref name="Free.elem"/>
- <ref name="Index.elem"/>
- </choice>
- </define>
-
- <define name="Other_Instructions.pat">
- <choice>
- <ref name="Cast.elem"/>
- <ref name="Select.elem"/>
- <ref name="Call.elem"/>
- <ref name="VA_Arg.elem"/>
- </choice>
- </define>
-
- <define name="Terminators.pat">
- <choice>
- <ref name="Return.elem"/>
- <ref name="Branch.elem"/>
- <ref name="Switch.elem"/>
- <ref name="Invoke.elem"/>
- <ref name="Unwind.elem"/>
- <ref name="Unreachable.elem"/>
- </choice>
- </define>
-
- <define name="Return.elem">
- <element name="ret">
- <optional>
- <ref name="Value.pat"/>
- </optional>
- </element>
- </define>
-
- <define name="Branch.elem">
- <element name="br">
- <choice>
- <group>
- <attribute name="to"><ref name="Identifier.type"/></attribute>
- <empty/>
- </group>
- <group>
- <attribute name="then"><ref name="Identifier.type"/></attribute>
- <attribute name="else"><ref name="Identifier.type"/></attribute>
- <ref name="Value.pat"/>
- </group>
- </choice>
- </element>
- </define>
-
- <define name="Switch.elem">
- <element name="switch">
- <attribute name="default"><ref name="Identifier.type"/></attribute>
- <element name="on"><ref name="Value.pat"/></element>
- <zeroOrMore>
- <element name="jump">
- <attribute name="to"><ref name="Identifier.type"/></attribute>
- <ref name="Value.pat"/>
- </element>
- </zeroOrMore>
- </element>
- </define>
-
- <define name="Invoke.elem">
- <element name="invoke">
- <attribute name="var"><ref name="Identifier.type"/></attribute>
- <attribute name="to"><ref name="Identifier.type"/></attribute>
- <attribute name="except"><ref name="Identifier.type"/></attribute>
- <ref name="Value.pat"/>
- <zeroOrMore>
- <ref name="Value.pat"/>
- </zeroOrMore>
- </element>
- </define>
-
- <define name="Unwind.elem">
- <element name="unwind"><empty/></element>
- </define>
-
- <define name="Unreachable.elem">
- <element name="unreachable"><empty/></element>
- </define>
-
- <define name="Binary_Operator.pat">
- <ref name="Value.pat"/>
- <ref name="Value.pat"/>
- </define>
-
- <define name="Add.elem">
- <element name="add"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Subtract.elem">
- <element name="sub"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Multiply.elem">
- <element name="mul"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Divide.elem">
- <element name="div"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Remainder.elem">
- <element name="rem"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Equal.elem">
- <element name="eq"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="NotEqual.elem">
- <element name="ne"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="GreaterThan.elem">
- <element name="gt"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="GreaterEqual.elem">
- <element name="ge"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="LessThan.elem">
- <element name="lt"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="LessEqual.elem">
- <element name="le"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="And.elem">
- <element name="and"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Or.elem">
- <element name="or"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Xor.elem">
- <element name="xor"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="ShiftLeft.elem">
- <element name="shl"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="ShiftRight.elem">
- <element name="shr"><ref name="Binary_Operator.pat"/></element>
- </define>
-
- <define name="Get.elem">
- <element name="get">
- <ref name="Value.pat"/>
- <optional>
- <attribute name="volatile">
- <ref name="Boolean.type"/>
- </attribute>
- </optional>
- <optional>
- <element name="gc">
- <ref name="Value.pat"/>
- </element>
- </optional>
</element>
</define>
- <define name="Put.elem">
- <element name="put">
- <ref name="Value.pat"/>
- <ref name="Value.pat"/>
- <optional>
- <attribute name="volatile"><ref name="Boolean.type"/></attribute>
- </optional>
- <optional>
- <element name="gc">
- <ref name="Value.pat"/>
- </element>
- </optional>
- </element>
- </define>
-
- <define name="Alloca.elem">
- <element name="alloca">
- <ref name="Typed_Element.pat"/>
- <ref name="Value.pat"/>
- </element>
- </define>
-
- <define name="Malloc.elem">
- <element name="malloc">
- <ref name="Typed_Element.pat"/>
- <ref name="Value.pat"/>
- </element>
- </define>
-
- <define name="Free.elem">
- <element name="free">
- <ref name="Value.pat"/>
- <optional>
- <attribute name="gc">
- <ref name="Boolean.type"/>
- </attribute>
- </optional>
- </element>
- </define>
-
- <define name="Index.elem">
- <element name="index">
- <ref name="Value.pat"/>
- <zeroOrMore>
- <choice>
- <element name="idx"><ref name="Value.pat"/></element>
- <element name="fld"><ref name="Named_Element.pat"/></element>
- </choice>
- </zeroOrMore>
- </element>
- </define>
-
- <define name="Cast.elem">
- <element name="cast">
- <ref name="Value.pat"/>
- <attribute name="to"><ref name="Identifier.type"/></attribute>
- </element>
- </define>
-
- <define name="Select.elem">
- <element name="select">
- <ref name="Value.pat"/>
- <ref name="Value.pat"/>
- <ref name="Value.pat"/>
- </element>
- </define>
-
- <define name="Call.elem">
- <element name="call">
- <ref name="Value.pat"/>
- <zeroOrMore>
- <ref name="Value.pat"/>
- </zeroOrMore>
- </element>
- </define>
-
- <define name="VA_Arg.elem">
- <element name="va_arg">
- <ref name="Typed_Element.pat"/>
- <ref name="Value.pat"/>
- </element>
- </define>
-
- <define name="Value.pat">
- <choice>
- <ref name="Binary_Operators.pat"/>
- <ref name="Bitwise_Operators.pat"/>
- <ref name="Constant.pat"/>
- <ref name="Invoke.elem"/>
- <ref name="Get.elem"/>
- <ref name="Alloca.elem"/>
- <ref name="Malloc.elem"/>
- <ref name="Index.elem"/>
- <ref name="Cast.elem"/>
- <ref name="Select.elem"/>
- <ref name="Call.elem"/>
- <ref name="VA_Arg.elem"/>
- </choice>
- </define>
-
<define name="Constant.pat">
<choice>
<ref name="Reference.elem"/>
<ref name="Literal.pat"/>
- <ref name="Cast.elem"/>
- <ref name="Index.elem"/>
- <ref name="Binary_Operators.pat"/>
- <ref name="Bitwise_Operators.pat"/>
</choice>
</define>
More information about the llvm-commits
mailing list