【Java开源代码栏目提醒】:网学会员为需要Java开源代码的朋友们搜集整理了TreeLableTokenTypesEnum.java相关资料,希望对各位网友有所帮助!
package com.cownew.SQLParser.ast.node.enumdef;
/**
*
* There are two types tokens in the AST.
* One type of them is replaced by special class,while the other type tokens have no sence and are only used for lable.
* This TreeLableTokenTypesEnum contains the latter ones.
* Thus all the tokens in this class are the nosence tokens which are not replaced with class other than SQLBaseAST and which are only used for tree labels.
* @author KingChou
*
*/
public enum TreeLableTokenTypesEnum {
//all clause
SET_CLAUSE(TokenTypes.SET_CLAUSE),
FROM_CLAUSE(TokenTypes.FROM_CLAUSE),
WHERE_CLAUSE(TokenTypes.WHERE_CLAUSE),
GROUP_BY_CLAUSE(TokenTypes.GROUP_BY_CLAUSE),
HAVING_CLAUSE(TokenTypes.HAVING_CLAUSE),
ORDER_BY_CLAUSE(TokenTypes.ORDER_BY_CLAUSE),
//all element
COLUMN_ELEMENTS(TokenTypes.COLUMN_ELEMENTS),
//COLUMN_NAME(TokenTypes.COLUMN_NAME),
VALUE_ELEMENTS(TokenTypes.VALUE_ELEMENTS),
//TOP_ELEMENT(TokenTypes.TOP_ELEMENT)
AGGREGATE_TYPE(TokenTypes.AGGREGATE_TYPE),
UNION(TokenTypes.UNION),
FUNCTION_PARAMETERS(TokenTypes.FUNCTION_PARAMETERS)
;
int type;
TreeLableTokenTypesEnum(int type){
this.type=type;
}
public int transformToTokenType(){
return type;
//TokenTypes.class.getField()
}
public static void main(String[] arg){
//TreeLableTokenTypesEnum a=TreeLableTokenTypesEnum.FROM_CLAUSE;
TreeLableTokenTypesEnum[]list=TreeLableTokenTypesEnum.values();
for(TreeLableTokenTypesEnum t:list){
System.out.println(t.toString()+":"+t.name()+":"+t.transformToTokenType());
}
}
}