URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-09-23 Maxime van Noppen <yabo(a)lrde.epita.fr>
Add template functions to the pretty-printer
* pp-cxx/CxxExp.str: Implement CxxFunCall constructor.
* pp-cxx/CxxStm.str: Be more strict when adding a semicolon.
CxxExp.str | 19 +++++++++++++++++--
CxxStm.str | 5 +++--
2 files changed, 20 insertions(+), 4 deletions(-)
Index: branches/scool-ng/src/pp-cxx/CxxExp.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxExp.str (revision 93)
+++ branches/scool-ng/src/pp-cxx/CxxExp.str (revision 94)
@@ -5,10 +5,10 @@
rules
CxxArgListToStr:
- [ e | [h|tail] ] -> <concat-strings> [ e, ", ",
<CxxArgListToStr> [h|tail] ]
+ [ e | [h|tail] ] -> <concat-strings> [ <CxxExpToStr> e, ", ",
<CxxArgListToStr> [h|tail] ]
CxxArgListToStr:
- [e | []] -> e
+ [e | []] -> <CxxExpToStr> e
CxxArgListToStr:
[] -> ""
@@ -46,3 +46,18 @@
CxxExpToAbox:
x -> S(<CxxExpToStr> x)
+
+ CxxExpToAbox:
+ CxxFunCall(params, CxxId(idf), args) -> H hs=0 [ ~<CxxIdToAbox> idf
"< " ~<CxxListToAbox(CxxParameterToAbox|",")> params "
>" "(" ~S(~<CxxArgListToStr> args) ")" ]
+ where <debug> params
+
+
+ CxxParameterToAbox:
+ type -> abox_type
+ where
+ <CxxTypeToAbox> type => abox_type
+
+ CxxParameterToAbox:
+ exp -> abox_exp
+ where
+ <CxxExpToAbox> exp => abox_exp
Index: branches/scool-ng/src/pp-cxx/CxxStm.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxStm.str (revision 93)
+++ branches/scool-ng/src/pp-cxx/CxxStm.str (revision 94)
@@ -11,8 +11,9 @@
// As said on
https://trac.lrde.org/scool/wiki/SCOOL/Specs/Misc the C++ inserted
// must be valid and so contain an ending ';'
Semicolon:
- _#([_, CxxProgram(exp)]) -> S("")
+ _#([_, CxxProgram(_)]) -> S("")
Semicolon:
- _#([_, _]) -> S(";")
+ x -> S(";")
+ where not(<?_#([_, CxxProgram(_)])> x)
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)