net.sourceforge.sqlunit.parsers
Class SymbolParser

java.lang.Object
  extended by net.sourceforge.sqlunit.parsers.SymbolParser
All Implemented Interfaces:
SymbolParserConstants

public class SymbolParser
extends java.lang.Object
implements SymbolParserConstants

Contains specifications and grammar for parsing Strings and replacing embedded ant-style variables with values from the SymbolTable.

Version:
$Revision: 1.1 $
Author:
Sujit Pal (sujit.pal@cnet.com)

Field Summary
 Token jj_nt
           
 Token token
           
 SymbolParserTokenManager token_source
           
 
Fields inherited from interface net.sourceforge.sqlunit.parsers.SymbolParserConstants
CODE_CHAR, DEFAULT, END_VAR, EOF, IN_VAR, START_VAR, tokenImage, VAR_CHAR
 
Constructor Summary
SymbolParser(java.io.InputStream stream)
           
SymbolParser(java.io.Reader stream)
           
SymbolParser(SymbolParserTokenManager tm)
           
 
Method Summary
 void disable_tracing()
           
 void enable_tracing()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
static java.lang.String parse(java.lang.String str, java.util.Map syms, boolean partialOk)
          This is the method that will be called from the client.
 void ReInit(java.io.InputStream stream)
           
 void ReInit(java.io.Reader stream)
           
 void ReInit(SymbolParserTokenManager tm)
           
 void Substitute()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public SymbolParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt
Constructor Detail

SymbolParser

public SymbolParser(java.io.InputStream stream)

SymbolParser

public SymbolParser(java.io.Reader stream)

SymbolParser

public SymbolParser(SymbolParserTokenManager tm)
Method Detail

parse

public static java.lang.String parse(java.lang.String str,
                                     java.util.Map syms,
                                     boolean partialOk)
                              throws ParseException
This is the method that will be called from the client.

Parameters:
str - the String with embedded ant-style variables.
syms - a Map of symbols in the SymbolTable.
partialOk - if true, exception will not be thrown if variable is not found, it is assumed that this will be passed in later.
Returns:
a String with the variables replaced by their values.
Throws:
ParseException - if there was a problem parsing the String, or if a variable could not be found in the SymbolTable.

Substitute

public final void Substitute()
                      throws ParseException
Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)

ReInit

public void ReInit(java.io.Reader stream)

ReInit

public void ReInit(SymbolParserTokenManager tm)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

generateParseException

public ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()