001package gudusoft.gsqlparser.nodes; 002 003import gudusoft.gsqlparser.*; 004import gudusoft.gsqlparser.stmt.TShowStmt; 005 006import java.util.ArrayList; 007 008 009public class TDummy extends TParseTreeNode { 010 public EDbVendor dbvendor; 011 public int int1 = 0; 012 public int int2 = 0; 013 public TSourceToken st1 = null; 014 public TSourceToken st2 = null; 015 public TSourceToken st3 = null; 016 public TParseTreeNode node1 = null; 017 public TParseTreeNode node2 = null; 018 public TParseTreeNode node3 = null; 019 public TParseTreeNodeList list1 = null; 020 public TParseTreeNodeList list2 = null; 021 public EDbObjectType objectType = EDbObjectType.table; 022 public EIndexType indexType; 023 public EJoinType joinType; 024 public ESortType sortType; 025 public ETableKind tableKind; 026 public TObjectNameList objectNameList; 027 public TPTNodeList<TObjectNameList> objectNameListTPTNodeList; 028 public ELockMode lockMode; 029 public ArrayList<TCreateTableOption> tableOptions; 030 public TShowStmt.EShowType showType; 031 public ArrayList arrayList1 = null; 032 public ArrayList<TSourceToken> tokens = new ArrayList<>(); 033 public void addTokens(ArrayList<TSourceToken> tokens){ 034 this.tokens.addAll(tokens); 035 } 036 037 // Used for DROP ... IF EXISTS support 038 public boolean ifExists = false; 039 040 /* 041 * used in sql server yacc rule file, when use TDummy to represent statements 042 * like commit,go and etc, this property to determine which kind of statement this 043 * dummy node represents for. 044 */ 045 public ESqlStatementType sqlstatementtype = ESqlStatementType.sstunknown; 046 047 048 public void init(Object arg1) 049 { 050 if (arg1 instanceof TParseTreeNodeList){ 051 list1 = (TParseTreeNodeList)arg1; 052 }else if (arg1 instanceof TSourceToken){ 053 st1 = (TSourceToken)arg1; 054 }else if (arg1 instanceof TConstant){ 055 node1 = (TConstant)arg1; 056 }else if (arg1 instanceof TParseTreeNode){ 057 node1 = (TParseTreeNode)arg1; 058 }else if (arg1 instanceof ArrayList){ 059 arrayList1 = (ArrayList) arg1; 060 } 061 } 062 063 public void init(Object arg1, Object arg2) 064 { 065 init(arg1); 066 if (arg2 instanceof TParseTreeNodeList){ 067 list2 = (TParseTreeNodeList)arg2; 068 }else if (arg2 instanceof TSourceToken){ 069 st2 = (TSourceToken)arg2; 070 }else if (arg2 instanceof TParseTreeNode){ 071 node2 = (TParseTreeNode)arg2; 072 } 073 } 074 075}