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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1377 - (download) (annotate)
Fri Apr 4 20:45:22 2014 UTC (4 years, 11 months ago) by jhr
File size: 1482 byte(s)
  Working on FI generation tools
(* db-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 DBXMLRep =
  struct

    datatype db = DB of {
        registry : string,       	(* specification file pathname *)
	api : string,
	profile : string,
	extensions : string,
	types : ty list,
	enums : enum list,
	commands : cmd list,
	groups : enum_grp list,
	features : feature list
      }

    and cmd = Cmd of {
        name : Atom.atom,               (* C name *)
        protos : proto list		(* non-empty list of prototypes *)
      }

    and proto = Proto of {
        name : Atom.atom,               (* ML name *)
        retTy : {cty : CType.ty, mlty : string option},
                                        (* return type *)
        params : param list		(* parameter types and names *)
      }

    and param = Param of {
        name : Atom.atom,
        cty : CType.ty,
	group : Atom.atom option,	(* optional enum group name *)
        mlty : string option
      }

    and enum_grp = EnumGrp of {
        name : Atom.atom,
	bitmask : bool,
        consts : Atom.atom list
      }

    and feature = Feature of {
	name : Atom.atom,
	version : int list,
	types : Atom.atom list,
	enums : Atom.atom list,
	commands : Atom.atom list
      }

    withtype enum = {name : Atom.atom, ty : CType.ty option, value : IntInf.int}
         and ty = {name : Atom.atom, def : CType.ty}

  end

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