diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag
index d007355fb82d4b4e2ab0652dda50213725e988a2..5520f2fd7dac977d74ff2a5e8c808f2ed9588ef7 100644
--- a/CompilerGeneration.jrag
+++ b/CompilerGeneration.jrag
@@ -1,10 +1,23 @@
 /* -*-Java-*- */
 
 /* 
- * Copyright (C) 2007  Anders Nilsson <anders.nilsson@cs.lth.se>
+ * Copyright (C) 2007,2008,2009  Anders Nilsson <anders.nilsson@cs.lth.se>
  *
- * This file is part of XmlSchemaCompiler.
- */
+ * This file is part of XMLSchemaCompiler.
+ *
+ * XMLSchemaCompiler is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * XMLSchemaCompiler is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with XMLSchemaCompiler.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 import java.io.*;
 import java.util.*;
@@ -272,7 +285,6 @@ aspect GenJavaCC {
         while (iter.hasNext()) {
             ((ASTNode) iter.next()).genJavaCC(pStream);
         }
-//         super.genJavaCC(pStream);
 	}
 
     void XsElement.genJavaCC(PrintStream pStream) {
@@ -282,14 +294,8 @@ aspect GenJavaCC {
             pStream.println("{");
 
             pStream.println("   <"+name+"> AttributeList()");
-//             pStream.println("   <"+name+"> AttributeList() \">\"");
-//             pStream.println("  \"<\" <"+name+"> AttributeList() \">\"");
-//             pStream.println("  ElementList()");
             pStream.print("  ( <GT> ElementList()");
             pStream.println("  \"</\" <"+name+">  \">\" | ElementList() \"/>\" )");
-//             pStream.println("  \"<\" <"+name.toUpperCase()+"> AttributeList() \">\"");
-//             pStream.println("  ElementList()");
-//             pStream.println("  \"</\" <"+name.toUpperCase()+">  \">\"");
             pStream.println("}");
         }
     }
@@ -404,22 +410,50 @@ aspect Misc {
 		return false;
 	}
 
