Skip to content

Commit

Permalink
simpler test cases; their connection to Languedoc
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@641 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed May 19, 2009
1 parent f732152 commit 384d64c
Show file tree
Hide file tree
Showing 17 changed files with 711 additions and 209 deletions.
2 changes: 1 addition & 1 deletion shared/python/lci.py
Expand Up @@ -777,7 +777,7 @@ def checkConsistency():
print '----- Tree convergence phase finished. -----'
else:
print '[WARN] No testing performed.'
#dumpGraph(sys.argv[2])
dumpGraph(sys.argv[2])
if problem:
sysexit(100)
log.close()
Expand Down
29 changes: 29 additions & 0 deletions shared/python/xbgfSlice.py
@@ -0,0 +1,29 @@
#!/usr/bin/python
import os
import sys
import string
import elementtree.ElementTree as ET
import slpsns
import slicing
import metrics

def main(xbgfFile):
xbgfDir = '/'.join(xbgfFile.split('/')[:-1])
if xbgfDir == '':
xbgfDir = './'
elif xbgfDir[-1]!='/':
xbgfDir += '/'
print 'Slicing...'
sliced = slicing.sliceFile(xbgfDir,xbgfDir,xbgfFile.split('/')[-1].replace('.xbgf',''))
return

if __name__ == "__main__":
if len(sys.argv) == 2:
slpsns.init(ET)
apply(main,sys.argv[1:6])
else:
print '''This tool takes an XBGF file and slices it.
Usage:'''
print ' ',sys.argv[0],'<xbgf file>'
sys.exit(1)
23 changes: 10 additions & 13 deletions shared/xsd/xbgf.xsd
Expand Up @@ -326,8 +326,7 @@
selectors can name arbitrary parts of any BGF expression.
This command allows to add a selector to the existing production.
To avoid disambiguations, the whole production is required
as an argument, with the newly introduced part being marked.
Selectors must be introduced one at a time.
as an argument, with the newly introduced part being marked.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down Expand Up @@ -357,7 +356,7 @@
<xsd:element name="disappear">
<xsd:annotation>
<xsd:documentation>
As project, but only allows for nillable elements (optional, star) to disappear.
As <ldf:keyword>project</ldf:keyword>, but only allows for nillable elements (optional, star) to disappear.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down Expand Up @@ -413,7 +412,7 @@
<xsd:element name="unlabel">
<xsd:annotation>
<xsd:documentation>
A reverse of designate that strips an existing production from a label.
A reverse of <ldf:keyword>designate</ldf:keyword> that strips an existing production from a label.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down Expand Up @@ -591,7 +590,7 @@
<xsd:annotation>
<xsd:documentation>
The argument production defines the intended result of the
transformation -- a production that has additional components
transformation --- a production that has additional components
in the sequential composition, when compared to the correpsonding
production in the input grammar with the same defined nonterminal
and the same label, if any.
Expand Down Expand Up @@ -734,7 +733,7 @@
<xsd:annotation>
<xsd:documentation>
The argument production defines the intended result of the
transformation -- a production that has the same components
transformation --- a production that has the same components
in the sequential composition, but in a different order, when
compared to the correpsonding production in the input grammar
with the same defined nonterminal and the same label, if any.
Expand All @@ -751,7 +750,7 @@
<xsd:annotation>
<xsd:documentation>
The argument production defines the intended result of the
transformation -- a production that has fewer components
transformation --- a production that has fewer components
in the sequential composition, when compared to the correpsonding
production in the input grammar with the same defined nonterminal
and the same label, if any.
Expand Down Expand Up @@ -1025,10 +1024,7 @@
<xsd:element name="concretize">
<xsd:annotation>
<xsd:documentation>
As inject, but works only with terminals.
</xsd:documentation>
<xsd:documentation>
Terminalize breaks concrete, but not abstract, semantics.
As <ldf:keyword>inject</ldf:keyword>, but works more carefully: allows to add only terminals.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down Expand Up @@ -1131,7 +1127,8 @@
<xsd:element name="abstractize">
<xsd:annotation>
<xsd:documentation>
As project, but works only with terminals.
As <ldf:keyword>project</ldf:keyword>, but works more carefully: checks that the part to be removed
consists of terminals.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand All @@ -1144,7 +1141,7 @@
<xsd:element name="anonymize">
<xsd:annotation>
<xsd:documentation>
A reverse of deanonymize that strips one (marked) selector
A reverse of <ldf:keyword>deanonymize</ldf:keyword> that strips one (marked) selector
from an existing definition.
</xsd:documentation>
</xsd:annotation>
Expand Down
56 changes: 56 additions & 0 deletions topics/languedoc/lcf/lcf.xldf
Expand Up @@ -31,6 +31,31 @@
</xbgf:unlabel>
<xbgf:horizontal>definition</xbgf:horizontal>
</xldf:transform-grammar>
<xldf:combine>
<section>group-definition</section>
<with>element-configuration</with>
</xldf:combine>
<xldf:retitle>
<from>
<title>configuration</title>
</from>
<to>Main configuration elements</to>
</xldf:retitle>

