EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

EdkCompatibilityPkg/Other/Maintained/Tools/Pccts/sorcerer/lib/errsupport.c

Go to the documentation of this file.
00001 /*
00002  * errsupport.c -- error support code for SORCERER output
00003  *
00004  * Define your own or compile and link this in.
00005  *
00006  * Terence Parr
00007  * U of MN, AHPCRC
00008  * February 1994
00009  */
00010 #include "sorcerer.h"
00011 
00012 void
00013 #ifdef __USE_PROTOS
00014 mismatched_range( STreeParser *_parser, int looking_for, int upper_token, SORAST *found )
00015 #else
00016 mismatched_range( _parser, looking_for, upper_token, found )
00017 int looking_for;
00018 int upper_token;
00019 SORAST *found;
00020 STreeParser *_parser;
00021 #endif
00022 {
00023   if ( found!=NULL ) {
00024     fprintf(stderr,
00025         "parse error: expected token range %d..%d found token %d\n",
00026         looking_for, upper_token,
00027         found->token);
00028   }
00029   else {
00030     fprintf(stderr,
00031         "parse error: expected token range %d..%d found NULL tree\n",
00032         looking_for, upper_token);
00033   }
00034 }
00035 
00036 void
00037 #ifdef __USE_PROTOS
00038 missing_wildcard(STreeParser *_parser)
00039 #else
00040 missing_wildcard(_parser)
00041 STreeParser *_parser;
00042 #endif
00043 {
00044   fprintf(stderr, "parse error: expected any token/tree found found NULL tree\n");
00045 }
00046 
00047 void
00048 #ifdef __USE_PROTOS
00049 mismatched_token( STreeParser *_parser, int looking_for, SORAST *found )
00050 #else
00051 mismatched_token( _parser, looking_for, found )
00052 int looking_for;
00053 SORAST *found;
00054 STreeParser *_parser;
00055 #endif
00056 {
00057   if ( found!=NULL ) {
00058     fprintf(stderr,
00059         "parse error: expected token %d found token %d\n",
00060         looking_for,
00061         found->token);
00062   }
00063   else {
00064     fprintf(stderr,
00065         "parse error: expected token %d found NULL tree\n",
00066         looking_for);
00067   }
00068 }
00069 
00070 void
00071 #ifdef __USE_PROTOS
00072 no_viable_alt( STreeParser *_parser, char *rulename, SORAST *root )
00073 #else
00074 no_viable_alt( _parser, rulename, root )
00075 char *rulename;
00076 SORAST *root;
00077 STreeParser *_parser;
00078 #endif
00079 {
00080   if ( root==NULL )
00081     fprintf(stderr,
00082         "parse error: in rule %s, no viable alternative for NULL tree\n",
00083         rulename);
00084   else
00085     fprintf(stderr,
00086         "parse error: in rule %s, no viable alternative for tree\n",
00087         rulename);
00088 }
00089 
00090 void
00091 #ifdef __USE_PROTOS
00092 sorcerer_panic(char *err)
00093 #else
00094 sorcerer_panic(err)
00095 char *err;
00096 #endif
00097 {
00098   fprintf(stderr, "panic: %s\n", err);
00099   exit(-1);
00100 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines