// demjava.cd -- class dictionary for Demeter/Java // from /proj/asl/lieber/java/new-java-envs/mihran import java.util.*; import java.io.*; Main = . ClassGraph = DList(ClassDef) EOF. ClassDef = "(" ClassName ClassParts ")". ClassParts : ConstOrAltClass | RepetitionClass. ConstOrAltClass : ConstructionClass | AlternationClass *common* + + + List(PartOrSyntax) - - -. PartOrSyntax : Part | OptionalPart | Syntax. Part = [ "(" PartName ")" ] ClassSpec. OptionalPart = "(opt" Sandwich(Part) ")". ConstructionClass = "=". AlternationClass = ":" + + + Barlist(Subclass) - - - [ Common ]. Subclass = ClassSpec. Common = *l + + + "*" "common" "*" - - -. RepetitionClass = "~" Sandwich(RepeatedPart). RepeatedPart = [ ClassSpec ] "(" Sandwich(ClassSpec) ")". Sandwich(S) = List(Syntax) S List(Syntax) . ClassSpec = ClassName. Syntax : PlainSyntax . PlainSyntax = String. // Terminal buffer classes. DirName = Ident. ClassName = Ident. PartName = Ident. TraversalName = Ident. VisitorName = Ident. MethodName = Ident. JavaCode = "(@" String "@)". // Parameterized class definitions. List(S) ~ "(" {S} ")". SList(S) ~ S { *l S } *l . DList(S) ~ "(" S { *l *l S } *l ")" . Barlist(S) ~ "(" S { *l "|" S} ")".