TraversalPaths = List(TraceMatch). TraceMatch = "tracematch" "(" [ CList(VariableDeclaration)] ")" List(Symbol) RegEx. VariableDeclaration = NodeName VariableName. Symbol = "sym" Name Kind ":" SelectorExp ";". Kind : Before | After. Before = "before". After = "after". // This is SAJ with three primitives instead of one: // The tree nodes are decorated with object references // NodeVisit selects all nodes with an object reference of a given class // Target selects all nodes which are decorated with object reference VariableName // This selects all nodes whose predecessor (along the current path) // is decorated with object reference VariableName SelectorExp : Simple | Compound. Simple : NodeVisit | Target | This. NodeVisit = "visit" "(" NodeName ")". // Target selects the current node on the path Target = "target" "(" VariableName ")". // This selects the previous node on the path This = "this" "(" VariableName ")". Compound = "(" Op List(SelectorExp) ")". Op : Union | Intersection. Union = "|". Intersection = "&". RegEx = "regex". Name = Ident . NodeName = Ident. MethodName = Ident. VariableName = Ident. List(S) ~ {S}. CList(S) ~ S {"," S}. Main = .