org.eclipse.datatools.sqltools.parsers.sql.lexer
Class SQLCharacterKindMap

java.lang.Object
  extended by org.eclipse.datatools.sqltools.parsers.sql.lexer.SQLCharacterKindMap
All Implemented Interfaces:
SQLLexersym

public class SQLCharacterKindMap
extends java.lang.Object
implements SQLLexersym

Every character that the lexer recognizes will be given a Token kind. This SQLCharacterKindMap provides the mapping from ASCII-code of a character to its Token kind, see getTokenKind(int).

Author:
ckadner

Field Summary
 
Fields inherited from interface org.eclipse.datatools.sqltools.parsers.sql.lexer.SQLLexersym
Char__, Char_0, Char_1, Char_2, Char_3, Char_4, Char_5, Char_6, Char_7, Char_8, Char_9, Char_A, Char_AfterASCII, Char_Ampersand, Char_AtSign, Char_B, Char_BackQuote, Char_BackSlash, Char_C, Char_Caret, Char_Colon, Char_Comma, Char_CR, Char_CtlCharNotWS, Char_D, Char_DelimIdQt, Char_DollarSign, Char_Dot, Char_DoubleQuote, Char_E, Char_EOF, Char_Equal, Char_Exclaimation, Char_F, Char_FF, Char_G, Char_GreaterThan, Char_H, Char_HostVarPrfx, Char_HT, Char_I, Char_J, Char_K, Char_L, Char_LeftBrace, Char_LeftBracket, Char_LeftParen, Char_LessThan, Char_LF, Char_M, Char_Minus, Char_N, Char_O, Char_P, Char_ParamMark, Char_Percent, Char_Plus, Char_Q, Char_QuestionMark, Char_R, Char_RightBrace, Char_RightBracket, Char_RightParen, Char_S, Char_SemiColon, Char_Sharp, Char_SingleQuote, Char_Slash, Char_Space, Char_Star, Char_StmtTerm, Char_T, Char_Tilde, Char_U, Char_V, Char_VerticalBar, Char_W, Char_X, Char_Y, Char_Z, isValidForParser, orderedTerminalSymbols
 
Constructor Summary
SQLCharacterKindMap()
          Constructs a new SQLCharacterKindMap.
 
Method Summary
 int getTokenKind(int asciiCode)
           
 void setTokenKind(int asciiCode, int newTokenKind)
           Note: A specific Token kind can only be given to one character!
 void unsetTokenKind(int oldTokenKind)
          If the given Token kind was previously mapped to an ASCII-code, the mapping will be removed, restoring the ASCII-code mapping that was active before the given Token kind was mapped.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLCharacterKindMap

public SQLCharacterKindMap()
Constructs a new SQLCharacterKindMap.

Method Detail

getTokenKind

public int getTokenKind(int asciiCode)
Returns:
Returns the tokenKind for the given asciiCode.

setTokenKind

public void setTokenKind(int asciiCode,
                         int newTokenKind)

Note: A specific Token kind can only be given to one character!

Parameters:
asciiCode - The ASCII-code of the character to set the Token kind for
newTokenKind - The tokenKind to set.

unsetTokenKind

public void unsetTokenKind(int oldTokenKind)
If the given Token kind was previously mapped to an ASCII-code, the mapping will be removed, restoring the ASCII-code mapping that was active before the given Token kind was mapped.

Note: There can only be one ASCII-code mapping for one Token kind

Parameters:
oldTokenKind - the Token kind not to be mapped anymore by any entry in the tokenKind array