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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.classfmt;
13 import net.sourceforge.phpdt.internal.compiler.ast.ASTNode;
15 public interface ClassFileConstants {
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;
42 int AccSuper = 0x0020;
45 * Extra flags for types and members attributes.
47 int AccAnnotationDefault = ASTNode.Bit18; // indicate presence of an attribute "DefaultValue" (annotation method)
48 int AccDeprecated = ASTNode.Bit21; // indicate presence of an attribute "Deprecated"
58 int MethodRefTag = 10;
59 int InterfaceMethodRefTag = 11;
60 int NameAndTypeTag = 12;
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;
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;
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;
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;
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
102 long CLDC_1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_4;
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;
110 int BOOLEAN_ARRAY = 4;
115 int DOUBLE_ARRAY = 7;
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