treeflag.def
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:9k
源码类别:

SQL Server

开发平台:

Unix_Linux

  1. /*
  2.  * treeflag.def  - description of flags, used by GNU SQL compiler
  3.  *                 tree library
  4.  *
  5.  *  This file is a part of GNU SQL Server
  6.  *
  7.  *  Copyright (c) 1996, 1997, Free Software Foundation, Inc
  8.  *  Developed at the Institute of System Programming, Russia
  9.  *  This file is written by Michael Kimelman
  10.  *
  11.  *  This program is free software; you can redistribute it and/or modify
  12.  *  it under the terms of the GNU General Public License as published by
  13.  *  the Free Software Foundation; either version 2 of the License, or
  14.  *  (at your option) any later version.
  15.  *
  16.  *  This program is distributed in the hope that it will be useful,
  17.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  *  GNU General Public License for more details.
  20.  *
  21.  *  You should have received a copy of the GNU General Public License
  22.  *  along with this program; if not, write to the Free Software
  23.  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24.  *
  25.  *  Contact:  gss@ispras.ru
  26.  *
  27.  */
  28. /* $Id: treeflag.def,v 1.245 1997/03/31 03:46:38 kml Exp $ */
  29. /*************************************************************************
  30. *      All flags used in the tree nodes has to be described in this file. *
  31. * Each flag assotiated with a bit in the node mask. So it's impossible to *
  32. * apply more than 32 flag to a node. Flags are assotiated with  nodes  by *
  33. * flags` group identifier. Each node description contain  list  of  flags *
  34. * group identifier and each flag description specify the group. Format of *
  35. * flag`s description is given below                                       *
  36. *                                                                         *
  37. *    DEF_FLAG_BIT(FLAGNAME,"flagname",'0',bit_no)                         *
  38. *    DEF_FLAG    (FLAGNAME,"flagname",'0')                                *
  39. *                                                                         *
  40. * where:                                                                  *
  41. *   FLAGNAME  -  flag code, used as a symbolic constant in compiler       *
  42. *  "flagname" -  string, which contains the same literal as a  FLAGNAME,  *
  43. *                but in a bit more readable form. Used in dumps as image  *
  44. *                of FLAGNAME                                              *
  45. *         Note: uppercase("flagname") = "FLAGNAME"  - it`s important for  *
  46. *               tree recognizer.                                          *
  47. *  '0'        -  flags' group identifier;                                 *
  48. *  bit_no     -  number of bit, assotiated with this flag                 *
  49. *         (used in assignment for enumeration constant. if this parameter *
  50. *          omitted - def_flag - the assignment for current enum constant  *
  51. *          will be omitted and curent_bit_no = previous_bit_no + 1      ) *
  52. *************************************************************************/
  53. /*-----------------------------------------------------------------------*
  54. !*   group  '0' - general purpose flags                            * bit *!
  55. *      VCB_F  -  vocabulary node                                  * No  */
  56.     DEF_FLAG(OP_B0_F   ,"op_b0_f"   ,'0')                         /*  0  */
  57.     DEF_FLAG(OP_B1_F   ,"op_b1_f"   ,'0')                         /*  1  */
  58.     DEF_FLAG(OP_B2_F   ,"op_b2_f"   ,'0')                         /*  2  */
  59.     DEF_FLAG(OP_B3_F   ,"op_b3_f"   ,'0')                         /*  3  */
  60.     DEF_FLAG(VCB_F     ,"vcb_f"     ,'0')                         /*  0+4*/
  61.     DEF_FLAG(LIST_F    ,"list"      ,'0')                         /*  5  */
  62.     DEF_FLAG(EXIST_OP_F,"exist_op"  ,'0')                         /*  6  */
  63.     DEF_FLAG(EXACT_F   ,"exact"     ,'0')                         /*  7  */
  64.     DEF_FLAG(PATTERN_F ,"pattern_f" ,'0')                         /*  8  */
  65.     DEF_FLAG(ACTION_F  ,"action_f"  ,'0')                         /*  9  */
  66.     DEF_FLAG(MARK1_F   ,"mark1_f"   ,'0')                         /* 10  */
  67.     DEF_FLAG(MARK_CMP_F,"mark_cmp_f",'0')                         /* 11  */
  68.     DEF_FLAG(MARK_CYC_F,"mark_cyc_f",'0')                         /* 12  */
  69.     DEF_FLAG(DEL_CUR_F ,"del_cur_f" ,'0')                         /* 13  */
  70.     DEF_FLAG(RO_F      ,"RO_f"      ,'0')                         /* 14  */
  71.     DEF_FLAG(MARK_F    ,"mark_f"    ,'0')                         /* 15  */
  72. /*      MARK_F  -  this remark used to avoid cycling.                    */
  73. /*                 It should be the last general purpose flag            */
  74. /*-----------------------------------------------------------------------*/
  75. /*   group  't' - table expressions flags                                */
  76.     DEF_FLAG_BIT(WHERE_F,"where_f"     ,'t',bt_MARK_F+1)          /* 16  */
  77.     DEF_FLAG(GROUP_F    ,"group_f"     ,'t')                      /* 17  */
  78.     DEF_FLAG(HAVING_F   ,"having_f"    ,'t')                      /* 18  */
  79.     DEF_FLAG(SUBQUERY_F ,"subquery_f"  ,'t')                      /* 19  */
  80.     DEF_FLAG(UPDATABLE_F,"updateable_f",'t')                      /* 20  */
  81. /*-----------------------------------------------------------------*-----*/
  82. /*   group  's' - flags of queries (select) and agregate functions *     */
  83. /*-----------------------------------------------------------------*-----*/
  84.     DEF_FLAG_BIT(DISTINCT_F,"distinct_f",'s',bt_UPDATABLE_F+1)    /* 21  */
  85.     DEF_FLAG(GROUP_BY_F    ,"group_by_f",'s')                     /* 22  */
  86.     DEF_FLAG(EMPTY_F       ,"empty_f"   ,'s')                     /* 23  */
  87. /*-----------------------------------------------------------------------*/
  88. /*   group  'r' - cursor flag                                            */
  89.     DEF_FLAG_BIT(UPD_CURS_F,"upd_curs_f",'r',bt_MARK_F+1)         /* 16  */
  90.     DEF_FLAG(ORDER_F       ,"order_f"   ,'r')                     /* 17  */
  91.     DEF_FLAG(CURS_DEL_F    ,"curs_del_f",'r')                     /* 18  */
  92.     DEF_FLAG(CURS_UPD_F    ,"curs_upd_f",'r')                     /* 19  */
  93. /*-----------------------------------------------------------------------*/
  94. /*   group  'c' - flags of sort direction                                */
  95.     DEF_FLAG_BIT(DESC_F    ,"desc_f"    ,'c',bt_MARK_F+1)         /* 16  */
  96. /*-----------------------------------------------------------------------*/
  97. /*   group  'u' - union's flags                                          */
  98.     DEF_FLAG_BIT(ALL_F,"all_f",'u',bt_MARK_F+1)                   /* 16  */
  99. /*-----------------------------------------------------------------------*/
  100. /*   group  'T' - tables', scans' and parameters' flags                  */
  101.     DEF_FLAG_BIT(CHECKED_F,"Checked_f"   , 'T',bt_MARK_F+1)       /* 16  */
  102.     DEF_FLAG(CHECK_OPT_F , "Check_Opt_f" , 'T')                   /* 17  */
  103.     DEF_FLAG(OUT_F       , "out_f"       , 'T')                   /* 18  */
  104.     DEF_FLAG(INDICATOR_F , "indicator_f" , 'T')                   /* 19  */
  105.     DEF_FLAG(PSEUDO_F    , "pseudo_f"    , 'T')                   /* 20  */
  106. /*-----------------------------------------------------------------------*/
  107. /*   group  'o' - predicate flags                                        */
  108.     DEF_FLAG_BIT(QUANTIF_F,"quantif_f",'o',bt_MARK_F+1)           /* 16  */
  109.     DEF_FLAG(SOME_F       ,"some_f"   ,'o')                       /* 17  */
  110.     DEF_FLAG(SIMPLE_F     ,"simple_f" ,'o')                       /* 18  */
  111. /*-----------------------------------------------------------------------*/
  112. /*   group  'i' - Insert node flags                                      */
  113.     DEF_FLAG_BIT(COLUMNS_F,"columns_f",'i',bt_MARK_F+1)           /* 16  */
  114.     DEF_FLAG(QUERY_F      ,"query_f"  ,'i')                       /* 17  */
  115. /*-----------------------------------------------------------------------*/
  116. /*   group  'I' - kitty constructors flags (and INSERT command as well)  */
  117.     DEF_FLAG_BIT(BEFORE_F ,"before"   ,'I',bt_MARK_F+1)           /* 16  */
  118.     DEF_FLAG(TREE_F       ,"tree"     ,'I')                       /* 17  */
  119. /*-----------------------------------------------------------------------*/
  120. /*   group  'G' - GRANT's flag                                           */
  121.     DEF_FLAG_BIT(GRANT_OPT_F,"grant_opt_f",'G',bt_MARK_F+1)       /* 16  */
  122. /*-----------------------------------------------------------------------*/
  123. /*   group  'v' - GRANT's flag                                           */
  124.     DEF_FLAG_BIT(HAS_VCB_F,"has_vcb_f",'v',gmax(bt_QUERY_F,bt_EMPTY_F)+1) 
  125. /*-----------------------------------------------------------------------*/
  126. /*   group  'R' - RULE`s flag                                            */
  127.     DEF_FLAG_BIT(STATIC_F,"static",'R',bt_MARK_F+1)               /* 16  */
  128. /*-----------------------------------------------------------------------*/
  129. /*   group  'a' - SWITCH construction of kitty flag                      */
  130.     DEF_FLAG_BIT(CYCLE_F,"cycle",'a',bt_MARK_F+1)                 /* 16  */
  131. /*-----------------------------------------------------------------------*/
  132. #if 0
  133. /*-----------------------------------------------------------------------*/
  134. /*   group  'x' - new flags` group                                       */
  135.     DEF_FLAG_BIT(FLAGNAME,"flagname",'x',bit_no)                  /* 16  */
  136.     DEF_FLAG    (FLAGNAME,"flagname",'x')                         /* 17  */
  137. /*-----------------------------------------------------------------------*/
  138. #endif
  139. #undef  DEF_FLAG_BIT
  140. #undef  DEF_FLAG