<xldf:retitle>
<from>
<title>shortcut</title>
</from>
<to>Shortcuts</to>
</xldf:retitle>

<xldf:retitle>
<from>
<title>generator</title>
</from>
<to>Generators</to>
</xldf:retitle>


<xldf:transform-grammar>
<target>complexType-source</target>
Expand Down Expand Up @@ -266,6 +291,12 @@
</bgf:production>
</xbgf:anonymize>
</xldf:transform-grammar>
<xldf:retitle>
<from>
<title>source</title>
</from>
<to>Sources</to>
</xldf:retitle>

<xldf:transform-grammar>
<target>complexType-target</target>
Expand Down Expand Up @@ -515,6 +546,12 @@
</text>
</content>
</xldf:append>
<xldf:retitle>
<from>
<title>target</title>
</from>
<to>Targets</to>
</xldf:retitle>

<xldf:transform-grammar>
<target>complexType-phase</target>
Expand Down Expand Up @@ -590,7 +627,20 @@
</text>
</content>
</xldf:append>
<xldf:retitle>
<from>
<title>phase</title>
</from>
<to>Phases</to>
</xldf:retitle>

<xldf:retitle>
<from>
<title>testset</title>
</from>
<to>Test sets</to>
</xldf:retitle>

<xldf:transform-grammar>
<target>simpleType-toolType</target>
<xbgf:vertical>
Expand All @@ -601,5 +651,11 @@
<section>simpleType-toolType</section>
<with>complexType-tool</with>
</xldf:combine>
<xldf:retitle>
<from>
<title>tool</title>
</from>
<to>Tools</to>
</xldf:retitle>

</xldf:evolution-sequence>
8 changes: 6 additions & 2 deletions topics/languedoc/xbgf/Makefile
Expand Up @@ -4,7 +4,11 @@ build: bnfbgf.pdf tex
pdflatex -interaction=batchmode xbgf
pdflatex -interaction=batchmode xbgf

tex:
slices:
cp ../../presentation/prettyprint/xbgf/stripTerminals.xbgf sliced/
python ../../../shared/python/xbgfSlice.py sliced/stripTerminals.xbgf

tex: slices
../../../shared/tools/xsd2ldf ../../../shared/xsd/xbgf.xsd xbgf.ldf
../../../shared/tools/xldf xbgf.xldf xbgf.ldf xbgf.ready.ldf
../../../shared/tools/ldf2tex xbgf.ready.ldf xbgf.tex
Expand All @@ -20,7 +24,7 @@ rebuild:
clean:
rm -f xbgf*.bgf xbgf*.ldf xbgf.html xbgf.fo xbgf.pdf *.xbnf
rm -f bgf*.bgf ldf*.bgf ldf*.ldf ldf.fo ldf.pdf xldf-tmp*
rm -f *.aux *.log *.toc *.tex printed_for_xldf.tmp bnfbgf.pdf
rm -f *.aux *.log *.toc *.tex printed_for_xldf.tmp bnfbgf.pdf sliced/*.xbgf

check:
ls -1 *.xbgf | xargs -n1 ${validator} xbgf
Expand Down
2 changes: 1 addition & 1 deletion topics/languedoc/xbgf/xldf/completeDecSection.xldf
Expand Up @@ -252,7 +252,7 @@
</text>
<formula>x? \textrm{ can be narrowed to } x</formula>
<formula>x^+ \textrm{ can be narrowed to } x</formula>
<formula>x^\star \textrm{ can be narrowed to } x,\: x?,\: x^+</formula>
<formula>x^\star \textrm{ can be narrowed to } x \textrm{ or } x? \textrm{ or } x^+</formula>
<text>
It is trivial to prove that for each case the expression on the right is included
in the expression on the right, but not otherwise. For going the other way
Expand Down

0 comments on commit 384d64c

Please sign in to comment.