1 /*
   2  * Permission is hereby granted, free of charge, to any person obtaining a copy of
   3  * this software and associated documentation files (the "Software"), to deal in
   4  * the Software without restriction, including without limitation the rights to
   5  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
   6  * of the Software, and to permit persons to whom the Software is furnished to do
   7  * so, subject to the following conditions:
   8  *
   9  * The above copyright notice and this permission notice shall be included in all
  10  * copies or substantial portions of the Software.
  11  *
  12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18  * SOFTWARE.
  19  */
  20 package jdk.nashorn.internal.runtime.regexp.joni.constants;
  21 
  22 @SuppressWarnings("javadoc")
  23 public interface NodeType {
  24     /* node type */
  25     final int  STR        = 0;
  26     final int  CCLASS     = 1;
  27     final int  CTYPE      = 2;
  28     final int  CANY       = 3;
  29     final int  BREF       = 4;
  30     final int  QTFR       = 5;
  31     final int  ENCLOSE    = 6;
  32     final int  ANCHOR     = 7;
  33     final int  LIST       = 8;
  34     final int  ALT        = 9;
  35     final int  CALL       = 10;
  36 
  37     final int BIT_STR        = 1 << STR;
  38     final int BIT_CCLASS     = 1 << CCLASS;
  39     final int BIT_CTYPE      = 1 << CTYPE;
  40     final int BIT_CANY       = 1 << CANY;
  41     final int BIT_BREF       = 1 << BREF;
  42     final int BIT_QTFR       = 1 << QTFR;
  43     final int BIT_ENCLOSE    = 1 << ENCLOSE;
  44     final int BIT_ANCHOR     = 1 << ANCHOR;
  45     final int BIT_LIST       = 1 << LIST;
  46     final int BIT_ALT        = 1 << ALT;
  47     final int BIT_CALL       = 1 << CALL;
  48 
  49     /* allowed node types in look-behind */
  50     final int ALLOWED_IN_LB = ( BIT_LIST |
  51                                 BIT_ALT |
  52                                 BIT_STR |
  53                                 BIT_CCLASS |
  54                                 BIT_CTYPE |
  55                                 BIT_CANY |
  56                                 BIT_ANCHOR |
  57                                 BIT_ENCLOSE |
  58                                 BIT_QTFR |
  59                                 BIT_CALL );
  60 
  61     final int SIMPLE =        ( BIT_STR |
  62                                 BIT_CCLASS |
  63                                 BIT_CTYPE |
  64                                 BIT_CANY |
  65                                 BIT_BREF);
  66 
  67 }