domain.rnc 2.77 KB
Newer Older
ankraft's avatar
ankraft committed
1 2 3 4 5
start = Domain
Domain =
  element Domain {
    attribute xml:base { xsd:anyURI }?,
    attribute id { xsd:ID },
6
    DocDef,
ankraft's avatar
ankraft committed
7
    element Imports { Domain+ }?,
ankraft's avatar
ankraft committed
8
    element Modules {
ankraft's avatar
ankraft committed
9
      element ModuleClass { ModuleDef }+
ankraft's avatar
ankraft committed
10 11 12 13
    }?,
    element Devices {
      element Device {
        attribute id { xsd:Name },
14
        DocDef,
15
        PropertiesDef?,
ankraft's avatar
ankraft committed
16 17
        Modules?,
        element SubDevices {
ankraft's avatar
ankraft committed
18 19
          element SubDevice {
            attribute id { xsd:Name },
20
            DocDef,
21
            PropertiesDef?,
ankraft's avatar
ankraft committed
22
            Modules?
ankraft's avatar
ankraft committed
23
          }+
ankraft's avatar
ankraft committed
24
        }?
ankraft's avatar
ankraft committed
25
      }+
ankraft's avatar
ankraft committed
26 27
    }?
  }
28 29 30
PropertiesDef =
  element Properties {
    element Property {
31 32 33 34 35 36 37
      attribute name { text },
      attribute optional { xsd:boolean }?,
      attribute value { text }?,
      DocDef,
      SimpleType
    }+
  }
ankraft's avatar
ankraft committed
38
DataTypeDef =
ankraft's avatar
ankraft committed
39
  element DataType {
ankraft's avatar
ankraft committed
40
    attribute name { text }?,
ankraft's avatar
ankraft committed
41 42 43 44
    attribute unitOfMeasure { text }?,
    DocDef,
    (StructType | ArrayType | SimpleType),
    ConstraintsDef?
ankraft's avatar
ankraft committed
45
  }
ankraft's avatar
ankraft committed
46 47
StructType = element Struct { DataTypeDef+ }
ArrayType = element Array { DataTypeDef }
ankraft's avatar
ankraft committed
48 49 50 51 52
SimpleType =
  element SimpleType {
    attribute type { BasicType }
  }
BasicType =
ankraft's avatar
ankraft committed
53 54 55 56 57 58 59 60 61 62 63 64
  "integer"
  | "boolean"
  | "string"
  | "byte"
  | "float"
  | "array"
  | "enum"
  | "date"
  | "time"
  | "datetime"
  | "blob"
  | "uri"
ankraft's avatar
ankraft committed
65 66 67 68 69 70 71 72 73
ConstraintsDef =
  element Constraints {
    element Constraint {
      attribute name { text },
      attribute type { BasicType }?,
      attribute value { text }?,
      DocDef
    }+
  }
ankraft's avatar
ankraft committed
74 75 76 77 78
DocText =
  (text
   | element em { text }
   | element b { text }
   | element tt { text })*
79 80
# <Doc> element is always optional
DocDef =
ankraft's avatar
ankraft committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
  element Doc {
    DocText
    | (element p { DocText }
       | element img {
           attribute src { text },
           element caption { text }
         })*
  }?
ModuleDef =
  attribute name { text },
  attribute optional { xsd:boolean }?,
  element extends {
    attribute domain { xsd:IDREF },
    attribute class { text }
  }?,
96
  DocDef,
97
  PropertiesDef?,
ankraft's avatar
ankraft committed
98 99 100 101 102
  Actions?,
  Data?,
  Events?
Modules =
  element Modules {
ankraft's avatar
ankraft committed
103
    element Module { ModuleDef }+
ankraft's avatar
ankraft committed
104 105 106 107 108 109
  }
Actions =
  element Actions {
    element Action {
      attribute name { text },
      attribute optional { xsd:boolean }?,
110
      DocDef,
ankraft's avatar
ankraft committed
111
      DataTypeDef?,
112
      ArgDef?
ankraft's avatar
ankraft committed
113
    }+
114 115 116 117 118 119 120
  }
ArgDef =
  element Args {
    element Arg {
      attribute name { text },
      DocDef,
      DataTypeDef
ankraft's avatar
ankraft committed
121
    }+
ankraft's avatar
ankraft committed
122 123 124 125 126 127 128 129 130
  }
Data =
  element Data {
    element DataPoint {
      attribute name { text },
      attribute optional { xsd:boolean }?,
      attribute writable { xsd:boolean }?,
      attribute readable { xsd:boolean }?,
      attribute eventable { xsd:boolean }?,
131
      DocDef,
ankraft's avatar
ankraft committed
132
      DataTypeDef
ankraft's avatar
ankraft committed
133
    }+
ankraft's avatar
ankraft committed
134 135 136 137 138 139
  }
Events =
  element Events {
    element Event {
      attribute name { text },
      attribute optional { xsd:boolean }?,
140
      DocDef,
141
      Data?
ankraft's avatar
ankraft committed
142
    }+
ankraft's avatar
ankraft committed
143
  }