Skip to content

Commit

Permalink
scripting
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@193 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Aug 19, 2008
1 parent 6a5f772 commit 22861a7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
25 changes: 25 additions & 0 deletions shared/tools/asfix2btf
@@ -0,0 +1,25 @@
#! /bin/sh

# Get our hands on basedir
LOCAL1=${PWD}
cd `dirname $0`
cd ../..
SLPS=${PWD}
cd ${LOCAL1}

if [ $# -ne 2 ]; then
echo "Usage: asfix2btf <AsFix-input> <BTF-output>"
exit 1
elif [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
else
# Build extractor if needed
cd ${SLPS}/topics/extraction/asfix2btf
make build
cd ${LOCAL1}
cat $1 | python ${SLPS}/topics/fl/asfsdf/pre.py | sglr -p ${SLPS}/topics/fl/asfsdf/FL.tbl -t > tmp.trm
(echo "main("; cat tmp.trm; echo ")" ) | sglr -p ${SLPS}/topics/extraction/asfix2btf//Main.tbl | asfe -e ${SLPS}/topics/extraction/asfix2btf//Main.eqs | unparsePT > $2
rm -f tmp.trm
fi

20 changes: 10 additions & 10 deletions shared/xsd/btf.xsd
Expand Up @@ -9,34 +9,34 @@
The BGF Tree Format
</xsd:documentation>
</xsd:annotation>

<xsd:import namespace="http://planet-sl.org/bgf" schemaLocation="bgf.xsd"/>

<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="bgf:grammar"/>
<xsd:element ref="btf:tree"/>
<xsd:element ref="bgf:grammar"/>
<xsd:element ref="btf:tree"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="tree">
<xsd:complexType>
<xsd:choice>

<xsd:element name="epsilon">
<xsd:complexType/>
</xsd:element>

<xsd:element name="any">
<xsd:complexType>
<xsd:sequence>
<xsd:any processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="terminal" type="bgf:terminal"/>

<xsd:element name="nonterminal">
Expand Down Expand Up @@ -65,15 +65,15 @@
</xsd:choice>
</xsd:complexType>
</xsd:element>

<xsd:element name="sequence">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="btf:tree" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="choice">
<xsd:complexType>
<xsd:sequence>
Expand Down Expand Up @@ -106,9 +106,9 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>

</xsd:choice>
</xsd:complexType>
</xsd:element>

</xsd:schema>

0 comments on commit 22861a7

Please sign in to comment.