org.apache.jdo.tck.util.signature
Class SignatureVerifier.Parser

java.lang.Object
  extended byorg.apache.jdo.tck.util.signature.SignatureVerifier.Parser
Enclosing class:
SignatureVerifier

protected class SignatureVerifier.Parser
extends java.lang.Object

For parsing of signature descriptor files.


Constructor Summary
protected SignatureVerifier.Parser()
           
 
Method Summary
protected  java.lang.String demandIdentifier()
          Parses the next token(s) and validates that it is an identifier.
protected  java.lang.String[] demandIdentifierList()
          Parses a comma-separated list of identifiers.
protected  java.lang.String demandLiteral()
          Parses the next token and validates that it is a literal.
protected  java.lang.String demandToken(java.lang.String token)
          Parses the next token and validates it against an expected one.
protected  java.lang.String demandType()
          Parses the next token and validates that it is a type expression.
protected  java.lang.String getLookAhead()
          Retrieves the look-ahead token to be parsed next.
protected  java.lang.String msgUnexpectedEOF()
          Returns an error message reporting an unextected end of file.
protected  java.lang.String msgUnexpectedToken(java.lang.String t)
          Returns an error message reporting an unextected token.
 void parse(java.util.List descrFileNames)
          Parses a list of signature descriptor files and processes the class definitions.
protected  java.lang.String parseClass()
          Parses a class definition and provides the information to a handler.
protected  java.lang.String parseIdentifier()
          Parses a (qualified) identifier.
protected  java.lang.String parseLiteral()
          Parses a literal.
protected  java.lang.String parseMember()
          Parses a class member declaration and provides the information to a field, constructor, or method handler.
protected  int parseModifiers()
          Parses any available Java modifiers.
protected  java.lang.String[] parseParameterList()
          Parses a comma-separated parameter list.
protected  java.lang.String parseToken()
          Returns the next token to be parsed.
protected  java.lang.String parseType()
          Parses a type expression.
protected  java.lang.String scanCharacterLiteral()
          Scans for a character literal.
protected  java.lang.String scanIdentifier()
          Scans for an (unqualified) identifier.
protected  java.lang.String scanNumberLiteral()
          Scans for a number literal.
protected  java.lang.String scanStringLiteral()
          Scans for a string literal.
protected  void setLookAhead(java.lang.String t)
          Sets the look-ahead token to be parsed next.
protected  boolean skip()
          Skips any "white space" and returns whether there are more characters to be parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignatureVerifier.Parser

protected SignatureVerifier.Parser()
Method Detail

msgUnexpectedEOF

protected java.lang.String msgUnexpectedEOF()
Returns an error message reporting an unextected end of file.


msgUnexpectedToken

protected java.lang.String msgUnexpectedToken(java.lang.String t)
Returns an error message reporting an unextected token.


getLookAhead

protected java.lang.String getLookAhead()
Retrieves the look-ahead token to be parsed next.


setLookAhead

protected void setLookAhead(java.lang.String t)
Sets the look-ahead token to be parsed next.


skip

protected boolean skip()
                throws java.io.IOException
Skips any "white space" and returns whether there are more characters to be parsed.

Throws:
java.io.IOException

scanIdentifier

protected java.lang.String scanIdentifier()
                                   throws java.io.IOException,
                                          java.text.ParseException
Scans for an (unqualified) identifier.

Returns:
null if the next token is not an identifier
Throws:
java.io.IOException
java.text.ParseException

scanNumberLiteral

protected java.lang.String scanNumberLiteral()
                                      throws java.io.IOException,
                                             java.text.ParseException
Scans for a number literal.

Returns:
null if the next token is not a number
Throws:
java.io.IOException
java.text.ParseException

scanCharacterLiteral

protected java.lang.String scanCharacterLiteral()
                                         throws java.io.IOException,
                                                java.text.ParseException
Scans for a character literal.

Returns:
null if the next token is not a character
Throws:
java.io.IOException
java.text.ParseException

scanStringLiteral

protected java.lang.String scanStringLiteral()
                                      throws java.io.IOException,
                                             java.text.ParseException
Scans for a string literal.

Returns:
null if the next token is not a string
Throws:
java.io.IOException
java.text.ParseException

parseToken

protected java.lang.String parseToken()
                               throws java.io.IOException,
                                      java.text.ParseException
Returns the next token to be parsed.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

demandToken

protected java.lang.String demandToken(java.lang.String token)
                                throws java.io.IOException,
                                       java.text.ParseException
Parses the next token and validates it against an expected one.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

parseLiteral

protected java.lang.String parseLiteral()
                                 throws java.io.IOException,
                                        java.text.ParseException
Parses a literal.

Returns:
null if the next token is not a literal
Throws:
java.io.IOException
java.text.ParseException

demandLiteral

protected java.lang.String demandLiteral()
                                  throws java.io.IOException,
                                         java.text.ParseException
Parses the next token and validates that it is a literal.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

parseModifiers

protected int parseModifiers()
                      throws java.io.IOException,
                             java.text.ParseException
Parses any available Java modifiers.

Returns:
an int value with the parsed modifiers' bit set
Throws:
java.io.IOException
java.text.ParseException

parseIdentifier

protected java.lang.String parseIdentifier()
                                    throws java.io.IOException,
                                           java.text.ParseException
Parses a (qualified) identifier.

Returns:
null if the next token is not an identifier
Throws:
java.io.IOException
java.text.ParseException

demandIdentifier

protected java.lang.String demandIdentifier()
                                     throws java.io.IOException,
                                            java.text.ParseException
Parses the next token(s) and validates that it is an identifier.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

demandIdentifierList

protected java.lang.String[] demandIdentifierList()
                                           throws java.io.IOException,
                                                  java.text.ParseException
Parses a comma-separated list of identifiers.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

parseType

protected java.lang.String parseType()
                              throws java.io.IOException,
                                     java.text.ParseException
Parses a type expression.

Returns:
null if the next token is not a type
Throws:
java.io.IOException
java.text.ParseException

demandType

protected java.lang.String demandType()
                               throws java.io.IOException,
                                      java.text.ParseException
Parses the next token and validates that it is a type expression.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

parseParameterList

protected java.lang.String[] parseParameterList()
                                         throws java.io.IOException,
                                                java.text.ParseException
Parses a comma-separated parameter list.

Returns:
never null
Throws:
java.io.IOException
java.text.ParseException

parseMember

protected java.lang.String parseMember()
                                throws java.io.IOException,
                                       java.text.ParseException
Parses a class member declaration and provides the information to a field, constructor, or method handler.

Returns:
null if there's no member declaration
Throws:
java.io.IOException
java.text.ParseException

parseClass

protected java.lang.String parseClass()
                               throws java.io.IOException,
                                      java.text.ParseException
Parses a class definition and provides the information to a handler.

Returns:
null if there's no class definition
Throws:
java.io.IOException
java.text.ParseException

parse

public void parse(java.util.List descrFileNames)
           throws java.io.IOException,
                  java.text.ParseException
Parses a list of signature descriptor files and processes the class definitions.

Parameters:
descrFileNames - list of signature descriptor file names
Throws:
java.io.IOException
java.text.ParseException


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.