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.joni;
  21 
  22 import java.io.PrintStream;
  23 
  24 public interface Config {
  25     final int CHAR_TABLE_SIZE = 256;
  26 
  27     /* from jcodings */
  28     final boolean VANILLA = false;
  29     final int INTERNAL_ENC_CASE_FOLD_MULTI_CHAR = (1<<30);
  30     final int ENC_CASE_FOLD_MIN = INTERNAL_ENC_CASE_FOLD_MULTI_CHAR;
  31     final int ENC_CASE_FOLD_DEFAULT = ENC_CASE_FOLD_MIN;
  32     final boolean USE_CRNL_AS_LINE_TERMINATOR = false;
  33 
  34     final boolean USE_NAMED_GROUP = true;
  35     final boolean USE_SUBEXP_CALL = true;
  36     final boolean USE_BACKREF_WITH_LEVEL = true;                            /* \k<name+n>, \k<name-n> */
  37 
  38     final boolean USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT = true; /* /(?:()|())*\2/ */
  39     final boolean USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE = true;     /* /\n$/ =~ "\n" */
  40     final boolean USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR = false;
  41 
  42     final boolean CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS = true;
  43 
  44     final boolean USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE = false;
  45     final boolean USE_CAPTURE_HISTORY = false;
  46     final boolean USE_VARIABLE_META_CHARS = true;
  47     final boolean USE_WORD_BEGIN_END = true;                                /* "\<": word-begin, "\>": word-end */
  48     final boolean USE_POSIX_API_REGION_OPTION = true;                           /* needed for POSIX API support */
  49     final boolean USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE = true;
  50     final boolean USE_COMBINATION_EXPLOSION_CHECK = false;
  51 
  52     final int NREGION                   = 10;
  53     final int MAX_BACKREF_NUM           = 1000;
  54     final int MAX_REPEAT_NUM            = 100000;
  55     final int MAX_MULTI_BYTE_RANGES_NUM = 10000;
  56 
  57 
  58     final boolean USE_WARN = true;
  59 
  60     // internal config
  61     final boolean USE_PARSE_TREE_NODE_RECYCLE       = true;
  62     final boolean USE_OP_PUSH_OR_JUMP_EXACT         = true;
  63     final boolean USE_SHARED_CCLASS_TABLE                       = false;
  64     final boolean USE_QTFR_PEEK_NEXT                = true;
  65 
  66     final int INIT_MATCH_STACK_SIZE                 = 64;
  67     final int DEFAULT_MATCH_STACK_LIMIT_SIZE        = 0;        /* unlimited */
  68     final int NUMBER_OF_POOLED_STACKS               = 4;
  69 
  70 
  71 
  72     final boolean DONT_OPTIMIZE                     = false;
  73 
  74     final boolean USE_STRING_TEMPLATES              = true; // use embeded string templates in Regex object as byte arrays instead of compiling them into int bytecode array
  75 
  76 
  77     final int MAX_CAPTURE_HISTORY_GROUP             = 31;
  78 
  79 
  80     final int CHECK_STRING_THRESHOLD_LEN            = 7;
  81     final int CHECK_BUFF_MAX_SIZE                   = 0x4000;
  82 
  83     final boolean NON_UNICODE_SDW                   = true;
  84 
  85 
  86     final PrintStream log = System.out;
  87     final PrintStream err = System.err;
  88 
  89     final boolean DEBUG_ALL                         = false;
  90 
  91     final boolean DEBUG                             = DEBUG_ALL;
  92     final boolean DEBUG_PARSE_TREE                  = DEBUG_ALL;
  93     final boolean DEBUG_PARSE_TREE_RAW              = true;
  94     final boolean DEBUG_COMPILE                     = DEBUG_ALL;
  95     final boolean DEBUG_COMPILE_BYTE_CODE_INFO      = DEBUG_ALL;
  96     final boolean DEBUG_SEARCH                      = DEBUG_ALL;
  97     final boolean DEBUG_MATCH                       = DEBUG_ALL;
  98     final boolean DEBUG_ASM                         = true;
  99     final boolean DEBUG_ASM_EXEC                    = true;
 100 }