edu.uky.rch.ept.data.filesystem.cxpath
Class Parser
java.lang.Object
edu.uky.rch.ept.data.filesystem.cxpath.Parser
- public class Parser
- extends Object
Utility class for parsing concurrent XPath expressions. The expressions
match the following grammar; forms marked with {braces} indicate currently
unimplemented features.
- expression => locationPath
- locationPath => absLocPath | {relLocPath}
- absLocPath => '/' relLocPath | '//' relLocPath
- relLocPath => step | relLocPath '/' step | relLocPath '//' step
- step => {'.' | '..'} | axisSpec nodeTest {predicate*}
- axisSpec => AXIS_NAME '::' | AT | \epsilon
- nodeTest => '*' | NAME | {NS ':' '*' | NS ':' NAME | NODE_TYPE '(' ')'}
- predicate => {'[' expression ']'}
TODO: generate a parser with ANTLR or such.
TODO: support full XPath syntax.
- Author:
- neil
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parser
public Parser()
parse
public static LocationStep[] parse(String expr)
throws CXPathException
- Parse a concurrent XPath expression into its component
LocationSteps.
- Parameters:
expr - the expression to parse; must be a location path.
- Returns:
- Returns an array representing the location steps in the expression.
- Throws:
CXPathException - if there is an error parsing the expression.