1 |
/* |
2 |
* Procedure Output |
3 |
* by Benjamin Allan |
4 |
* Created: 3/12/98 |
5 |
* Version: $Revision: 1.6 $ |
6 |
* Version control file: $RCSfile: procio.h,v $ |
7 |
* Date last modified: $Date: 1998/03/17 22:09:21 $ |
8 |
* Last modified by: $Author: ballan $ |
9 |
* |
10 |
* This file is part of the Ascend Language Interpreter. |
11 |
* |
12 |
* Copyright (C) 1998 Carnegie Mellon University |
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 |
* Procedure Output. |
31 |
* <pre> |
32 |
* When #including procio.h, make sure these files are #included first: |
33 |
* #include <stdio.h> |
34 |
* #include "utilities/ascConfig.h" |
35 |
* #include "compiler.h" |
36 |
* #include "proc.h" |
37 |
* </pre> |
38 |
*/ |
39 |
|
40 |
#ifndef ASC_PROCIO_H |
41 |
#define ASC_PROCIO_H |
42 |
|
43 |
/** addtogroup compiler Compiler |
44 |
@{ |
45 |
*/ |
46 |
|
47 |
/** Codes for old-style external call messaging. */ |
48 |
enum ProcExtError { |
49 |
PE_unloaded, |
50 |
PE_nulleval, |
51 |
PE_argswrong, |
52 |
PE_badarg, |
53 |
PE_evalerr |
54 |
}; |
55 |
|
56 |
/** METHODs equivalent of WSEM. Should go away soon. */ |
57 |
extern void WriteInitWarn(struct procFrame *fm, char *str); |
58 |
/** METHODs equivalent of WSEM. Should go away soon. */ |
59 |
extern void WriteInitErr(struct procFrame *fm, char *str); |
60 |
|
61 |
/* error message services */ |
62 |
|
63 |
/** |
64 |
* <!-- ProcWriteCaseError(fm,arm,pos); --> |
65 |
* Write error encountered while evaluating SWITCH. |
66 |
* arm gives the number of the case in question. pos |
67 |
* gives the position of the error in the var list. |
68 |
*/ |
69 |
extern void ProcWriteCaseError(struct procFrame *fm, int arm, int pos); |
70 |
|
71 |
/** |
72 |
* <!-- ProcWriteForError(fm); --> |
73 |
* Write error encountered while evaluating FOR/DO. |
74 |
*/ |
75 |
extern void ProcWriteForError(struct procFrame *fm); |
76 |
|
77 |
/** |
78 |
* <!-- ProcWriteAssignmentError(fm); --> |
79 |
* Write error encountered while evaluating := assignment. |
80 |
*/ |
81 |
extern void ProcWriteAssignmentError(struct procFrame *fm); |
82 |
|
83 |
/** |
84 |
* <!-- ProcWriteFixError(fm,var); --> |
85 |
* Write error encountered while evaluating var.fixed assignment. |
86 |
*/ |
87 |
extern void ProcWriteFixError(struct procFrame *fm, CONST struct Name *var); |
88 |
|
89 |
|
90 |
/** |
91 |
* <!-- ProcWriteIfError(fm,cname); --> |
92 |
* Write error encountered while evaluating boolean flow control. |
93 |
* cname is normally "IF" or "WHILE". |
94 |
*/ |
95 |
extern void ProcWriteIfError(struct procFrame *fm, CONST char *cname); |
96 |
|
97 |
/** |
98 |
* <!-- ProcWriteRunError(fm); --> |
99 |
* Write error encountered while evaluating RUN arguments. |
100 |
*/ |
101 |
extern void ProcWriteRunError(struct procFrame *fm); |
102 |
|
103 |
/** |
104 |
* <!-- ProcWriteExtError(fm,funcname,err,pos); --> |
105 |
* Write error encountered while evaluating Ext arguments. |
106 |
*/ |
107 |
extern void ProcWriteExtError(struct procFrame *fm, |
108 |
CONST char *funcmane, |
109 |
enum ProcExtError err, |
110 |
int pos); |
111 |
|
112 |
/* backtrace output functions. */ |
113 |
|
114 |
/** |
115 |
* Issue a message if we blew the stack limit or are |
116 |
* unwinding the stack. |
117 |
*/ |
118 |
extern void ProcWriteStackCheck(struct procFrame *fm, |
119 |
struct Name *class, |
120 |
struct Name *name); |
121 |
|
122 |
/** |
123 |
* <!-- WriteProcedureBlock(fp,initstack,str); --> |
124 |
* Writes a line to file fp. Write format resembles: |
125 |
* ("%s %s in %s\n",str,stack->last->proc,stack->last->context) |
126 |
* For example: |
127 |
* <pre> |
128 |
* WriteProcedureBlock(ASCERR,stack,"Entering "); |
129 |
* --> "Entering METHOD myproc in mysim.myinstance[3]" |
130 |
* </pre> |
131 |
* str may be empty or NULL. |
132 |
* The format is subject to change as this feature is in development. |
133 |
*/ |
134 |
extern void WriteProcedureBlock(FILE *fp, |
135 |
struct gl_list_t *initstack, |
136 |
CONST char *str); |
137 |
|
138 |
/** |
139 |
* <!-- WriteProcedureLine(fp,initstack,str); --> |
140 |
* Writes a line to file fp. Write format resembles: |
141 |
* ("%s %d: %s in %s\n",str,line,proc,context) |
142 |
* For example: |
143 |
* <pre> |
144 |
* WriteProcedureLine(ASCERR,initstack,"Executing line "); |
145 |
* --> "Executing line 137 of myprocname in mysim.myinstance[3]" |
146 |
* </pre> |
147 |
* The format is subject to change as this feature is in development. |
148 |
*/ |
149 |
extern void WriteProcedureLine(FILE *fp, |
150 |
struct gl_list_t *initstack, |
151 |
CONST char *str); |
152 |
|
153 |
/* @} */ |
154 |
|
155 |
#endif /* ASC_PROCIO_H */ |
156 |
|