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