1 /****************************************************************************
2     Copyright (C) 1987-2015 by Jeffery P. Hansen
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License along
15     with this program; if not, write to the Free Software Foundation, Inc.,
16     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 ****************************************************************************/
18 #ifndef __error_h
19 #define __error_h
20 
21 /*****************************************************************************
22  *
23  * Embedded script declaration (affects error reporting)
24  *
25  *****************************************************************************/
26 struct GEScript_str {
27   char		*es_name;		/* Name of script */
28   int		es_beginLine;		/* Starting line number */
29   int		es_endLine;		/* ending line number (or 0 if still parsing script) */
30   GEScript	*es_next;		/* next in list of scripts */
31 };
32 
33 /*****************************************************************************
34  *
35  * List of errors
36  *
37  *****************************************************************************/
38 struct ErrorList_str {
39   GateError *errlist;
40   GateError *curerr;
41   GateError **errors;
42   int ErrorCount;
43 
44   GEScript *el_esList;
45 
46   int ErrorXPos;
47   int ErrorYPos;
48 };
49 
50 
51 /*****************************************************************************
52  *
53  * Simulator error object
54  *
55  *****************************************************************************/
56 struct GError_str {
57   int 		e_id;		/* Unique identifier for error report */
58   int		e_level;	/* Level of error 0=warning, 1=error */
59   char		*e_fileName;	/* Name of file in which error occured */
60   int		e_fileLine;	/* Line number within file */
61   char		*e_modName;	/* Name of module in which error occured */
62   int		e_modLine;	/* Line number within module */
63   char		*e_message;	/* Error message text */
64   char		*e_instName;	/* Name of instance causing error */
65   char		*e_portName;	/* Port on instance where error occurred */
66   GCElement	*e_inst;	/* Instance associated with error */
67   GateError	*e_next;	/* Next error in error list */
68   GateError	*e_last;	/* Previous error in error list */
69 };
70 
71 ErrorList *new_ErrorList();
72 
73 void Error_scriptBegin(const char *name,int line);
74 void Error_scriptEnd(const char *name,int line);
75 void Error_report(const char *errText);
76 void Error_close();
77 void Error_purge();
78 EditState *Error_open(GateError *err,EditState *es);
79 void Error_navigateToModule(EditState **es,const char *path);
80 void Error_decode(char *emsg);
81 
82 #endif
83 
84