Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Language Convergence Infrastructure committed.
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
1 parent
b3e9bf7
commit bd772c8
Showing
3 changed files
with
455 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
all: | ||
python lci.py lci-fl.cfg architecture.pdf | ||
|
||
clean: | ||
rm -f architecture.* | ||
rm -f sample* | ||
rm -f tests/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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%)" |
Oops, something went wrong.