diff options
author | Martin Odersky <odersky@gmail.com> | 2012-12-06 14:06:00 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-12-06 14:06:00 +0100 |
commit | 90962407e72d88f8f3249ade0f6bd60ff15af5ce (patch) | |
tree | 6b2fc0ba13bad7c4532ebf1df39b0b2f5d7e70b6 /src/dotty/tools/dotc/core/Contexts.scala | |
parent | 2308509d2651ee78e1122b5d61b798c984c96c4d (diff) | |
download | dotty-90962407e72d88f8f3249ade0f6bd60ff15af5ce.tar.gz dotty-90962407e72d88f8f3249ade0f6bd60ff15af5ce.tar.bz2 dotty-90962407e72d88f8f3249ade0f6bd60ff15af5ce.zip |
Initial commit
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala new file mode 100644 index 000000000..b13594f0b --- /dev/null +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -0,0 +1,47 @@ +package dotty.tools.dotc +package core + +import Decorators._ +import Periods._ +import Names._ +import Phases._ +import Types._ + +object Contexts { + + val NoContext: Context = null + + abstract class Context extends Periods { + val underlying: Context + val root: RootContext + val period: Period + def names: NameTable + def phase: Phase = ??? + + } + + abstract class SubContext(val underlying: Context) extends Context { + val root: RootContext = underlying.root + val period: Period = underlying.period + def names: NameTable = root.names + } + + class RootContext extends Context + with Symbols + with Denotations + with DenotationTransformers + with Types { + + val underlying: Context = throw new UnsupportedOperationException("RootContext.underlying") + + val root: RootContext = this + val period = periodOf(NoRunId, NoPhaseId) + val names: NameTable = new NameTable + val variance = 1 + + var lastPhaseId: Int = NoPhaseId + + } + + private final val initialUniquesCapacity = 4096 +}
\ No newline at end of file |