00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #define CLIST_IMPLEMENT_HERE
00044 #include "cw_misc.h"
00045
00046 #include "debug.h"
00047 #include "parse_util.hh"
00048 #include "catch_clause.hh"
00049
00050 extern int yylineno;
00051
00052 CLINK void deleteCstring (Cstring *s)
00053 {
00054 free(s);
00055 }
00056
00057 CLINK void deleteCwCharClass (CwCharClass *c)
00058 {
00059 free(c);
00060 }
00061
00062 CLINK void deleteCwCatchClause (CwCatchClause *ptr)
00063 {
00064 delete static_cast<CatchClause*>(ptr);
00065 }
00066
00067
00068 CLINK void yyerror (char *message)
00069 {
00070 die(formatError(Position(yylineno), message));
00071 }
00072
00073
00074 CLINK void yywarn (char *message)
00075 {
00076 die(formatWarning(Position(yylineno), message));
00077 }
00078
00079
00080 CLINK void cw_die (char *message)
00081 {
00082 die(message);
00083 }
00084
00085 vector<string>* CstringList2vector (CstringList l)
00086 {
00087 vector<string> *v = new vector<string>;
00088 CstringList i;
00089
00090 for (i = l; i != NULL; i = i->next)
00091 v->push_back(string(i->data));
00092
00093 return v;
00094 }
00095
00096 vector<CharClassDescriptor>* CwCharClassList2vector (CwCharClassList l)
00097 {
00098 vector<CharClassDescriptor> *v = new vector<CharClassDescriptor>;
00099 CwCharClassList i;
00100
00101 for (i = l; i != NULL; i = i->next)
00102 v->push_back(CharClassDescriptor(i->data->first, i->data->last));
00103
00104 return v;
00105 }