Initial upgrade to Platform/JDT 3.4.1
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / classfmt / ClassFileConstants.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2008 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.classfmt;
12
13 import net.sourceforge.phpdt.internal.compiler.ast.ASTNode;
14
15 public interface ClassFileConstants {
16         
17         int AccDefault = 0;
18         /*
19          * Modifiers
20          */
21         int AccPublic       = 0x0001;
22         int AccPrivate      = 0x0002;
23         int AccProtected    = 0x0004;
24         int AccStatic       = 0x0008;
25         int AccFinal        = 0x0010;
26         int AccSynchronized = 0x0020;
27         int AccVolatile     = 0x0040;
28         int AccBridge       = 0x0040;
29         int AccTransient    = 0x0080;
30         int AccVarargs      = 0x0080;
31         int AccNative       = 0x0100;
32         int AccInterface    = 0x0200;
33         int AccAbstract     = 0x0400;
34         int AccStrictfp     = 0x0800;
35         int AccSynthetic    = 0x1000;
36         int AccAnnotation   = 0x2000;
37         int AccEnum         = 0x4000;
38
39         /**
40          * Other VM flags.
41          */
42         int AccSuper = 0x0020;
43
44         /**
45          * Extra flags for types and members attributes.
46          */
47         int AccAnnotationDefault = ASTNode.Bit18; // indicate presence of an attribute  "DefaultValue" (annotation method)
48         int AccDeprecated = ASTNode.Bit21; // indicate presence of an attribute "Deprecated"
49
50         int Utf8Tag = 1;
51         int IntegerTag = 3;
52         int FloatTag = 4;
53         int LongTag = 5;
54         int DoubleTag = 6;
55         int ClassTag = 7;
56         int StringTag = 8;
57         int FieldRefTag = 9;
58         int MethodRefTag = 10;
59         int InterfaceMethodRefTag = 11;
60         int NameAndTypeTag = 12;
61         
62         int ConstantMethodRefFixedSize = 5;
63         int ConstantClassFixedSize = 3;
64         int ConstantDoubleFixedSize = 9;
65         int ConstantFieldRefFixedSize = 5;
66         int ConstantFloatFixedSize = 5;
67         int ConstantIntegerFixedSize = 5;
68         int ConstantInterfaceMethodRefFixedSize = 5;
69         int ConstantLongFixedSize = 9;
70         int ConstantStringFixedSize = 3;
71         int ConstantUtf8FixedSize = 3;
72         int ConstantNameAndTypeFixedSize = 5;
73         
74         int MAJOR_VERSION_1_1 = 45;
75         int MAJOR_VERSION_1_2 = 46;
76         int MAJOR_VERSION_1_3 = 47;
77         int MAJOR_VERSION_1_4 = 48;
78         int MAJOR_VERSION_1_5 = 49; 
79         int MAJOR_VERSION_1_6 = 50; 
80         int MAJOR_VERSION_1_7 = 51; 
81         
82         int MINOR_VERSION_0 = 0;
83         int MINOR_VERSION_1 = 1;
84         int MINOR_VERSION_2 = 2;
85         int MINOR_VERSION_3 = 3;
86         int MINOR_VERSION_4 = 4;
87
88         // JDK 1.1 -> 1.7, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
89         // 16 unsigned bits for major, then 16 bits for minor
90         long JDK1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_3; // 1.1. is 45.3
91         long JDK1_2 =  ((long)ClassFileConstants.MAJOR_VERSION_1_2 << 16) + ClassFileConstants.MINOR_VERSION_0;
92         long JDK1_3 =  ((long)ClassFileConstants.MAJOR_VERSION_1_3 << 16) + ClassFileConstants.MINOR_VERSION_0;
93         long JDK1_4 = ((long)ClassFileConstants.MAJOR_VERSION_1_4 << 16) + ClassFileConstants.MINOR_VERSION_0;
94         long JDK1_5 = ((long)ClassFileConstants.MAJOR_VERSION_1_5 << 16) + ClassFileConstants.MINOR_VERSION_0;  
95         long JDK1_6 = ((long)ClassFileConstants.MAJOR_VERSION_1_6 << 16) + ClassFileConstants.MINOR_VERSION_0;  
96         long JDK1_7 = ((long)ClassFileConstants.MAJOR_VERSION_1_7 << 16) + ClassFileConstants.MINOR_VERSION_0;  
97
98         /*
99          * cldc1.1 is 45.3, but we modify it to be different from JDK1_1.
100          * In the code gen, we will generate the same target value as JDK1_1
101          */ 
102         long CLDC_1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_4;
103
104         // jdk level used to denote future releases: optional behavior is not enabled for now, but may become so. In order to enable these,
105         // search for references to this constant, and change it to one of the official JDT constants above.
106         long JDK_DEFERRED = Long.MAX_VALUE;
107
108         int INT_ARRAY = 10;
109         int BYTE_ARRAY = 8;
110         int BOOLEAN_ARRAY = 4;
111         int SHORT_ARRAY = 9;
112         int CHAR_ARRAY = 5;
113         int LONG_ARRAY = 11;
114         int FLOAT_ARRAY = 6;
115         int DOUBLE_ARRAY = 7;
116
117         // Debug attributes
118         int ATTR_SOURCE = 0x1; // SourceFileAttribute
119         int ATTR_LINES = 0x2; // LineNumberAttribute
120         int ATTR_VARS = 0x4; // LocalVariableTableAttribute
121         int ATTR_STACK_MAP_TABLE = 0x8; // Stack map table attribute
122         int ATTR_STACK_MAP = 0x10; // Stack map attribute: cldc
123 }