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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1066 - (show annotations) (download) (as text)
Sun Jan 7 10:02:41 2007 UTC (17 years, 9 months ago) by johnpye
File MIME type: text/x-chdr
File size: 3148 byte(s)
Adding doxygen 'addtogroup' for Solver, Compiler, Integrator.
1 /* ASCEND modelling environment
2 Copyright (C) 1998 Carnegie Mellon University
3 Copyright (C) 2006 Carnegie Mellon University
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19 *//** @file
20 Module for storing braced text of notes and some other
21 BRACEDTEXT_T applications.
22
23 What we're calling "braced text" is just a regular C char* augmented with a
24 language attribute and string length, and with reference counting.
25
26 Not everything that is defined as BRACEDTEXT_T in the grammar is necessarily
27 kept by using this module. For example, some units END up in the symbol
28 table.
29
30 'struct bracechar' is defined first in compiler.h, to hide the details of
31 whatever it is we do with braced text in composing NOTES and other
32 persistent forms.
33
34 Braced text may be very long.
35 *//*
36 By Benjamin Allan, March 20, 1998.
37 Last in CVS:$Revision: 1.5 $ $Date: 1998/06/16 16:38:39 $ $Author: mthomas $
38 */
39
40 #ifndef ASC_BRACED_H
41 #define ASC_BRACED_H
42
43 /** addtogroup compiler Compiler
44 @{
45 */
46
47 #include <utilities/ascConfig.h>
48 #include "compiler.h"
49
50 /**
51 * Creates a bracechar from a string. We do not keep the string.
52 * If a lang is given, it is kept.
53 */
54 extern struct bracechar *AddBraceChar(CONST char *string, symchar *lang);
55
56 /**
57 * Increments a reference count and returns bc.
58 */
59 extern struct bracechar *CopyBraceChar(struct bracechar *bc);
60
61 /**
62 * Frees memory associated with bc (subject to refcounting).
63 */
64 extern void DestroyBraceChar(struct bracechar *bc);
65
66 /**
67 * Returns a string of the bracechar content for READ-ONLY
68 * use. Since we frequently want to use this inside
69 * printf and the like, a short macro form is provided.
70 */
71 ASC_DLLSPEC CONST char *BraceCharString(struct bracechar *sbc);
72 /** Shortcut to BraceCharString(). */
73 #define BCS(sbc) BraceCharString(sbc)
74
75 /**
76 * Returns a 'language' of the bracechar content for READ-ONLY
77 * use. Since we frequently want to use this inside
78 * printf and the like, a short macro form is provided.
79 * Will not be NULL. To print, wrap in SCP.
80 */
81 extern symchar *BraceCharLang(struct bracechar *sbc);
82 /** Shortcut to BraceCharLang(). */
83 #define BCLANG(sbc) BraceCharLang(sbc)
84
85 /**
86 * Returns length of the bracechar content for READ-ONLY
87 * use. Since we frequently want to use this inside
88 * printf and the like, a short macro form is provided.
89 * will not be NULL. (This is not the length of lang).
90 */
91 ASC_DLLSPEC int BraceCharLen(struct bracechar *sbc);
92 /** Shortcut to BraceCharLen(). */
93 #define BCL(sbc) BraceCharLen(sbc)
94
95 /* @} */
96
97 #endif /* ASC_BRACED_H */

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