From 47d8be53127b98dd103f977c6de3f79666d98045 Mon Sep 17 00:00:00 2001 From: grammarware Date: Tue, 7 Oct 2008 01:28:02 +0000 Subject: [PATCH] more on class declarations convergence git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@324 ab42f6e0-554d-0410-b580-99e487e6eeb2 --- topics/java/lci/xbgf/prepare3.xbgf | 5 - .../lci/xbgf/refactorClassDeclarations3.xbgf | 942 +++++++++++++----- 2 files changed, 696 insertions(+), 251 deletions(-) diff --git a/topics/java/lci/xbgf/prepare3.xbgf b/topics/java/lci/xbgf/prepare3.xbgf index ede0013f..7fa8f642 100644 --- a/topics/java/lci/xbgf/prepare3.xbgf +++ b/topics/java/lci/xbgf/prepare3.xbgf @@ -16,9 +16,6 @@ IdentifierSuffix - - MemberDecl - Expression3 @@ -32,6 +29,4 @@ InterfaceDeclaration - - FormalParameterDecls diff --git a/topics/java/lci/xbgf/refactorClassDeclarations3.xbgf b/topics/java/lci/xbgf/refactorClassDeclarations3.xbgf index dd055e4c..2eb27d7a 100644 --- a/topics/java/lci/xbgf/refactorClassDeclarations3.xbgf +++ b/topics/java/lci/xbgf/refactorClassDeclarations3.xbgf @@ -88,39 +88,11 @@ + + TypeDeclaration + - - - - ClassOrInterfaceDeclaration - - - - ModifiersOpt - - - - - ClassDeclaration - - - InterfaceDeclaration - - - - - - - - + + NormalClassDeclaration @@ -195,27 +162,84 @@ + + ClassMemberDeclaration + + + + + ClassMemberDeclaration + + ClassDeclaration + + + + + + + ClassMemberDeclaration + + + + ModifiersOpt + + + ClassDeclaration + + + + + + + + + + + + ClassMemberDeclaration + + InterfaceDeclaration + + + + + + + ClassMemberDeclaration + + + + ModifiersOpt + + + InterfaceDeclaration + + + + + + + + + ClassMemberDeclaration + + Super Interfaces - - ClassMemberDeclaration InstanceInitializer StaticInitializer - ConstructorDeclaration - MethodDeclaration - ConstructorDeclarator - ResultType - MethodHeader - - ClassBodyDeclaration - @@ -271,123 +295,155 @@ - - ClassBodyDeclaration - - - - - ClassBodyDeclaration - - ClassOrInterfaceDeclaration - - - - + + FormalParameters + - - ClassBodyDeclaration + FormalParameters - ModifiersOpt + ( + + + + + FormalParameterDecls + + - ClassOrInterfaceDeclaration + ) - - - - - - + + - ClassBodyDeclaration + FormalParameterDecls - FieldDeclaration + + + + + final + + + + + Annotations + + + + + Type + + + FormalParameterDeclsRest + + + + - - FieldDeclaration - - - - - - ( - - - - - FormalParameterList - - - - - ) - - - - - FormalParameters - - - - - - + + - ConstructorDeclaratorRest + FormalParameterDeclsRest - - - FormalParameters - + - + - Throws + VariableDeclaratorId - + + + + + + , + + + FormalParameterDecls + + + + + + - ConstructorBody + + + ... + + + VariableDeclaratorId + + - + - - ConstructorBody - - ConstructorBody - MethodBody - - + + + ClassMemberDeclaration + ConstructorDeclaration + MethodDeclaration + ConstructorDeclarator + MethodHeader + FieldDeclaration + + ClassBodyDeclaration + + + MethodDeclarator MethodDeclarator + + + + + FormalParameterList + + + FormalParameterDecls + + + ClassBodyDeclaration + + + + FormalParameters + + ClassBodyDeclaration + + - VoidMethodDeclaratorRestFull + ConstructorDeclaratorRest - - void - - - Identifier - FormalParameters @@ -399,20 +455,38 @@ - MethodBody + ConstructorBody + + - VoidMethodDeclaratorRest + MethodDeclaratorRest FormalParameters + + + + + + [ + + + ] + + + + + @@ -427,32 +501,15 @@ - VoidMethodDeclaratorRestFull + ClassBodyDeclaration - - - MethodDeclaratorRest - - - - FormalParameters - - - - - Throws - - - - - MethodBody - - - - - - ClassBodyDeclaration + + @@ -468,14 +525,11 @@ - - Type - Identifier - MethodDeclaratorRest + ConstructorDeclaratorRest @@ -491,11 +545,14 @@ + + ResultType + Identifier - ConstructorDeclaratorRest + MethodDeclaratorRest @@ -517,24 +574,24 @@ - - Type - Identifier - MethodDeclaratorRest + ConstructorDeclaratorRest + + ResultType + Identifier - ConstructorDeclaratorRest + MethodDeclaratorRest @@ -550,24 +607,24 @@ - - Type - Identifier - MethodDeclaratorRest + ConstructorDeclaratorRest + + ResultType + Identifier - ConstructorDeclaratorRest + MethodDeclaratorRest @@ -575,6 +632,10 @@ + + GenericMethodOrConstructorDecl @@ -594,34 +655,7 @@ - - - + @@ -635,21 +669,120 @@ GenericMethodOrConstructorDecl - - - MethodDeclaratorRest - - VoidMethodDeclaratorRest - - + + + + ResultType + ClassBodyDeclaration + + VariableDeclaratorId + + + + + ClassBodyDeclaration + + + + ModifiersOpt + + + Type + + + VariableDeclarators + + + ; + + + + + + + + ClassBodyDeclaration + + + + ModifiersOpt + + + void + + + Identifier + + + VoidMethodDeclaratorRest + + + + + + + + VoidMethodDeclaratorRest + + + + FormalParameters + + + + + + + throws + + + QualifiedIdentifierList + + + + + + + + + MethodBody + + + ; + + + + + + + + + + ClassBodyDeclaration + + + + ModifiersOpt + + + MethodOrFieldDecl + + + + + + MethodOrFieldDecl @@ -661,55 +794,372 @@ Identifier - MethodDeclaratorRest + MethodOrFieldRest - - + + MethodOrFieldRest - MethodDeclaratorRest + + + VariableDeclaratorRest + + + MethodDeclaratorRest + + - - MethodOrFieldDecl - - + + + + VariableDeclaratorRest + + + + + + + + [ + + + ] + + + + + + + + + + + = + + + VariableInitializer + + + + + + + + + - MethodOrFieldRest + ClassBodyDeclaration - VariableDeclaratorRest + + + ModifiersOpt + + + Identifier + + + ConstructorDeclaratorRest + + - MethodOrFieldRest ---> + ClassBodyDeclaration - + - Fail: ClassBodyDeclaration. + - [], ;([... ,([*(n(Modifier)), n(MemberDecl)])]) + vs. + - [], ,([*(n(Modifier)), n(Identifier), n(ConstructorDeclaratorRest)]) + - [], ,([*(n(Modifier)), n(MethodOrFieldDecl)]) + - [], ,([*(n(Modifier)), t(void), n(Identifier), n(VoidMethodDeclaratorRest)]) + - [], ,([*(n(Modifier)), n(InterfaceDeclaration)]) + - [], ,([*(n(Modifier)), n(ClassDeclaration)]) + - [], ,([*(n(Modifier)), n(GenericMethodOrConstructorDecl)]) + --> + + + + + + + ModifiersOpt + + + Identifier + + + ConstructorDeclaratorRest + + + + + + + ModifiersOpt + + + MethodOrFieldDecl + + + + + + + ModifiersOpt + + + void + + + Identifier + + + VoidMethodDeclaratorRest + + + + + + + ModifiersOpt + + + InterfaceDeclaration + + + + + + + ModifiersOpt + + + ClassDeclaration + + + + + + + ModifiersOpt + + + GenericMethodOrConstructorDecl + + + + + + + + + ModifiersOpt + + + + + + + Identifier + + + ConstructorDeclaratorRest + + + + + MethodOrFieldDecl + + + + + void + + + Identifier + + + VoidMethodDeclaratorRest + + + + + InterfaceDeclaration + + + ClassDeclaration + + + GenericMethodOrConstructorDecl + + + + + + + + + MemberDecl + + + + + Identifier + + + ConstructorDeclaratorRest + + + + + MethodOrFieldDecl + + + + + void + + + Identifier + + + VoidMethodDeclaratorRest + + + + + InterfaceDeclaration + + + ClassDeclaration + + + GenericMethodOrConstructorDecl + + + + + - - + + + + ClassOrInterfaceDeclaration + + + + ModifiersOpt + + + + + ClassDeclaration + + + InterfaceDeclaration + + + + + + + + + + ModifiersOpt + + + + + ConstructorBody + + + MethodBody + + + ConstructorDeclaratorRest + + + + + TypeParameterList + + + AdditionalBoundList + AdditionalBoundList + + + + + + + AdditionalBound + + + + + + + + + AdditionalBound + + + + + AdditionalBound + TypeBound + + \ No newline at end of file