URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-10-08 Maxime van Noppen <yabo(a)lrde.epita.fr>
Handle class predeclaration
* Class.str: Handle where-clauses when there is no class body.
* Declaration.str: Handle the ClassDeclaration constructor.
Class.str | 11 ++++++++++-
Declaration.str | 12 ++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
Index: branches/scool-ng/src/scoolt/Class.str
===================================================================
--- branches/scool-ng/src/scoolt/Class.str (revision 111)
+++ branches/scool-ng/src/scoolt/Class.str (revision 112)
@@ -52,7 +52,7 @@
AddExactParameter(| cqualif, cxx_idf):
SimpleType(type) -> cxx_class
where
- <ExactParameter(| cqualif, cxx_idf)> "x" => params
+ <ExactParameter(| cqualif, cxx_idf)> [] => params
; <StaticExpressionToCxx> StaticFunctionCall(Identifier(type),
Parameters([params])) => cxx_class
AddExactParameter(| cqualif, cxx_idf):
@@ -99,3 +99,12 @@
; <IdentifierToCxx> idf => cxx_idf
; <InheritanceToCxx(| cqualif, cxx_idf)> mother => cxx_mother
; <ClassBodyToCxx> body => cxx_body
+
+ ClassWhereClauseToCxx(|cqualif, idf):
+ Inherits(daughter, mother) -> CxxClassDecl(cxx_params, cxx_idf, cxx_mother)
+ where
+ <CheckDaughter(| idf)> daughter // Check if we are the daughter
+ ; <AddExactType(| cqualif)> [] => cxx_params
+ ; <IdentifierToCxx> idf => cxx_idf
+ ; <InheritanceToCxx(| cqualif, cxx_idf)> mother => cxx_mother
+
Index: branches/scool-ng/src/scoolt/Declaration.str
===================================================================
--- branches/scool-ng/src/scoolt/Declaration.str (revision 111)
+++ branches/scool-ng/src/scoolt/Declaration.str (revision 112)
@@ -64,6 +64,18 @@
////////////////////////////////////////////////////////////////////////////////
DeclarationToCxx:
+ ClassDeclaration(cqualif, idf, None()) -> CxxClassDecl(cxx_params, cxx_idf, [])
+ where
+ <AddExactType(|cqualif)> [] => cxx_params
+ ; <IdentifierToCxx> idf => cxx_idf
+
+ DeclarationToCxx:
+ ClassDeclaration(cqualif, idf, Some(ClassWhereClause([wclause]))) -> cxx_code
+ where
+ <ClassWhereClauseToCxx(|cqualif, idf)> wclause => cxx_code
+
+
+ DeclarationToCxx:
ClassDefinition(cqualif, idf, None(), ClassBlock(body)) ->
CxxClassDecl(cxx_params, cxx_idf, [], cxx_body)
where
<AddExactType(|cqualif)> [] => cxx_params
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)