Skip to content

Commit

Permalink
derive-free version with better XBGF modularisation
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@96 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed Jul 30, 2008
1 parent 863d2f7 commit 44d041c
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 54 deletions.
4 changes: 2 additions & 2 deletions topics/fl/lci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ schemata = ../../../shared/xsd
build:

test:
python ../../convergence/lci/lci.py fl-lci.cfg architecture.pdf
python ../../convergence/lci/lci.py fl-lci.cfg architecture

check:
ls xbgf/*.xbgf | xargs java -jar ${validator} ${schemata}/xbgf.xsd
Expand All @@ -18,5 +18,5 @@ clean:
rm -f *.user
rm -f *.suo
rm -f sample*
rm -f architecture.*
rm -f architecture*

21 changes: 10 additions & 11 deletions topics/fl/lci/fl-lci.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ ACTIONS
# %2% - in diff macro for the second filename in a pair
extract
%tools%/%type%2bgf %args% bgf/%name%.bgf
derive
%tools%/xbgf bgf/%name%.bgf xbgf/%name%.xbgf bgf/%name%.%action%.bgf
unerase, abstract1, abstract2
unerase, abstract1, c2a, downcase, h2v, preferdcg, reroot, java3drop, downcase, omdrop, preferjaxb, stripterminals, layering, preferjava, xsdmassage
%tools%/xbgf bgf/%name%.bgf xbgf/%action%.xbgf bgf/%name%.%action%.bgf
validate
java -jar %validator% %bgfschema% bgf/%name%.bgf
Expand All @@ -39,10 +37,10 @@ SOURCES
antlr
antlr
%fl%/java1/FL.g
java1
om
java
%fl%/java1 types
#java3
#jaxb
# java
# %fl%/java3 fl
dcg
Expand All @@ -53,15 +51,16 @@ TARGETS
# any number of input branches per target
# if more then one input, all results get to be pairwise diffed
java:
derive java1
reroot preferjaxb omdrop downcase om
#reroot java3drop downcase jaxb
xsdjava:
unerase java
derive xsd
dcgantlr:
derive dcg
derive antlr
xsdmassage preferjava downcase xsd
concrete:
reroot downcase dcg
reroot h2v preferdcg downcase antlr
abstract:
abstract2 dcgantlr
c2a layering stripterminals concrete
abstract1 xsdjava

IMPLEMENTATIONS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:strip>
<allTerminals/>
</xbgf:strip>
<xbgf:unite>
<add>atom</add>
<to>expr</to>
</xbgf:unite>
<xbgf:prune>eoln</xbgf:prune>
<xbgf:massage>
<bgf:production>
<label>binary</label>
Expand Down Expand Up @@ -55,4 +47,4 @@
</bgf:expression>
</bgf:production>
</xbgf:permute>
</xbgf:sequence>
</xbgf:sequence>
4 changes: 4 additions & 0 deletions topics/fl/lci/xbgf/downcase.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<xbgf:sequence
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:downcase/>
</xbgf:sequence>
13 changes: 0 additions & 13 deletions topics/fl/lci/xbgf/antlr.xbgf → topics/fl/lci/xbgf/h2v.xbgf
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:downcase/>
<xbgf:rename>
<nonterminal>
<from>newline</from>
<to>eoln</to>
</nonterminal>
</xbgf:rename>
<xbgf:rename>
<nonterminal>
<from>id</from>
<to>name</to>
</nonterminal>
</xbgf:rename>
<xbgf:vertical>
<nonterminal>expr</nonterminal>
</xbgf:vertical>
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions topics/fl/lci/xbgf/layering.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:unite>
<add>atom</add>
<to>expr</to>
</xbgf:unite>
<xbgf:prune>eoln</xbgf:prune>
</xbgf:sequence>
3 changes: 3 additions & 0 deletions topics/fl/lci/xbgf/omdrop.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:undefine>visitor</xbgf:undefine>
</xbgf:sequence>
16 changes: 16 additions & 0 deletions topics/fl/lci/xbgf/preferdcg.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:rename>
<nonterminal>
<from>newline</from>
<to>eoln</to>
</nonterminal>
</xbgf:rename>
<xbgf:rename>
<nonterminal>
<from>id</from>
<to>name</to>
</nonterminal>
</xbgf:rename>
</xbgf:sequence>
17 changes: 17 additions & 0 deletions topics/fl/lci/xbgf/preferjava.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:undefine>fragment</xbgf:undefine>
<xbgf:rename>
<nonterminal>
<from>xsd:string</from>
<to>string</to>
</nonterminal>
</xbgf:rename>
<xbgf:rename>
<nonterminal>
<from>xsd:int</from>
<to>int</to>
</nonterminal>
</xbgf:rename>
</xbgf:sequence>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:downcase/>
<xbgf:undefine>visitor</xbgf:undefine>
<xbgf:rename>
<selector>
<from>args</from>
Expand All @@ -13,7 +11,4 @@
<to>function</to>
</selector>
</xbgf:rename>
<xbgf:reroot>
<root>program</root>
</xbgf:reroot>
</xbgf:sequence>
5 changes: 5 additions & 0 deletions topics/fl/lci/xbgf/reroot.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:reroot>
<root>program</root>
</xbgf:reroot>
</xbgf:sequence>
7 changes: 7 additions & 0 deletions topics/fl/lci/xbgf/stripterminals.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:strip>
<allTerminals/>
</xbgf:strip>
</xbgf:sequence>
14 changes: 0 additions & 14 deletions topics/fl/lci/xbgf/xsd.xbgf
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
<xbgf:sequence
xmlns:bgf="http://planet-sl.org/bgf"
xmlns:xbgf="http://planet-sl.org/xbgf">
<xbgf:downcase/>
<xbgf:undefine>fragment</xbgf:undefine>
<xbgf:rename>
<nonterminal>
<from>xsd:string</from>
<to>string</to>
</nonterminal>
</xbgf:rename>
<xbgf:rename>
<nonterminal>
<from>xsd:int</from>
<to>int</to>
</nonterminal>
</xbgf:rename>
<xbgf:massage>
<bgf:production>
<nonterminal>program</nonterminal>
Expand Down

0 comments on commit 44d041c

Please sign in to comment.