URL:
https://svn.lrde.epita.fr/svn/xrm/trunk
ChangeLog:
2007-01-07 SIGOURE Benoit <tsuna(a)lrde.epita.fr>
Fix for the latest version of StrategoXT 0.17M2.
Due do a recent release of SDF2-Bundle, some experimental features
have been dropped which entails that a part of the grammar had to be
hacked to work around the problem.
* ChangeLog: Fix the previous entry which was very unclear.
* doc/user-guide.txt: StrategoXT 0.17M2 is now required.
* src/syn/xrm/Makefile.am: Work around to complete the signature of
the XRM language.
* src/sig/Makefile.am: Use the XRM signature generated under
src/syn/xrm instead of regenerating a new (incomplete) one.
* src/syn/xrm/XRM-Constant.sdf: Work around the fact that
Meta-Environment dropped the {A B}n+ syntax.
* src/syn/xrm/XRM-Constant.str: New.
ChangeLog | 4 +++-
doc/user-guide.txt | 3 +--
src/sig/Makefile.am | 3 +++
src/syn/xrm/Makefile.am | 7 +++++++
src/syn/xrm/XRM-Constant.sdf | 40 ++++++++++++++++++++++++++++++----------
src/syn/xrm/XRM-Constant.str | 7 +++++++
6 files changed, 51 insertions(+), 13 deletions(-)
Index: src/syn/xrm/XRM-Constant.str
===================================================================
--- src/syn/xrm/XRM-Constant.str (revision 0)
+++ src/syn/xrm/XRM-Constant.str (revision 0)
@@ -0,0 +1,7 @@
+// Workaround: see the comment in XRM-Constant.sdf
+
+ // FIXME: Remove this when sdf2rtg supports "ast" attributes.
+ signature constructors
+ ConstIntDecList : List(DeclPart) -> ConstantDef
+ ConstDoubleDecList : List(DeclPart) -> ConstantDef
+ ConstBoolDecList : List(DeclPart) -> ConstantDef
Index: src/syn/xrm/XRM-Constant.sdf
===================================================================
--- src/syn/xrm/XRM-Constant.sdf (revision 100)
+++ src/syn/xrm/XRM-Constant.sdf (working copy)
@@ -57,19 +57,39 @@
%% Declaration lists. A declaration list must declare at least two
%% identifiers otherwise it can be seen as a simple declaration already
%% handled in the base grammar.
+ %% This section is a bit hacky for two reasons:
+ %% First, meta-environment dropped the syntax:
+ %% "const" "int" {DeclPart ","}2+ ";" ->
ConstantDef {cons("ConstIntDecList")}
+ %% ^^^
+ %% That's why we have to write DeclPart "," {DeclPart ","}+
instead.
+ %% But now the problem is that ConstIntDecList contains a DeclPart and a
+ %% list of DeclPart whereas we wanted it to contain only a list of DeclPart.
+ %% That's why we work around this using the experimental "ast()"
attribute.
+ %% Alas, this raises another problem: sdf2rtg does not support the "ast()"
+ %% attributes and because of that the signatures generated will not declare
+ %% ConstIntDecList. That's why must declare them manually in a separate .str
+ %% file.
context-free syntax
- "const" "int" {DeclPart ","}2+ ";" ->
ConstantDef {cons("ConstIntDecList")}
- "const" {DeclPart ","}2+ ";" -> ConstantDef
{cons("ConstIntDecList")}
+ "const" "int" DeclPart "," {DeclPart ","}+
";"
+ -> ConstantDef {ast("ConstIntDecList(<conc([<1>],
<2>)>)")
+ , cons("ConstIntDecList__")}
+ "const" DeclPart "," {DeclPart ","}+
";"
+ -> ConstantDef {ast("ConstIntDecList(<conc([<1>],
<2>)>)")
+ , cons("ConstIntDecList__")}
- "const" "double" {DeclPart ","}2+ ";"
- -> ConstantDef {cons("ConstDoubleDecList")}
- "rate" {DeclPart ","}2+ ";"
- -> ConstantDef {cons("ConstDoubleDecList")}
- "prob" {DeclPart ","}2+ ";"
- -> ConstantDef {cons("ConstDoubleDecList")}
+ "const" "double" DeclPart "," {DeclPart ","}+
";"
+ -> ConstantDef {ast("ConstDoubleDecList(<conc([<1>],
<2>)>)")
+ , cons("ConstDoubleDecList__")}
+ "rate" DeclPart "," {DeclPart ","}+ ";"
+ -> ConstantDef {ast("ConstDoubleDecList(<conc([<1>],
<2>)>)")
+ , cons("ConstDoubleDecList__")}
+ "prob" DeclPart "," {DeclPart ","}+ ";"
+ -> ConstantDef {ast("ConstDoubleDecList(<conc([<1>],
<2>)>)")
+ , cons("ConstDoubleDecList__")}
- "const" "bool" {DeclPart ","}2+ ";"
- -> ConstantDef {cons("ConstBoolDecList")}
+ "const" "bool" DeclPart "," {DeclPart ","}+
";"
+ -> ConstantDef {ast("ConstBoolDecList(<conc([<1>],
<2>)>)")
+ , cons("ConstBoolDecList__")}
sorts DeclPart
context-free syntax
Index: src/syn/xrm/Makefile.am
===================================================================
--- src/syn/xrm/Makefile.am (revision 100)
+++ src/syn/xrm/Makefile.am (working copy)
@@ -84,3 +84,10 @@
XRM-Prefixed.sdf: XRM.def
$(SDF_TOOLS)/bin/gen-renamed-sdf-module -i $< -o $@ \
--main XRM --name XRM-Prefixed --prefix XRM
+
+all-am: XRM.str.stamp
+
+XRM.str.stamp: XRM.str
+ mv -f XRM.str XRM.str.bak
+ cat XRM.str.bak $(srcdir)/XRM-Constant.str >XRM.str
+ date >XRM.str.stamp
Index: src/sig/Makefile.am
===================================================================
--- src/sig/Makefile.am (revision 100)
+++ src/sig/Makefile.am (working copy)
@@ -44,3 +44,6 @@
XRM.def: $(top_builddir)/src/syn/xrm/XRM.def
rm -f $@
$(LN_S) $^ $@
+XRM.str: $(top_builddir)/src/syn/xrm/XRM.str
+ rm -f $@
+ $(LN_S) $^ $@
Index: doc/user-guide.txt
===================================================================
--- doc/user-guide.txt (revision 100)
+++ doc/user-guide.txt (working copy)
@@ -42,8 +42,7 @@
****************
- Requirements:
- o Stratego/XT 0.17M1 (at least revision 15278 committed Mon, 29 May 2006)
- because of libstratego-gpp (added in Stratego/XT 0.17M1 rev 15278).
+ o Stratego/XT 0.17M2 revision 16205 or later.
o A C99 compiler.
o OS with executable stack.
o ATerm 2.4.2 or newer.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 100)
+++ ChangeLog (working copy)
@@ -1,7 +1,9 @@
2007-01-07 SIGOURE Benoit <tsuna(a)lrde.epita.fr>
Update the requirements of XRM.
- * doc/user-guide.txt: Here.
+ * doc/user-guide.txt: GCC is no longer required: any C99-compliant
+ compiler will do. Using only the strategoxt-packages-stable-latest Nix
+ channel is recommended in order to install XRM.
2006-12-15 SIGOURE Benoit <sigoure.benoit(a)lrde.epita.fr>
--
SIGOURE Benoit aka Tsuna (SUSv3 compliant)
_____ "On a long enough timeline, the survival rate
/EPITA\ Promo 2008.CSI/ACU for everyone drops to zero" -- Jack.