//____________________________________<80>____________________________________\\ // Course Number: CSU 670 // Name: Jason Seifried // Assignment: Project (Phase 2) // Date: 11.13.04 // // File: xal.cd // Adapted from: sg.cd,v 1.12 2003/01/30 02:26:05 dougo, modified by // Karl Leiberherr //____________________________________<80>____________________________________\\ import java.util.*; import edu.neu.ccs.demeter.aplib.cd.*; import edu.neu.ccs.demeter.aplib.sg.*; XAspectLanguage = List(AspectLanguage) EOF. AspectLanguage : lookahead {{ 3 }} ClassDictionaryL | SelectorL. ClassDictionaryL = "aspect" "(" "ClassDictionary" ")" ClassDictionaryName ClassDict. SelectorL = "aspect" "(" "Traversal" ")" TraversalName "{" List(StrategyDef) List(NodeSubsetDef) [lookahead {{3}} "declare" "chosen" "selector:" SelectorName ";"] // to be highlighted [lookahead {{3}} "declare" "chosen" "class" "dictionary:" ClassDictionaryName ";"] // to be highlighted "}". StrategyDef = "declare" "strategy" ":" StrategyName ":" StrategyExpr ";". NodeSubsetDef = "declare" "node" "set" ":" NodeSubsetName ":" NodeSubsetExpression ";". NodeSubsetExpression : Simple | BCompound | UCompound. Simple : NodeSubsetName | ClassNameSet | GraphNodes | GraphNodeRegExp. BCompound = BinaryOp PCList(NodeSubsetExpression) . UCompound = UnaryOp NodeSubsetExpression . ClassNameSet = BCList(ClassName). GraphNodes = "nodes" StrategyName . GraphNodeRegExp = "regexp" ClassName WildCard . WildCard ="*". BinaryOp : Union | Intersection. UnaryOp : Complement. Union = "or". Intersection = "and". Complement = "!". ClassName = Name. Name ~ ConstIdent { "." ConstIdent }. ClassDict = ConstText. StrategyExpr = ConstText. SelectorName = ConstIdent. TraversalName = ConstIdent. StrategyName = ConstIdent. NodeSubsetName = ConstIdent. ClassDictionaryName = ConstIdent. Operator : BinaryOp | UnaryOp. //Buffer definitions ConstIdent = Ident. ConstText = Text. // Parameterized class definitions. List(S) ~ { lookahead {{ 3 }} *s S}. SList(S) ~ S { *l S } . Commalist(S) ~ S {"," *s S}. BCList(S) ~ "{" S {"," S} "}". PCList(S) ~ "(" S {"," S} ")". PList(S) ~ "(" {S} ")". NPList(S) ~ "(" S {S} ")". Main = .