1 /*
  2  * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */
 23 package org.openjdk.asmtools.jasm;
 24 
 25 /**
 26  * This interface defines constant that are used throughout the compiler. It inherits from
 27  * RuntimeConstants, which is an autogenerated class that contains constants defined in
 28  * the interpreter.
 29  */
 30 public interface Constants extends RuntimeConstants {
 31 
 32 
 33     /**
 34      * End of input
 35      */
 36     public static final int EOF        = -1;
 37 
 38     /*
 39      * Flags
 40      */
 41     public static final int F_VERBOSE        = 1 << 0;
 42     public static final int F_DUMP           = 1 << 1;
 43     public static final int F_WARNINGS       = 1 << 2;
 44     public static final int F_DEBUG          = 1 << 3;
 45     public static final int F_OPTIMIZE       = 1 << 4;
 46     public static final int F_DEPENDENCIES   = 1 << 5;
 47 
 48     /*
 49      * Type codes
 50      */
 51     public static final int TC_BOOLEAN   = 0;
 52     public static final int TC_BYTE      = 1;
 53     public static final int TC_CHAR      = 2;
 54     public static final int TC_SHORT     = 3;
 55     public static final int TC_INT       = 4;
 56     public static final int TC_LONG      = 5;
 57     public static final int TC_FLOAT     = 6;
 58     public static final int TC_DOUBLE    = 7;
 59     public static final int TC_NULL      = 8;
 60     public static final int TC_ARRAY     = 9;
 61     public static final int TC_CLASS     = 10;
 62     public static final int TC_VOID      = 11;
 63     public static final int TC_METHOD    = 12;
 64     public static final int TC_ERROR     = 13;
 65 
 66     /*
 67      * Type Masks
 68      */
 69     public static final int TM_NULL      = 1 << TC_NULL;
 70     public static final int TM_VOID      = 1 << TC_VOID;
 71     public static final int TM_BOOLEAN   = 1 << TC_BOOLEAN;
 72     public static final int TM_BYTE      = 1 << TC_BYTE;
 73     public static final int TM_CHAR      = 1 << TC_CHAR;
 74     public static final int TM_SHORT     = 1 << TC_SHORT;
 75     public static final int TM_INT       = 1 << TC_INT;
 76     public static final int TM_LONG      = 1 << TC_LONG;
 77     public static final int TM_FLOAT     = 1 << TC_FLOAT;
 78     public static final int TM_DOUBLE    = 1 << TC_DOUBLE;
 79     public static final int TM_ARRAY     = 1 << TC_ARRAY;
 80     public static final int TM_CLASS     = 1 << TC_CLASS;
 81     public static final int TM_METHOD    = 1 << TC_METHOD;
 82     public static final int TM_ERROR     = 1 << TC_ERROR;
 83 
 84     public static final int TM_INT32     = TM_BYTE | TM_SHORT | TM_CHAR | TM_INT;
 85     public static final int TM_NUM32     = TM_INT32 | TM_FLOAT;
 86     public static final int TM_NUM64     = TM_LONG | TM_DOUBLE;
 87     public static final int TM_INTEGER   = TM_INT32 | TM_LONG;
 88     public static final int TM_REAL      = TM_FLOAT | TM_DOUBLE;
 89     public static final int TM_NUMBER    = TM_INTEGER | TM_REAL;
 90     public static final int TM_REFERENCE = TM_ARRAY | TM_CLASS | TM_NULL;
 91 
 92     /*
 93      * Class status
 94      */
 95     public static final int CS_UNDEFINED        = 0;
 96     public static final int CS_UNDECIDED        = 1;
 97     public static final int CS_BINARY           = 2;
 98     public static final int CS_SOURCE           = 3;
 99     public static final int CS_PARSED           = 4;
100     public static final int CS_COMPILED         = 5;
101     public static final int CS_NOTFOUND         = 6;
102 
103     /*
104      * Attributes
105      */
106     public static final int ATT_ALL             = -1;
107     public static final int ATT_CODE            = 1;
108 
109     /*
110      * Number of bits used in file offsets
111      */
112     public static final int OFFSETBITS          = 19;
113     public static final int MAXFILESIZE         = (1 << OFFSETBITS) - 1;
114     public static final int MAXLINENUMBER       = (1 << (32 - OFFSETBITS)) - 1;
115 
116     /*
117      * Operator precedence
118      */
119     /* Who uses this????
120     public static final int opPrecedence[] = {
121         10,  11,  11,  11,  11,  11,  11,  11,  11,  11,
122         11,  11,  11,  12,  13,  14,  15,  16,  17,  18,
123         18,  19,  19,  19,  19,  19,  20,  20,  20,  21,
124         21,  22,  22,  22,  23,  24,  24,  24,  24,  24,
125         24,  25,  25,  26,  26,  26,  26,  26,  26
126     };
127     * */
128 }