Skip to content

Commit

Permalink
JLS test case is finished; LCI adjusted the file naming scheme a bit …
Browse files Browse the repository at this point in the history
…due to technical reasons

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@459 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Feb 10, 2009
1 parent 3816ddd commit 35e5383
Show file tree
Hide file tree
Showing 14 changed files with 3,030 additions and 160 deletions.
27 changes: 18 additions & 9 deletions topics/convergence/lci/lci.py
Expand Up @@ -141,12 +141,21 @@ def expanduni(where,rep):
def quote(a):
return '"'+a+'"'

def stripSelector(lbl):
def stripSelector1(lbl):
l = lbl[:]
if l.find('-')>0:
l = l.split('-')[0]
return l

def stripSelector2(lbl):
l=''
for x in lbl:
if x.islower() or x=='.':
l+=x
else:
break
return l

def addarc(fromnode,tonode,q,labelnode):
if [fromnode,tonode,q,labelnode] not in graph_big:
graph_big.append([fromnode,tonode,q,labelnode])
Expand All @@ -161,10 +170,10 @@ def makegraph():
name = src[0]
qname = src[0]
for i in range(1,len(src)-1):
qname += '_'+stripSelector(src[i])
addarc(name,qname,name,stripSelector(src[i]))
qname += '_'+stripSelector1(src[i])
addarc(name,qname,name,stripSelector1(src[i]))
name = qname
addarc(name,x,qname,stripSelector(src[-1]))
addarc(name,x,qname,stripSelector1(src[-1]))
# make a simplified one
for x in targets.keys():
for src in targets[x][0]:
Expand Down Expand Up @@ -332,23 +341,23 @@ def preparebgf(cut):
ontheroll = True
for a in cut[1:]:
if ontheroll:
run = tools['transformation']+' xbgf/'+a+'.xbgf bgf/'+curname+'.bgf bgf/'+curname+'.'+stripSelector(a)+'.bgf'
run = tools['transformation']+' xbgf/'+a+'.xbgf bgf/'+curname+'.bgf bgf/'+curname+'.'+stripSelector2(a)+'.bgf'
logwrite(run)
if os.system(run+shutup):
problem = True
print '[FAIL]',
failedarc.append([curname,a])
failednode.append(cut[0]+"'"*(curname.count('.')+1))
failedaction.append(postfix2prefix(curname+'.'+stripSelector(a)))
failedaction.append(postfix2prefix(curname+'.'+stripSelector2(a)))
ontheroll = False
else:
print '[PASS]',
print 'Applied',a+'.xbgf','to',stripSelector(curname)+'.bgf'
print 'Applied',a+'.xbgf','to',curname+'.bgf'
else:
failedarc.append([curname,a])
failednode.append(cut[0]+"'"*(curname.count('.')+1))
failedaction.append(postfix2prefix(curname+'.'+stripSelector(a)))
curname += '.'+stripSelector(a)
failedaction.append(postfix2prefix(curname+'.'+stripSelector2(a)))
curname += '.'+stripSelector2(a)
name = postfix2prefix('.'.join(cut))
if name in failedaction:
print '[FAIL]',
Expand Down
12 changes: 6 additions & 6 deletions topics/java/lci/java.lcf
Expand Up @@ -117,7 +117,7 @@
<perform>correct-doc2</perform>
<perform>generalizeModifiers</perform>
<perform>generalizeNames</perform>
<perform>deyaccify-doc2</perform>
<perform>deyaccifyStatements</perform>
<perform>refactorTypes-doc2</perform>
<perform>refactorExpressions</perform>
<perform>inlineStatements</perform>
Expand All @@ -131,7 +131,6 @@
</branch>
</target>

<!---->
<target>
<name>jls3</name>
<branch>
Expand All @@ -149,7 +148,7 @@
<perform>correct-doc3</perform>
<perform>generalizeModifiers</perform>
<perform>generalizeNames</perform>
<perform>deyaccify-doc2</perform>
<perform>deyaccifyStatements</perform>
<perform>refactorTypes-doc3</perform>
<perform>refactorExpressions-doc3</perform>
<perform>inlineStatements</perform>
Expand Down Expand Up @@ -180,14 +179,15 @@
<input>jls2</input>
</branch>
</target>
<!---->
<target>
<name>jls123</name>
<branch>
<input>jls12</input>
<perform>rename-jls2</perform>
<perform>inline-jls2</perform>
<perform>extend-jls2</perform>
<perform>extendDeclarations</perform>
<perform>extendExpressions</perform>
<perform>extendStatements</perform>
</branch>
<branch>
<input>jls3</input>
Expand Down
Binary file modified topics/java/lci/snapshot/architecture_large.pdf
Binary file not shown.
Binary file modified topics/java/lci/snapshot/architecture_small.pdf
Binary file not shown.
30 changes: 30 additions & 0 deletions topics/java/lci/xbgf/correct-app2.xbgf
Expand Up @@ -256,4 +256,34 @@
<!-- GENERALITY -->
<xbgf:undefine>Identifier</xbgf:undefine>

<!-- ISSUE CORRECT SPECERROR
Real error in JLS2:
- Fail: Expression2Rest.
- [], ;([,([t(instanceof), n(Type)]), *(,([n(InfixOp), n(Expression3)]))])
vs.
- [], ;([*(,([n(InfixOp), n(Expression3)])), ,([n(Expression3), t(instanceof), n(Type)])])
-->
<!-- REVISE -->
<xbgf:project>
<bgf:production>
<nonterminal>Expression2Rest</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<marked>
<bgf:expression>
<nonterminal>Expression3</nonterminal>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<terminal>instanceof</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>
</xbgf:sequence>
47 changes: 22 additions & 25 deletions topics/java/lci/xbgf/correct-app3.xbgf
Expand Up @@ -26,31 +26,28 @@ Annotation:
- [], ;([*(,([n(InfixOp), n(Expression3)])), ,([n(Expression3), t(instanceof), n(Type)])])
-->
<!-- REVISE -->
<xbgf:replace tag="revise">
<bgf:expression>
<sequence>
<bgf:expression>
<nonterminal>Expression3</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>instanceof</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
<bgf:expression>
<sequence>
<bgf:expression>
<terminal>instanceof</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</xbgf:replace>
<xbgf:project>
<bgf:production>
<nonterminal>Expression2Rest</nonterminal>
<bgf:expression>
<sequence>
<bgf:expression>
<marked>
<bgf:expression>
<nonterminal>Expression3</nonterminal>
</bgf:expression>
</marked>
</bgf:expression>
<bgf:expression>
<terminal>instanceof</terminal>
</bgf:expression>
<bgf:expression>
<nonterminal>Type</nonterminal>
</bgf:expression>
</sequence>
</bgf:expression>
</bgf:production>
</xbgf:project>

<!-- ISSUE CORRECT SPECERROR
lacking definition copied from JLS2 with proper renaming -->
Expand Down
File renamed without changes.
104 changes: 0 additions & 104 deletions topics/java/lci/xbgf/extend-jls2.xbgf

This file was deleted.

0 comments on commit 35e5383

Please sign in to comment.