trait ReflectedRepository[R] extends AnyRef
A Bounded Combinatory Logic repository constructed from Scala code via reflection.
Use [ReflectedRepository.apply] of the companion object to obtain a new instance.
- R
the Scala type of the repository.
- Self Type
- ReflectedRepository[R]
- Alphabetic
- By Inheritance
- ReflectedRepository
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
sealed
trait
HasPriorJob[P] extends InhabitationBatchJob
An InhabitationBatchJob with more than one recorded job.
An InhabitationBatchJob with more than one recorded job.
- P
the combined native Scala type of prior requests.
-
sealed
trait
InhabitationBatchJob extends AnyRef
Combines multiple inhabitation requests into one more efficient batch job.
Combines multiple inhabitation requests into one more efficient batch job. Reuses shared intermediate results. Create new batch jobs using [InhabitationBatchJob.apply[R](Type*)] and [InhabitationBatchJob.addJob[R](Type*)].
Abstract Value Members
-
abstract
val
algorithm: InhabitationAlgorithm
The algorithm to use.
-
abstract
val
classLoader: ClassLoader
The class loader used for interpreting inhabitation results.
-
abstract
val
instance: R
Instance of the Scala repository.
-
abstract
val
semanticTaxonomy: Taxonomy
Taxonomy for semantic type information.
-
abstract
val
substitutionSpace: FiniteSubstitutionSpace
Finite restriction on well-formed substitutions.
-
abstract
val
typeTag: scala.reflect.api.JavaUniverse.WeakTypeTag[R]
Reflection information for the Scala repository.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addCombinator[C](combinator: C, position: Array[StackTraceElement] = ...)(implicit combinatorTag: scala.reflect.api.JavaUniverse.WeakTypeTag[C]): ReflectedRepository[R]
Build a new reflected repository, which additionaly includes
combinator.Build a new reflected repository, which additionaly includes
combinator. The combinator to add must have a single monomorphic apply method and can additionally include a fieldval semanticType: Type. Its name will be based on the class name ofC.- C
the type of the combinator object to add.
- combinator
the new combinator to include.
- position
the stack trace of the position where this method was called -- used to provide debugging information.
- combinatorTag
reflection information for
combinator.- returns
a new reflected repository augmented by
combinator.
-
def
applyMethodInfoFor(combinatorName: String, typeSignature: scala.reflect.api.JavaUniverse.Type): (Option[Seq[scala.reflect.api.JavaUniverse.Type]], scala.reflect.api.JavaUniverse.Type)
Extracts the type information of an apply method inside of the type described by
typeSignature.Extracts the type information of an apply method inside of the type described by
typeSignature. The apply method must be unique, declared via def, and cannot have type parameters.- returns
a pair of the parameter types and the result type, where the first component is None if there are no parameters (
def apply: A), or Some(Seq.empty), if there are empty parameters (def apply(): A).
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
lazy val
combinatorComponents: Map[String, CombinatorInfo]
A map from combinator names to reflected combinator information.
A map from combinator names to reflected combinator information. Obtained by findCombinatorComponents.
-
lazy val
combinators: Map[String, Type]
Maps all combinator names in this repository to their full (native Scala and semantic) intersection type.
-
def
dynamicCombinatorInfoFor[C](combinatorName: String, combinatorInstance: C, position: Array[StackTraceElement])(implicit combinatorTypeTag: scala.reflect.api.JavaUniverse.WeakTypeTag[C]): DynamicCombinatorInfo[C]
Obtains the DynamicCombinatorInfo for a single object programmatically added to the repository.
Obtains the DynamicCombinatorInfo for a single object programmatically added to the repository. The object must have an apply-Method found by applyMethodInfoFor. It can include a field
val semanticType: Type, which will be interpreted as the semantic type of the combinator. The latter interpretation internally performs locking, because the Scala runtime compiler used to dynamically obtain the field content is not thread safe.- combinatorName
the name of the combinator to add; it will be augmented by a random generated UUID avoiding name clashes.
- combinatorInstance
the object to obtain information for.
- position
a stack trace of the code position where the combinator is added -- required for debugging.
- returns
the DynamicCombinatorInfo for
combinatorInstance.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
evalInhabitant[T](inhabitant: Tree): T
Inteprets
inhabitantas an instance of typeT.Inteprets
inhabitantas an instance of typeT. Performs runtime compilation and maps each combinator application to a call to the apply method of the combinator's scala object. The caller is responsible for proving a correct typeT, otherwise runtime errors will occur. Reconstructs the shape (empty of no argument list) of the apply method fromcombinatorComponents. Example:evalInhabitant[Int](Tree("Foo", List(Tree("Bar"), Tree("Baz"))) = Foo.apply(Bar.apply, Baz.apply())
Uses the scala runtime compiler toolbox, which is not threadsafe.
- inhabitant
the inhabitant to interpret.
- returns
the interpreted inhabitant.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
findCombinatorComponents: Map[String, CombinatorInfo]
Performs reflection to find all objects in the Scala repository, which are annotated by combinator.
Performs reflection to find all objects in the Scala repository, which are annotated by combinator. Overload this to add additional combinators.
- returns
A map from combinator names to their reflected information.
- Attributes
- protected
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
inhabit[T](semanticTypes: Type*)(implicit targetTag: scala.reflect.api.JavaUniverse.WeakTypeTag[T]): InhabitationResult[T]
Uses type inhabitation relative to this reflected repository to obtain a result of Scala type
Tand the intersection of allsemanticTypes.Uses type inhabitation relative to this reflected repository to obtain a result of Scala type
Tand the intersection of allsemanticTypes.- T
the native Scala type to inhabit.
- semanticTypes
the semantic types to inhabit.
- targetTag
reflection information for the target type.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
nativeTypeTaxonomy: NativeTaxonomyBuilder
A taxonomy representing the subtype relationship of all Scala types in this repository.
-
lazy val
nativeTypes: Set[Constructor]
The set of all intersection types representing Scala types present in this reflected repository.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
lazy val
scalaTypes: Set[scala.reflect.api.JavaUniverse.Type]
The set of all scala types present in this reflected repository.
-
def
staticCombinatorInfoFor(combinatorName: String, typeSignature: scala.reflect.api.JavaUniverse.Type): StaticCombinatorInfo
Obtains the StaticCombinatorInfo for a single combinator-annotated object inside of the repository.
Obtains the StaticCombinatorInfo for a single combinator-annotated object inside of the repository. The object must have an apply-Method found by applyMethodInfoFor. It can include a field
val semanticType: Type, which will be interpreted as the semantic type of the combinator. The latter interpretation internally performs locking, because the Scala runtime compiler used to dynamically obtain the field content is not thread safe.- combinatorName
the name of the combinator to add.
- typeSignature
reflected type information of the combinator object.
- returns
the StaticCombinatorInfo for
typeSignature.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tb: ToolBox[universe.type]
The compiler toolbox used to runtime compile interpreted results.
The compiler toolbox used to runtime compile interpreted results.
- Attributes
- protected
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
object
InhabitationBatchJob
Helper object to create new batch jobs of inhabitation requests.