Skip to content

Commit

Permalink
Language Convergence Infrastructure committed.
Browse files Browse the repository at this point in the history
This is the heart of SLPS for now.
It uses extractors to get BGFs from various FL implementations.
It uses grammar transformations (XBGF) to approximate grammars.
It uses grammar diffing (BDT) to make sure grammars converge.
It uses the language document (LDT) as source of test set.
It uses differential testing to compare how different implementations react to that test set.
It reports results in a concise manner.
It generates a PDF diagram showing what grammars converged using what transformations.
It operates on basis of a simple configuration file.

For now it does not work since XBGF deal is not yet committed.
Future work: migrate from CFG to XML.



git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@89 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Jul 29, 2008
1 parent b3e9bf7 commit bd772c8
Show file tree
Hide file tree
Showing 3 changed files with 455 additions and 0 deletions.
8 changes: 8 additions & 0 deletions topics/convergence/lci/Makefile
@@ -0,0 +1,8 @@
all:
python lci.py lci-fl.cfg architecture.pdf

clean:
rm -f architecture.*
rm -f sample*
rm -f tests/*

79 changes: 79 additions & 0 deletions topics/convergence/lci/lci-fl.cfg
@@ -0,0 +1,79 @@
SHORTCUTS
slps = ../../..
fl = %slps%/topics/fl
tools = %slps%/shared/tools
bgfs = tests
xbgfs = %slps%/topics/transformation/xbgf
validator = %slps%/download/msv/msv.jar
bgfschema = %slps%/shared/xsd/bgf.xsd
baseldf = %slps%/topics/fl/ldf/fl.ldf
runjava1jar = %slps%/topics/fl/java1/javafl.jar
rundcgdir = %slps%/topics/fl/prolog

ACTIONS
# extract, diff and test must be present, the rest is optional and completely volatile
# if validate is present, extracted bgfs and all bgfs produced by transformations will be validated with it
# besides shortcuts, one can use these variables:
# %action% - everywhere macro for the name of the action
# %name% - everywhere macro for the name of the source
# %type% - in extract macro for the type of the source
# %args% - in extract macro for the extraction arguments
# %1% - in diff macro for the first filename in a pair
# %2% - in diff macro for the second filename in a pair
extract
%tools%/%type%2bgf %args% %bgfs%/%name%.bgf
derive, unerase, abstract1, abstract2
%tools%/xbgf %bgfs%/%name%.bgf %xbgfs%/%name%.xbgf %bgfs%/%name%.%action%.bgf
validate
java -jar %validator% %bgfschema% %bgfs%/%name%.bgf
diff
%tools%/lgd %bgfs%/%1%.bgf %bgfs%/%2%.bgf
test
xsltproc %slps%/shared/xsl/ldf2samples.xslt %baseldf% >samples.xml

SOURCES
# three lines: name, type, arguments
xsd
xsd
%fl%/xsd/fl.xsd
antlr
antlr
%fl%/java1/FL.g
java1
java
%fl%/java1 types
#java3
# java
# %fl%/java3 fl
dcg
dcg
%fl%/prolog/Parser.pro

TARGETS
# any number of input branches per target
# if more then one input, all results get to be pairwise diffed
java:
derive java1
xsdjava:
unerase java
derive xsd
dcgantlr:
derive dcg
derive antlr
abstract:
abstract2 dcgantlr
abstract1 xsdjava

IMPLEMENTATIONS
# first line for parser, second for evaluator
# besides shortcuts, one can use these variables:
# %sample% - name of the test case file
# %parsed% - parsing result
# %context% - name of the context file for evaluations
# %yields% - expected evaluation result
antlr
java -cp ${CLASSPATH}:%runjava1jar% -ea TestIO %sample% %parsed% 2>/dev/null
java -cp ${CLASSPATH}:%runjava1jar% -ea TestEvaluator %context% %sample% %yields% 2>/dev/null
dcg
swipl -q -f %rundcgdir%/TestIO.pro -t "main('%sample%','%parsed%')"
swipl -q -f %rundcgdir%/TestEvaluator.pro -t "main('%context%','%sample%',%yields%)"

0 comments on commit bd772c8

Please sign in to comment.