/
lcf.xsd
165 lines (151 loc) · 6.4 KB
/
lcf.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema
xmlns:lcf="http://planet-sl.org/lcf"
xmlns:ldf="http://planet-sl.org/ldf"
targetNamespace="http://planet-sl.org/lcf"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation>
LCF Configuration Format, where
LCI = Language Convergence Infrastructure
Part of SLPS = Software Language Processing Suite
</xsd:documentation>
</xsd:annotation>
<xsd:element name="configuration">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="lcf:definition" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:group name="definition">
<xsd:choice >
<xsd:element name="shortcut" type="lcf:shortcutType" />
<xsd:element name="tool" type="lcf:toolType" />
<xsd:element name="source" type="lcf:sourceType" />
<xsd:element name="target" type="lcf:targetType" />
<xsd:element name="testset" type="lcf:testsetType" />
</xsd:choice>
</xsd:group>
<xsd:complexType name="shortcutType">
<xsd:annotation>
<xsd:documentation>
A shortcut in LCF is just a simple macro.
If binds a longer definition to a concise name.
For example, a path with long directory names that is used multiple times in the LCF document is a good shortcut.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="expansion" type="lcf:xstring">
<xsd:annotation>
<xsd:documentation>
Shortcuts can be defined on basis of other shortcuts defined before them in the LCF file.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="sourceType">
<xsd:annotation>
<xsd:documentation>
A source in LCF is the starting point for the grammar convergence.
A source must have a name by which it will be referenced later.
A source must have a defined extractor that provides LCI with a BGF.
A source may have a parser and an evaluator defined as commands - if they are present, they will be tested.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="extraction" type="lcf:xstring" />
<xsd:element name="parsing" type="lcf:xstring" minOccurs="0" />
<xsd:element name="evaluation" type="lcf:xstring" minOccurs="0" />
<xsd:element name="testing" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="set" type="lcf:xstring" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="targetType">
<xsd:annotation>
<xsd:documentation>
A target in LCF is the convergence point.
A target must have a name by which it is referenced and displayed on a diagram.
A target can have any number of branches.
Each branch defines an input that can be either source name or a target name.
Each branch also references a sequence of actions that are performed on that source or target to reach this target.
Once all branches are made, a diff tool is run to make sure all results converge.
If there is one branch, no diffing takes place.
If there are three or more branches, diffs occur pairwise.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element maxOccurs="unbounded" name="branch">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="input" type="xsd:string" />
<xsd:element name="perform" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Perform element in LCF executes a transformation step.
A performed action must reside in an external XBGF file
that contains a sequence of atomic grammar transformations
grouped by one theme.
Performing a chain of actions is a way to get from sources
and intermediate targets to one final target.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="testsetType">
<xsd:annotation>
<xsd:documentation>
A testset in LCF is a set of code samples in the given language.
When testing,
all .src files are parsed
all .run files are evaluated in the context of their .src to yield .val
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="command" type="lcf:xstring"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="toolType">
<xsd:annotation>
<xsd:documentation>
A tool in LCF is an external script.
At this point there are three tools which output is needed by LCI:
The validator makes sure that the BGFs are valid against their schema.
This includes extracted BGFs as well as all derived BGFs.
If the validator is not defined, LCI works fine without it.
The diff tool takes two parameters and returns zero if both BGFs are deemed equal.
If the diff tool is not defined, LCI can only work with one-branch targets.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="lcf:tool"/>
<xsd:element name="command" type="lcf:xstring"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="tool">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="validation"/>
<xsd:enumeration value="comparison"/>
<xsd:enumeration value="transformation"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="xstring" mixed="true">
<xsd:sequence>
<xsd:element name="expand" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>