org.jcoderz.phoenix.sqlparser
Class SqlScanner

java.lang.Object
  extended by org.jcoderz.phoenix.sqlparser.SqlScanner
All Implemented Interfaces:
ScannerInterface

public final class SqlScanner
extends Object
implements ScannerInterface

Simple SQL Scanner.

Author:
Michael Griffel

Constructor Summary
SqlScanner(InputStream input)
          create a new SQL Scanner.
 
Method Summary
 int getColumn()
          Returns the offset.
 int getLine()
          Returns the line.
 boolean isSetReportWhitespace()
          Returns the reportWhitespace.
static void main(String[] args)
          Simple SQL Scanner that reads the file given at argument 1 and dumps the tokens to stderr and the content on stdout.
 Token nextToken()
          This is just a wrapper around the real nextToken() method for logging.
 void setReportWhitespace(boolean reportWhitespace)
          Sets the reportWhitespace to given reportWhitespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlScanner

public SqlScanner(InputStream input)
create a new SQL Scanner.

Parameters:
input - the input stream to read SQL data from
Method Detail

isSetReportWhitespace

public boolean isSetReportWhitespace()
Returns the reportWhitespace.

Returns:
the reportWhitespace.

setReportWhitespace

public void setReportWhitespace(boolean reportWhitespace)
Sets the reportWhitespace to given reportWhitespace.

Specified by:
setReportWhitespace in interface ScannerInterface
Parameters:
reportWhitespace - The reportWhitespace to set.

getLine

public int getLine()
Returns the line.

Specified by:
getLine in interface ScannerInterface
Returns:
the line.

getColumn

public int getColumn()
Returns the offset.

Specified by:
getColumn in interface ScannerInterface
Returns:
the offset.

nextToken

public Token nextToken()
                throws ParseException
This is just a wrapper around the real nextToken() method for logging.

Specified by:
nextToken in interface ScannerInterface
Returns:
the next token
Throws:
ParseException - if a syntax error is encountered
See Also:
ScannerInterface.nextToken()

main

public static void main(String[] args)
                 throws Exception
Simple SQL Scanner that reads the file given at argument 1 and dumps the tokens to stderr and the content on stdout.

Parameters:
args - command line arguments
Throws:
Exception - An error occurred


Copyright 2007 The jCoderZ Project.