Commit 1a32873c authored by david_v's avatar david_v
Browse files

2004-01-27 Valentin David <valentin@lrde.epita.fr>

	* src/disamb/disambiguate/TemplateClassTraverse.str,
	* src/disamb/disambiguate/TemplateClassDefinitionCandidate.str,
	* src/disamb/disambiguate/TemplateClassDefinition.str,
	* src/disamb/disambiguate/TemplateFunctionDefinition.str,
	* src/disamb/disambiguate/TemplateFunctionTraverse.str,
	* src/disamb/disambiguate/ClassTraverse.str,
	* src/disamb/disambiguate/ClassDefinitionCandidate.str,
	* src/disamb/disambiguate/ClassDefinition.str:
	Accept class declaration without definitions.

	* src/disamb/disambiguate/CheckClassName.str: Check more cases.

	* src/disamb/disambiguate/SimpleTypeSpecifier.str: Simplify.

	* src/disamb/disambiguate/MemInitializerIdAmbiguity.str,
	* src/disamb/disambiguate/MemInitializerIdAmbiguity.meta: New.

	* src/disamb/disambiguate/ResolveCompound.str,
	* src/disamb/disambiguate/Resolve.str: Add mem initializer id tests.

	* test/g++/template/Makefile.am,
	* test/g++/other/Makefile.am,
	* test/g++/opt/Makefile.am,
	* test/g++/init/Makefile.am,
	* test/g++/inherit/Makefile.am,
	* test/g++/eh/Makefile.am,
	* test/g++/debug/Makefile.am,
	* test/g++/abi/Makefile.am: Update.
