From cddc4c3cf51354e9e697fbefdac591f25d6bbc73 Mon Sep 17 00:00:00 2001 From: michelou Date: Tue, 22 Jan 2008 12:48:53 +0000 Subject: added comments --- .../nsc/symtab/classfile/ClassfileConstants.scala | 82 +++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala index e55564ad49..3b60a45b0f 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileConstants.scala @@ -1,5 +1,5 @@ /* NSC -- new Scala compiler - * Copyright 2005-2006 LAMP/EPFL + * Copyright 2005-2008 LAMP/EPFL * @author Martin Odersky */ // $Id$ @@ -12,6 +12,86 @@ object ClassfileConstants { final val JAVA_MAJOR_VERSION = 45 final val JAVA_MINOR_VERSION = 3 + /**

+ * (see http://java.sun.com/docs/books/jvms/second_edition/jvms-clarify.html) + *

+ *

+ * Table 4.1 Class access and property flags + * ------------------------------------------ + * ACC_PUBLIC Declared public; may be accessed from + * outside its package. + * ACC_FINAL Declared final; no subclasses allowed. + * ACC_SUPER Treat superclass methodsd specially when invoked by the + * invokespecial instruction. + * ACC_INTERFACE Is an interface, not a class. + * ACC_ABSTRACT Declared abstract; must not be instantiated. + * ACC_SYNTHETIC Declared synthetic; not present in the source code. + * ACC_ANNOTATION Declared as an annotation type. + * ACC_ENUM Declared as an enum type. + *

+ *

+ * If the ACC_INTERFACE flag is set, the ACC_ABSTRACT + * flag must also be set (ch. 2.13.1). + *

+ *

+ * A class file cannot have both its ACC_FINAL and + * ACC_ABSTRACT flags set (ch. 2.8.2). + *

+ *

+ * Table 4.4 Field access and property flags + * ------------------------------------------ + * ACC_PUBLIC See Table 4.1. + * ACC_PRIVATE Declared private; usable only within + * the defining class. + * ACC_PROTECTED Declared protected; may be accessed within + * subclasses. + * ACC_STATIC Declared static. + * ACC_FINAL Declared final; no further assignment after + * initialization. + * ACC_VOLATILE Declared volatile; cannot be cached. + * ACC_TRANSIENT Declared transient; not written or read by + * a persistent object manager. + * ACC_SYNTHETIC Declared synthetic; not present in the source code. + * ACC_ENUM Declared as an element of an enum. + *

+ *

+ * A field may have at most one of its ACC_PRIVATE, + * ACC_PROTECTED, ACC_PUBLIC flags set (ch. 2.7.4). + *

+ *

+ * A field may not have both its ACC_FINAL and + * ACC_VOLATILE flags set (ch. 2.9.1). + *

+ *

+ * Table 4.5 Method access and property flags + * ------------------------------------------- + * ACC_PUBLIC See Table 4.4. + * ACC_PRIVATE See Table 4.4. + * ACC_PROTECTED See Table 4.4. + * ACC_STATIC See Table 4.4. + * ACC_FINAL Declared final; must no be overridden. + * ACC_SYNCHRONIZED Declared synchronized; + * ACC_BRIDGE A bridge method, generated by the compiler. + * ACC_VARARGS Declared with variable number of arguments. + * ACC_NATIVE Declared native: implemented in a + * language other than Java. + * ACC_ABSTRACT Declared abstract; no implementation + * is provided. + * ACC_STRICT Declared strictfp, floating-point mode + * is FP-strict. + * ACC_SYNTHETIC See Table 4.4. + *

+ *

+ * If a method has its ACC_ABSTRACT flag set it must not + * have any of its ACC_FINAL, ACC_NATIVE, + * ACC_PRIVATE, ACC_STATIC, ACC_STRICT, + * or ACC_SYNCHRONIZED flags set (ch. 2.13.3.2). + *

+ *

+ * All interface methods must have their ACC_ABSTRACT and + * ACC_PUBLIC flags set. + *

+ */ final val JAVA_ACC_PUBLIC = 0x0001 final val JAVA_ACC_PRIVATE = 0x0002 final val JAVA_ACC_PROTECTED = 0x0004 -- cgit v1.2.3