org.apache.turbine.torque.engine.sql
Class SQLScanner

java.lang.Object
  |
  +--org.apache.turbine.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$
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.Vector 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.Vector scan()
          Scan the input Reader and returns a list of tokens.
private  void scanIdentifier()
          Scans an identifier.
 void setInput(java.io.Reader input)
          Set the Input
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

white

private static final java.lang.String white

alfa

private static final java.lang.String alfa

numer

private static final java.lang.String numer

alfanum

private static final java.lang.String alfanum

special

private static final java.lang.String special

commentPound

private static final char commentPound

commentSlash

private static final char commentSlash

commentStar

private static final char commentStar

commentDash

private static final char commentDash

in

private java.io.Reader in

chr

private int chr

token

private java.lang.String token

tokens

private java.util.Vector 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.

scanIdentifier

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

scan

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


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