com.alibaba.druid.sql.parser
Class Lexer

java.lang.Object
  extended by com.alibaba.druid.sql.parser.Lexer
Direct Known Subclasses:
MySqlLexer, OracleLexer, PGLexer, SQLServerLexer

public class Lexer
extends Object

Author:
wenshao

Constructor Summary
Lexer(char[] input, int inputLength, boolean skipComment)
           
Lexer(String input)
           
Lexer(String input, boolean skipComment)
           
 
Method Summary
 String addSymbol()
           
 void arraycopy(int srcPos, char[] dest, int destPos, int length)
           
 int bp()
           
 char charAt(int index)
           
 char current()
           
 BigDecimal decimalValue()
           
 Keywords getKeywods()
           
 String hexString()
           
 String info()
           
 Number integerValue()
           
 boolean isAllowComment()
           
 boolean isDigit(char ch)
           
 boolean isEOF()
           
 void mark()
           
 void nextToken()
           
 int nextVarIndex()
           
 String numberString()
           
 int pos()
          Return the current token's position: a 0-based offset from beginning of the raw input stream (before unicode translation)
 void reset()
           
 void reset(int mark, char markChar, Token token)
           
 void scanComment()
           
 void scanHexaDecimal()
           
 void scanIdentifier()
           
 void scanNumber()
           
 void scanVariable()
           
 void setAllowComment(boolean allowComment)
           
 String stringVal()
          The value of a literal token, recorded as a string.
 String subString(int offset, int count)
           
 Token token()
          Return the current token, set by nextToken().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lexer

public Lexer(String input)

Lexer

public Lexer(String input,
             boolean skipComment)

Lexer

public Lexer(char[] input,
             int inputLength,
             boolean skipComment)
Method Detail

charAt

public final char charAt(int index)

addSymbol

public String addSymbol()

subString

public final String subString(int offset,
                              int count)

arraycopy

public void arraycopy(int srcPos,
                      char[] dest,
                      int destPos,
                      int length)

isAllowComment

public boolean isAllowComment()

setAllowComment

public void setAllowComment(boolean allowComment)

nextVarIndex

public int nextVarIndex()

getKeywods

public Keywords getKeywods()

mark

public void mark()

reset

public void reset()

isEOF

public boolean isEOF()

token

public final Token token()
Return the current token, set by nextToken().


info

public String info()

nextToken

public final void nextToken()

scanVariable

public void scanVariable()

scanComment

public void scanComment()

scanIdentifier

public void scanIdentifier()

scanNumber

public void scanNumber()

scanHexaDecimal

public void scanHexaDecimal()

hexString

public String hexString()

isDigit

public final boolean isDigit(char ch)

pos

public final int pos()
Return the current token's position: a 0-based offset from beginning of the raw input stream (before unicode translation)


stringVal

public final String stringVal()
The value of a literal token, recorded as a string. For integers, leading 0x and 'l' suffixes are suppressed.


integerValue

public Number integerValue()

bp

public int bp()

current

public char current()

reset

public void reset(int mark,
                  char markChar,
                  Token token)

numberString

public final String numberString()

decimalValue

public BigDecimal decimalValue()


Copyright © 2012 Alibaba Group. All Rights Reserved.