Overview  Index  Help 
SMLDoc

ElaboratedAst


structure ElaboratedAst =
struct
  type loc = AnnotatedAst.loc
  type path = string list
  type moduleFQN = (moduleType * stringlist
  type typeReference = moduleReference * path
  type exceptionReference = moduleReference * path
  type tyvar = string
  type docComment = string * string * tagSet
  type optDocComment = (string * string * tagSetoption
  datatype moduleType =
           STRUCTURE
         | SIGNATURE
         | FUNCTOR
         | FUNCTORSIGNATURE
         | FUNCTORPARAMETER_STRUCTURE
         | ANONYMOUS_FUNCTORPARAMETER_STRUCTURE
  datatype moduleReference =
           UnknownRef of path
         | ModuleRef of  moduleFQN *  path
         | ExternalRef of moduleFQN * string
  datatype 'a sigConst = NoSig | Transparent of 'a | Opaque of 'a
  datatype strexp =
           VarStr of moduleReference
         | BaseStr of decSet
         | ConstrainedStr of strexp * sigexp sigConst
         | AppStr of moduleReference * (strexp * bool) list
  datatype fctexp =
           VarFct of moduleReference * fsigexp sigConst
         | BaseFct of
           {
             params : (string option * sigexplist,
             body : strexp,
             constraint : sigexp sigConst
           }
         | AppFct of moduleReference * (strexp * bool) list * fsigexp sigConst
  datatype wherespec =
           WhType of string list * tyvar list * ty
         | WhStruct of string list * moduleReference
  datatype sigexp =
           VarSig of moduleReference
         | AugSig of sigexp * wherespec list list
         | BaseSig of specSet
  datatype fsigexp =
           VarFsig of moduleReference
         | BaseFsig of {params : (string option * sigexplist, result : sigexp}
  datatype specSet =
           SpecSet of
           {
              strs : sigb list,
              fcts : fsigb list,
              shareStrs : moduleReference list list,
              shareTycs : typeReference list list,
              includes : sigexp list,
              types : tb list,
              datatypes : db list,
              exceptions : eb list,
              vals : vb list
           }
  datatype decSet =
           DecSet of
           {
              strs : strb list,
              fcts : fctb list,
              sigs : sigb list,
              fsigs : fsigb list,
              opens : moduleReference list,
              types : tb list,
              datatypes : db list,
              exceptions : eb list,
              vals : vb list
           }
  datatype strb =
           STRB of
           moduleFQN * string * loc * strexp * sigexp sigConst * optDocComment
  datatype fctb = FCTB of moduleFQN * string * loc * fctexp * optDocComment
  datatype sigb =
           SIGB of
           moduleFQN * string * loc * sigexp * path option * optDocComment
  datatype fsigb = FSIGB of moduleFQN * string * loc * fsigexp * optDocComment
  datatype tb =
           TB of
           moduleFQN *
           string *
           loc *
           tyvar list *
           ty option *
            bool *
           optDocComment
  datatype db =
           DB of moduleFQN * string * loc * tyvar list * dbrhs * optDocComment
  datatype vb = VB of moduleFQN * string * loc * ty option * optDocComment
  datatype dbrhs = Constrs of cb list | Repl of typeReference
  datatype cb = CB of moduleFQN * string * loc * ty option * ty * optDocComment
  datatype eb =
           EBGen of moduleFQN * string * loc * ty option * optDocComment
         | EBDef of
           moduleFQN * string * loc * exceptionReference * optDocComment
  datatype ty =
           VarTy of tyvar
         | ConTy of typeReference * ty list
         | FunTy of ty * ty
         | RecordTy of (string * ty * optDocCommentlist
         | TupleTy of ty list
         | CommentedTy of docComment * ty
  datatype paramPattern =
           IDParamPat of string * ty option
         | TupleParamPat of paramPattern list
         | RecordParamPat of (string * paramPatternlist
  datatype tagSet =
           TagSet of
           {
             authors : string list,
             contributors : string list,
             copyrights : string list,
             exceptions : (exceptionReference * stringlist,
             params : (string * ty option * stringlist,
             paramPattern : paramPattern list option,
             return : string option,
             sees : string list,
             version : string option
           }
  datatype compileUnit = CompileUnit of string * decSet
  val pathToString
  val moduleFQNToPath
  val moduleFQNToString
  val isFQNOfFunctorParameter
  val emptySpecSet
  val appendSpecSet
  val emptyDecSet
  val appendDecSet
end

data structures generated by elaboration.

Author:
YAMATODANI Kiyoshi
Version:
$Id: StrElaboratedAst.html,v 1.9 2007/02/17 07:01:58 kiyoshiy Exp $

 
Type detail

loc

type loc = AnnotatedAst.loc


path

type path = string list


moduleFQN

type moduleFQN = (moduleType * stringlist


typeReference

type typeReference = moduleReference * path


exceptionReference

type exceptionReference = moduleReference * path


tyvar

type tyvar = string


docComment

type docComment = string * string * tagSet


optDocComment

type optDocComment = (string * string * tagSetoption

 
Datatype detail

moduleType

datatype moduleType =
         STRUCTURE
       | SIGNATURE
       | FUNCTOR
       | FUNCTORSIGNATURE
       | FUNCTORPARAMETER_STRUCTURE
       | ANONYMOUS_FUNCTORPARAMETER_STRUCTURE


moduleReference

datatype moduleReference =
         UnknownRef of path
       | ModuleRef of
         (* absolute FQN of the dest module used to link.*)
         moduleFQN * (* relative path used as display string .*) path
       | ExternalRef of moduleFQN * string


sigConst

datatype 'a sigConst = NoSig | Transparent of 'a | Opaque of 'a


strexp

datatype strexp =
         VarStr of moduleReference
       | BaseStr of decSet
       | ConstrainedStr of strexp * sigexp sigConst
       | AppStr of moduleReference * (strexp * bool) list

STRUCTURE EXPRESSION


fctexp

datatype fctexp =
         VarFct of moduleReference * fsigexp sigConst
       | BaseFct of
         {
           params : (string option * sigexplist,
           body : strexp,
           constraint : sigexp sigConst
         }
       | AppFct of moduleReference * (strexp * bool) list * fsigexp sigConst

FUNCTOR EXPRESSION


wherespec

datatype wherespec =
         WhType of string list * tyvar list * ty
       | WhStruct of string list * moduleReference

WHERE SPEC


sigexp

datatype sigexp =
         VarSig of moduleReference
       | AugSig of sigexp * wherespec list list
       | BaseSig of specSet

SIGNATURE EXPRESSION


fsigexp

datatype fsigexp =
         VarFsig of moduleReference
       | BaseFsig of {params : (string option * sigexplist, result : sigexp}

FUNCTOR SIGNATURE EXPRESSION


specSet

datatype specSet =
         SpecSet of
         {
           (* structure *) strs : sigb list,
           (* functor *) fcts : fsigb list,
           (* structure sharing *) shareStrs : moduleReference list list,
           (* type sharing *) shareTycs : typeReference list list,
           (* include specif *) includes : sigexp list,
           (* types *) types : tb list,
           (* datatype *) datatypes : db list,
           (* exception *) exceptions : eb list,
           (* value *) vals : vb list
         }

SPECIFICATION FOR SIGNATURE DEFINITIONS


decSet

datatype decSet =
         DecSet of
         {
           (* structure *) strs : strb list,
           (* functor *) fcts : fctb list,
           (* signature *) sigs : sigb list,
           (* funsig *) fsigs : fsigb list,
           (* opens *) opens : moduleReference list,
           (* type dec *) types : tb list,
           (* datatype dec *) datatypes : db list,
           (* exception *) exceptions : eb list,
           (* values *) vals : vb list
         }

DECLARATIONS (let and structure)


strb

datatype strb =
         STRB of
         moduleFQN * string * loc * strexp * sigexp sigConst * optDocComment


fctb

datatype fctb = FCTB of moduleFQN * string * loc * fctexp * optDocComment


sigb

datatype sigb =
         SIGB of moduleFQN * string * loc * sigexp * path option * optDocComment


fsigb

datatype fsigb = FSIGB of moduleFQN * string * loc * fsigexp * optDocComment


tb

datatype tb =
         TB of
         moduleFQN *
         string *
         loc *
         tyvar list *
         ty option *
         (* isEqtype *) bool *
         optDocComment


db

datatype db =
         DB of moduleFQN * string * loc * tyvar list * dbrhs * optDocComment


vb

datatype vb = VB of moduleFQN * string * loc * ty option * optDocComment


dbrhs

datatype dbrhs = Constrs of cb list | Repl of typeReference

DATATYPE BINDING RIGHT HAND SIDE


cb

datatype cb = CB of moduleFQN * string * loc * ty option * ty * optDocComment


eb

datatype eb =
         EBGen of moduleFQN * string * loc * ty option * optDocComment
       | EBDef of moduleFQN * string * loc * exceptionReference * optDocComment

EXCEPTION BINDING


ty

datatype ty =
         VarTy of tyvar
       | ConTy of typeReference * ty list
       | FunTy of ty * ty
       | RecordTy of (string * ty * optDocCommentlist
       | TupleTy of ty list
       | CommentedTy of docComment * ty

TYPES


paramPattern

datatype paramPattern =
         IDParamPat of string * ty option
       | TupleParamPat of paramPattern list
       | RecordParamPat of (string * paramPatternlist


tagSet

datatype tagSet =
         TagSet of
         {
           authors : string list,
           contributors : string list,
           copyrights : string list,
           exceptions : (exceptionReference * stringlist,
           params : (string * ty option * stringlist,
           paramPattern : paramPattern list option,
           return : string option,
           sees : string list,
           version : string option
         }


compileUnit

datatype compileUnit = CompileUnit of string * decSet

 
DataConstructor detail

STRUCTURE

constructor STRUCTURE : moduleType


SIGNATURE

constructor SIGNATURE : moduleType


FUNCTOR

constructor FUNCTOR : moduleType


FUNCTORSIGNATURE

constructor FUNCTORSIGNATURE : moduleType


FUNCTORPARAMETER_STRUCTURE

constructor FUNCTORPARAMETER_STRUCTURE : moduleType


ANONYMOUS_FUNCTORPARAMETER_STRUCTURE

constructor ANONYMOUS_FUNCTORPARAMETER_STRUCTURE : moduleType


UnknownRef

constructor UnknownRef : path -> moduleReference


ModuleRef

constructor ModuleRef
            : (* absolute FQN of the dest module used to link.*)
              moduleFQN * (* relative path used as display string .*) path ->
                moduleReference


ExternalRef

constructor ExternalRef : moduleFQN * string -> moduleReference


NoSig

constructor NoSig : 'a sigConst


Transparent

constructor Transparent : 'a -> 'a sigConst


Opaque

constructor Opaque : 'a -> 'a sigConst


VarStr

constructor VarStr : moduleReference -> strexp

variable structure


BaseStr

constructor BaseStr : decSet -> strexp

basic structure (struct...end)


ConstrainedStr

constructor ConstrainedStr : strexp * sigexp sigConst -> strexp

constrained sig


AppStr

constructor AppStr : moduleReference * (strexp * bool) list -> strexp

application (external)


VarFct

constructor VarFct : moduleReference * fsigexp sigConst -> fctexp

functor variable


BaseFct

constructor BaseFct
            : {
                params : (string option * sigexplist,
                body : strexp,
                constraint : sigexp sigConst
              } ->
                fctexp

definition of a functor


AppFct

constructor AppFct
            : moduleReference * (strexp * bool) list * fsigexp sigConst ->
                fctexp

application


WhType

constructor WhType : string list * tyvar list * ty -> wherespec


WhStruct

constructor WhStruct : string list * moduleReference -> wherespec


VarSig

constructor VarSig : moduleReference -> sigexp

signature variable


AugSig

constructor AugSig : sigexp * wherespec list list -> sigexp

sig augmented with where specs


BaseSig

constructor BaseSig : specSet -> sigexp

basic signature (sig...end)


VarFsig

constructor VarFsig : moduleReference -> fsigexp

funsig variable


BaseFsig

constructor BaseFsig
            : {params : (string option * sigexplist, result : sigexp} ->
                fsigexp

basic funsig


SpecSet

constructor SpecSet
            : {
                (* structure *) strs : sigb list,
                (* functor *) fcts : fsigb list,
                (* structure sharing *) shareStrs : moduleReference list list,
                (* type sharing *) shareTycs : typeReference list list,
                (* include specif *) includes : sigexp list,
                (* types *) types : tb list,
                (* datatype *) datatypes : db list,
                (* exception *) exceptions : eb list,
                (* value *) vals : vb list
              } ->
                specSet


DecSet

constructor DecSet
            : {
                (* structure *) strs : strb list,
                (* functor *) fcts : fctb list,
                (* signature *) sigs : sigb list,
                (* funsig *) fsigs : fsigb list,
                (* opens *) opens : moduleReference list,
                (* type dec *) types : tb list,
                (* datatype dec *) datatypes : db list,
                (* exception *) exceptions : eb list,
                (* values *) vals : vb list
              } ->
                decSet


STRB

constructor STRB
            : moduleFQN *
              string *
              loc *
              strexp *
              sigexp sigConst *
              optDocComment ->
                strb


FCTB

constructor FCTB : moduleFQN * string * loc * fctexp * optDocComment -> fctb


SIGB

constructor SIGB
            : moduleFQN * string * loc * sigexp * path option * optDocComment ->
                sigb


FSIGB

constructor FSIGB : moduleFQN * string * loc * fsigexp * optDocComment -> fsigb


TB

constructor TB
            : moduleFQN *
              string *
              loc *
              tyvar list *
              ty option *
              (* isEqtype *) bool *
              optDocComment ->
                tb


DB

constructor DB
            : moduleFQN * string * loc * tyvar list * dbrhs * optDocComment ->
                db


VB

constructor VB : moduleFQN * string * loc * ty option * optDocComment -> vb


Constrs

constructor Constrs : cb list -> dbrhs


Repl

constructor Repl : typeReference -> dbrhs


CB

constructor CB : moduleFQN * string * loc * ty option * ty * optDocComment -> cb


EBGen

constructor EBGen : moduleFQN * string * loc * ty option * optDocComment -> eb


EBDef

constructor EBDef
            : moduleFQN * string * loc * exceptionReference * optDocComment ->
                eb


VarTy

constructor VarTy : tyvar -> ty

type variable


ConTy

constructor ConTy : typeReference * ty list -> ty

type constructor


FunTy

constructor FunTy : ty * ty -> ty

function type


RecordTy

constructor RecordTy : (string * ty * optDocCommentlist -> ty

record


TupleTy

constructor TupleTy : ty list -> ty

tuple


CommentedTy

constructor CommentedTy : docComment * ty -> ty

with comment


IDParamPat

constructor IDParamPat : string * ty option -> paramPattern


TupleParamPat

constructor TupleParamPat : paramPattern list -> paramPattern


RecordParamPat

constructor RecordParamPat : (string * paramPatternlist -> paramPattern


TagSet

constructor TagSet
            : {
                authors : string list,
                contributors : string list,
                copyrights : string list,
                exceptions : (exceptionReference * stringlist,
                params : (string * ty option * stringlist,
                paramPattern : paramPattern list option,
                return : string option,
                sees : string list,
                version : string option
              } ->
                tagSet


CompileUnit

constructor CompileUnit : string * decSet -> compileUnit

 
Value detail

pathToString

val pathToString


moduleFQNToPath

val moduleFQNToPath


moduleFQNToString

val moduleFQNToString


isFQNOfFunctorParameter

val isFQNOfFunctorParameter


emptySpecSet

val emptySpecSet


appendSpecSet

val appendSpecSet


emptyDecSet

val emptyDecSet


appendDecSet

val appendDecSet

 


Overview  Index  Help 
SMLDoc: Documentation generator for SML