Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/ml-nlffigen/spec.sml
ViewVC logotype

Annotation of /sml/trunk/src/ml-nlffigen/spec.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 975 - (view) (download)

1 : blume 828 (*
2 :     * spec.sml - A data structure describing the export interface of a
3 :     * C program.
4 :     *
5 :     * (C) 2001, Lucent Technologies, Bell Labs
6 :     *
7 :     * author: Matthias Blume (blume@research.bell-labs.com)
8 :     *)
9 :     structure Spec = struct
10 :    
11 :     datatype constness = RO | RW
12 :     type tag = string
13 :    
14 :     datatype ctype =
15 :     SCHAR | UCHAR | SINT | UINT | SSHORT | USHORT | SLONG | ULONG
16 :     | FLOAT | DOUBLE | VOIDPTR
17 :     | STRUCT of tag
18 :     | UNION of tag
19 :     | FPTR of cft
20 :     | PTR of cobj
21 :     | ARR of { t: ctype, d: int, esz: int }
22 :    
23 :     withtype cft = { args: ctype list, res: ctype option }
24 :    
25 :     and cobj = constness * ctype
26 :    
27 :     datatype fieldspec =
28 :     OFIELD of { offset: int, spec: cobj, synthetic: bool }
29 :     | SBF of { offset: int, constness: constness, bits: word, shift: word }
30 :     | UBF of { offset: int, constness: constness, bits: word, shift: word }
31 :    
32 :     type field = { name: string, spec: fieldspec }
33 :    
34 :     type s =
35 :     { tag: tag, anon: bool, size: word, fields: field list }
36 :     type u =
37 :     { tag: tag, anon: bool, size: word, largest: field, all: field list }
38 :    
39 :     type gvar = { name: string, spec: cobj }
40 :    
41 : blume 975 type gfun = { name: string, spec: cft, argnames: string list option }
42 : blume 828
43 :     type gty = { name: string, spec: ctype }
44 :    
45 : blume 975 type enum = { name: string, spec: LargeInt.int }
46 :    
47 : blume 828 type spec = { structs: s list,
48 :     unions: u list,
49 :     gtys: gty list,
50 :     gvars: gvar list,
51 : blume 975 gfuns: gfun list,
52 :     enums: enum list }
53 : blume 828 end

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