Class

io.fsq.spindle.codegen.runtime

TypeDeclarationResolver

Related Doc: package runtime

Permalink

class TypeDeclarationResolver extends AnyRef

TypeDeclarations are used to bridge the gap between the type information contained in the TypeRegistry (which can only resolve types included in the same file) and the type information needed to compile a file (which might span several source files, because of includes).

TypeDeclarationResolver will look across several source files and resolve all the types declared in any of those files.

The following Thrift keywords can declare new types: enum, struct, union, exception, service, typedef.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TypeDeclarationResolver
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TypeDeclarationResolver(enhancedTypes: EnhancedTypes)

    Permalink

Type Members

  1. case class ScopedTypedef(typedef: Typedef, program: ProgramSource, scope: Map[String, TypeDeclaration]) extends Product with Serializable

    Permalink

    Helper class to hold a type declaration and all the parts necessary for it to be properly scoped.

    Helper class to hold a type declaration and all the parts necessary for it to be properly scoped.

    typedef

    - a type declaration

    scope

    - the scope as seen from the program it appears in

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def debugScopedTypedef(unresolvedTypedef: ScopedTypedef): String

    Permalink
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def findUnresolvedTypedefs(programs: Seq[ProgramSource], decls: Map[ProgramSource, Map[String, TypeDeclaration]]): Seq[ScopedTypedef]

    Permalink

    Given a set of programs and the currently resolved type declarations, finds any typedefs that are yet to be resolved and properly scopes them.

    Given a set of programs and the currently resolved type declarations, finds any typedefs that are yet to be resolved and properly scopes them.

    programs

    - set of programs for which to resolve typedef declarations

    decls

    - a map of already-resolved type declarations, keyed first by program name and then by type alias

  11. def firstPassResolveTypeDeclarations(program: ProgramSource): Map[ProgramSource, Map[String, TypeDeclaration]]

    Permalink

    Takes a program and resolves the "first pass" TypeDeclarations.

    Takes a program and resolves the "first pass" TypeDeclarations. That is, the easy ones.

    Resolves types declared as enums, structs, unions, and exceptions. Typedefs are left for the recursive phase, because they can reference types across source boundaries.

    Types declared as services are not resolved, because they cannot be referenced in Thrift files.

    program

    - program for which to resolve type declarations

  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def makeAnnotations(annotations: Seq[Annotation]): Annotations

    Permalink
  16. def mergeMaps[A, B, C](x: Map[A, Map[B, C]], y: Map[A, Map[B, C]]): Map[A, Map[B, C]]

    Permalink

    Helper method to merge two nested maps.

  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def recursiveResolveTypeDeclarations(programs: Seq[ProgramSource], decls: Map[ProgramSource, Map[String, TypeDeclaration]]): Map[ProgramSource, Map[String, TypeDeclaration]]

    Permalink

    Takes a set of programs and recursively resolves all the types declared as typedefs.

    Takes a set of programs and recursively resolves all the types declared as typedefs.

    These declarations can reference types across source boundaries, so we must keep track of all included program sources and all the type declarations seen so far in order to successfully resolve.

    For each pass, the set of type declarations which have not yet been resolved is found. If the set is empty, the recursion is done. If the set is non-empty, an attempt is made to resolve those type declarations. If any progress is made, the recursion continues. If no progress is made, the recursion terminates with an exception.

    programs

    - set of programs for which to resolve typedef declarations

    decls

    - a map of already-resolved type declarations, keyed first by program name and then by type alias

    Annotations
    @tailrec()
  21. def resolveAdditional(scopedTypedefs: Seq[ScopedTypedef]): Map[String, TypeDeclaration]

    Permalink

    Given a set of scoped type declarations, attempts to resolve them.

    Given a set of scoped type declarations, attempts to resolve them. Returns a map of successfully resolved type declarations.

    May not resolve all the given type declarations.

    scopedTypedefs

    - set of scoped type declarations to resolve

  22. def resolveAllTypeDeclarations(programs: Seq[ProgramSource]): Map[ProgramSource, Map[String, TypeDeclaration]]

    Permalink

    Takes a set of programs and resolves all its type declarations.

    Takes a set of programs and resolves all its type declarations.

    This is accomplished in a series of passes. The first pass resolves all type declarations which cannot reference other types (enum, struct, union exception). Subsequent passes attempt to resolve type declarations that can reference other types (typedefs).

    programs

    - set of programs for which to resolve type declarations

  23. def seqToMapBy[T, K, V](xs: Seq[T])(f: (T) ⇒ (K, V)): Map[K, V]

    Permalink
  24. def seqToMapByKey[T, K](xs: Seq[T])(f: (T) ⇒ K): Map[K, T]

    Permalink
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped