Class Resolver.ResolvedDatatypeDecl

java.lang.Object
net.hydromatic.morel.compile.Resolver.ResolvedDecl
net.hydromatic.morel.compile.Resolver.ResolvedDatatypeDecl
Enclosing class:
Resolver

static class Resolver.ResolvedDatatypeDecl extends Resolver.ResolvedDecl
Resolved datatype declaration.
  • Field Details

    • dataTypes

      private final com.google.common.collect.ImmutableList<DataType> dataTypes
  • Constructor Details

    • ResolvedDatatypeDecl

      ResolvedDatatypeDecl(com.google.common.collect.ImmutableList<DataType> dataTypes)
  • Method Details

    • toExp

      Core.Exp toExp(Core.Exp resultExp)
      Description copied from class: Resolver.ResolvedDecl
      Converts the declaration to a let or a local.
      Specified by:
      toExp in class Resolver.ResolvedDecl
    • toExp

      private Core.Exp toExp(List<DataType> dataTypes, Core.Exp resultExp)
    • toDecl

      public Core.DatatypeDecl toDecl()
      Creates a datatype declaration that may have multiple datatypes.

      Only the REPL needs this. Because datatypes are not recursive, a composite declaration

      
       datatype d1 ... and d2 ...

      can always be converted to a chained local,

      
       local datatype d1 ... in local datatype d2 ... end end