-	static final String[] ASTNode.forbiddenNames = {"Attribute",
-													"else",
-													"final",
-													"if",
-													"to"};
-
-    static String ASTNode.fixName(String s) {
-        if (s.equals("class")) {
-            return "clazz";
-        }
-		if (Arrays.binarySearch(forbiddenNames,s) > -1) {
+	static final  String[] ASTNode.forbiddenNames = {"Attribute",
+													 "else",
+													 "final",
+													 "if",
+													 "to"};
+	static ArrayList<String> ASTNode.problemNames = new ArrayList();
+	static HashSet<String> ASTNode.registeredNames = new HashSet();
+
+	static String ASTNode.fixName(String s) {
+		if (s.equals("class")) {
+			return "clazz";
+		}
+		if (problemNames.contains(s)) {
 			s = "_" + s;
 		}
-        s = s.replace("-","_");
-        return s;
-    }
+		s = s.replace("-","_");
+		return s;
+	}
+
+	public void ASTNode.registerProblematicNames() {
+		for (ASTNode child : this) {
+			child.registerProblematicNames();
+		}
+	}
+
+	public void Start.registerProblematicNames() {
+		for (int i=0; i<forbiddenNames.length; i++) {
+			problemNames.add(forbiddenNames[i]);
+		}
+		super.registerProblematicNames();
+	}
+
+	public void XsElement.registerProblematicNames() {
+		if (!registeredNames.add(name().toLowerCase())) {
+			problemNames.add(name());
+		}
+		super.registerProblematicNames();
+	}
+
+	public void XsAttribute.registerProblematicNames() {
+		if (!registeredNames.add(name().toLowerCase())) {
+			problemNames.add(name());
+		}
+	}
 }
 
 aspect GenAspects {
diff --git a/GenCompiler.java b/GenCompiler.java
index 32389aa3ddbec782f516be2dfc0cbd5d4e6a614b..2170f0405ac8abb9d2b6766580fbe4e63cf44085 100644
--- a/GenCompiler.java
+++ b/GenCompiler.java
@@ -52,6 +52,8 @@ public class GenCompiler extends Parser {
 
 	ast.setGrammar(grammarName);
 
+	ast.registerProblematicNames();
+
 	File siarasDir = new File(dir);
 	if (!siarasDir.isDirectory()) {
 	    siarasDir.mkdir();
diff --git a/LICENSE b/LICENSE
index 94a9ed024d3859793618152ea559a168bbcbb5e2..85b8e59922af06a29135a36d55993b6509e700a2 100644
--- a/LICENSE
+++ b/LICENSE
@@ -618,57 +618,3 @@ an absolute waiver of all civil liability in connection with the
 Program, unless a warranty or assumption of liability accompanies a
 copy of the Program in return for a fee.
 
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/examples/actionSchedule.xml b/examples/actionSchedule.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c6e97d2b54f8618bfbb80837a8bd6d21adcfa34e
--- /dev/null
+++ b/examples/actionSchedule.xml
@@ -0,0 +1,76 @@
+<actionSchedule class="dynamic" start="0">
+  <actor name="ZigzagAddr" xlim="ZigZagAddr_0.xlim"/>
+  <mode ident="0">
+    <consumptionRate port="START" tokenCount="1"/>
+    <decision>
+      <test source="0$guard">
+        <!-- Embedded XLIM: the skip-action guard -->
+        <operation kind="$literal_Integer" value="0">
+          <port dir="out" source="2$zero" typeName="int" size="1"/>
+        </operation>
+        <operation kind="pinPeek" portName="START">
+          <port dir="in" source="2$zero"/>
+          <port dir="out" source="0$start" typeName="int" size="3"/>
+        </operation>
+        <operation kind="$lt">
+          <port dir="in" source="0$start"/>
+          <port dir="in" source="2$zero"/>
+          <port dir="out" source="1$guard" typeName="bool"/>
+         </operation>
+      </test>
+      <action when="true" nextNode="0">
+        <!-- Embedded XLIM: the skip-action -->
+        <operation kind="taskCall" target="skip"/>
+      </action>
+      <action nextNode="1">
+        <!-- Embedded XLIM: the start-action -->
+        <operation kind="taskCall" target="start"/>
+      </action>
+    </decision>
+  </mode>
+
+  <sequence ident="1" repeat="1">
+    <sequence repeat="63">
+      <mode ident="2">
+        <productionRate port="ADDR" tokenCount="1"/>
+        <action nextNode="4">
+          <!-- Embedded XLIM: the zz-action -->
+          <operation kind="taskCall" target="zz"/>
+        </action>
+      </mode>
+    </sequence>
+    <mode ident="3">
+      <!-- empty production/consumption -->
+      <action nextNode="0">
+        <!-- Embedded XLIM: the done-action -->
+        <operation kind="taskCall" target="done"/>
+      </action>
+    </mode>
+  </sequence>
+
+  <decision ident="4">
+    <!-- this decision node tests the guard count=0
+         it may be used to re-generate the action
+         scheduler (particularly to achieve the 
+         repetition factor of 63).                -->
+    <test source="1$id$w1587ab8b4b1a">
+      <operation kind="noop">
+        <port dir="in" source="0$id$w343ab5"/>
+        <port dir="out" source="0$id$w343ab7b5b1ab1" 
+         typeName="int" size="7"/>
+      </operation>
+      <operation kind="$literal_Integer" value="0">
+        <port dir="out" source="2$id$w2809ab9b4b1ab1b1" 
+         typeName="int" size="1" />
+      </operation>
+      <operation kind="$eq">
+        <port dir="in" source="0$id$w343ab7b5b1ab1"/>
+        <port dir="in" source="2$id$w2809ab9b4b1ab1b1"/>
+        <port dir="out" source="1$id$w1587ab8b4b1a" typeName="bool"/>
+      </operation>
+    </test>
+
+    <nodeRef when="true" node="3"/>
+    <nodeRef when="false" node="2"/>
+  </decision>
+</actionSchedule>
diff --git a/examples/actionSchedule.xsd b/examples/actionSchedule.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..510f55553361d5f9ac6cb32d65eb01a0e4925a0f
--- /dev/null
+++ b/examples/actionSchedule.xsd
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="action">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="operation" />
+      </xs:sequence>
+      <xs:attribute name="when" type="xs:NMTOKEN" use="optional" />
+      <xs:attribute name="nextNode" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="actionSchedule">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="actor" />
+        <xs:element ref="mode" />
+        <xs:element ref="sequence" />
+        <xs:element ref="decision" />
+      </xs:sequence>
+      <xs:attribute name="class" type="xs:NMTOKEN" use="required" />
+      <xs:attribute name="start" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="actor">
+    <xs:complexType>
+      <xs:attribute name="xlim" type="xs:NMTOKEN" use="required" />
+      <xs:attribute name="name" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="consumptionRate">
+    <xs:complexType>
+      <xs:attribute name="port" type="xs:NMTOKEN" use="required" />
+      <xs:attribute name="tokenCount" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="decision">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="action" />
+        <xs:element ref="nodeRef" />
+        <xs:element ref="test" />
+      </xs:choice>
+      <xs:attribute name="ident" type="xs:NMTOKEN" use="optional" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="mode">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="action" />
+        <xs:element ref="consumptionRate" />
+        <xs:element ref="decision" />
+        <xs:element ref="productionRate" />
+      </xs:choice>
+      <xs:attribute name="ident" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="nodeRef">
+    <xs:complexType>
+      <xs:attribute name="when" type="xs:NMTOKEN" use="required" />
+      <xs:attribute name="node" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="operation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="port" minOccurs="0" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="kind" type="xs:string" use="required" />
+      <xs:attribute name="value" type="xs:NMTOKEN" use="optional" />
+      <xs:attribute name="target" type="xs:NMTOKEN" use="optional" />
+      <xs:attribute name="portName" type="xs:NMTOKEN" use="optional" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="port">
+    <xs:complexType>
+      <xs:attribute name="typeName" type="xs:NMTOKEN" use="optional" />
+      <xs:attribute name="dir" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:NMTOKEN">
+            <xs:enumeration value="in" />
+            <xs:enumeration value="out" />
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="size" type="xs:NMTOKEN" use="optional" />
+      <xs:attribute name="source" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="productionRate">
+    <xs:complexType>
+      <xs:attribute name="port" type="xs:NMTOKEN" use="required" />
+      <xs:attribute name="tokenCount" type="xs:NMTOKEN" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="sequence">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="sequence" minOccurs="0" />
+        <xs:element ref="mode" minOccurs="0" />
+      </xs:sequence>
+      <xs:attribute name="repeat" type="xs:NMTOKEN" use="required" />
+      <xs:attribute name="ident" type="xs:NMTOKEN" use="optional" />
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="test">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="operation" maxOccurs="unbounded" />
+      </xs:sequence>
+      <xs:attribute name="source" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
\ No newline at end of file
diff --git a/examples/xdf.xsd b/examples/xdf.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..7375f3af19744ce8b2da6ad6126953ec5d3c3edb
--- /dev/null
+++ b/examples/xdf.xsd
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="XDF">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Instance"/>
+        <xs:element maxOccurs="unbounded" ref="Connection"/>
+        <xs:element maxOccurs="unbounded" ref="Note"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Instance">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="Note"/>
+          <xs:element ref="Class"/>
+          <xs:element ref="Parameter"/>
+        </xs:choice>
+        <xs:element ref="Actor"/>
+        <xs:element ref="Attribute"/>
+      </xs:sequence>
+      <xs:attribute name="id" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Class">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Parameter">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Actor">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Import"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="Decl"/>
+          <xs:element ref="Port"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="Action"/>
+        <xs:element ref="Note"/>
+        <xs:element minOccurs="0" ref="Schedule"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Import">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="QID"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Port">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Type"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Action">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="QID"/>
+        <xs:element minOccurs="0" ref="Input"/>
+        <xs:element minOccurs="0" ref="Output"/>
+        <xs:choice minOccurs="0">
+          <xs:element ref="Guards"/>
+          <xs:element ref="Stmt"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Input">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Decl"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="port" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Output">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="port" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Guards">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Stmt">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+        <xs:element ref="Args"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Schedule">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Transition"/>
+      </xs:sequence>
+      <xs:attribute name="initial-state" use="required" type="xs:NCName"/>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Transition">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ActionTags"/>
+      </xs:sequence>
+      <xs:attribute name="from" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+      <xs:attribute name="to" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ActionTags">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="QID"/>
+      </xs:sequence>
+      <xs:attribute name="text-begin-col" use="required"/>
+      <xs:attribute name="text-begin-line" use="required"/>
+      <xs:attribute name="text-end-col" use="required"/>
+      <xs:attribute name="text-end-line" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Attribute">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Connection">
+    <xs:complexType>
+      <xs:attribute name="dst" use="required"/>
+      <xs:attribute name="dst-port" use="required" type="xs:NCName"/>
+      <xs:attribute name="src" use="required"/>
+      <xs:attribute name="src-port" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Note">
+    <xs:complexType>
+      <xs:choice minOccurs="0">
+        <xs:element ref="Expr"/>
+        <xs:element ref="Type"/>
+      </xs:choice>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" type="xs:NCName"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Expr">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Args"/>
+        <xs:element minOccurs="0" ref="Op"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="literal-kind" type="xs:NCName"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="text-begin-col" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" type="xs:integer"/>
+      <xs:attribute name="text-end-col" type="xs:integer"/>
+      <xs:attribute name="text-end-line" type="xs:integer"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Op">
+    <xs:complexType>
+      <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="QID">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ID"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ID">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Decl">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Type"/>
+        <xs:element minOccurs="0" ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="assignable" type="xs:NCName"/>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="text-begin-col"/>
+      <xs:attribute name="text-begin-line"/>
+      <xs:attribute name="text-end-col" type="xs:integer"/>
+      <xs:attribute name="text-end-line" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Type">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Entry"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Entry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Args">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Expr"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>