package MyEditor.xaspect.xpath; import edu.neu.ccs.demeter.dj.*; import java.util.*; Main = String. public XPathExp =XPath. public XPath: NormalXPath|SetCompoundXPath. public NormalXPath = SimpleXPath [OrSimpleXPaths]. public OrSimpleXPaths ~ "|" SimpleXPath {"|" SimpleXPath}. public SimpleXPath = NList(OneSegmentAxisPath). public OneSegmentAxisPath =AxisOp Node. public Node:SingleNode|Wildcard. public SingleNode=Ident. public Wildcard="*". public AxisOp: Descendant|Child. public Descendant = "/+/". public Child ="/". public SetCompoundXPath= SetOp "(" SetTerm "," SetTerm ")" . public SetTerm: XPath | XPathRefName. public CompoundXPath= SetCompoundXPath. public SetOp: Intersect|Complement|Union. public Intersect="intersect". public Complement="except". public Union="union". public XPathRefName=Ident. public List(S) ~ {S}. public NList(S) ~ S{S}. public CList(S) ~ "(" {"," S} ")".