| 1 |
/* |
| 2 |
* Ascend Atom Child Definition Module |
| 3 |
* by Benjamin A Allan |
| 4 |
* Created: 11/20/96 |
| 5 |
* Version: $Revision: 1.4 $ |
| 6 |
* Version control file: $RCSfile: childdef.h,v $ |
| 7 |
* Date last modified: $Date: 1998/02/05 16:35:37 $ |
| 8 |
* Last modified by: $Author: ballan $ |
| 9 |
* |
| 10 |
* This file is part of the Ascend Language Interpreter. |
| 11 |
* |
| 12 |
* Copyright (C) 1996 Benjamin Andrew Allan |
| 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 |
* Ascend Atom Child Definition Module |
| 31 |
* <pre> |
| 32 |
* When #including typedef.h, make sure these files are #included first: |
| 33 |
* #include "utilities/ascConfig.h" |
| 34 |
* #include "fractions.h" |
| 35 |
* #include "instance_enum.h" |
| 36 |
* #include "compiler.h" |
| 37 |
* #include "module.h" |
| 38 |
* #include "list.h" |
| 39 |
* #include "slist.h" |
| 40 |
* #include "dimen.h" |
| 41 |
* #include "child.h" |
| 42 |
* #include "type_desc.h" |
| 43 |
* </pre> |
| 44 |
*/ |
| 45 |
|
| 46 |
#ifndef ASC_CHILDDEF_H |
| 47 |
#define ASC_CHILDDEF_H |
| 48 |
|
| 49 |
/** @addtogroup compiler_inst Compiler Instance Hierarchy |
| 50 |
@{ |
| 51 |
*/ |
| 52 |
|
| 53 |
/** |
| 54 |
* There are 5 allowable ATOM children types, at present. |
| 55 |
* The functions BaseType and GetTypeInfoFromISA rely on a table |
| 56 |
* and the ordering within it. This is a hack to restrict the types |
| 57 |
* allowed as ATOM children. |
| 58 |
*/ |
| 59 |
#define NUM_FUNDTYPES 5 |
| 60 |
|
| 61 |
extern int BaseType(symchar *name); |
| 62 |
/**< |
| 63 |
* Returns the number of the fundamental type, or -1 if not fundamental. |
| 64 |
* The code here is *VERY* dependent upon the number and position |
| 65 |
* of the FundamentalTypeList (internal to childdef.c)! |
| 66 |
* Note that the fundamentalTypeList should be refilled with |
| 67 |
* pointers from the symbol table and then comparisons done |
| 68 |
* by ptr rather than strcmp. But that comes after we get a |
| 69 |
* real symbol table. |
| 70 |
*/ |
| 71 |
|
| 72 |
extern struct ChildDesc *MakeChildDesc(symchar *name, |
| 73 |
struct StatementList *sl, |
| 74 |
ChildListPtr clist); |
| 75 |
/**< |
| 76 |
* Returns the child description array based on legal statements in sl. |
| 77 |
*/ |
| 78 |
|
| 79 |
extern unsigned long CalcByteSize(enum type_kind t, |
| 80 |
ChildListPtr clist, |
| 81 |
struct ChildDesc *childd); |
| 82 |
/**< |
| 83 |
* Calculates the byte size of an atomic instance given its |
| 84 |
* child information |
| 85 |
*/ |
| 86 |
|
| 87 |
/* @} */ |
| 88 |
|
| 89 |
#endif /* ASC_CHILDDEF_H */ |
| 90 |
|