Overview  Index  Help 
SMLDoc

AnnotatedAst


structure AnnotatedAst =
struct
  type loc = {fileName : string, line : int, column : int}
  type path = string list
  type tyvar = string
  type optDocComment = DocComment.docComment option
  datatype 'a sigConst = NoSig | Transparent of 'a | Opaque of 'a
  datatype strexp =
           VarStr of path
         | BaseStr of dec list
         | ConstrainedStr of strexp * sigexp sigConst
         | AppStr of path * (strexp * bool) list
         | LetStr of dec list * strexp
  datatype fctexp =
           VarFct of path * fsigexp sigConst
         | BaseFct of
           {
             params : (string option * sigexplist,
             body : strexp,
             constraint : sigexp sigConst
           }
         | AppFct of path * (strexp * bool) list * fsigexp sigConst
         | LetFct of dec list * fctexp
  datatype wherespec =
           WhType of string list * tyvar list * ty
         | WhStruct of string list * string list
  datatype sigexp =
           VarSig of string
         | AugSig of sigexp * wherespec list
         | BaseSig of spec list
  datatype fsigexp =
           VarFsig of string
         | BaseFsig of {params : (string option * sigexplist, result : sigexp}
  datatype spec =
           StrSpec of string * loc * sigexp * path option * optDocComment
         | TycSpec of
           string * loc * tyvar list * ty option * bool * optDocComment
         | FctSpec of string * loc * fsigexp * optDocComment
         | ValSpec of string * loc * ty * optDocComment
         | DataSpec of {datatycs : db list, withtycs : tb list}
         | ExceSpec of string * loc * ty option * optDocComment
         | ShareStrSpec of path list
         | ShareTycSpec of path list
         | IncludeSpec of sigexp
  datatype dec =
           ValDec of string * loc * optDocComment
         | FunDec of string * loc * optDocComment
         | TypeDec of tb
         | DatatypeDec of {datatycs : db list, withtycs : tb list}
         | AbstypeDec of
           {datatycs : db list, withtycs : tb list, body : dec list}
         | ExceptionDec of eb
         | StrDec of string * loc * strexp * sigexp sigConst * optDocComment
         | FctDec of string * loc * fctexp * optDocComment
         | SigDec of string * loc * sigexp * optDocComment
         | FsigDec of string * loc * fsigexp * optDocComment
         | LocalDec of dec list * dec list
         | OpenDec of path
  datatype tb = Tb of string * loc * tyvar list * ty option * optDocComment
  datatype db =
           Db of
           {tyc : string, loc : loc, tyvars : tyvar list, rhs : dbrhs} *
           optDocComment
  datatype dbrhs =
           Constrs of (string * loc * ty option * optDocCommentlist
         | Repl of string list
  datatype eb =
           EbGen of string * loc * ty option * optDocComment
         | EbDef of string * loc * path * optDocComment
  datatype ty =
           VarTy of tyvar
         | ConTy of string list * ty list
         | RecordTy of (string * ty * optDocCommentlist
         | TupleTy of ty list
         | CommentedTy of DocComment.docComment * ty
  datatype compileUnit = CompileUnit of string * dec list
end

abstract syntax tree annotated with doc comment.

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

 
Type detail

loc

type loc = {fileName : string, line : int, column : int}


path

type path = string list

symbolic path (Modules.spath)


tyvar

type tyvar = string


optDocComment

type optDocComment = DocComment.docComment option

 
Datatype detail

sigConst

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


strexp

datatype strexp =
         VarStr of path
       | BaseStr of dec list
       | ConstrainedStr of strexp * sigexp sigConst
       | AppStr of path * (strexp * bool) list
       | LetStr of dec list * strexp


fctexp

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


wherespec

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


sigexp

datatype sigexp =
         VarSig of string
       | AugSig of sigexp * wherespec list
       | BaseSig of spec list


fsigexp

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


spec

datatype spec =
         StrSpec of string * loc * sigexp * path option * optDocComment
       | TycSpec of string * loc * tyvar list * ty option * bool * optDocComment
       | FctSpec of string * loc * fsigexp * optDocComment
       | ValSpec of string * loc * ty * optDocComment
       | DataSpec of {datatycs : db list, withtycs : tb list}
       | ExceSpec of string * loc * ty option * optDocComment
       | ShareStrSpec of path list
       | ShareTycSpec of path list
       | IncludeSpec of sigexp


dec

datatype dec =
         ValDec of string * loc * optDocComment
       | FunDec of string * loc * optDocComment
       | TypeDec of tb
       | DatatypeDec of {datatycs : db list, withtycs : tb list}
       | AbstypeDec of {datatycs : db list, withtycs : tb list, body : dec list}
       | ExceptionDec of eb
       | StrDec of string * loc * strexp * sigexp sigConst * optDocComment
       | FctDec of string * loc * fctexp * optDocComment
       | SigDec of string * loc * sigexp * optDocComment
       | FsigDec of string * loc * fsigexp * optDocComment
       | LocalDec of dec list * dec list
       | OpenDec of path


tb

datatype tb = Tb of string * loc * tyvar list * ty option * optDocComment


db

datatype db =
         Db of
         {tyc : string, loc : loc, tyvars : tyvar list, rhs : dbrhs} *
         optDocComment


dbrhs

datatype dbrhs =
         Constrs of (string * loc * ty option * optDocCommentlist
       | Repl of string list


eb

datatype eb =
         EbGen of string * loc * ty option * optDocComment
       | EbDef of string * loc * path * optDocComment


ty

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


compileUnit

datatype compileUnit = CompileUnit of string * dec list

source file name and set of all declarations in the file.

 
DataConstructor detail

NoSig

constructor NoSig : 'a sigConst


Transparent

constructor Transparent : 'a -> 'a sigConst


Opaque

constructor Opaque : 'a -> 'a sigConst


VarStr

constructor VarStr : path -> strexp


BaseStr

constructor BaseStr : dec list -> strexp


ConstrainedStr

constructor ConstrainedStr : strexp * sigexp sigConst -> strexp


AppStr

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


LetStr

constructor LetStr : dec list * strexp -> strexp


VarFct

constructor VarFct : path * fsigexp sigConst -> fctexp


BaseFct

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


AppFct

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


LetFct

constructor LetFct : dec list * fctexp -> fctexp


WhType

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


WhStruct

constructor WhStruct : string list * string list -> wherespec


VarSig

constructor VarSig : string -> sigexp


AugSig

constructor AugSig : sigexp * wherespec list -> sigexp


BaseSig

constructor BaseSig : spec list -> sigexp


VarFsig

constructor VarFsig : string -> fsigexp


BaseFsig

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


StrSpec

constructor StrSpec
            : string * loc * sigexp * path option * optDocComment -> spec


TycSpec

constructor TycSpec
            : string * loc * tyvar list * ty option * bool * optDocComment ->
                spec


FctSpec

constructor FctSpec : string * loc * fsigexp * optDocComment -> spec


ValSpec

constructor ValSpec : string * loc * ty * optDocComment -> spec


DataSpec

constructor DataSpec : {datatycs : db list, withtycs : tb list} -> spec


ExceSpec

constructor ExceSpec : string * loc * ty option * optDocComment -> spec


ShareStrSpec

constructor ShareStrSpec : path list -> spec


ShareTycSpec

constructor ShareTycSpec : path list -> spec


IncludeSpec

constructor IncludeSpec : sigexp -> spec


ValDec

constructor ValDec : string * loc * optDocComment -> dec


FunDec

constructor FunDec : string * loc * optDocComment -> dec


TypeDec

constructor TypeDec : tb -> dec


DatatypeDec

constructor DatatypeDec : {datatycs : db list, withtycs : tb list} -> dec


AbstypeDec

constructor AbstypeDec
            : {datatycs : db list, withtycs : tb list, body : dec list} -> dec


ExceptionDec

constructor ExceptionDec : eb -> dec


StrDec

constructor StrDec
            : string * loc * strexp * sigexp sigConst * optDocComment -> dec


FctDec

constructor FctDec : string * loc * fctexp * optDocComment -> dec


SigDec

constructor SigDec : string * loc * sigexp * optDocComment -> dec


FsigDec

constructor FsigDec : string * loc * fsigexp * optDocComment -> dec


LocalDec

constructor LocalDec : dec list * dec list -> dec


OpenDec

constructor OpenDec : path -> dec


Tb

constructor Tb : string * loc * tyvar list * ty option * optDocComment -> tb


Db

constructor Db
            : {tyc : string, loc : loc, tyvars : tyvar list, rhs : dbrhs} *
              optDocComment ->
                db


Constrs

constructor Constrs : (string * loc * ty option * optDocCommentlist -> dbrhs


Repl

constructor Repl : string list -> dbrhs


EbGen

constructor EbGen : string * loc * ty option * optDocComment -> eb


EbDef

constructor EbDef : string * loc * path * optDocComment -> eb


VarTy

constructor VarTy : tyvar -> ty


ConTy

constructor ConTy : string list * ty list -> ty


RecordTy

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


TupleTy

constructor TupleTy : ty list -> ty


CommentedTy

constructor CommentedTy : DocComment.docComment * ty -> ty


CompileUnit

constructor CompileUnit : string * dec list -> compileUnit

   


Overview  Index  Help 
SMLDoc: Documentation generator for SML