URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-10-17 Maxime van Noppen <yabo(a)lrde.epita.fr>
Handle C++ const methods
* cxx-syn/CxxFun.sdf: Add a grammar rule to produce const methods.
* cxx-syn/Lexical.sdf: Add the "const" keyword.
* scl-syn/Declaration.sdf: Remove useless commented code.
* scl-syn/Lexical.sdf: Cleanup keywords.
cxx-syn/CxxFun.sdf | 3 +++
cxx-syn/Lexical.sdf | 2 ++
scl-syn/Declaration.sdf | 1 -
scl-syn/Lexical.sdf | 13 +++++++------
4 files changed, 12 insertions(+), 7 deletions(-)
Index: branches/scool-ng/src/scl-syn/Declaration.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Declaration.sdf (revision 118)
+++ branches/scool-ng/src/scl-syn/Declaration.sdf (revision 119)
@@ -25,7 +25,6 @@
FunctionQualifier? Identifier ":" FunctionType ";" ->
Declaration {cons("FunctionDeclaration")}
FunctionQualifier? Identifier ":" FunctionType "=" FunctionBlock
-> Declaration {cons("FunctionDefinition")}
-%% FunctionQualifier? Identifier ":" FunctionType "=>"
Expression ";" -> Declaration {cons("FunctionDefinition")}
Identifier ":" ParametersDeclaration "->" "type"
"=" StaticBlock -> StaticFunction
{cons("StaticTypeFunction")}
ClassQualifier? Identifier ":" ParametersDeclaration "->"
"class" "=" StaticClassBlock -> StaticFunction
{cons("StaticClassFunction")}
Index: branches/scool-ng/src/scl-syn/Lexical.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Lexical.sdf (revision 118)
+++ branches/scool-ng/src/scl-syn/Lexical.sdf (revision 119)
@@ -29,17 +29,18 @@
"var" -> SimpleQualifier
"final" -> ClassQualifier
+ "abtract" -> ClassQualifier
"models" -> TypeQualifier
+ "abtract" -> FunctionQualifier
+ "mutable" -> FunctionQualifier
- "decl" -> FunctionQualifier
- "abtract" -> MethodQualifier
-
+ SimpleQualifier -> Keyword
+ ClassQualifier -> Keyword
+ TypeQualifier -> Keyword
+ FunctionQualifier -> Keyword
"class" -> Keyword
"concept" -> Keyword
- "var" -> Keyword
- "final" -> Keyword
- "models" -> Keyword
"type" -> Keyword
"ref" -> Keyword
"public" -> Keyword
Index: branches/scool-ng/src/cxx-syn/CxxFun.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxFun.sdf (revision 118)
+++ branches/scool-ng/src/cxx-syn/CxxFun.sdf (revision 119)
@@ -17,6 +17,9 @@
"template" "<" {(CxxType CxxId) ","}* ">"
CxxType CxxId "(" {(CxxType CxxId) ","}* ")" ";"
-> CxxTopLevel {cons("CxxFun")}
+ "template" "<" {(CxxType CxxId) ","}* ">"
+ CxxType CxxId "(" {(CxxType CxxId) ","}* ")" Const?
";" -> CxxTopLevel {cons("CxxFun")}
+
CxxId ("<" {CxxType ","}* ">")? "("
{(CxxType CxxId) ","}* ")" ";" -> CxxTopLevel
{cons("CxxFunCall")}
CxxDecl -> CxxTopLevel
Index: branches/scool-ng/src/cxx-syn/Lexical.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/Lexical.sdf (revision 118)
+++ branches/scool-ng/src/cxx-syn/Lexical.sdf (revision 119)
@@ -11,6 +11,8 @@
"public" -> CxxAccessModifier
"protected" -> CxxAccessModifier
+
context-free syntax
CxxId -> CxxId {cons("CxxId")}
CxxType "::" CxxId -> CxxId {cons("CxxScope")}
+ "const" -> Const {cons("Const")}
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)