Skip to content

Commit

Permalink
LCI 1.6:
Browse files Browse the repository at this point in the history
* renamings all over the place
* <action> is gone, defined implicitly by <perform>s
* detailed <command>s ditched in favour of external wrappers
* new tool for transformation
* schema massaging
* probably bugfixes


git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@142 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Aug 6, 2008
1 parent 2ef29ea commit c5d8aaf
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 238 deletions.
136 changes: 50 additions & 86 deletions shared/xsd/lcf.xsd
Expand Up @@ -22,101 +22,48 @@
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="shortcut" type="lcf:shortcutType" />
<xsd:element name="tool" type="lcf:toolType" />
<xsd:element name="action" type="lcf:actionType" />
<xsd:element name="source" type="lcf:sourceType" />
<xsd:element name="target" type="lcf:targetType" />
<xsd:element name="comment" type="ldf:mixedType" />
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:complexType name="actionType">
<xsd:annotation>
<xsd:documentation>
An action in LCF is a transformation step.
Usually an action is defined as a reference to an XBGF file with a sequence of atomic grammar transformations
grouped by one theme.
Actions are combined in chains to get from sources and intermediate targets to one final target.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="comment" type="xsd:string" minOccurs="0"/>
<xsd:element name="name" type="xsd:string" maxOccurs="unbounded"/>
<xsd:element name="definition">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="command" type="lcf:commandtype" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="shortcutType">
<xsd:annotation>
<xsd:documentation>
An shortcut in LCF is just a simple macro.
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.
Shortcuts can be defined on basis of other shortcuts defined before them in the LCF file.
</xsd:documentation>
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="definition">
<xsd:complexType mixed="true">
<xsd:group ref="lcf:expansion" minOccurs="0" maxOccurs="unbounded"/>
<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:sequence>
<xsd:element name="expand" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>

<xsd:group name="expansion">
<xsd:annotation>
<xsd:documentation>
An expand in LCF is a way to use macros.
The volatile expand references a user-defined shortcut.
The expand-action is substituted with a name of an action inside which it is used.
The expand-input is substituted with a name of the file that is the main input for the parser/evaluator.
The expand-output is substituted with a name of the file that is produced by the parser/evaluator.
The expand-context is substituted with a name of the file that contains a context for the evaluator.
The expand-yields is substituted with a value that the evaluator is expected to return.

For more information on sample-related matters, consult LDF schema.
</xsd:documentation>
</xsd:annotation>
<xsd:choice>
<xsd:element name="expand" type="xsd:string" />
<xsd:element name="expand-action">
<xsd:complexType/>
</xsd:element>
<xsd:element name="expand-input">
<xsd:complexType/>
</xsd:element>
<xsd:element name="expand-output">
<xsd:complexType/>
</xsd:element>
<xsd:element name="expand-context">
<xsd:complexType/>
</xsd:element>
<xsd:element name="expand-yields">
<xsd:complexType/>
</xsd:element>
</xsd:choice>
</xsd:group>

<xsd:complexType name="commandtype" mixed="true">
<xsd:annotation>
<xsd:documentation>
A command in LCF is something that is possible to run with a given shell.
If one needs to redirect the output stream (stdout), use the @out attribute.
If one needs to redirect the error stream (stderr), use the @err attribute.
An expand in LCF is a way to use shortcuts.
</xsd:documentation>
</xsd:annotation>
<xsd:group ref="lcf:expansion" minOccurs="0" maxOccurs="unbounded"/>
<xsd:attribute name="err" type="xsd:string" use="optional" />
<xsd:attribute name="out" type="xsd:string" use="optional" />
<xsd:sequence>
<xsd:element name="expand" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="sourceType">
Expand All @@ -130,20 +77,24 @@
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="extractor">
<xsd:element name="extraction">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name">
<xsd:complexType mixed="true">
<xsd:group ref="lcf:expansion" minOccurs="0" maxOccurs="unbounded"/>
<xsd:sequence>
<xsd:element name="expand" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="arguments">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="argument">
<xsd:complexType mixed="true">
<xsd:group ref="lcf:expansion" minOccurs="0" maxOccurs="unbounded"/>
<xsd:sequence>
<xsd:element name="expand" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
Expand All @@ -152,14 +103,14 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="parser" minOccurs="0">
<xsd:element name="parsing" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="command" type="lcf:commandtype"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="evaluator" minOccurs="0">
<xsd:element name="evaluation" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="command" type="lcf:commandtype"/>
Expand All @@ -175,8 +126,8 @@
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.
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.
Expand All @@ -188,7 +139,19 @@
<xsd:complexType>
<xsd:sequence>
<xsd:element name="input" type="xsd:string" />
<xsd:element name="perform" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<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>
Expand All @@ -200,25 +163,26 @@
<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.
The testset generates a test set in LDF, presumably by taking it from a bigger LDF document.
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.
The testset generates a test set in LDF, presumably by taking it from a bigger LDF document.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="name" type="lcf:Tools"/>
<xsd:element name="name" type="lcf:tools"/>
<xsd:element name="command" type="lcf:commandtype"/>
</xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="Tools">
<xsd:simpleType name="tools">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="validator"/>
<xsd:enumeration value="diff"/>
<xsd:enumeration value="validation"/>
<xsd:enumeration value="comparison"/>
<xsd:enumeration value="testset"/>
<xsd:enumeration value="transformation"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</xsd:schema>

0 comments on commit c5d8aaf

Please sign in to comment.