001package gudusoft.gsqlparser.nodes.postgresql; 002 003import gudusoft.gsqlparser.nodes.TConstant; 004import gudusoft.gsqlparser.nodes.TExpressionList; 005import gudusoft.gsqlparser.nodes.TParseTreeNode; 006import gudusoft.gsqlparser.nodes.TParseTreeVisitor; 007 008 009public class TPartitionBoundSpecSqlNode extends TParseTreeNode { 010 011 // https://www.postgresql.org/docs/current/sql-createtable.html 012 013 private TExpressionList partition_bound_expr_list; 014 private TExpressionList partition_bound_expr_list_from; 015 private TExpressionList partition_bound_expr_list_to; 016 017 private TConstant modulus_numeric_literal; 018 private TConstant remainder_numeric_literal; 019 020 public enum ESpecType {typeIn,typeFromTo,typeWith,typeDefault}; 021 022 private ESpecType specType; 023 024 public TExpressionList getPartition_bound_expr_list() { 025 return partition_bound_expr_list; 026 } 027 028 public TExpressionList getPartition_bound_expr_list_from() { 029 return partition_bound_expr_list_from; 030 } 031 032 public TExpressionList getPartition_bound_expr_list_to() { 033 return partition_bound_expr_list_to; 034 } 035 036 public TConstant getModulus_numeric_literal() { 037 return modulus_numeric_literal; 038 } 039 040 public TConstant getRemainder_numeric_literal() { 041 return remainder_numeric_literal; 042 } 043 044 public ESpecType getSpecType() { 045 return specType; 046 } 047 048 public void init(Object arg1){ 049 specType = (ESpecType) arg1; 050 } 051 052 public void init(Object arg1,Object arg2){ 053 init(arg1); 054 switch (specType){ 055 case typeIn: 056 partition_bound_expr_list = (TExpressionList)arg2; 057 break; 058 } 059 } 060 061 public void init(Object arg1,Object arg2,Object arg3){ 062 init(arg1); 063 switch (specType){ 064 case typeFromTo: 065 partition_bound_expr_list_from = (TExpressionList)arg2; 066 partition_bound_expr_list_to = (TExpressionList)arg3; 067 break; 068 } 069 } 070 071 public void accept(TParseTreeVisitor v){ 072 v.preVisit(this); 073 v.postVisit(this); 074 } 075 076 public void acceptChildren(TParseTreeVisitor v){ 077 v.preVisit(this); 078 v.postVisit(this); 079 } 080 081}