org.exolab.adaptx.xpath.engine

Class Parser

public class Parser extends Object

A class for parsing expression strings

Version: $Revision: 4090 $ $Date: 2004-01-23 20:21:23 -0500 (Fri, 23 Jan 2004) $

Author: Keith Visco

Method Summary
static XPathExpressioncreateExpr(String exprString)
Creates an Expr from the given String
static FunctionCallcreateFunctionCall(String name)
Creates the appropriate FunctionCall based on the given name
static XPathExpressioncreateLiteralExpr(String literal)
Creates a literal expression, which simply evaluates to the given string literal.
static MatchExpressioncreateMatchExpr(String matchString)
Parses the a pattern String into a MatchExpr
static PathExprcreatePathExpr(String pattern)
Creates a PathExpr from the string argument.
static SelectExprcreateSelectExpr(String selectString)
Parses the a pattern String into a SelectExpr
static UnionExprcreateUnionExpr(String pattern)
Creates a UnionExpr from the given string argument.
static voidmain(String[] args)

Method Detail

createExpr

public static XPathExpression createExpr(String exprString)
Creates an Expr from the given String

Parameters: exprString the String to create the Expr from

Returns: the new Expr

Throws: InvalidExprException when a parsing error occurs

createFunctionCall

public static FunctionCall createFunctionCall(String name)
Creates the appropriate FunctionCall based on the given name

Parameters: name the name of the function to call params the List of Expr paramaters for the function call

Returns: the new FunctionCall

createLiteralExpr

public static XPathExpression createLiteralExpr(String literal)
Creates a literal expression, which simply evaluates to the given string literal.

Parameters: literal the string literal the literal expression should evaluate to.

Returns: an XPathExpression which will evaluate to the given string literal.

createMatchExpr

public static MatchExpression createMatchExpr(String matchString)
Parses the a pattern String into a MatchExpr

Parameters: matchString the pattern string to create the MatchExpr from

Returns: the new MatchExpr

Throws: InvalidExprException

createPathExpr

public static PathExpr createPathExpr(String pattern)
Creates a PathExpr from the string argument.

Parameters: pattern the string to create the PathExpr from

Returns: the new PathExpr

Throws: InvalidExprException

createSelectExpr

public static SelectExpr createSelectExpr(String selectString)
Parses the a pattern String into a SelectExpr

Parameters: selectString the pattern string to create the SelectExpr from

Returns: the new SelectExpr

Throws: XSLException

createUnionExpr

public static UnionExpr createUnionExpr(String pattern)
Creates a UnionExpr from the given string argument.

Parameters: pattern the string to create the UnionExpr from

Returns: the new UnionExpr

Throws: InvalidExprException

main

public static void main(String[] args)