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