See faculty/bickmore =============== Hi Theo: July 14, 2004 after our discussion yseterday, here is my statement of the generality of this approach. It is just a coincidence that we use the class dictionary for class dictionaries and we should not use it in our paper. General theme: Given is a pair of cds: G1 (base language) and G2 (extension without attachment) and a glue specification GL consisting of a cd and replacement clauses (defining the attachment). G3=(G1,G2,GL) is a new language that is in a language extension relationship wrt. G1. We design an aspect language to express for c in G1, how to enhance it to a c3 in G3. To define the possible extension points, we use traversal strategies in G1 and we use those strategies also to define the pointcut semantics of the aspect language. The goal is to prove that the aspect language is complete with respect to the language extension from G1 to G3. The security example seems to suggest the following scenario: G1 is a class dictionary where we also express methods. G2 provides RBAC information. GL defines annotations to parts and methods that are expressed in the form of aspects controlling the executions and calls of those methods and part accesses. -- Karl ===================================== Hi Theo: July 13, 2004 as we discussed: The strategy notation is only used to define the semantics of the nice, user-friendly aspect language. For example: semantics of y = before/after ClassBody: SyntaxCoordinates(y, ClassBody) where ClassName (from ClassBody up ParamClassName to ClassName) is Q = y "class" "Q". Have you done something similar for security? -- Karl ====================================== Hi Theo: July 8, 2004 I have added the derivation of the the aspect language: // parameterized strategy SyntaxCoordinates(PartName x, ClassName Y) = from ClassGraphh via Sandwich(Y) bypassing Y via ->*,x,* to Syntax SyntaxCoordinates(before, ClassBody) where ClassName (from ClassBody up ParamClassName to ClassName) is Q = "begin" "class" "Q". etc. see below. How would XPath express this? -- Karl ============================== Hi Theo: July 7, 2004 here is the reworked example at the end. Can you bring it in line with your model/notation? -- Karl From Final CSU670 Sp 04: // CLASS DICTIONARY SyntaxAspect // generate.cd -- class dictionary for DemeterJ code generator // modified for syntax commands 2004/04/19 import edu.neu.ccs.demeter.dj.*; import java.util.*; import java.io.*; Main = . Input = ClassGraphh SyntaxEnhancement. ClassGraphh = DList(Definition). Definition : ClassDef. public ClassDef = ParamClassName *s ClassBody "." . ParamClassName = ClassName ["(" Commalist(ClassName) ")"]. ClassBody : ConstOrAltClass | RepetitionClass. ConstOrAltClass : ConstructionClass | AlternationClass *common* + // The following: // List(ClassElement) // changed to: List(ClassElementWithSyntax) -. // The following: // ClassElement : Part | OptionalPart | Syntax. // changed to: ClassElement : Part | OptionalPart . // Glue ClassElementWithSyntax : ClassElement | SandwichedClassElement . SandwichedClassElement = PSandwich(ClassElement). // Glue PSandwich(S) = "{" Sandwich(S) "}". Part = *l [ "<" PartName ">" *s ] ClassSpec. OptionalPart = *l "[" Sandwich(Part) "]". ConstructionClass = "=". AlternationClass = ":" + [ Barlist(ClassSpec) ] - "common". RepetitionClass = "~" Sandwich(RepeatedPart). RepeatedPart = [ ClassSpec ] "{" Sandwich(ClassSpec) *s "}". // Glue Sandwich(S) = List(Syntax) *s S List(Syntax) . ClassSpec = ClassName ["(" Commalist(ClassSpec) ")" ] . // Glue Syntax : SyntaxToken | PrintCommand. // Syntax cd SyntaxToken = String. // PP cd PrintCommand : PrintIndent | PrintUnindent | PrintSkip | PrintSpace. PrintIndent = "+" . PrintUnindent = "-" . PrintSkip = "*l" . PrintSpace = "*s" . // Terminal buffer classes. ClassName = Ident. PartName = Ident. // Parameterized class definitions. List(S) ~ {*s S}. NList(S) ~ S {*s S}. SList(S) ~ S { *l S } . DList(S) ~ S { *l *l S } *l . Commalist(S) ~ S {"," *s S}. Barlist(S) ~ S { *l "|" *s S}. ////////////////////////////////////// //syntax enhancement aspect language// ////////////////////////////////////// SyntaxEnhancement = List(Enhancement) EOF. Enhancement = *l Where EnhancementBody. EnhancementBody : ClassBody | PartCoordinate | OptionalPartCoordinate | CollectionCoordinate common ":" SyntaxToken . // also applies outside of optional parts PartCoordinate = "part" SyntaxClassName "." SyntaxPartName. // only for optional parts OptionalPartCoordinate = "inside" "optional" "part" SyntaxClassName "." SyntaxPartName. ClassBody = "class" SyntaxClassName. CollectionCoordinate = "collection" SyntaxClassName CurlyBracket. CurlyBracket : Left | Right. Left = "{". Right = "}". SyntaxClassName = Ident. SyntaxPartName = Ident. Where : Before | After. Before = "before". After = "after". Want to derive the equivalent automatically from the information below! Basic.cd Syntax.cd PP.cd Glue.cd // parameterized strategy SyntaxCoordinates(PartName x, ClassName Y) = from ClassGraphh via Sandwich(Y) bypassing Y via ->*,x,* to Syntax //associate syntax with parts AroundClassElement(PartName x) = SyntaxCoordinates(x, ClassElement) call: AroundClassElement(before), AroundClassElement(after) //associate syntax with class AroundClassBody(PartName x) = SyntaxCoordinates(x, ClassBody) // syntax inside repetition class AroundClassSpec(PartName x) = SyntaxCoordinates(x, ClassSpec) // syntax inside optional part AroundClassSpec(PartName x) = SyntaxCoordinates(x, Part) The aspect language will be: // need XPath capability AroundClassBody(before) where ClassName (from ClassBody up ParamClassName to ClassName) is Q = "begin" "class" "Q". AroundClassBody(after) where class is Q = "end" "class" "Q". AroundClassElement(before) where part is x = "before x" AroundClassElement(after) where part is x = "after x" Separate the concerns: ====================== // CLASS DICTIONARY Basic.cd provides all classes; // what we use: ClassSpec, RepeatedPart, Part, OptionalPart, ... // generate.cd -- class dictionary for DemeterJ code generator // modified import edu.neu.ccs.demeter.dj.*; import java.util.*; import java.io.*; Main = . Input = ClassGraphh SyntaxEnhancement. ClassGraphh = DList(Definition). Definition : ClassDef. public ClassDef = ParamClassName *s ClassBody "." . ParamClassName = ClassName ["(" Commalist(ClassName) ")"]. ClassBody : ConstOrAltClass | RepetitionClass. ConstOrAltClass : ConstructionClass | AlternationClass *common* + // The following: // List(ClassElement) // changed to: List(ClassElementWithSyntax) -. // The following: // ClassElement : Part | OptionalPart | Syntax. // changed to: ClassElement : Part | OptionalPart . Part = *l [ "<" PartName ">" *s ] ClassSpec. OptionalPart = *l "[" Part "]". ConstructionClass = "=". AlternationClass = ":" + [ Barlist(ClassSpec) ] - "common". RepetitionClass = "~" RepeatedPart. RepeatedPart = [ ClassSpec ] "{" ClassSpec *s "}". ClassSpec = ClassName ["(" Commalist(ClassSpec) ")" ] . // Terminal buffer classes. ClassName = Ident. PartName = Ident. // Parameterized class definitions. List(S) ~ {*s S}. NList(S) ~ S {*s S}. SList(S) ~ S { *l S } . DList(S) ~ S { *l *l S } *l . Commalist(S) ~ S {"," *s S}. Barlist(S) ~ S { *l "|" *s S}. ================== // Syntax.cd provides SyntaxToken. SyntaxToken = String. //============================================================================ // PP.cd provides PrintCommand. PrintCommand : PrintIndent | PrintUnindent | PrintSkip | PrintSpace. PrintIndent = "+" . PrintUnindent = "-" . PrintSkip = "*l" . PrintSpace = "*s" . //============================================================================ // Glue cd // the following needs some reworking import Basic.cd, Syntax.cd, PP.cd expects SyntaxToken, PrintCommand provides ClassGraphh Syntax : SyntaxToken | PrintCommand. // set up coordinate infrastructure Sandwich(S) = List(Syntax) *s S List(Syntax) . PSandwich(S) = "{" Sandwich(S) "}". SandwichedClassElement = PSandwich(ClassElement). ClassElementWithSyntax : ClassElement | SandwichedClassElement . // define coordinates Replace: RepeatedPart = [ ClassSpec ] "{" ClassSpec *s "}". by RepeatedPart = [ ClassSpec ] "{" Sandwich(ClassSpec) *s "}". // // the following Replace are extensions // define the coordinates where the extension happens // Replace: // RepetitionClass = "~" RepeatedPart. // by // RepetitionClass = "~" Sandwich(RepeatedPart). // generalized to wrap any class Replace: OptionalPart = *l "[" Part "]". by OptionalPart = *l "[" Sandwich(Part) "]". Replace: ConstOrAltClass : ConstructionClass | AlternationClass *common* + List(ClassElement) -. by ConstOrAltClass : ConstructionClass | AlternationClass *common* + List(ClassElementWithSyntax) -. Replace: public ClassDef = ParamClassName *s ClassBody "." . by public ClassDef = ParamClassName *s Sandwich(ClassBody) "." . //============================================================================