Skip to content

Commit

Permalink
Languedoc daily progress
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@522 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Mar 21, 2009
1 parent 3a04045 commit b4ac484
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 99 deletions.
29 changes: 14 additions & 15 deletions topics/languedoc/xbgf/Makefile
@@ -1,25 +1,24 @@
validator = ../../../shared/tools/checkxml
xldf = ../../../shared/tools/xldf
xbgf = ../../../shared/tools/xbgf

build: bgf_pretty.bgf xbgf.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeIntro.xldf xbgf.ldf xbgf1.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeFoldSection.xldf xbgf1.ldf xbgf2.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeRefSection.xldf xbgf2.ldf xbgf3.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeIncSection.xldf xbgf3.ldf xbgf4.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeDecSection.xldf xbgf4.ldf xbgf5.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeRevSections.xldf xbgf5.ldf xbgf6.ldf
python ../../../topics/transformation/xldf/xldf.py xldf/completeDecorSection.xldf xbgf6.ldf xbgf7.ldf
build: xbgf.ldf
${xldf} xldf/completeIntro.xldf xbgf.ldf xbgf1.ldf
${xldf} xldf/completeFoldSection.xldf xbgf1.ldf xbgf2.ldf
${xldf} xldf/completeRefSection.xldf xbgf2.ldf xbgf3.ldf
${xldf} xldf/completeIncSection.xldf xbgf3.ldf xbgf4.ldf
${xldf} xldf/completeDecSection.xldf xbgf4.ldf xbgf5.ldf
${xldf} xldf/completeRevSections.xldf xbgf5.ldf xbgf6.ldf
${xldf} xldf/completeDecorSection.xldf xbgf6.ldf xbgf7.ldf
xsltproc ../../../shared/xsl/ldf2tex.xslt xbgf7.ldf > xbgf.tex
pdflatex -interaction=batchmode xbgf
pdflatex -interaction=batchmode xbgf

bgf_pretty.bgf:
../../../shared/tools/xsd2bgf ../../../shared/xsd/bgf.xsd bgf.bgf
../../../shared/tools/xbgf beautify_bgf.xbgf bgf.bgf bgf_pretty.bgf

xbgf.ldf:
xbgf.ldf:
../../../shared/tools/xsd2bgf ../../../shared/xsd/xbgf.xsd xbgf.bgf
../../../shared/tools/xbgf beautify_xbgf.xbgf xbgf.bgf xbgf_1.bgf
../../../topics/extraction/xsd2ldf/ldfgen.py ../../../shared/xsd/xbgf.xsd xbgf_1.bgf xbgf.ldf
${xbgf} beautify_bgf.xbgf xbgf.bgf xbgf_1.bgf
${xbgf} beautify_xbgf.xbgf xbgf_1.bgf xbgf_2.bgf
../../../topics/extraction/xsd2ldf/ldfgen.py ../../../shared/xsd/xbgf.xsd xbgf_2.bgf xbgf.ldf

rebuild:
make clean
Expand Down
21 changes: 5 additions & 16 deletions topics/languedoc/xbgf/beautify_bgf.xbgf
Expand Up @@ -70,19 +70,14 @@
</bgf:expression>
</bgf:production>
</xbgf:anonymize>

<xbgf:vertical>
<nonterminal>expression</nonterminal>
</xbgf:vertical>
<xbgf:unlabel>
<label>value</label>
</xbgf:unlabel>
<xbgf:unlabel>
<label>terminal</label>
</xbgf:unlabel>
<xbgf:unlabel>
<label>nonterminal</label>
</xbgf:unlabel>
<xbgf:vertical>
<nonterminal>value</nonterminal>
</xbgf:vertical>

<xbgf:anonymize>
<bgf:production>
<label>selectable</label>
Expand All @@ -108,11 +103,5 @@
</bgf:expression>
</bgf:production>
</xbgf:anonymize>
<xbgf:horizontal>expression</xbgf:horizontal>

<xbgf:undefine>label</xbgf:undefine>
<xbgf:undefine>nonterminal</xbgf:undefine>
<xbgf:undefine>terminal</xbgf:undefine>
<xbgf:undefine>selector</xbgf:undefine>

</xbgf:sequence>
57 changes: 3 additions & 54 deletions topics/languedoc/xbgf/beautify_xbgf.xbgf
Expand Up @@ -233,59 +233,8 @@
</bgf:production>
</xbgf:anonymize>

<xbgf:anonymize>
<bgf:production>
<nonterminal>scope</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<marked>
<bgf:expression>
<selectable>
<selector>label</selector>
<bgf:expression>
<nonterminal>label</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<selectable>
<selector>nonterminal</selector>
<bgf:expression>
<nonterminal>nonterminal</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
</xbgf:anonymize>

<xbgf:anonymize>
<bgf:production>
<nonterminal>scope</nonterminal>
<bgf:expression>
<choice>
<bgf:expression>
<nonterminal>label</nonterminal>
</bgf:expression>
<bgf:expression>
<marked>
<bgf:expression>
<selectable>
<selector>nonterminal</selector>
<bgf:expression>
<nonterminal>nonterminal</nonterminal>
</bgf:expression>
</selectable>
</bgf:expression>
</marked>
</bgf:expression>
</choice>
</bgf:expression>
</bgf:production>
</xbgf:anonymize>
<xbgf:vertical>
<nonterminal>scope</nonterminal>
</xbgf:vertical>

</xbgf:sequence>
2 changes: 1 addition & 1 deletion topics/languedoc/xbgf/xldf/completeFoldSection.xldf
Expand Up @@ -194,7 +194,7 @@
<example id="extract-example">
<content>
<text>
<ldf:keyword>Extract</ldf:keyword> also works vertically. Given the input:
Extraction also works vertically. Given the input:
</text>
</content>
</example>
Expand Down
41 changes: 34 additions & 7 deletions topics/languedoc/xbgf/xldf/completeIntro.xldf
Expand Up @@ -71,18 +71,43 @@
<content>
<text>
BGF is a BNF-like Grammar Format, an XML dialect of Extended Backus Naur Form
that was used in the language convergence infrastructure. Its grammar is presented
that was used in the language convergence infrastructure. The grammar of
its abstract syntax, generated from the corresponding XML Schema, is presented
below in a slightly beautified form (all undefined nonterminals are strings):
</text>
</content>
</notation>
</xldf:add-subsection>

<xldf:import-grammar>
<target>notation-section</target>
<file>bgf_pretty.bgf</file>
</xldf:import-grammar>

<xldf:combine>
<section>element-grammar</section>
<with>notation-section</with>
</xldf:combine>
<xldf:combine>
<section>element-production</section>
<with>notation-section</with>
</xldf:combine>
<xldf:combine>
<section>element-expression</section>
<with>notation-section</with>
</xldf:combine>
<xldf:combine>
<section>simpleType-value</section>
<with>notation-section</with>
</xldf:combine>
<xldf:drop>
<section>simpleType-label</section>
</xldf:drop>
<xldf:drop>
<section>simpleType-nonterminal</section>
</xldf:drop>
<xldf:drop>
<section>simpleType-selector</section>
</xldf:drop>
<xldf:drop>
<section>simpleType-terminal</section>
</xldf:drop>

<xldf:append>
<where>notation-section</where>
<content>
Expand Down Expand Up @@ -146,7 +171,9 @@
its semantics only means that we do not want to have empty samples
while an empty grammar is still acceptable in general. Since this is
data refinement, a semantic decreasing transformation is used without
hesitation. The rest of the transformational sequence is trivial refactorings.
hesitation. The rest of the transformational sequence are
trivial refactorings (verticalisations are already performed in the
example from the previous section).
</text>
<text>
The BNF source undergoes the following transformation for stripping
Expand Down
12 changes: 6 additions & 6 deletions topics/languedoc/xbgf/xldf/completeRefSection.xldf
Expand Up @@ -29,7 +29,7 @@
<table>
<header>
<cell>
<empty/>
<formula>|</formula>
</cell>
<cell>
<formula>\varepsilon</formula>
Expand Down Expand Up @@ -149,22 +149,22 @@
</row>
</table>
<text>
Second, a composion of two EBNF modifers can be massaged to one modifier according
Second, a composition of two EBNF modifers can be massaged to one modifier according
to the table below:
</text>
<table>
<header>
<cell>
<empty/>
<formula>y</formula>
</cell>
<cell>
<formula>x?</formula>
<formula>y?</formula>
</cell>
<cell>
<formula>x^+</formula>
<formula>y^+</formula>
</cell>
<cell>
<formula>x^\star</formula>
<formula>y^\star</formula>
</cell>
</header>
<row>
Expand Down

0 comments on commit b4ac484

Please sign in to comment.