Skip to content

Commit

Permalink
changed undefine syntax; propagated the changes everywhere
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@769 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Feb 15, 2010
1 parent 713a491 commit f628ffd
Show file tree
Hide file tree
Showing 22 changed files with 236 additions and 46 deletions.
5 changes: 3 additions & 2 deletions shared/prolog/readXbgf.pro
Expand Up @@ -347,10 +347,11 @@ xml2xbgf(T,unchain(P2))
child(name(bgf:production),T,P1),
xmlToP(P1,P2).

xml2xbgf(T,undefine(N))
xml2xbgf(T,undefine(Ns2))
:-
self(name(xbgf:undefine),T),
content(T,N).
children(name(nonterminal),T,Ns1),
maplist(content,Ns1,Ns2).

xml2xbgf(T,redefine(Ps2))
:-
Expand Down
9 changes: 7 additions & 2 deletions shared/prolog/xbgf1.pro
Expand Up @@ -109,7 +109,7 @@ ps2n(Ps1,N)
redefine(Ps1,G1,G2)
:-
ps2n(Ps1,N),
undefine(N,G1,G3),
undefine1(N,G1,G3),
define(Ps1,G3,G2).


Expand Down Expand Up @@ -1379,8 +1379,13 @@ unchain(P1,g(Rs,Ps1),g(Rs,Ps4))
%
% Undefine a nonterminal, i.e., remove all productions
%
undefine([],g(Rs1,Ps1),g(Rs1,Ps1)).
undefine([N|Ns],g(Rs1,Ps1),g(Rs3,Ps3))
:-
undefine1(N,g(Rs1,Ps1),g(Rs2,Ps2)),
undefine(Ns,g(Rs2,Ps2),g(Rs3,Ps3)).

undefine(N,g(Rs1,Ps1),g(Rs2,Ps2))
undefine1(N,g(Rs1,Ps1),g(Rs2,Ps2))
:-
definedNs(Ps1,Defined),
require(
Expand Down
4 changes: 3 additions & 1 deletion shared/xsd/slps-xsd.csproj
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>slps_xsd</RootNamespace>
<AssemblyName>slps-xsd</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -32,6 +32,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -59,6 +60,7 @@
</Target>
-->
<ItemGroup>
<None Include="app.config" />
<None Include="bgf.xsd" />
<None Include="btf.xsd" />
<None Include="edd.xsd">
Expand Down
9 changes: 4 additions & 5 deletions shared/xsd/xbgf.xsd
Expand Up @@ -1084,11 +1084,10 @@
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="bgf:nonterminal">
<xsd:attribute name="tag" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
<xsd:sequence>
<xsd:element name="nonterminal" type="bgf:nonterminal" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="tag" type="xsd:string"/>
</xsd:complexType>
</xsd:element>

Expand Down
6 changes: 5 additions & 1 deletion shared/xsl/slps-xsl.csproj
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>slps_xsl</RootNamespace>
<AssemblyName>slps-xsl</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand All @@ -32,6 +32,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -97,4 +98,7 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
</Project>
22 changes: 17 additions & 5 deletions shared/xsl/xbgf2xbnf.xslt
Expand Up @@ -5,7 +5,7 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">

<xsl:import href="bgf2bnf.xslt" />

<xsl:output
method="text"
encoding="UTF-8"
Expand Down Expand Up @@ -39,7 +39,7 @@
</xsl:when>
</xsl:choose>
</xsl:template>

<!-- chain, define, ... -->

<xsl:template match="xbgf:*">
Expand Down Expand Up @@ -91,7 +91,19 @@
</xsl:text>
</xsl:template>

<xsl:template match="xbgf:deyaccify|xbgf:eliminate|xbgf:horizontal|xbgf:inline|xbgf:undefine">
<xsl:template match="xbgf:undefine">
<xsl:value-of select="local-name()" />
<xsl:text>(</xsl:text>
<xsl:value-of select="*[1]/text()"/>
<xsl:for-each select="*[position()>1]">
<xsl:text>, </xsl:text>
<xsl:value-of select="text()"/>
</xsl:for-each>
<xsl:text>);
</xsl:text>
</xsl:template>

<xsl:template match="xbgf:deyaccify|xbgf:eliminate|xbgf:horizontal|xbgf:inline">
<xsl:value-of select="local-name()" />
<xsl:text>(</xsl:text>
<xsl:value-of select="text()"/>
Expand Down Expand Up @@ -198,7 +210,7 @@
<xsl:text>);
</xsl:text>
</xsl:template>

<xsl:template match="xbgf:reroot">
<xsl:value-of select="local-name()" />
<xsl:text>(</xsl:text>
Expand Down Expand Up @@ -258,4 +270,4 @@
</xsl:text>
</xsl:template>

</xsl:stylesheet>
</xsl:stylesheet>
48 changes: 46 additions & 2 deletions topics/java/lci/java-lci.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,8 +10,29 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>java_lci</RootNamespace>
<AssemblyName>java-lci</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -54,6 +75,7 @@
<None Include="..\..\..\shared\xsd\xbgf.xsd">
<Link>xbgf.xsd</Link>
</None>
<None Include="app.config" />
<None Include="java.lcf" />
<None Include="xbgf\correct-impl1.xbgf" />
<None Include="xbgf\correct-impl2.xbgf" />
Expand Down Expand Up @@ -126,4 +148,26 @@
<None Include="xbgf\rename-read21.xbgf" />
<None Include="xbgf\rename-read3.xbgf" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
</Project>
5 changes: 2 additions & 3 deletions topics/java/lci/java-lci.sln
@@ -1,6 +1,5 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C# Express 2008
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "java-lci", "java-lci.csproj", "{9DF685A6-6572-47F9-8DE3-1E827BFDB62F}"
EndProject
Global
Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/correct-impl2.xbgf
Expand Up @@ -214,7 +214,9 @@
<!-- undefine lexical term -->
<!-- GENERALITY -->
<!-- RELAXATION -->
<xbgf:undefine>Identifier</xbgf:undefine>
<xbgf:undefine>
<nonterminal>Identifier</nonterminal>
</xbgf:undefine>

<!-- ISSUE CORRECT SPECERROR
Real error in JLS2:
Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/correct-impl3.xbgf
Expand Up @@ -187,7 +187,9 @@ Annotation:
<!-- undefine lexical term -->
<!-- GENERALITY -->
<!-- RELAXATION -->
<xbgf:undefine>Identifier</xbgf:undefine>
<xbgf:undefine>
<nonterminal>Identifier</nonterminal>
</xbgf:undefine>

<!-- ISSUE CORRECT SPECERROR -->
<!-- not right because VariableDeclarator starts with Identifier:
Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/edit-read2.xbgf
Expand Up @@ -8,7 +8,9 @@
{ [ ExplicitConstructorInvocation ] [ BlockStatements ] }
-->
<!-- RELAXATION -->
<xbgf:undefine>ConstructorBody</xbgf:undefine>
<xbgf:undefine>
<nonterminal>ConstructorBody</nonterminal>
</xbgf:undefine>
<!-- RELAXATION -->
<xbgf:unite>
<add>ConstructorBody</add>
Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/inlineStatements.xbgf
Expand Up @@ -136,7 +136,9 @@
<xbgf:inline>IfThenStatement</xbgf:inline>
<!-- GENERALITY -->
<!-- RELAXATION -->
<xbgf:undefine>StatementNoShortIf</xbgf:undefine>
<xbgf:undefine>
<nonterminal>StatementNoShortIf</nonterminal>
</xbgf:undefine>
<xbgf:eliminate>WhileStatementNoShortIf</xbgf:eliminate>
<xbgf:eliminate>IfThenElseStatementNoShortIf</xbgf:eliminate>
<xbgf:eliminate>ForStatementNoShortIf</xbgf:eliminate>
Expand Down
32 changes: 14 additions & 18 deletions topics/java/lci/xbgf/refactorExpressions.xbgf
Expand Up @@ -725,21 +725,16 @@ vs
</xbgf:vertical>
</xbgf:atomic>
<!-- BREFACTOR -->
<xbgf:undefine>MultiplicativeExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>AdditiveExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>ShiftExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>RelationalExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>EqualityExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>AndExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>ExclusiveOrExpression</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>InclusiveOrExpression</xbgf:undefine>
<xbgf:undefine>
<nonterminal>MultiplicativeExpression</nonterminal>
<nonterminal>AdditiveExpression</nonterminal>
<nonterminal>ShiftExpression</nonterminal>
<nonterminal>RelationalExpression</nonterminal>
<nonterminal>EqualityExpression</nonterminal>
<nonterminal>AndExpression</nonterminal>
<nonterminal>ExclusiveOrExpression</nonterminal>
<nonterminal>InclusiveOrExpression</nonterminal>
</xbgf:undefine>
<xbgf:eliminate>ConditionalAndExpression</xbgf:eliminate>

<!-- And now "Expression1" -->
Expand Down Expand Up @@ -823,9 +818,10 @@ vs

<!-- last effort for Expression1-->
<!-- BREFACTOR -->
<xbgf:undefine>LeftHandSide</xbgf:undefine>
<!-- BREFACTOR -->
<xbgf:undefine>Assignment</xbgf:undefine>
<xbgf:undefine>
<nonterminal>LeftHandSide</nonterminal>
<nonterminal>Assignment</nonterminal>
</xbgf:undefine>
<!-- RELAXATION -->
<xbgf:remove>
<vertical>
Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/refactorInterfaces-read3.xbgf
Expand Up @@ -646,7 +646,9 @@
ExceptionTypeList vs QualifiedIdentifierList -->
<!-- GENERALITY -->
<!-- RELAXATION -->
<xbgf:undefine>ExceptionTypeList</xbgf:undefine>
<xbgf:undefine>
<nonterminal>ExceptionTypeList</nonterminal>
</xbgf:undefine>
<!-- RELAXATION -->
<xbgf:unite>
<add>ExceptionTypeList</add>
Expand Down
4 changes: 3 additions & 1 deletion topics/java/lci/xbgf/refactorStatements-jls1.xbgf
Expand Up @@ -274,7 +274,9 @@

<!-- Getting rid of all of them -->
<!-- BREFACTOR -->
<xbgf:undefine>StatementNoShortIf</xbgf:undefine>
<xbgf:undefine>
<nonterminal>StatementNoShortIf</nonterminal>
</xbgf:undefine>
<xbgf:eliminate>ForStatementNoShortIf</xbgf:eliminate>
<xbgf:eliminate>WhileStatementNoShortIf</xbgf:eliminate>
<xbgf:eliminate>LabeledStatementNoShortIf</xbgf:eliminate>
Expand Down

0 comments on commit f628ffd

Please sign in to comment.