jd.xml.xpath.parser
Class Scanner

java.lang.Object
  extended byjd.xml.xpath.parser.Scanner
All Implemented Interfaces:
TokenConstants

public class Scanner
extends Object
implements TokenConstants

A Scanner to tokenize XPath expressions.


Field Summary
 int token
           
 String value
           
 
Fields inherited from interface jd.xml.xpath.parser.TokenConstants
AT, AXISNAME, BRACKET_CLOSE, BRACKET_OPEN, COMMA, DOT, DOTDOT, END_OF_EXPRESSION, EQUALS, GREATER, GREATER_EQUALS, LESS, LESS_EQUALS, LITERAL, MAX, MINUS, MULTIPLY, NAME, NOT_EQUALS, NUMBER, PARENTHESIS_CLOSE, PARENTHESIS_OPEN, PLUS, SLASH, SLASHSLASH, UNDEFINED, UNION, VARIABLE_REFERENCE
 
Constructor Summary
Scanner(String expression)
          Create a Scanner for the given expression.
 
Method Summary
 void consumeExpectedToken(int token)
           
 void consumeExpectedToken(int token, String value)
           
 boolean consumeToken(int token)
           
 boolean consumeToken(int token, String value)
           
 XPathParseException createParseException(String message)
           
 String getExpressionString()
           
 int getPosition()
           
 String getRestString()
           
 String getTokenName()
           
static String getTokenName(int token)
           
 String getTokenString()
           
 boolean matchToken(int token)
           
 boolean matchToken(int token, String value)
           
 int nextToken()
           
static void print(String expr)
           
 void stopAtUnexpectedChar()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token

public int token

value

public String value
Constructor Detail

Scanner

public Scanner(String expression)
Create a Scanner for the given expression.

Method Detail

stopAtUnexpectedChar

public void stopAtUnexpectedChar()

nextToken

public int nextToken()
              throws XPathParseException
Throws:
XPathParseException

matchToken

public boolean matchToken(int token)

matchToken

public boolean matchToken(int token,
                          String value)

consumeToken

public boolean consumeToken(int token)
                     throws XPathParseException
Throws:
XPathParseException

consumeToken

public boolean consumeToken(int token,
                            String value)
                     throws XPathParseException
Throws:
XPathParseException

consumeExpectedToken

public void consumeExpectedToken(int token)
                          throws XPathParseException
Throws:
XPathParseException

consumeExpectedToken

public void consumeExpectedToken(int token,
                                 String value)
                          throws XPathParseException
Throws:
XPathParseException

createParseException

public XPathParseException createParseException(String message)

getTokenString

public String getTokenString()

getTokenName

public String getTokenName()

getTokenName

public static String getTokenName(int token)

getExpressionString

public String getExpressionString()

getRestString

public String getRestString()

getPosition

public int getPosition()

print

public static void print(String expr)
                  throws XPathParseException
Throws:
XPathParseException