org.apache.torque.engine.sql
Class SQLScanner

java.lang.Object
  extended byorg.apache.torque.engine.sql.SQLScanner

public class SQLScanner
extends java.lang.Object

A simple Scanner implementation that scans an sql file into usable tokens. Used by SQLToAppData.

Version:
$Id: SQLScanner.java,v 1.3.2.1 2003/05/22 21:58:05 mpoeschl Exp $
Author:
Leon Messerschmidt, Jon S. Stevens

Field Summary
private static java.lang.String alfa
           
private static java.lang.String alfanum
           
private  int chr
           
private  int col
           
private static char commentDash
           
private static char commentPound
           
private static char commentSlash
           
private static char commentStar
           
private  java.io.Reader in
           
private  int line
           
private static java.lang.String numer
           
private static java.lang.String special
           
private  java.lang.String token
           
private  java.util.List tokens
           
private static java.lang.String white
           
 
Constructor Summary
SQLScanner()
          Creates a new scanner with no Reader
SQLScanner(java.io.Reader input)
          Creates a new scanner with an Input Reader
 
Method Summary
private  void readChar()
          Reads the next character and increments the line and column counters.
 java.util.List scan()
          Scan the input Reader and returns a list of tokens.
private  void scanIdentifier()
          Scans an identifier.
private  void scanNegativeIdentifier()
          Scans an identifier which had started with the negative sign.
 void setInput(java.io.Reader input)
          Set the Input
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

white

private static final java.lang.String white
See Also:
Constant Field Values

alfa

private static final java.lang.String alfa
See Also:
Constant Field Values

numer

private static final java.lang.String numer
See Also:
Constant Field Values

alfanum

private static final java.lang.String alfanum
See Also:
Constant Field Values

special

private static final java.lang.String special
See Also:
Constant Field Values

commentPound

private static final char commentPound
See Also:
Constant Field Values

commentSlash

private static final char commentSlash
See Also:
Constant Field Values

commentStar

private static final char commentStar
See Also:
Constant Field Values

commentDash

private static final char commentDash
See Also:
Constant Field Values

in

private java.io.Reader in

chr

private int chr

token

private java.lang.String token

tokens

private java.util.List tokens

line

private int line

col

private int col
Constructor Detail

SQLScanner

public SQLScanner()
Creates a new scanner with no Reader


SQLScanner

public SQLScanner(java.io.Reader input)
Creates a new scanner with an Input Reader

Method Detail

setInput

public void setInput(java.io.Reader input)
Set the Input


readChar

private void readChar()
               throws java.io.IOException
Reads the next character and increments the line and column counters.

Throws:
java.io.IOException

scanIdentifier

private void scanIdentifier()
                     throws java.io.IOException
Scans an identifier.

Throws:
java.io.IOException

scanNegativeIdentifier

private void scanNegativeIdentifier()
                             throws java.io.IOException
Scans an identifier which had started with the negative sign.

Throws:
java.io.IOException

scan

public java.util.List scan()
                    throws java.io.IOException
Scan the input Reader and returns a list of tokens.

Throws:
java.io.IOException


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.