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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1066 - (hide 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 johnpye 897 /* ASCEND modelling environment
2     Copyright (C) 1998 Carnegie Mellon University
3     Copyright (C) 2006 Carnegie Mellon University
4 jds 54
5 johnpye 897 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 jds 54
10 johnpye 897 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 aw0a 1
15 johnpye 897 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 johnpye 1066 /** addtogroup compiler Compiler
44     @{
45     */
46    
47 johnpye 897 #include <utilities/ascConfig.h>
48     #include "compiler.h"
49    
50 jds 54 /**
51 aw0a 1 * Creates a bracechar from a string. We do not keep the string.
52     * If a lang is given, it is kept.
53     */
54 jds 54 extern struct bracechar *AddBraceChar(CONST char *string, symchar *lang);
55 aw0a 1
56 jds 54 /**
57     * Increments a reference count and returns bc.
58 aw0a 1 */
59 jds 54 extern struct bracechar *CopyBraceChar(struct bracechar *bc);
60 aw0a 1
61 jds 54 /**
62     * Frees memory associated with bc (subject to refcounting).
63 aw0a 1 */
64 jds 54 extern void DestroyBraceChar(struct bracechar *bc);
65 aw0a 1
66 jds 54 /**
67 aw0a 1 * 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 johnpye 1063 ASC_DLLSPEC CONST char *BraceCharString(struct bracechar *sbc);
72 jds 54 /** Shortcut to BraceCharString(). */
73 aw0a 1 #define BCS(sbc) BraceCharString(sbc)
74    
75 jds 54 /**
76 aw0a 1 * 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 johnpye 897 * Will not be NULL. To print, wrap in SCP.
80 aw0a 1 */
81 jds 54 extern symchar *BraceCharLang(struct bracechar *sbc);
82     /** Shortcut to BraceCharLang(). */
83 aw0a 1 #define BCLANG(sbc) BraceCharLang(sbc)
84    
85 jds 54 /**
86 aw0a 1 * 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 johnpye 1063 ASC_DLLSPEC int BraceCharLen(struct bracechar *sbc);
92 jds 54 /** Shortcut to BraceCharLen(). */
93 aw0a 1 #define BCL(sbc) BraceCharLen(sbc)
94    
95 johnpye 1066 /* @} */
96    
97 johnpye 897 #endif /* ASC_BRACED_H */

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