Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] View of /trunk/sml3d/gen/spec-parser/spec-db/xml-rep.sml
ViewVC logotype

View of /trunk/sml3d/gen/spec-parser/spec-db/xml-rep.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (download) (annotate)
Wed Aug 3 18:28:46 2011 UTC (7 years, 2 months ago) by jhr
File size: 1568 byte(s)
  Working on spec parser/database
(* xml-rep.sml
 *
 * COPYRIGHT (c) 2011 The SML3d Project (http://sml3d.cs.uchicago.edu)
 * All rights reserved.
 *
 * Parse tree representation of the XML database format.
 *)

structure XMLRep =
  struct

    datatype db = DB of {
        typemap : string,       (* typemap pathname *)
        enums : string,
        functs : string,
        constprefix : string,
        functprefix : string,
        constants : const_grp list,
        types : ty list,
        functions : category list
      }

    and const_grp = ConstGrp of {
        name : Atom.atom,
        kind : Atom.atom,       (* one of "define", "mask", "enum" *)
        consts : const list
      }

    and category = Category of {
        name : Atom.atom,
        functs : funct list
      }

    and funct = Fun of {
        name : Atom.atom,               (* C name (includes functprefix) *)
        alias : Atom.atom option,       (* defined if this is an alias *)
        version : string option,        (* version that defined this function *)
        deprecated : string option,     (* version that deprecated this function *)
        retTy : {cty : CType.ty, mlty : string option},
                                        (* return type *)
        params : param list		(* parameter types and names *)
      }

    and param = Param of {
        name : string,
        cty : CType.ty,
(* FIXME: should we add direction/transfer type? *)
        mlty : string option
      }

    withtype const = {name : Atom.atom, value : string}
         and ty = {name : Atom.atom, def : CType.ty}

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0