SCM Repository
Annotation of /branches/lamont/src/compiler/c-util/world.sml
Parent Directory
|
Revision Log
Revision 2081 - (view) (download)
1 : | jhr | 1850 | (* world.sml |
2 : | * | ||
3 : | * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu) | ||
4 : | * All rights reserved. | ||
5 : | *) | ||
6 : | |||
7 : | structure World : sig | ||
8 : | |||
9 : | (* create the declaration for the world type *) | ||
10 : | val genStruct : TargetUtil.target_desc * (CLang.ty * string) list -> CLang.decl | ||
11 : | |||
12 : | jhr | 2049 | (* generate code to register an error message *) |
13 : | val errorMsgAdd : CLang.exp -> CLang.stm | ||
14 : | |||
15 : | jhr | 1850 | end = struct |
16 : | |||
17 : | structure CL = CLang | ||
18 : | |||
19 : | (* WORLD_STRUCT_PREFIX componenets (see Diderot/world.h) *) | ||
20 : | val prefix = [ | ||
21 : | (CL.T_Ptr(CL.T_Named "const char"), "name"), | ||
22 : | jhr | 1862 | (CL.T_Ptr(CL.T_Named "biffMsg"), "errors"), |
23 : | jhr | 1850 | (CL.boolTy, "verboseFlg"), |
24 : | (CL.boolTy, "isArray"), | ||
25 : | (CL.uint32, "nStrandTys"), | ||
26 : | (CL.T_Ptr(CL.T_Named "Strand_t"), "strandDesc"), | ||
27 : | (CL.uint32, "nAxes"), | ||
28 : | (CL.T_Ptr CL.uint32, "base"), | ||
29 : | (CL.T_Ptr CL.uint32, "size"), | ||
30 : | (CL.uint32, "numStrands") | ||
31 : | ] | ||
32 : | |||
33 : | fun genStruct (tgt : TargetUtil.target_desc, tgtFields) = CL.D_StructDef( | ||
34 : | SOME(#namespace tgt ^ "struct_world"), | ||
35 : | prefix @ tgtFields, | ||
36 : | NONE) | ||
37 : | |||
38 : | jhr | 2049 | fun errorMsgAdd msg = |
39 : | CL.mkCall("biffMsgAdd", [CL.mkIndirect(CL.mkVar "wrld", "errors"), msg]) | ||
40 : | |||
41 : | jhr | 1850 | end |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |