<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<!-- Charles André version 0.2 - July 14, 2002 -->
	<!-- SyncChart -->
	<xsd:annotation>
		<xsd:documentation xml:lang="en">
			syncChart XML-schema
			Charles André
			I3S Laboratory
			andre@unice.fr		
		</xsd:documentation>
		<xsd:appinfo>
			<xsd:attribute name="version" fixed="0.2"/>
			<xsd:attribute name="date" fixed="2002.07.14"/>
			<xsd:attribute name="author" fixed="Charles André"/>
			<xsd:attribute name="company" fixed="I3S Laboratory"/>
		</xsd:appinfo>
	</xsd:annotation>
	<xsd:element name="syncchart">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="macrostar" maxOccurs="unbounded"/>
				<!-- macrostar [1,...]-->
			</xsd:sequence>
			<xsd:attribute name="root" type="stdID" use="required"/>
		</xsd:complexType>
	</xsd:element>
	<!-- MacroStar -->
	<xsd:element name="macrostar">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="decl"/>
				<xsd:element name="ldcl" minOccurs="0"/>
				<xsd:element ref="constel" maxOccurs="unbounded"/>
				<!-- declarations [1,1]-->
				<!-- ldcl [0,1] -->
				<!-- constels [1,*]-->
			</xsd:sequence>
			<xsd:attribute name="id" type="macrostarID" use="required"/>
			<xsd:attribute name="name" type="stdID"/>
			<xsd:attribute name="andDeg" type="xsd:integer" default="1"/>
			<!-- id [1]-->
			<!-- user name [?] ("") -->
			<!-- nb of constels [?] (1) -->
		</xsd:complexType>
	</xsd:element>
	<!-- Constellation -->
	<xsd:element name="constel">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="vdcl" minOccurs="0"/>
				<xsd:element name="initials"/>
				<xsd:element ref="star" maxOccurs="unbounded"/>
				<!-- vdcl [0,1] -->
				<!-- initial [1,1]-->
				<!-- stars [1,*]-->
			</xsd:sequence>
			<xsd:attribute name="id" type="constelID" use="required"/>
			<xsd:attribute name="orDeg" type="xsd:integer" default="1"/>
			<!-- id [1]-->
			<!-- nb of stars [?] (1) -->
		</xsd:complexType>
	</xsd:element>
	<!-- Star -->
	<xsd:element name="star">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="suspBeam" type="suspBeamType" minOccurs="0"/>
				<xsd:element name="abortion" minOccurs="0"/>
				<xsd:element name="body" minOccurs="0"/>
				<!-- optional suspension -->
				<!-- optional abortion -->
				<!-- optional star body [?]-->
			</xsd:sequence>
			<xsd:attribute name="id" type="starID" use="required"/>
			<xsd:attribute name="outDeg" type="xsd:integer" default="0"/>
			<xsd:attribute name="final" type="xsd:boolean" default="false"/>
			<!-- id [1]-->
			<!-- outDeg [?] (0) -->
			<!-- final [?] (false)-->
		</xsd:complexType>
	</xsd:element>
	<!-- body -->
	<xsd:element name="body">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:choice minOccurs="0">
					<xsd:element name="sustain"/>
					<xsd:element name="run"/>
					<!-- sustain signal -->
					<!-- run -->
				</xsd:choice>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- initials -->
	<xsd:element name="initials">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="initBeam" type="initBeamType" maxOccurs="unbounded"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- suspBeam -->
	<xsd:element name="suspBeam" type="suspBeamType"/>
	<!-- initBeam -->
	<xsd:element name="initBeam" type="initBeamType"/>
	<!-- ntBeam -->
	<xsd:element name="ntBeam" type="ntBeamType"/>
	<!-- weak abort beams -->
	<xsd:element name="waBeam" type="abortBeamType"/>
	<!-- strong abort beams -->
	<xsd:element name="saBeam" type="abortBeamType"/>
	<!-- abortion -->
	<xsd:element name="abortion">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="saBeam" type="abortBeamType" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element name="waBeam" type="abortBeamType" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element name="ntBeam" type="ntBeamType" minOccurs="0"/>
				<!-- strong abortBeam [0,*] -->
				<!-- weak abortBeam [0,*] -->
				<!-- normal termination [0,1]-->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- Sustain  -->
	<xsd:element name="sustain">
		<xsd:complexType>
			<xsd:attribute name="cond" type="xsd:string"/>
			<xsd:attribute name="signal" type="stdID" use="required"/>
			<xsd:attribute name="value" type="xsd:string" />
			<!-- cond [?] -->
			<!-- signal [1] -->
			<!-- value [?] -->
		</xsd:complexType>
	</xsd:element>
	<!-- Run  -->
	<xsd:element name="run">
		<xsd:complexType>
			<xsd:attribute name="ref" type="macrostarID" use="required"/>
			<xsd:attribute name="name" type="xsd:string"/>
			<!-- ref [1] -->
			<!-- name [?] -->
		</xsd:complexType>
	</xsd:element>
	<!-- Signal -->
	<xsd:element name="signal" type="sigDeclType"/>
	<!-- Sensor -->
	<xsd:element name="sensor" type="withoutInitDeclType"/>
	<!-- Var -->
	<xsd:element name="var" type="withInitDeclType"/>
	<!-- Const -->
	<xsd:element name="const" type="withInitDeclType"/>
	<!-- Type -->
	<xsd:element name="tdcl">
		<xsd:complexType>
			<xsd:attribute name="id" type="stdID" use="required"/>
			<!-- type name [1]-->
		</xsd:complexType>
	</xsd:element>
	<!-- relation -->
	<xsd:element name="rdcl">
		<xsd:complexType>
			<xsd:attribute name="expr" type="xsd:string" use="required"/>
			<!-- relation expression[1]-->
		</xsd:complexType>
	</xsd:element>
	<!-- Function -->
	<xsd:element name="fdcl">
		<xsd:complexType>
			<xsd:attribute name="id" type="stdID" use="required"/>
			<xsd:attribute name="param" type="xsd:string"/>
			<xsd:attribute name="return" type="stdID" use="required"/>
			<!-- function name [1]-->
			<!-- param list [1]-->
			<!-- return type [1]-->
		</xsd:complexType>
	</xsd:element>
	<!-- Procedure -->
	<xsd:element name="pdcl">
		<xsd:complexType>
			<xsd:attribute name="id" type="stdID" use="required"/>
			<xsd:attribute name="ref" type="xsd:string"/>
			<xsd:attribute name="param" type="xsd:string"/>
			<!-- proc name [1]-->
			<!-- ref list [1]-->
			<!-- param list [1]-->
		</xsd:complexType>
	</xsd:element>
	<!-- Task -->
	<xsd:element name="kdcl">
		<xsd:complexType>
			<xsd:attribute name="id" type="stdID" use="required"/>
			<xsd:attribute name="ref" type="xsd:string"/>
			<xsd:attribute name="param" type="xsd:string"/>
			<!-- task name [1]-->
			<!-- ref list [1]-->
			<!-- param list [1]-->
		</xsd:complexType>
	</xsd:element>
	<!-- Const decl -->
	<xsd:element name="cdcl">
		<xsd:complexType mixed="false">
			<xsd:sequence>
				<xsd:element name="const" type="withInitDeclType" maxOccurs="unbounded"/>
				<!-- consts[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- input signal decl -->
	<xsd:element name="idcl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="signal" type="sigDeclType" maxOccurs="unbounded"/>
				<!-- signals[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- output signal decl -->
	<xsd:element name="odcl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="signal" type="sigDeclType" maxOccurs="unbounded"/>
				<!-- signals[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- local signal decl -->
	<xsd:element name="ldcl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="signal" type="sigDeclType" maxOccurs="unbounded"/>
				<!-- signals[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- return signal decl -->
	<xsd:element name="rtdcl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="signal" type="sigDeclType" maxOccurs="unbounded"/>
				<!-- signals[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- sensor decl -->
	<xsd:element name="sdcl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="sensor" type="withoutInitDeclType" maxOccurs="unbounded"/>
				<!-- signals[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- variable decl -->
	<xsd:element name="vdcl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="var" type="withInitDeclType" maxOccurs="unbounded"/>
				<!-- vars[1,*] -->
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- decl -->
	<xsd:element name="decl">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:choice maxOccurs="unbounded">
					<xsd:element name="idcl"/>
					<xsd:element name="odcl"/>
					<xsd:element name="sdcl"/>
					<xsd:element name="tdcl"/>
					<xsd:element name="cdcl"/>
					<xsd:element name="fdcl"/>
					<xsd:element name="pdcl"/>
					<xsd:element name="kdcl"/>
					<xsd:element name="rtdcl"/>
					<xsd:element name="rdcl"/>
				</xsd:choice>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<!-- ========================================= -->
	<!-- Type definitions -->
	<!--
			****************************************
	-->
	<!-- Simple Type Definitions -->
	<!-- Star id -->
	<xsd:simpleType name="starID">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="S(_[0-9]+)+([A-Z]+)([0-9]+)"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Macrostate id -->
	<xsd:simpleType name="macrostarID">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="M(_[0-9]+)+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Constellation id -->
	<xsd:simpleType name="constelID">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A-Z]+"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!-- Std Id -->
	<xsd:simpleType name="stdID">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A-Za-z][A-Za-z_0-9]*"/>
		</xsd:restriction>
	</xsd:simpleType>
	<!--
			****************************************
	-->
	<!-- Complex Type Definitions -->
	<!-- abortBeamType -->
	<xsd:complexType name="abortBeamType">
		<xsd:attribute name="imm" type="xsd:boolean" default="false"/>
		<xsd:attribute name="factor" type="xsd:string" default="1"/>
		<xsd:attribute name="trigger" type="xsd:string" default="tick"/>
		<xsd:attribute name="guard" type="xsd:string"/>
		<xsd:attribute name="effect" type="xsd:string"/>
		<xsd:attribute name="to" type="starID" use="required"/>
		<!-- imm [?] -->
		<!-- factor [?] -->
		<!-- trigger [?] -->
		<!-- guard [?] -->
		<!-- effect [?] -->
		<!-- to [1] -->
	</xsd:complexType>
	<xsd:complexType name="ntBeamType">
		<xsd:attribute name="effect" type="xsd:string"/>
		<xsd:attribute name="to" type="starID" use="required"/>
		<!-- effect [?] -->
		<!-- to [1] -->
	</xsd:complexType>
	<xsd:complexType name="suspBeamType">
		<xsd:attribute name="imm" type="xsd:boolean" default="false"/>
		<xsd:attribute name="factor" type="xsd:string" default="1"/>
		<xsd:attribute name="trigger" type="xsd:string" default="tick"/>
		<xsd:attribute name="guard" type="xsd:string"/>
		<!-- imm [?] -->
		<!-- factor [?] -->
		<!-- trigger [?] -->
		<!-- guard [?] -->
	</xsd:complexType>
	<xsd:complexType name="initBeamType">
		<xsd:attribute name="trigger" type="xsd:string" default="tick"/>
		<xsd:attribute name="guard" type="xsd:string"/>
		<xsd:attribute name="effect" type="xsd:string"/>
		<xsd:attribute name="to" type="starID" use="required"/>
		<!-- trigger [?] -->
		<!-- guard [?] -->
		<!-- effect [?] -->
		<!-- to [1] -->
	</xsd:complexType>
	<xsd:complexType name="sigDeclType">
		<xsd:attribute name="name" type="stdID" use="required"/>
		<xsd:attribute name="type" type="stdID"/>
		<xsd:attribute name="init" type="xsd:string"/>
		<!-- signal name [1]-->
		<!-- signal type [?]-->
		<!-- signal init [?]-->
	</xsd:complexType>
	<xsd:complexType name="withoutInitDeclType">
		<xsd:attribute name="name" type="stdID" use="required"/>
		<xsd:attribute name="type" type="stdID" use="required"/>
		<!-- sensor name [1]-->
		<!-- sensor type [1]-->
	</xsd:complexType>
	<xsd:complexType name="withInitDeclType">
		<xsd:attribute name="name" type="stdID" use="required"/>
		<xsd:attribute name="type" type="stdID" use="required"/>
		<xsd:attribute name="init" type="xsd:string"/>
		<!-- var/const name [1]-->
		<!-- var/const type [1]-->
		<!-- var/const init [?]-->
	</xsd:complexType>
</xsd:schema>

