URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-09-23 Maxime van Noppen <yabo(a)lrde.epita.fr>
Use Abox instead of strings
* pp-cxx/CxxExp.str: Use Abox format instead of strings.
CxxExp.str | 63 ++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 34 insertions(+), 29 deletions(-)
Index: branches/scool-ng/src/pp-cxx/CxxExp.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxExp.str (revision 94)
+++ branches/scool-ng/src/pp-cxx/CxxExp.str (revision 95)
@@ -4,53 +4,58 @@
rules
- CxxArgListToStr:
- [ e | [h|tail] ] -> <concat-strings> [ <CxxExpToStr> e, ", ",
<CxxArgListToStr> [h|tail] ]
-
- CxxArgListToStr:
- [e | []] -> <CxxExpToStr> e
+ CxxArgListToAbox:
+// [ e | [h|tail] ] -> <concat-strings> [ <CxxExpToStr> e, ",
", <CxxArgListToStr> [h|tail] ]
+ [ e | l ] -> H hs=0 [ ~<CxxExpToAbox> e H hs=1 [ ","
~<CxxArgListToAbox> l ] ]
+ where
+ not(<?[]> l)
- CxxArgListToStr:
- [] -> ""
+ CxxArgListToAbox:
+ [e | []] -> H hs=0 [ ~<CxxExpToAbox> e ]
- CxxExpToStr:
- CxxInt(i) -> i
+ CxxArgListToAbox:
+ [] -> []
- CxxExpToStr:
- CxxSum(e1, e2) -> <concat-strings> [<CxxExpToStr> e1, " + ",
<CxxExpToStr> e2]
- CxxExpToStr:
- CxxKeyword(idf, exp) -> <concat-strings> [idf, " ",
<CxxExpToStr> exp]
+ CxxExpToAbox:
+ CxxFunCall(params, CxxId(idf), args) -> H hs=0 [ ~<CxxIdToAbox> idf
~<CxxParametersToAbox> params "(" ~<CxxArgListToAbox> args
")" ]
- CxxExpToStr:
- CxxAssign(idf, exp) -> <concat-strings> [idf, " = ",
<CxxExpToStr> exp]
+ CxxParametersToAbox:
+ params -> H hs=1 [ "<"
~<CxxListToAbox(CxxParameterToAbox|",")> params ">" ]
+ where
+ not(<?[]> params)
- CxxExpToStr:
- CxxFunCall([], CxxId(idf), args) -> <concat-strings> [ idf, "(",
<CxxArgListToStr> args, ")" ]
+ CxxExpToAbox:
+ CxxAdressOf(idf) -> H hs=0 [ "&" ~<CxxIdToAbox> idf ]
- CxxExpToStr:
- CxxProgram(exp) -> exp
+ CxxExpToAbox:
+ CxxInt(i) -> S(i)
- CxxExpToStr:
- x -> x
- where <is-string> x
+ CxxExpToAbox:
+ CxxSum(e1, e2) -> H hs=1 [~<CxxExpToAbox> e1 "+"
~<CxxExpToAbox> e2]
- CxxExpToStr:
- CxxId(idf) -> idf
+ CxxExpToAbox:
+ CxxKeyword(idf, exp) -> H hs=1 [ ~<CxxIdToAbox> idf ~<CxxExpToAbox>
exp]
+ CxxExpToAbox:
+ CxxAssign(idf, exp) -> H hs=1 [ ~<CxxIdToAbox> idf "="
~<CxxExpToAbox> exp]
+ CxxExpToAbox:
+ CxxProgram(exp) -> S(exp)
CxxExpToAbox:
- CxxAdressOf(idf) -> H hs=0 [ "&" ~<CxxIdToAbox> idf ]
+ x -> S(x)
+ where
+ <is-string> x
CxxExpToAbox:
- x -> S(<CxxExpToStr> x)
+ CxxId(idf) -> S(idf)
- CxxExpToAbox:
- CxxFunCall(params, CxxId(idf), args) -> H hs=0 [ ~<CxxIdToAbox> idf
"< " ~<CxxListToAbox(CxxParameterToAbox|",")> params "
>" "(" ~S(~<CxxArgListToStr> args) ")" ]
- where <debug> params
+ // FIXME: This shouldn't be here.
+ CxxParametersToAbox:
+ [] -> H []
CxxParameterToAbox:
type -> abox_type
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)