Back to index

tetex-bin  3.0
error_routines.c
Go to the documentation of this file.
00001 /* error_routines.c: General error routines.
00002 
00003 This file is part of Omega,
00004 which is based on the web2c distribution of TeX,
00005 
00006 Copyright (c) 1994--2001 John Plaice and Yannis Haralambous
00007 
00008 Omega is free software; you can redistribute it and/or modify
00009 it under the terms of the GNU General Public License as published by
00010 the Free Software Foundation; either version 2 of the License, or
00011 (at your option) any later version.
00012 
00013 Omega is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with Omega; if not, write to the Free Software Foundation, Inc.,
00020 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00021 
00022 */
00023 
00024 #include "cpascal.h"
00025 #include "parser.h"
00026 
00027 /* Error routines:
00028 
00029 All of the routines in this file have the same general format.
00030 They 
00031 
00032 */
00033 
00034 void
00035 lex_error_0(string fmt)
00036 {
00037     fprintf(stderr, "line %d (lexing): ", line_number);
00038     fprintf(stderr, fmt);
00039     fprintf(stderr, "\n");
00040 }
00041 
00042 void
00043 lex_error_1(string fmt, int item)
00044 {
00045     fprintf(stderr, "line %d (lexing): ", line_number);
00046     fprintf(stderr, fmt, item);
00047     fprintf(stderr, "\n");
00048 }
00049 
00050 void
00051 lex_error_s(string fmt, string item)
00052 {
00053     fprintf(stderr, "line %d (lexing): ", line_number);
00054     fprintf(stderr, fmt, item);
00055     fprintf(stderr, "\n");
00056 }
00057 
00058 void
00059 lex_error_s_1(string fmt, string item, int item1)
00060 {
00061     fprintf(stderr, "line %d (lexing): ", line_number);
00062     fprintf(stderr, fmt, item, item1);
00063     fprintf(stderr, "\n");
00064 }
00065 
00066 void
00067 yyerror(string fmt)
00068 {
00069     fprintf(stderr, "line %d (parsing): ", line_number);
00070     fprintf(stderr, fmt);
00071     fprintf(stderr, "\n");
00072 }
00073 
00074 
00075 void
00076 warning_0(string fmt)
00077 {
00078     fprintf(stderr, "line %d (warning): ", line_number);
00079     fprintf(stderr, fmt);
00080     fprintf(stderr, "\n");
00081 }
00082 
00083 void
00084 warning_1(string fmt, int item)
00085 {
00086     fprintf(stderr, "line %d (warning): ", line_number);
00087     fprintf(stderr, fmt, item);
00088     fprintf(stderr, "\n");
00089 }
00090 
00091 void
00092 warning_2(string fmt, int item, int item2)
00093 {
00094     fprintf(stderr, "line %d (warning): ", line_number);
00095     fprintf(stderr, fmt, item, item2);
00096     fprintf(stderr, "\n");
00097 }
00098 
00099 void
00100 warning_s(string fmt, string item)
00101 {
00102     fprintf(stderr, "line %d (warning): ", line_number);
00103     fprintf(stderr, fmt, item);
00104     fprintf(stderr, "\n");
00105 }
00106 
00107 void
00108 warning_s_1(string fmt, string item, int item1)
00109 {
00110     fprintf(stderr, "line %d (warning): ", line_number);
00111     fprintf(stderr, fmt, item, item1);
00112     fprintf(stderr, "\n");
00113 }
00114 
00115 void
00116 warning_s_2(string fmt, string item, int item1, int item2)
00117 {
00118     fprintf(stderr, "line %d (warning): ", line_number);
00119     fprintf(stderr, fmt, item, item1, item2);
00120     fprintf(stderr, "\n");
00121 }
00122 
00123 void
00124 fatal_error_0(string fmt)
00125 {
00126     fprintf(stderr, "line %d (fatal): ", line_number);
00127     fprintf(stderr, fmt);
00128     fprintf(stderr, "\n");
00129     exit(1);
00130 }
00131 
00132 void
00133 fatal_error_1(string fmt, int item)
00134 {
00135     fprintf(stderr, "line %d (fatal): ", line_number);
00136     fprintf(stderr, fmt, item);
00137     fprintf(stderr, "\n");
00138     exit(1);
00139 }
00140 
00141 void
00142 fatal_error_2(string fmt, int item, int item2)
00143 {
00144     fprintf(stderr, "line %d (fatal): ", line_number);
00145     fprintf(stderr, fmt, item, item2);
00146     fprintf(stderr, "\n");
00147     exit(1);
00148 }
00149 
00150 void
00151 fatal_error_s(string fmt, string  item)
00152 {
00153     fprintf(stderr, "line %d (fatal): ", line_number);
00154     fprintf(stderr, fmt, item);
00155     fprintf(stderr, "\n");
00156     exit(1);
00157 }
00158 
00159 void
00160 internal_error_0(string fmt)
00161 {
00162     fprintf(stderr, "line %d (internal): ", line_number);
00163     fprintf(stderr, fmt);
00164     fprintf(stderr, "\n");
00165     exit(2);
00166 }
00167 
00168 void
00169 internal_error_1(string fmt, int item)
00170 {
00171     fprintf(stderr, "line %d (internal): ", line_number);
00172     fprintf(stderr, fmt, item);
00173     fprintf(stderr, "\n");
00174     exit(2);
00175 }
00176 
00177 void
00178 internal_error_s(string fmt, string item)
00179 {
00180     fprintf(stderr, "line %d (internal): ", line_number);
00181     fprintf(stderr, fmt, item);
00182     fprintf(stderr, "\n");
00183     exit(2);
00184 }