/[ascend]/trunk/base/generic/compiler/type_descio.h
ViewVC logotype

Contents of /trunk/base/generic/compiler/type_descio.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1290 - (show annotations) (download) (as text)
Mon Feb 26 04:54:45 2007 UTC (17 years, 5 months ago) by johnpye
File MIME type: text/x-chdr
File size: 3786 byte(s)
Added new 'default' functionality plus test case
1 /*
2 * Type Description Output
3 * by Tom Epperly
4 * Created: 1/15/89
5 * Version: $Revision: 1.9 $
6 * Version control file: $RCSfile: type_descio.h,v $
7 * Date last modified: $Date: 1998/03/26 20:40:28 $
8 * Last modified by: $Author: ballan $
9 *
10 * This file is part of the Ascend Language Interpreter.
11 *
12 * Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
13 *
14 * The Ascend Language Interpreter is free software; you can redistribute
15 * it and/or modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
18 *
19 * The Ascend Language Interpreter is distributed in hope that it will be
20 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with the program; if not, write to the Free Software Foundation, Inc., 675
26 * Mass Ave, Cambridge, MA 02139 USA. Check the file named COPYING.
27 */
28
29 /** @file
30 Type Description Output.
31 */
32
33 #ifndef ASC_TYPE_DESCIO_H
34 #define ASC_TYPE_DESCIO_H
35
36 #include <stdio.h>
37
38 #include <utilities/ascConfig.h>
39
40 #include "type_desc.h"
41
42 /** @addtogroup compiler Compiler
43 @{
44 */
45
46 ASC_DLLSPEC void WriteDefinition(FILE *f, struct TypeDescription *desc);
47 /**<
48 * Write the type description structure to the given file in text.
49 * May include compiler derived information in comments.
50 */
51
52 extern char *WriteDefinitionStringList(struct TypeDescription *d);
53 /**<
54 * Returns a string containing in braced list format (compatible
55 * with tcl) the contents of a type description.
56 * name is an identifier_t, kind is a string indicating base class
57 * such as real, integer, symbol, etc., stuff in CAPS is literal,
58 * or empty implies the field may be {} if no appropriate statement
59 * exists, and value is as yet ill defined. statementlist will be
60 * written as WriteStatementListString defines.
61 * <pre>
62 * family/format:
63 * CONSTANTS/
64 * {kind} {UNIVERSAL or empty} {CONSTANT} {name2} {REFINES name1 or empty}
65 * {dims or empty} {value or empty}
66 * ATOMS/
67 * {kind} {UNIVERSAL or empty} {ATOM} {name2} {REFINES name1 or empty}
68 * {dims or empty} {value or empty} {statementlist}
69 * MODELS/
70 * {MODEL} {UNIVERSAL or empty} {MODEL} {name2} {REFINES name1 or empty}
71 * {parameter statements or empty} {where statements or empty}
72 * {refinement assignments or empty} {ancestor body statementlist or empty}
73 * {body statementlist or empty} {method names and type defined in or empty}
74 * </pre>
75 * @bug WriteDefinitionStringList() not implemented.
76 * @bug WriteDefinitionStringList() does not handle 'DEFINITIONs' for relation
77 * types. Any user who want's to mess with system.a4l can do it by hand.
78 * No GUI idiots need apply.
79 */
80
81 ASC_DLLSPEC void WriteDiffDefinition(FILE *f, struct TypeDescription *desc);
82 /**<
83 * Write the type description structure to the given file in text but
84 * only those statements that are in the declarative section which are
85 * different from the refinement ancestor of the type. The procedures
86 * are not dealt with as that is messy. If no ancestor, defaults to
87 * writing all declarative statements.<br><br>
88 *
89 * Note that the parameters, wheres, reductions, and absorbed
90 * statements of desc are NOT written.
91 */
92
93 extern symchar *GetBaseTypeName(enum type_kind t);
94 /**<
95 * Returns the symbol for the kind of type given.
96 * InitBaseTypeNames must have been called first.
97 * ascCompiler takes care of that.
98 */
99
100 extern void InitBaseTypeNames(void);
101 /**< Set up the basetypes symbol table. */
102
103 /* @} */
104
105 #endif /* ASC_TYPE_DESCIO_H */

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22