Skip to content

Commit

Permalink
Languedoc project for MSVS; daily progress in LDF
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@498 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Feb 27, 2009
1 parent 51e089d commit 60088b4
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 15 deletions.
45 changes: 32 additions & 13 deletions shared/xsd/xbgf.xsd
Expand Up @@ -42,10 +42,6 @@
<xsd:group ref="xbgf:decorativetransformation"/>
<!-- status unclear -->
<xsd:element ref="xbgf:reroot"/>
<!-- debug -->
<xsd:element ref="xbgf:dump"/>
<!-- semantics unclear -->
<xsd:element ref="xbgf:rename"/>
<!-- deprecated -->
<xsd:element ref="xbgf:strip"/>
</xsd:choice>
Expand Down Expand Up @@ -101,6 +97,9 @@
<xsd:element ref="xbgf:import"/>
<xsd:element ref="xbgf:vertical"/>
<xsd:element ref="xbgf:horizontal"/>
<!-- semantics unclear -->
<xsd:element ref="xbgf:rename"/>
<!-- do we need them? -->
<xsd:element ref="xbgf:rassoc"/>
<xsd:element ref="xbgf:lassoc"/>
</xsd:choice>
Expand Down Expand Up @@ -214,8 +213,10 @@
<xsd:choice>
<xsd:element ref="xbgf:designate"/>
<xsd:element ref="xbgf:unlabel"/>
<xsd:element ref="xbgf:anonymize"/>
<xsd:element ref="xbgf:deanonymize"/>
<xsd:element ref="xbgf:anonymize"/>
<!-- debug -->
<xsd:element ref="xbgf:dump"/>
</xsd:choice>
</xsd:group>

Expand Down Expand Up @@ -293,8 +294,12 @@
<xsd:element name="deanonymize">
<xsd:annotation>
<xsd:documentation>
Adding a selector to the existing production.
Selectors must be introduced one at a time, and the one being introduced needs to be marked.
While labels are only used to name individual productions,
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.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down Expand Up @@ -355,7 +360,14 @@
<xsd:annotation>
<xsd:documentation>
An unlabeled production is labeled. The argument production is
the intended result, i.e., the labeled production.
the intended result, i.e., the labeled production---the transformation
refuses to work if the argument production contains no label.
</xsd:documentation>
<xsd:documentation>
Labelling transformations serve two roles usually: they can be used
directly to make the labels in both grammars agree so that they can
converge; or they are used to mark the target for the transformations
that follow them and perform local manipulations.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand All @@ -368,7 +380,7 @@
<xsd:element name="unlabel">
<xsd:annotation>
<xsd:documentation>
Strips an existing production from a label.
A reverse of designate that strips an existing production from a label.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down Expand Up @@ -426,9 +438,15 @@
<xsd:element name="dump">
<xsd:annotation>
<xsd:documentation>
A debugging tool.
Upon arrival at current transformation, the input grammar is dumped.
See the file xbgf.log.
Not so much of a decorative transformation, but more of a
debugging tool. When the dump command is encountered,
the transformation sequence stops and the grammar in its
current state is dumped to the file xbgf.log.
</xsd:documentation>
<xsd:documentation>
The contents of xbgf.log can be used as an input for grammar
comparator or for copy-pasting productions and expressions
from the grammar to the construction point of the XBGF sequence.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType/>
Expand Down Expand Up @@ -1085,7 +1103,8 @@
<xsd:element name="anonymize">
<xsd:annotation>
<xsd:documentation>
Removes one (marked) selector from an existing definition.
A reverse of deanonymize that strips one (marked) selector
from an existing definition.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
Expand Down
1 change: 1 addition & 0 deletions topics/languedoc/Makefile
Expand Up @@ -40,6 +40,7 @@ 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
rm -f *.aux *.log *.toc *.tex
rm -f distribute_*.bgf

check:
ls -1 *.xbgf | xargs -n1 ${validator} xbgf
Expand Down
74 changes: 74 additions & 0 deletions topics/languedoc/languedoc.csproj
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30428</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9DF685A6-6572-47F9-8DE3-1E827BFDB62F}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>java_lci</RootNamespace>
<AssemblyName>java-lci</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<None Include="..\..\shared\xsd\bgf.xsd">
<Link>bgf.xsd</Link>
</None>
<None Include="..\..\shared\xsd\lcf.xsd">
<Link>lcf.xsd</Link>
</None>
<None Include="..\..\shared\xsd\ldf.xsd">
<Link>ldf.xsd</Link>
</None>
<None Include="..\..\shared\xsd\xbgf.xsd">
<Link>xbgf.xsd</Link>
</None>
<None Include="..\..\shared\xsd\xldf.xsd">
<Link>xldf.xsd</Link>
</None>
<None Include="beautify_bgf.xbgf" />
<None Include="beautify_xbgf.xbgf" />
<None Include="bnf.bgf" />
<None Include="bnf\bnf.lcf" />
<None Include="bnf\xbgf\designate.xbgf" />
<None Include="bnf\xbgf\preferBnf.xbgf" />
<None Include="bnf\xbgf\refactorBnf.xbgf" />
<None Include="bnf\xbgf\stripTerminals.xbgf" />
<None Include="bnf\xbgf\stripWhitespace.xbgf" />
<None Include="xldf\completeDecorSection.xldf" />
<None Include="xldf\completeDecSection.xldf" />
<None Include="xldf\completeFoldSection.xldf" />
<None Include="xldf\completeIncSection.xldf" />
<None Include="xldf\completeIntro.xldf" />
<None Include="xldf\completeRefSection.xldf" />
<None Include="xldf\completeRevSections.xldf" />
</ItemGroup>
</Project>
20 changes: 19 additions & 1 deletion topics/languedoc/xldf/completeDecorSection.xldf
Expand Up @@ -19,12 +19,30 @@
<section>element-unlabel</section>
<inside>group-decorativetransformation</inside>
</xldf:place>
<xldf:place>
<section>element-deanonymize</section>
<inside>group-decorativetransformation</inside>
</xldf:place>
<xldf:append>
<where>element-anonymize</where>
<content>
<p>
Given the input BGF and a clear goal to strip all selectors,
it becomes trivial to generate a list of anonymize commands that,
if executed on the same grammar, would produce a selector-free
yet structurally equivalent grammar. We used such a generator
called strips in the FL case study as the final stage to converge
the abstract syntax (with selectors) with the concrte syntax (with
terminals).
</p>
</content>
</xldf:append>
<xldf:place>
<section>element-anonymize</section>
<inside>group-decorativetransformation</inside>
</xldf:place>
<xldf:place>
<section>element-deanonymize</section>
<section>element-dump</section>
<inside>group-decorativetransformation</inside>
</xldf:place>

Expand Down
10 changes: 10 additions & 0 deletions topics/languedoc/xldf/completeIntro.xldf
Expand Up @@ -188,6 +188,16 @@
<name>grammar</name>
<definition>
<p>A set of interdependent productions.</p>
<bgf:production>
<nonterminal>grammar</nonterminal>
<bgf:expression>
<star>
<bgf:expression>
<nonterminal>production</nonterminal>
</bgf:expression>
</star>
</bgf:expression>
</bgf:production>
</definition>
</term>
</definitions>
Expand Down
6 changes: 5 additions & 1 deletion topics/languedoc/xldf/completeRefSection.xldf
Expand Up @@ -15,7 +15,7 @@
<section>element-massage</section>
<inside>group-refactoringtransformation</inside>
</xldf:place>

<xldf:insert>
<after>
<p>
Expand Down Expand Up @@ -223,6 +223,10 @@
<section>element-horizontal</section>
<inside>group-refactoringtransformation</inside>
</xldf:place>
<xldf:place>
<section>element-rename</section>
<inside>group-refactoringtransformation</inside>
</xldf:place>
<xldf:place>
<section>element-rassoc</section>
<inside>group-refactoringtransformation</inside>
Expand Down

0 comments on commit 60088b4

Please sign in to comment.