Directions for reading class dictionaries in HtDP style: = is: : is one of: ".." token (delete " and ") called x (read after type) common and they have in common In the following we use class dictionaries because they are more succinct and machine-checkable. Grammar for class graphs: ========================= ClassGraph = List(Adjacency). Adjacency = ClassName Body. Body : Construction | Alternation common List(Part). Construction = "=". Alternation = ":" BarList(ClassName). Part = LabelName ClassName. ClassName = Ident. LabelName = "<" Ident ">". List(S) ~ "(" {S} ")". BarList ~ S {"|" S}. Grammar for object graphs: ========================== ObjectGraph = List(Adjacency). Adjacency = ClassName List(Part). Part : TerminalPart | NonTerminalPart. TerminalPart = "term" LabelName ClassName TerminalValue. NonTerminalPart = LabelName ClassName. List(S) ~ "(" {S} ")". TerminalValue = String. // any Scheme primiitive value ClassName = Ident. LabelName = "<" Ident ">". Main = . Grammar for strategies: ======================= Strategy : SimpleStrategy | CompoundStrategy. SimpleStrategy = "/+/" Node Node. CompoundStrategy = "(join" Strategy Strategy ). Grammar for visitors: ===================== Visitor = "(visitor" List(VarName) ["start" LambdaExpression] ["finish" LambdaExpression] List(NJPAdvice) // in the future: List(EJPAdvice) "getReturnValue" LambdaExpression ")". NJPAdvice = NJoinPoint LambdaExpression. NJoinPoint = When DTN. When : Before | After. Before = "before". After = "after". Grammar for programs: ===================== Program = List(ClassGraphDef) List(ObjectGraphDef) List(StrategyDef) List(VisitorDef) List(AdaptiveMethod). AdaptiveMethod = ClassGraphName ObjectGraphName StrategyName VisitorName. ClassGrapfDef = "(define-classgraph" ClassGraphName ClassGraph ")". ObjectGraphDef = "(define-objectgraph" ObjectGraphName ObjectGraph ")". StrategyDef = "(define-strategy" StrategyName Strategy ")". VisitorDef = "(define-visitor" VisitorName Visitor ")".