err.c

Go to the documentation of this file.
00001 /*
00002  * A n t l r  S e t s / E r r o r  F i l e  H e a d e r
00003  *
00004  * Generated from: parser.h parser.g
00005  *
00006  * Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001
00007  * Parr Research Corporation
00008  * with Purdue University Electrical Engineering
00009  * With AHPCRC, University of Minnesota
00010  * ANTLR Version 1.33MR33
00011  */
00012 
00013 #define ANTLR_VERSION 13333
00014 #include "pcctscfg.h"
00015 #include "pccts_stdio.h"
00016 
00017 #include "charbuf.h"
00018 #include "stringbuffer.h"
00019 #include "libicl.h"
00020 #include "libicl_private.h"
00021 #include "glib.h"
00022 #include <stdio.h>
00023 #ifdef _WINDOWS
00024 #include "oaa-windows.h"
00025 #endif
00026 
00027 /* Abstract Syntax Tree fields */
00028 #define AST_FIELDS int isDefined; int type; char* tokenData; size_t tokenLen;
00029 /* Remember column numbers */
00030 #define ZZCOL
00031 /* We define syntax error function */
00032 #define USER_ZZSYN
00033 /* Token buffer size */
00034 /* #define ZZLEXBUFSIZE 10485760*/
00035 #define ZZLEXBUFSIZE 10485760
00036 
00037 extern GByteArray* parser_dblQuoteBuf;
00038 extern char* parser_tmpStrIn;
00039 #ifdef NORMAL_GC
00040 extern void* GC_debug_malloc(size_t, const char*, int);
00041 extern char* gc_strdup(char*);
00042 #endif
00043 
00044 #ifdef NORMAL_GC
00045 #define zzcr_ast(ast, attr, ttype, text) { \
00046   if(((ttype) == ICLDATAQ) || \
00047   ((ttype) == DBLQUOTED)) { \
00048     char* buf = parser_dblQuoteBuf->data; \
00049     g_byte_array_free(parser_dblQuoteBuf, FALSE); \
00050     /* \
00051     char* buf = (char*)malloc(parser_dblQuoteLen + 1); \
00052     memcpy(buf, text, parser_dblQuoteLen); \
00053     buf[parser_dblQuoteLen] = '\0'; \
00054     */ \
00055     ast->tokenData = buf; \
00056     ast->tokenLen = parser_dblQuoteLen; \
00057   } \
00058   else { \
00059     if(zzbufovf) { \
00060       ast->tokenLen = ZZLEXBUFSIZE; \
00061       ast->tokenData = (char*)GC_debug_malloc(ZZLEXBUFSIZE + 1, __FILE__, __LINE__); \
00062       strncpy(ast->tokenData, text, ZZLEXBUFSIZE); \
00063       fprintf(stderr, "ZZLEXBUFSIZE overflowed (%i)\n", ZZLEXBUFSIZE); \
00064     } \
00065     else { \
00066       ast->tokenData = gc_strdup(text); \
00067       ast->tokenLen = strlen(text); \
00068     } \
00069   } \
00070   ast->type = (ttype); \
00071   ast->isDefined = 1; \
00072   ast->right = NULL; \
00073   ast->down = NULL; \
00074   /* printf("zzcr_ast at pointer %p\n", ast); */ \
00075 };
00076 
00077 /*
00078 #define zzd_ast(t) { \
00079   GC_debug_free(t->tokenData); \
00080   fprintf(stderr, "freed token data at pointer %p\n", t); \
00081   t->isDefined = 0; \
00082 } \
00083 */
00084 #undef zzd_ast
00085 
00086 #else
00087 #define zzcr_ast(ast, attr, ttype, text) { \
00088   if(((ttype) == ICLDATAQ) || \
00089   ((ttype) == DBLQUOTED)) { \
00090     char* buf = parser_dblQuoteBuf->data; \
00091     g_byte_array_free(parser_dblQuoteBuf, FALSE); \
00092     /* \
00093     char* buf = (char*)malloc(parser_dblQuoteLen + 1); \
00094     memcpy(buf, text, parser_dblQuoteLen); \
00095     buf[parser_dblQuoteLen] = '\0'; \
00096     */ \
00097     ast->tokenData = buf; \
00098     ast->tokenLen = parser_dblQuoteLen; \
00099   } \
00100   else { \
00101     if(zzbufovf) { \
00102       ast->tokenLen = ZZLEXBUFSIZE; \
00103       ast->tokenData = (char*)malloc(ZZLEXBUFSIZE + 1); \
00104       strncpy(ast->tokenData, text, ZZLEXBUFSIZE); \
00105       fprintf(stderr, "ZZLEXBUFSIZE overflowed (%i)\n", ZZLEXBUFSIZE); \
00106     } \
00107     else { \
00108       ast->tokenData = strdup(text); \
00109       ast->tokenLen = strlen(text); \
00110     } \
00111   } \
00112   ast->type = (ttype); \
00113   ast->isDefined = 1; \
00114   ast->right = NULL; \
00115   ast->down = NULL; \
00116   /* printf("zzcr_ast at pointer %p\n", ast); */ \
00117 };
00118 
00119 /*
00120 #define zzd_ast(t) { \
00121   free(t->tokenData); \
00122   t->isDefined = 0; \
00123 } \
00124 */
00125 #undef zzd_ast
00126 
00127 #endif
00128 
00129 extern int parser_dblQuoteLen;
00130 extern ICLTerm* parser_getTermFromString(char* str, size_t len);
00131 extern ICLTerm* parser_getTermFromStringDebug(char* str, size_t len);
00132 extern int parser_getTermFromBuf(ICLTerm** result, stringbuffer_t* buf, int* lookedAhead);
00133 extern int parser_getNetTermFromBuf(ICLTerm** result, stringbuffer_t* buf);
00134 /*extern void zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text);*/
00135 extern int parser_error;
00136 extern int parser_setDebug(int b);
00137 extern void handleDblQuotedData();
00138 #define LL_K 2
00139 #define zzSET_SIZE 8
00140 #include "antlr.h"
00141 #include "ast.h"
00142 #include "tokens.h"
00143 #include "dlgdef.h"
00144 #include "err.h"
00145 
00146 ANTLRChar *zztokens[49]={
00147   /* 00 */  "Invalid",
00148   /* 01 */  "@",
00149   /* 02 */  "GROUP",
00150   /* 03 */  "LIST",
00151   /* 04 */  "VAR",
00152   /* 05 */  "STRUCT",
00153   /* 06 */  "ICLDATAQ",
00154   /* 07 */  "STR",
00155   /* 08 */  "INT",
00156   /* 09 */  "FLOAT",
00157   /* 10 */  "TERM_LITERAL",
00158   /* 11 */  "ICLDATAQ_LITERAL",
00159   /* 12 */  "LBRACE",
00160   /* 13 */  "RBRACE",
00161   /* 14 */  "LBRACK",
00162   /* 15 */  "RBRACK",
00163   /* 16 */  "LPAREN",
00164   /* 17 */  "RPAREN",
00165   /* 18 */  "DBL_COLON",
00166   /* 19 */  "TURNSTILE",
00167   /* 20 */  "COLON",
00168   /* 21 */  "SEMI",
00169   /* 22 */  "COMMA",
00170   /* 23 */  "PLUS",
00171   /* 24 */  "MINUS",
00172   /* 25 */  "STAR",
00173   /* 26 */  "DIV",
00174   /* 27 */  "EQUAL",
00175   /* 28 */  "BACKSLASH",
00176   /* 29 */  "BANG",
00177   /* 30 */  "TILDE",
00178   /* 31 */  "PIPE",
00179   /* 32 */  "DOT",
00180   /* 33 */  "NUM_INTONE",
00181   /* 34 */  "NUM_INTTWO",
00182   /* 35 */  "NUM_FLOATONE",
00183   /* 36 */  "NUM_FLOATTWO",
00184   /* 37 */  "WS",
00185   /* 38 */  "NEWLINE",
00186   /* 39 */  "SPECIAL_CHAR_LITERAL",
00187   /* 40 */  "IDENT",
00188   /* 41 */  "VARIABLE",
00189   /* 42 */  "'",
00190   /* 43 */  "\"",
00191   /* 44 */  "''",
00192   /* 45 */  "STRING_LITERAL",
00193   /* 46 */  "[\\n\\r]",
00194   /* 47 */  "~['\\n\\r]+",
00195   /* 48 */  "DBLQUOTED"
00196 };
00197 SetWordType zzerr1[8] = {0x2,0x0,0x0,0x0, 0x1,0x0,0x0,0x0};
00198 SetWordType zzerr2[8] = {0x0,0x4,0x0,0x0, 0x1,0x0,0x0,0x0};
00199 SetWordType zzerr3[8] = {0x0,0x0,0x14,0x0, 0x0,0x0,0x0,0x0};
00200 SetWordType setwd1[49] = {0x0,0x7f,0x0,0x0,0x0,0x0,0x0,
00201   0x0,0x0,0x0,0x0,0x0,0x0,0x78,0x0,
00202   0x78,0x0,0x78,0x80,0x70,0x80,0x60,0x78,
00203   0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,
00204   0x0,0x78,0x0,0x0,0x0,0x0,0x0,0x0,
00205   0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
00206   0x0,0x0};
00207 SetWordType zzerr4[8] = {0x0,0x0,0x80,0x1, 0x0,0x0,0x0,0x0};
00208 SetWordType zzerr5[8] = {0x0,0x0,0x0,0x6, 0x0,0x0,0x0,0x0};
00209 SetWordType zzerr6[8] = {0x0,0x5c,0xbd,0x3f, 0x9e,0x23,0x0,0x0};
00210 SetWordType zzerr7[8] = {0x2,0xfc,0xff,0x3f, 0x9f,0x23,0x0,0x0};
00211 SetWordType setwd2[49] = {0x0,0x95,0x0,0x0,0x0,0x0,0x0,
00212   0x0,0x0,0x0,0xc0,0xc0,0xc0,0x95,0xc0,
00213   0x95,0xc0,0x95,0xb4,0xf5,0xb4,0xf5,0x95,
00214   0xf2,0xf2,0xe8,0xe8,0xf5,0xb5,0xe0,0x0,
00215   0x0,0x95,0xc0,0xc0,0xc0,0xc0,0x0,0x0,
00216   0xe0,0xe0,0xc0,0x0,0x0,0x0,0xe0,0x0,
00217   0x0,0x0};
00218 SetWordType zzerr8[8] = {0x0,0x0,0xbc,0x3f, 0x80,0x21,0x0,0x0};
00219 SetWordType zzerr9[8] = {0x0,0xfc,0xbf,0x3f, 0x9e,0x23,0x0,0x0};
00220 SetWordType zzerr10[8] = {0x0,0x0,0x0,0x0, 0x6,0x0,0x1,0x0};
00221 SetWordType setwd3[49] = {0x0,0x83,0x0,0x0,0x0,0x0,0x0,
00222   0x0,0x0,0x0,0x8,0x8,0x8,0xb3,0x8,
00223   0xb3,0x8,0xb7,0x8b,0x8b,0x8b,0x8b,0x83,
00224   0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x8,0x0,
00225   0x0,0x83,0x48,0x48,0x8,0x8,0x0,0x0,
00226   0x8,0x8,0x8,0x0,0x0,0x0,0x8,0x0,
00227   0x0,0x0};
00228 SetWordType zzerr11[8] = {0x0,0x0,0x0,0x0, 0x6,0x0,0x0,0x0};
00229 SetWordType zzerr12[8] = {0x0,0x0,0x0,0x0, 0x6,0x0,0x0,0x0};
00230 SetWordType zzerr13[8] = {0x0,0x5c,0xa9,0x2f, 0x9e,0x23,0x0,0x0};
00231 SetWordType zzerr14[8] = {0x0,0xc,0xa8,0x2f, 0x80,0x21,0x0,0x0};
00232 SetWordType zzerr15[8] = {0x0,0x10,0x1,0x0, 0x0,0x0,0x0,0x0};
00233 SetWordType setwd4[49] = {0x0,0xf0,0x0,0x0,0x0,0x0,0x0,
00234   0x0,0x0,0x0,0x4,0x4,0x8,0xf0,0x0,
00235   0xf0,0x8,0xf3,0xf0,0xf4,0xf0,0xf4,0xf0,
00236   0xf4,0xf4,0xf4,0xf4,0xf4,0xf0,0x4,0x0,
00237   0x0,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,
00238   0x4,0x4,0x0,0x0,0x0,0x0,0x4,0x0,
00239   0x0,0x0};
00240 SetWordType setwd5[49] = {0x0,0x1,0x0,0x0,0x0,0x0,0x0,
00241   0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,
00242   0x1,0x0,0x1,0x1,0x1,0x1,0x1,0x1,
00243   0x1,0x1,0x1,0x1,0x1,0x1,0x0,0x0,
00244   0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,
00245   0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
00246   0x0,0x0};

Generated on Wed May 23 17:20:10 2007 using doxygen 1.5.2