parent 918e66d0
2004-01-27 Valentin David <valentin@lrde.epita.fr>
* src/disamb/disambiguate/TemplateClassTraverse.str,
* src/disamb/disambiguate/TemplateClassDefinitionCandidate.str,
* src/disamb/disambiguate/TemplateClassDefinition.str,
* src/disamb/disambiguate/TemplateFunctionDefinition.str,
* src/disamb/disambiguate/TemplateFunctionTraverse.str,
* src/disamb/disambiguate/ClassTraverse.str,
* src/disamb/disambiguate/ClassDefinitionCandidate.str,
* src/disamb/disambiguate/ClassDefinition.str:
Accept class declaration without definitions.
* src/disamb/disambiguate/CheckClassName.str: Check more cases.
* src/disamb/disambiguate/SimpleTypeSpecifier.str: Simplify.
* src/disamb/disambiguate/MemInitializerIdAmbiguity.str,
* src/disamb/disambiguate/MemInitializerIdAmbiguity.meta: New.
* src/disamb/disambiguate/ResolveCompound.str,
* src/disamb/disambiguate/Resolve.str: Add mem initializer id tests.
* test/g++/template/Makefile.am,
* test/g++/other/Makefile.am,
* test/g++/opt/Makefile.am,
* test/g++/init/Makefile.am,
* test/g++/inherit/Makefile.am,
* test/g++/eh/Makefile.am,
* test/g++/debug/Makefile.am,
* test/g++/abi/Makefile.am: Update.
2004-01-23 Valentin David <valentin@lrde.epita.fr>
* src/strategocxx/Makefile.am,
......
......@@ -37,7 +37,7 @@ CXX_PP_AF=$(top_builddir)/src/syn/Cxx.pp.af
# Check that the disambiguation has kept the right branches
.astcc.diff:
$(SGLR)/bin/sglr -2 -t -fi -A -p $(DXX_TBL) \
-i $(srcdir)/$(<:.astcc=.detcc) | \
-i $(<:.astcc=.detcc) | \
$(ASFIX_TOOLS)/bin/implode-asfix -o $(<:.astcc=.astcc2)
diff $< $(<:.astcc=.astcc2) > $@
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 2)
(Project-Description "Meta/SDF Grammar for C++")
(Project-Version meta-c++-grammar 0 140)
(Parent-Version meta-c++-grammar 0 139)
(Project-Version meta-c++-grammar 0 141)
(Parent-Version meta-c++-grammar 0 140)
(New-Version-Log "")
(Version-Log "2004-01-23 Valentin David <valentin@lrde.epita.fr>
(Version-Log "2004-01-27 Valentin David <valentin@lrde.epita.fr>
* src/strategocxx/Makefile.am,
* test/disambiguate/Makefile.am,
* test/expressions/Makefile.am,
* test/g++/template/Makefile.am,
* src/disamb/disambiguate/Makefile.am,
* src/disamb/specifier/Stop.str,
* src/disamb/namespace/NamespaceDefinition.str,
* config/check-rules.mk,
* src/disamb/classparam/Makefile.am: Fix.")
* src/disamb/disambiguate/TemplateClassTraverse.str,
* src/disamb/disambiguate/TemplateClassDefinitionCandidate.str,
* src/disamb/disambiguate/TemplateClassDefinition.str,
* src/disamb/disambiguate/TemplateFunctionDefinition.str,
* src/disamb/disambiguate/TemplateFunctionTraverse.str,
* src/disamb/disambiguate/ClassTraverse.str,
* src/disamb/disambiguate/ClassDefinitionCandidate.str,
* src/disamb/disambiguate/ClassDefinition.str:
Accept class declaration without definitions.
* src/disamb/disambiguate/CheckClassName.str: Check more cases.
* src/disamb/disambiguate/SimpleTypeSpecifier.str: Simplify.
(Checkin-Time "Fri, 23 Jan 2004 20:58:50 +0100")
* src/disamb/disambiguate/MemInitializerIdAmbiguity.str,
* src/disamb/disambiguate/MemInitializerIdAmbiguity.meta: New.
* src/disamb/disambiguate/ResolveCompound.str,
* src/disamb/disambiguate/Resolve.str: Add mem initializer id tests.
* test/g++/template/Makefile.am,
* test/g++/other/Makefile.am,
* test/g++/opt/Makefile.am,
* test/g++/init/Makefile.am,
* test/g++/inherit/Makefile.am,
* test/g++/eh/Makefile.am,
* test/g++/debug/Makefile.am,
* test/g++/abi/Makefile.am: Update.")
(Checkin-Time "Tue, 27 Jan 2004 21:16:51 +0100")
(Checkin-Login david_v)
(Populate-Ignore
(
......@@ -88,7 +107,7 @@
)
(Project-Keywords)
(Files
(ChangeLog (meta-c++-grammar/0_ChangeLog 1.136 600))
(ChangeLog (meta-c++-grammar/0_ChangeLog 1.137 600))
(Makefile.am (meta-c++-grammar/f/34_Makefile.a 1.12 644))
(README (meta-c++-grammar/g/37_README 1.7 600))
(config/Makefile.am (meta-c++-grammar/f/40_Makefile.a 1.5 644))
......@@ -383,7 +402,7 @@
(src/sdf/Makefile.am (meta-c++-grammar/g/50_Makefile.a 1.4 644))
(src/strategocxx/CxxVariables.sdf (meta-c++-grammar/g/51_CxxVariabl 1.5 644))
(src/strategocxx/StrategoCxx.sdf (meta-c++-grammar/h/0_StrategoCx 1.4 644))
(src/strategocxx/Makefile.am (meta-c++-grammar/h/1_Makefile.a 1.6 644))
(src/strategocxx/Makefile.am (meta-c++-grammar/h/1_Makefile.a 1.7 644))
(src/pp/Options.pp (meta-c++-grammar/h/2_Options.pp 1.1 644))
(src/pp/pp-dxx.str (meta-c++-grammar/h/3_pp-dxx.str 1.2 600))
(src/cxxsdf/Makefile.am (meta-c++-grammar/h/4_Makefile.a 1.2 644))
......@@ -498,31 +517,31 @@
(test/disambiguate/class-02.detcc (meta-c++-grammar/j/16_class-02.d 1.2 644))
(test/disambiguate/class-01.detcc (meta-c++-grammar/j/17_class-01.d 1.1 644))
(test/disambiguate/test.test (meta-c++-grammar/j/18_test.test 1.4 750))
(test/disambiguate/Makefile.am (meta-c++-grammar/j/19_Makefile.a 1.6 640))
(test/expressions/Makefile.am (meta-c++-grammar/j/20_Makefile.a 1.5 640))
(test/disambiguate/Makefile.am (meta-c++-grammar/j/19_Makefile.a 1.7 640))
(test/expressions/Makefile.am (meta-c++-grammar/j/20_Makefile.a 1.6 640))
(test/expressions/test.test (meta-c++-grammar/j/21_test.test 1.2 750))
(test/g++/Makefile.am (meta-c++-grammar/j/22_Makefile.a 1.1 644))
(test/g++/template/Makefile.am (meta-c++-grammar/j/23_Makefile.a 1.7 644))
(test/g++/template/Makefile.am (meta-c++-grammar/j/23_Makefile.a 1.8 644))
(test/g++/template/test.test (meta-c++-grammar/j/24_test.test 1.3 750))
(test/g++/parse/Makefile.am (meta-c++-grammar/j/25_Makefile.a 1.5 644))
(test/g++/parse/test.test (meta-c++-grammar/j/26_test.test 1.3 750))
(test/g++/overload/Makefile.am (meta-c++-grammar/j/27_Makefile.a 1.5 644))
(test/g++/overload/test.test (meta-c++-grammar/j/28_test.test 1.3 750))
(test/g++/other/Makefile.am (meta-c++-grammar/j/29_Makefile.a 1.6 644))
(test/g++/other/Makefile.am (meta-c++-grammar/j/29_Makefile.a 1.7 644))
(test/g++/other/test.test (meta-c++-grammar/j/30_test.test 1.3 750))
(test/g++/opt/Makefile.am (meta-c++-grammar/j/31_Makefile.a 1.6 644))
(test/g++/opt/Makefile.am (meta-c++-grammar/j/31_Makefile.a 1.7 644))
(test/g++/opt/test.test (meta-c++-grammar/j/32_test.test 1.3 750))
(test/g++/lookup/Makefile.am (meta-c++-grammar/j/33_Makefile.a 1.4 644))
(test/g++/lookup/test.test (meta-c++-grammar/j/34_test.test 1.3 750))
(test/g++/init/Makefile.am (meta-c++-grammar/j/35_Makefile.a 1.5 644))
(test/g++/init/Makefile.am (meta-c++-grammar/j/35_Makefile.a 1.6 644))
(test/g++/init/test.test (meta-c++-grammar/j/36_test.test 1.3 750))
(test/g++/inherit/Makefile.am (meta-c++-grammar/j/37_Makefile.a 1.5 644))
(test/g++/inherit/Makefile.am (meta-c++-grammar/j/37_Makefile.a 1.6 644))
(test/g++/inherit/test.test (meta-c++-grammar/j/38_test.test 1.3 750))
(test/g++/eh/Makefile.am (meta-c++-grammar/j/39_Makefile.a 1.5 644))
(test/g++/eh/Makefile.am (meta-c++-grammar/j/39_Makefile.a 1.6 644))
(test/g++/eh/test.test (meta-c++-grammar/j/40_test.test 1.3 750))
(test/g++/debug/Makefile.am (meta-c++-grammar/j/41_Makefile.a 1.5 644))
(test/g++/debug/Makefile.am (meta-c++-grammar/j/41_Makefile.a 1.6 644))
(test/g++/debug/test.test (meta-c++-grammar/j/42_test.test 1.3 750))
(test/g++/abi/Makefile.am (meta-c++-grammar/j/43_Makefile.a 1.5 644))
(test/g++/abi/Makefile.am (meta-c++-grammar/j/43_Makefile.a 1.6 644))
(test/g++/abi/test.test (meta-c++-grammar/j/44_test.test 1.3 750))
(src/disamb/Makefile.am (meta-c++-grammar/j/45_Makefile.a 1.3 644))
(src/disamb/disambiguate/TemplateArguments.str (meta-c++-grammar/j/46_TemplateAr 1.4 644))
......@@ -541,13 +560,13 @@
(src/disamb/disambiguate/TemplateTraverse.str (meta-c++-grammar/k/7_TemplateTr 1.4 644))
(src/disamb/disambiguate/TemplateDefinitionCandidate.str (meta-c++-grammar/k/8_TemplateDe 1.3 644))
(src/disamb/disambiguate/TemplateDefinition.str (meta-c++-grammar/k/9_TemplateDe 1.4 644))
(src/disamb/disambiguate/TemplateClassTraverse.str (meta-c++-grammar/k/10_TemplateCl 1.4 644))
(src/disamb/disambiguate/TemplateClassDefinitionCandidate.str (meta-c++-grammar/k/11_TemplateCl 1.3 644))
(src/disamb/disambiguate/TemplateClassDefinition.str (meta-c++-grammar/k/12_TemplateCl 1.4 644))
(src/disamb/disambiguate/TemplateClassTraverse.str (meta-c++-grammar/k/10_TemplateCl 1.5 644))
(src/disamb/disambiguate/TemplateClassDefinitionCandidate.str (meta-c++-grammar/k/11_TemplateCl 1.4 644))
(src/disamb/disambiguate/TemplateClassDefinition.str (meta-c++-grammar/k/12_TemplateCl 1.5 644))
(src/disamb/disambiguate/SimpleTypeSpecifierCandidate.str (meta-c++-grammar/k/13_SimpleType 1.3 644))
(src/disamb/disambiguate/SimpleTypeSpecifier.str (meta-c++-grammar/k/14_SimpleType 1.5 644))
(src/disamb/disambiguate/ResolveCompound.str (meta-c++-grammar/k/15_ResolveCom 1.4 644))
(src/disamb/disambiguate/Resolve.str (meta-c++-grammar/k/16_Resolve.st 1.4 644))
(src/disamb/disambiguate/SimpleTypeSpecifier.str (meta-c++-grammar/k/14_SimpleType 1.6 644))
(src/disamb/disambiguate/ResolveCompound.str (meta-c++-grammar/k/15_ResolveCom 1.5 644))
(src/disamb/disambiguate/Resolve.str (meta-c++-grammar/k/16_Resolve.st 1.5 644))
(src/disamb/disambiguate/PrimaryExpressionCandidate.str (meta-c++-grammar/k/17_PrimaryExp 1.3 644))
(src/disamb/disambiguate/PrimaryExpression.str (meta-c++-grammar/k/18_PrimaryExp 1.5 644))
(src/disamb/disambiguate/Parameter.str (meta-c++-grammar/k/19_Parameter. 1.4 644))
......@@ -555,7 +574,7 @@
(src/disamb/disambiguate/NamespaceTraverse.str (meta-c++-grammar/k/21_NamespaceT 1.3 644))
(src/disamb/disambiguate/NamespaceDefinitionCandidate.str (meta-c++-grammar/k/22_NamespaceD 1.3 644))
(src/disamb/disambiguate/NamespaceDefinition.str (meta-c++-grammar/k/23_NamespaceD 1.3 644))
(src/disamb/disambiguate/Makefile.am (meta-c++-grammar/k/24_Makefile.a 1.4 640))
(src/disamb/disambiguate/Makefile.am (meta-c++-grammar/k/24_Makefile.a 1.5 640))
(src/disamb/disambiguate/afcxx-disambiguate.str (meta-c++-grammar/k/25_afcxx-disa 1.4 644))
(src/disamb/disambiguate/Lookup.str (meta-c++-grammar/k/26_Lookup.str 1.3 644))
(src/disamb/disambiguate/LocalOrGlobal.str (meta-c++-grammar/k/27_LocalOrGlo 1.3 644))
......@@ -565,22 +584,22 @@
(src/disamb/disambiguate/Definition.str (meta-c++-grammar/k/31_Definition 1.4 644))
(src/disamb/disambiguate/CompoundStatementCandidate.str (meta-c++-grammar/k/32_CompoundSt 1.3 644))
(src/disamb/disambiguate/CompoundStatement.str (meta-c++-grammar/k/33_CompoundSt 1.3 644))
(src/disamb/disambiguate/ClassTraverse.str (meta-c++-grammar/k/34_ClassTrave 1.3 644))
(src/disamb/disambiguate/ClassTraverse.str (meta-c++-grammar/k/34_ClassTrave 1.4 644))
(src/disamb/disambiguate/ClassOrNamespaceTraverse.str (meta-c++-grammar/k/35_ClassOrNam 1.4 644))
(src/disamb/disambiguate/ClassOrNamespaceAmbiguityCut.str (meta-c++-grammar/k/36_ClassOrNam 1.2 644))
(src/disamb/disambiguate/ClassOrNamespaceAmbiguityCandidate.str (meta-c++-grammar/k/37_ClassOrNam 1.3 644))
(src/disamb/disambiguate/ClassOrNamespaceAmbiguity.str (meta-c++-grammar/k/38_ClassOrNam 1.3 644))
(src/disamb/disambiguate/ClassDefinitionCandidate.str (meta-c++-grammar/k/39_ClassDefin 1.3 644))
(src/disamb/disambiguate/ClassDefinition.str (meta-c++-grammar/k/40_ClassDefin 1.3 644))
(src/disamb/disambiguate/ClassDefinitionCandidate.str (meta-c++-grammar/k/39_ClassDefin 1.4 644))
(src/disamb/disambiguate/ClassDefinition.str (meta-c++-grammar/k/40_ClassDefin 1.4 644))
(src/disamb/disambiguate/CheckTypeName.str (meta-c++-grammar/k/41_CheckTypeN 1.3 644))
(src/disamb/disambiguate/CheckNamespaceName.str (meta-c++-grammar/k/42_CheckNames 1.3 644))
(src/disamb/disambiguate/CheckEnumName.str (meta-c++-grammar/k/43_CheckEnumN 1.3 644))
(src/disamb/disambiguate/CheckClassName.str (meta-c++-grammar/k/44_CheckClass 1.3 644))
(src/disamb/disambiguate/CheckClassName.str (meta-c++-grammar/k/44_CheckClass 1.4 644))
(src/disamb/disambiguate/BaseTraverseCandidate.str (meta-c++-grammar/k/45_BaseTraver 1.3 644))
(src/disamb/disambiguate/BaseTraverse.str (meta-c++-grammar/k/46_BaseTraver 1.4 644))
(src/disamb/disambiguate/AmbiguityCandidate.str (meta-c++-grammar/k/47_AmbiguityC 1.3 644))
(src/disamb/disambiguate/Ambiguity.str (meta-c++-grammar/k/48_Ambiguity. 1.3 644))
(src/disamb/specifier/Stop.str (meta-c++-grammar/k/49_Stop.str 1.5 644))
(src/disamb/specifier/Stop.str (meta-c++-grammar/k/49_Stop.str 1.6 644))
(src/disamb/specifier/Specifier.str (meta-c++-grammar/k/50_Specifier. 1.4 644))
(src/disamb/specifier/Makefile.am (meta-c++-grammar/k/51_Makefile.a 1.2 644))
(src/disamb/specifier/afcxx-specifier.str (meta-c++-grammar/l/0_afcxx-spec 1.2 644))
......@@ -612,7 +631,7 @@
(src/disamb/namespace/NamespaceDefinitionSelect.str (meta-c++-grammar/l/26_NamespaceD 1.2 640))
(src/disamb/namespace/NamespaceDefinitionCut.str (meta-c++-grammar/l/27_NamespaceD 1.5 640))
(src/disamb/namespace/NamespaceDefinitionCandidate.str (meta-c++-grammar/l/28_NamespaceD 1.4 640))
(src/disamb/namespace/NamespaceDefinition.str (meta-c++-grammar/l/29_NamespaceD 1.4 640))
(src/disamb/namespace/NamespaceDefinition.str (meta-c++-grammar/l/29_NamespaceD 1.5 640))
(src/disamb/namespace/NamespaceAliasDefinitionCandidate.str (meta-c++-grammar/l/30_NamespaceA 1.4 640))
(src/disamb/namespace/NamespaceAliasDefinition.str (meta-c++-grammar/l/31_NamespaceA 1.5 640))
(src/disamb/namespace/Makefile.am (meta-c++-grammar/l/32_Makefile.a 1.2 640))
......@@ -620,7 +639,7 @@
(src/parser/parse-cxx.str (meta-c++-grammar/l/34_parse-cxx. 1.4 644))
(src/parser/parse-dxx.str (meta-c++-grammar/l/35_parse-dxx. 1.5 644))
(src/parser/Makefile.am (meta-c++-grammar/l/36_Makefile.a 1.2 644))
(config/check-rules.mk (meta-c++-grammar/l/37_check-rule 1.5 640))
(config/check-rules.mk (meta-c++-grammar/l/37_check-rule 1.6 640))
(config/defs.in (meta-c++-grammar/l/38_defs.in 1.1 644))
(test/disambiguate/variable-01.detcc (meta-c++-grammar/l/39_variable-0 1.2 644))
(test/disambiguate/typedef-02.detcc (meta-c++-grammar/l/40_typedef-02 1.2 644))
......@@ -771,7 +790,7 @@
(src/disamb/simpledeclaration/afcxx-simpledeclaration.str (meta-c++-grammar/o/14_afcxx-simp 1.1 644))
(src/disamb/simpledeclaration/afcxx-simpledeclaration.meta (meta-c++-grammar/o/15_afcxx-simp 1.1 644))
(src/disamb/classparam/afcxx-classparam.meta (meta-c++-grammar/o/16_afcxx-clas 1.1 644))
(src/disamb/classparam/Makefile.am (meta-c++-grammar/o/17_Makefile.a 1.2 640))
(src/disamb/classparam/Makefile.am (meta-c++-grammar/o/17_Makefile.a 1.3 640))
(src/disamb/classparam/afcxx-classparam.str (meta-c++-grammar/o/18_afcxx-clas 1.1 644))
(src/disamb/disambiguate/PostfixExpressionAmbiguity.str (meta-c++-grammar/o/19_PostfixExp 1.1 644))
(src/disamb/disambiguate/PostfixExpressionAmbiguity.meta (meta-c++-grammar/o/20_PostfixExp 1.1 644))
......@@ -784,10 +803,10 @@
(src/disamb/disambiguate/TemplateIdAmbiguityCandidate.meta (meta-c++-grammar/o/27_TemplateId 1.1 644))
(src/disamb/disambiguate/TemplateIdAmbiguity.meta (meta-c++-grammar/o/28_TemplateId 1.1 644))
(src/disamb/disambiguate/TemplateFunctionDefinitionCandidate.str (meta-c++-grammar/o/29_TemplateFu 1.1 644))
(src/disamb/disambiguate/TemplateFunctionDefinition.str (meta-c++-grammar/o/30_TemplateFu 1.1 644))
(src/disamb/disambiguate/TemplateFunctionDefinition.str (meta-c++-grammar/o/30_TemplateFu 1.2 644))
(src/disamb/disambiguate/TemplateFunctionDefinitionCandidate.meta (meta-c++-grammar/o/31_TemplateFu 1.1 644))
(src/disamb/disambiguate/TemplateFunctionDefinition.meta (meta-c++-grammar/o/32_TemplateFu 1.1 644))
(src/disamb/disambiguate/TemplateFunctionTraverse.str (meta-c++-grammar/o/33_TemplateFu 1.1 644))
(src/disamb/disambiguate/TemplateFunctionTraverse.str (meta-c++-grammar/o/33_TemplateFu 1.2 644))
(src/disamb/disambiguate/TemplateFunctionTraverse.meta (meta-c++-grammar/o/34_TemplateFu 1.1 644))
(src/disamb/ambdown/ambdown.str (meta-c++-grammar/o/35_ambdown.st 1.1 644))
(src/disamb/ambdown/Makefile.am (meta-c++-grammar/o/36_Makefile.a 1.1 640))
......
......@@ -16,4 +16,4 @@ EXTRA_DIST = $(SRCS)
CLEANFILES = afcxx-classparam.c.dep afcxx-classparam-ast.c.dep
afcxx-classparam-ast.c: afcxx-classparam.str
$(SCOMPILE) $(STRINCLUDES) --main afcxx-classparam --verbose 0 -i $< -o $@ -c
$(SCOMPILE) $(STRINCLUDES) --main afcxx-simpledeclaration --verbose 0 -i $< -o $@ -c
......@@ -34,7 +34,16 @@ imports
rules
CheckClassName : a@|TypeName[ ~ClassName: |ClassName[ ID ]|~ ]| -> a
CheckClassName : |TypeName[ ClassName ]| -> |TypeName[ ClassName' ]|
where < CheckClassName > ClassName => ClassName'
CheckClassName : |ClassOrNamespaceName[ ClassName ]| -> |ClassOrNamespaceName[ ClassName' ]|
where < CheckClassName > ClassName => ClassName'
CheckClassName : |MemInitializerId[ Dummy0-opt la1 NestedNameSpecifier-opt la2 ClassName ]| -> |MemInitializerId[ Dummy0-opt la1 NestedNameSpecifier-opt la2 ClassName' ]|
where < CheckClassName > ClassName => ClassName'
CheckClassName : a@|ClassName[ ID ]| -> a
where < identifier > ID => c
; < rewrite (!"$namespace") > "$value" => d
; < lookup > c => class-kind
......@@ -43,16 +52,17 @@ rules
"in namespace", " ", e, " ",
"as class name"]
CheckClassName' : a@|ClassOrNamespaceName[ ~ClassName: |ClassName[ ID ]|~ ]| -> a
CheckClassName : |ClassName[ ~TemplateId: tid@|TemplateId[ID < TemplateArgumentList-opt > ]|~ ]| -> |ClassName[ ~TemplateId: tid'~ ]|
where < identifier > ID => c
; < rewrite (!"$namespace") > "$value" => d
; < scope (!"$namespace", lookup) > c => class-kind
; < lookup > c => class-template-kind([_])
; < print-key > d => e
; < resolve > tid => tid'
; < concat-strings ; debug > ["Resolved ambiguity on name", " ", c, " ",
"in namespace", " ", e, " ",
"as class name"]
"as template class name"]
strategies
check-class-name = CheckClassName
check-class-name' = CheckClassName'
check-class-name' = check-class-name
......@@ -52,6 +52,22 @@ rules
; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; debug > ["- Definition of class", " ", e']
ClassDefinition : a@|ElaboratedTypeSpecifier[ ClassKey Dummy0-opt NestedNameSpecifier-opt ID ]| -> a
where scope(!"$namespace",
< local-or-global > Dummy0-opt
; < try(
?|NestedNameSpecifier?[ ~NestedNameSpecifier: nested~ ]|;
!nested; nested-name-specifier; ?nested';
!|NestedNameSpecifier?[ ~NestedNameSpecifier: nested'~ ]|)
> NestedNameSpecifier-opt
; < identifier > ID => c
; < rewrite (!"$namespace") > "$value" => d
; < assert (!d) > (c, class-kind)
; < ?list-key (as); !as > d => d'
; < conc; ?x; !list-key (x) > (d', [string-key (c)]) => e
; < print-key > e => e'
; < concat-strings; debug > ["Declaration of class", " ", e'])
strategies
class-definition-stop(s) = class-definition-candidate
......
......@@ -35,6 +35,10 @@ rules
where < not (rewrite (!"$template")) > "$value"
; < ifdebug (debug) > "Candidate for class declaration"
ClassDefinitionCandidate : a@|ElaboratedTypeSpecifier[ ClassKey Dummy0-opt NestedNameSpecifier-opt ID ]| -> a
where < not (rewrite (!"$template")) > "$value"
; < ifdebug (debug) > "Candidate for class declaration"
strategies
class-definition-candidate = ClassDefinitionCandidate
......@@ -56,6 +56,8 @@ rules
; < end-scope (!"$namespace") > a
; < concat-strings; debug > ["- Entering class", " ", e']
ClassTraverse : a@|ElaboratedTypeSpecifier[ ClassKey Dummy0-opt NestedNameSpecifier-opt ID ]| -> a
strategies
class-traverse-candidate = class-definition-candidate
......
......@@ -41,6 +41,7 @@ SRCS = \
ResolveCompound.str \
SimpleTypeSpecifier.str \
SimpleTypeSpecifierCandidate.str \
StatementAmbiguity.str \
TemplateArguments.str \
TemplateClassDefinition.str \
TemplateClassDefinitionCandidate.str \
......
......@@ -30,6 +30,7 @@ imports
ClassOrNamespaceAmbiguity
ClassTraverse
CompoundStatement
MemInitializerIdAmbiguity
NamespaceTraverse
PostfixExpressionAmbiguity
PrimaryExpression
......@@ -49,6 +50,7 @@ strategies
class-or-namespace-ambiguity-stop(s) <+
class-traverse-stop(s) <+
base-traverse-stop(s) <+
mem-initializer-id-ambiguity-stop(s) <+
simple-type-specifier-stop(s) <+
primary-expression-stop(s) <+
compound-statement-stop(s) <+
......@@ -63,6 +65,7 @@ strategies
class-traverse <+
base-traverse <+
simple-type-specifier <+
mem-initializer-id-ambiguity <+
primary-expression <+
compound-statement <+
templateid-ambiguity <+
......@@ -75,6 +78,7 @@ strategies
class-traverse-candidate <+
base-traverse-candidate <+
simple-type-specifier-candidate <+
mem-initializer-id-ambiguity-candidate <+
primary-expression-candidate <+
compound-statement-candidate <+
templateid-ambiguity-candidate <+
......
......@@ -29,10 +29,12 @@ imports
ClassOrNamespaceAmbiguity
ClassTraverse
CompoundStatement
MemInitializerIdAmbiguity
NamespaceTraverse
PostfixExpressionAmbiguity
PrimaryExpression
SimpleTypeSpecifier
StatementAmbiguity
TemplateIdAmbiguity
TemplateTraverse
TypeDefinition
......@@ -48,7 +50,9 @@ strategies
class-traverse-stop(s) <+
simple-type-specifier-stop(s) <+
primary-expression-stop(s) <+
mem-initializer-id-ambiguity-stop(s) <+
templateid-ambiguity-stop(s) <+
statement-ambiguity-stop(s) <+
compound-statement-stop(s) <+
type-definition-stop(s) <+
variable-definition-stop(s)
......@@ -60,6 +64,8 @@ strategies
class-or-namespace-ambiguity <+
class-traverse <+
simple-type-specifier <+
mem-initializer-id-ambiguity <+
statement-ambiguity <+
primary-expression <+
templateid-ambiguity <+
compound-statement <+
......@@ -73,6 +79,8 @@ strategies
class-or-namespace-ambiguity-candidate <+
class-traverse-candidate <+
simple-type-specifier-candidate <+
mem-initializer-id-ambiguity-candidate <+
statement-ambiguity-candidate <+
primary-expression-candidate <+
compound-statement-candidate <+
type-definition-candidate <+
......
......@@ -42,13 +42,7 @@ rules
!nested; nested-name-specifier; ?nested';
!|NestedNameSpecifier?[ ~NestedNameSpecifier: nested'~ ]|)
> NestedNameSpecifier-opt => NestedNameSpecifier-opt'
; < type-ambiguity <+ type-ambiguity-cut
<+ (?|TypeName[ TemplateId ]|
; resolve-compound
; where(!TemplateId
; GetTemplateIdKind
; class-template-kind(id))
)> TypeName => TypeName'
; < type-ambiguity <+ type-ambiguity-cut > TypeName => TypeName'
strategies
......
......@@ -58,6 +58,28 @@ rules
; < end-scope (!"$namespace") > a // Restore old current namespace name.
; < concat-strings; debug > ["- Definition of template class", " ", g']
ClassDefinition : a@|ElaboratedTypeSpecifier[ ClassKey Dummy0-opt NestedNameSpecifier-opt ID ]| -> a
where scope(!"$namespace",
< local-or-global > Dummy0-opt
; < try(
?|NestedNameSpecifier?[ ~NestedNameSpecifier: nested~ ]|;
!nested; nested-name-specifier; ?nested';
!|NestedNameSpecifier?[ ~NestedNameSpecifier: nested'~ ]|)
> NestedNameSpecifier-opt
; < identifier > ID => c
; < rewrite (!"$namespace") > "$value" => d
; < rewrite (!"$template") > "$value" => e
; < rewrite (!"$template-parameters") > "$value" => p
; < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a
; < map({idt, kind: ?(idt, kind); !idt; ("" <+ <assert(!d)> (idt, kind)) }) > p
; < assert (!d) > (c, class-template-kind (e))
; < ?list-key (as); !as > d => d'
; < id > template-key (c, e) => f
; < conc; ?x; !list-key (x) > (d', [f]) => g
; < print-key > g => g'
; < concat-strings; debug > ["Declaration of template class", " ", g'])
strategies
template-class-definition-stop(s) = template-class-definition-candidate
......
......@@ -35,6 +35,10 @@ rules
where < rewrite (!"$template") > "$value"
; < ifdebug (debug) > "Candidate for template class declaration"
TemplateClassDefinitionCandidate : a@|ElaboratedTypeSpecifier[ ClassKey Dummy0-opt NestedNameSpecifier-opt ID ]| -> a
where < rewrite (!"$template") > "$value"
; < ifdebug (debug) > "Candidate for class declaration"
strategies
template-class-definition-candidate = TemplateClassDefinitionCandidate
......@@ -62,6 +62,10 @@ rules
; < end-scope (!"$namespace") > a
; < concat-strings; debug > ["- Entering template class", " ", g']
TemplateClassTraverse : a@|ElaboratedTypeSpecifier[ ClassKey Dummy0-opt NestedNameSpecifier-opt ID ]| -> a
where < end-scope (!"$template") > a
; < end-scope (!"$template-parameters") > a
strategies
template-class-traverse-candidate = template-class-definition-candidate
......
......@@ -47,6 +47,7 @@ rules
; < conc; ?x; !list-key (x) > (d', [f]) => g
; < print-key > g => g'
; < concat-strings; debug > ["+ Definition of template function", " ", g']
; < definition > Declarator
; < definition > FunctionBody
; < concat-strings; debug > ["- Definition of template function", " ", g']
......
......@@ -35,7 +35,7 @@ imports
rules
TemplateFunctionTraverse : a@|FunctionDefinition[ DeclSpecifierSeq-opt la1 Declarator la2 CtorInitializer-opt la3 FunctionBody ]| -> |FunctionDefinition[ DeclSpecifierSeq-opt la1 Declarator la2 CtorInitializer-opt la3 FunctionBody' ]|
TemplateFunctionTraverse : a@|FunctionDefinition[ DeclSpecifierSeq-opt la1 Declarator la2 CtorInitializer-opt la3 FunctionBody ]| -> |FunctionDefinition[ DeclSpecifierSeq-opt la1 Declarator' la2 CtorInitializer-opt la3 FunctionBody' ]|
where < oncetd(?|DeclaratorId[ ~IdExpression: |IdExpression[ ID ]|~ ]|); !ID; identifier > Declarator => c
......@@ -50,6 +50,7 @@ rules
; < conc; ?x; !list-key (x) > (d', [f]) => g
; < print-key > g => g'
; < concat-strings; debug > ["+ Entering template function", " ", g']
; < resolve > Declarator => Declarator'
; < resolve > FunctionBody => FunctionBody'
; < concat-strings; debug > ["- Entering template function", " ", g']
......
/*
* Copyright (C) 2003, 2004 EPITA Research and Development Laboratory
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -31,7 +31,7 @@ imports
strategies
namespace-definition-stop(s) = namespace-definition-candidate-e +
namespace-definition-stop = namespace-definition-candidate-e +
namespace-definition-candidate-o +
namespace-alias-definition-candidate
......
/*
* Copyright (C) 2003, 2004 EPITA Research and Development Laboratory
* Copyright (C) 2003 EPITA Research and Development Laboratory
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -28,4 +28,4 @@ rules
strategies
stop(s) = Stop-0
stop = Stop-0
......@@ -19,6 +19,5 @@ StrategoCxxGen.sdf: $(top_builddir)/src/syn/Cxx.def $(top_builddir)/src/strcxxge
EXTRA_DIST = StrategoCxx.sdf \
CxxVariables.sdf
CLEANFILES = StrategoCxxGen.sdf \
StrategoCxx.def \
CLEANFILES = StrategoCxx.def \
StrategoCxx.tbl
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment