package scala.tools.nsc
package symtab
class Flags extends reflect.generic.Flags {
final val InitialFlags = 0x0001FFFFFFFFFFFFL
final val LateFlags = 0x00FE000000000000L
final val AntiFlags = 0x7F00000000000000L
final val LateShift = 47L
final val AntiShift = 56L
final val latePRIVATE = (PRIVATE: Long) << LateShift
final val lateABSTRACT = (ABSTRACT: Long) << LateShift
final val lateDEFERRED = (DEFERRED: Long) << LateShift
final val lateINTERFACE = (INTERFACE: Long) << LateShift
final val lateMODULE = (MODULE: Long) << LateShift
final val lateFINAL = (FINAL: Long) << LateShift
final val lateMETHOD = (METHOD: Long) << LateShift
final val notFINAL = (FINAL: Long) << AntiShift
final val notPRIVATE = (PRIVATE: Long) << AntiShift
final val notDEFERRED = (DEFERRED: Long) << AntiShift
final val notPROTECTED = (PROTECTED: Long) << AntiShift
final val notABSTRACT = (ABSTRACT: Long) << AntiShift
final val notOVERRIDE = (OVERRIDE: Long) << AntiShift
final val notMETHOD = (METHOD: Long) << AntiShift
final val notFlagMap = Map[Int, Long](
FINAL -> notFINAL,
PRIVATE -> notPRIVATE,
DEFERRED -> notDEFERRED,
PROTECTED -> notPROTECTED,
ABSTRACT -> notABSTRACT,
OVERRIDE -> notOVERRIDE,
METHOD -> notMETHOD
)
final val TopLevelCreationFlags: Long =
MODULE | PACKAGE | FINAL | JAVA
final val ExplicitFlags: Long =
PRIVATE | PROTECTED | ABSTRACT | FINAL | SEALED |
OVERRIDE | CASE | IMPLICIT | ABSOVERRIDE | LAZY
final val PrintableFlags: Long =
ExplicitFlags | LOCAL | SYNTHETIC | STABLE | CASEACCESSOR |
ACCESSOR | SUPERACCESSOR | PARAMACCESSOR | BRIDGE | STATIC | VBRIDGE | SPECIALIZED
final val BRIDGES = BRIDGE | VBRIDGE
final val FieldFlags: Long =
MUTABLE | CASEACCESSOR | PARAMACCESSOR | STATIC | FINAL | PRESUPER | LAZY
final val AccessFlags: Long = PRIVATE | PROTECTED | LOCAL
final val VarianceFlags = COVARIANT | CONTRAVARIANT
final val ConstrFlags: Long = JAVA
final val ModuleToClassFlags: Long = AccessFlags | MODULE | PACKAGE | CASE | SYNTHETIC | JAVA
def getterFlags(fieldFlags: Long): Long = ACCESSOR + (
if ((fieldFlags & MUTABLE) != 0) fieldFlags & ~MUTABLE & ~PRESUPER
else fieldFlags & ~PRESUPER | STABLE
)
def setterFlags(fieldFlags: Long): Long =
getterFlags(fieldFlags) & ~STABLE & ~CASEACCESSOR
@annotation.switch override def flagToString(flag: Long): String = flag match {
case PROTECTED => "protected"
case OVERRIDE => "override"
case PRIVATE => "private"
case ABSTRACT => "abstract"
case DEFERRED => "<deferred>"
case FINAL => "final"
case METHOD => "<method>"
case INTERFACE => "<interface>"
case MODULE => "<module>"
case IMPLICIT => "implicit"
case SEALED => "sealed"
case CASE => "case"
case MUTABLE => "<mutable>"
case PARAM => "<param>"
case PACKAGE => "<package>"
case 0x8000L => ""
case BYNAMEPARAM => "<bynameparam/captured/covariant>"
case CONTRAVARIANT => "<contravariant/inconstructor/label>"
case ABSOVERRIDE => "absoverride"
case LOCAL => "<local>"
case JAVA => "<java>"
case SYNTHETIC => "<synthetic>"
case STABLE => "<stable>"
case STATIC => "<static>"
case CASEACCESSOR => "<caseaccessor>"
case DEFAULTPARAM => "<defaultparam/trait>"
case BRIDGE => "<bridge>"
case ACCESSOR => "<accessor>"
case SUPERACCESSOR => "<superaccessor>"
case PARAMACCESSOR => "<paramaccessor>"
case MODULEVAR => "<modulevar>"
case LAZY => "lazy"
case IS_ERROR => "<is_error>"
case OVERLOADED => "<overloaded>"
case LIFTED => "<lifted>"
case EXISTENTIAL => "<existential/mixedin>"
case EXPANDEDNAME => "<expandedname>"
case IMPLCLASS => "<implclass/presuper>"
case TRANS_FLAG => "<trans_flag>"
case LOCKED => "<locked>"
case SPECIALIZED => "<specialized>"
case DEFAULTINIT => "<defaultinit>"
case VBRIDGE => "<vbridge>"
case VARARGS => "<varargs>"
case 0x100000000000L => ""
case 0x200000000000L => ""
case 0x400000000000L => ""
case 0x800000000000L => ""
case 0x1000000000000L => ""
case `latePRIVATE` => "<lateprivate>"
case `lateABSTRACT` => "<lateabstract>"
case `lateDEFERRED` => "<latedeferred>"
case `lateFINAL` => "<latefinal>"
case `lateMETHOD` => "<latemethod>"
case `lateINTERFACE` => "<lateinterface>"
case `lateMODULE` => "<latemodule>"
case `notPROTECTED` => "<notprotected>"
case `notOVERRIDE` => "<notoverride>"
case `notPRIVATE` => "<notprivate>"
case `notABSTRACT` => "<notabstract>"
case `notDEFERRED` => "<notdeferred>"
case `notFINAL` => "<notfinal>"
case `notMETHOD` => "<notmethod>"
case 0x8000000000000000L => ""
case _ => ""
}
}
object Flags extends Flags { }