📄 err.c
字号:
/*
* A n t l r S e t s / E r r o r F i l e H e a d e r
*
* Generated from: parser.h parser.g
*
* Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001
* Parr Research Corporation
* with Purdue University Electrical Engineering
* With AHPCRC, University of Minnesota
* ANTLR Version 1.33MR33
*/
#define ANTLR_VERSION 13333
#include "pcctscfg.h"
#include "pccts_stdio.h"
#include "charbuf.h"
#include "stringbuffer.h"
#include "libicl.h"
#include "libicl_private.h"
#include "glib.h"
#include <stdio.h>
#ifdef _WINDOWS
#include "oaa-windows.h"
#endif
/* Abstract Syntax Tree fields */
#define AST_FIELDS int isDefined; int type; char* tokenData; size_t tokenLen;
/* Remember column numbers */
#define ZZCOL
/* We define syntax error function */
#define USER_ZZSYN
/* Token buffer size */
/* #define ZZLEXBUFSIZE 10485760*/
#define ZZLEXBUFSIZE 10485760
extern GByteArray* parser_dblQuoteBuf;
extern char* parser_tmpStrIn;
#ifdef NORMAL_GC
extern void* GC_debug_malloc(size_t, const char*, int);
extern char* gc_strdup(char*);
#endif
#ifdef NORMAL_GC
#define zzcr_ast(ast, attr, ttype, text) { \
if(((ttype) == ICLDATAQ) || \
((ttype) == DBLQUOTED)) { \
char* buf = parser_dblQuoteBuf->data; \
g_byte_array_free(parser_dblQuoteBuf, FALSE); \
/* \
char* buf = (char*)malloc(parser_dblQuoteLen + 1); \
memcpy(buf, text, parser_dblQuoteLen); \
buf[parser_dblQuoteLen] = '\0'; \
*/ \
ast->tokenData = buf; \
ast->tokenLen = parser_dblQuoteLen; \
} \
else { \
if(zzbufovf) { \
ast->tokenLen = ZZLEXBUFSIZE; \
ast->tokenData = (char*)GC_debug_malloc(ZZLEXBUFSIZE + 1, __FILE__, __LINE__); \
strncpy(ast->tokenData, text, ZZLEXBUFSIZE); \
fprintf(stderr, "ZZLEXBUFSIZE overflowed (%i)\n", ZZLEXBUFSIZE); \
} \
else { \
ast->tokenData = gc_strdup(text); \
ast->tokenLen = strlen(text); \
} \
} \
ast->type = (ttype); \
ast->isDefined = 1; \
ast->right = NULL; \
ast->down = NULL; \
/* printf("zzcr_ast at pointer %p\n", ast); */ \
};
/*
#define zzd_ast(t) { \
GC_debug_free(t->tokenData); \
fprintf(stderr, "freed token data at pointer %p\n", t); \
t->isDefined = 0; \
} \
*/
#undef zzd_ast
#else
#define zzcr_ast(ast, attr, ttype, text) { \
if(((ttype) == ICLDATAQ) || \
((ttype) == DBLQUOTED)) { \
char* buf = parser_dblQuoteBuf->data; \
g_byte_array_free(parser_dblQuoteBuf, FALSE); \
/* \
char* buf = (char*)malloc(parser_dblQuoteLen + 1); \
memcpy(buf, text, parser_dblQuoteLen); \
buf[parser_dblQuoteLen] = '\0'; \
*/ \
ast->tokenData = buf; \
ast->tokenLen = parser_dblQuoteLen; \
} \
else { \
if(zzbufovf) { \
ast->tokenLen = ZZLEXBUFSIZE; \
ast->tokenData = (char*)malloc(ZZLEXBUFSIZE + 1); \
strncpy(ast->tokenData, text, ZZLEXBUFSIZE); \
fprintf(stderr, "ZZLEXBUFSIZE overflowed (%i)\n", ZZLEXBUFSIZE); \
} \
else { \
ast->tokenData = strdup(text); \
ast->tokenLen = strlen(text); \
} \
} \
ast->type = (ttype); \
ast->isDefined = 1; \
ast->right = NULL; \
ast->down = NULL; \
/* printf("zzcr_ast at pointer %p\n", ast); */ \
};
/*
#define zzd_ast(t) { \
free(t->tokenData); \
t->isDefined = 0; \
} \
*/
#undef zzd_ast
#endif
extern int parser_dblQuoteLen;
extern ICLTerm* parser_getTermFromString(char* str, size_t len);
extern ICLTerm* parser_getTermFromStringDebug(char* str, size_t len);
extern int parser_getNetTermFromBuf(ICLTerm** result, stringbuffer_t* buf);
/*extern void zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text);*/
extern int parser_error;
extern int parser_setDebug(int b);
extern void handleDblQuotedData();
#define LL_K 2
#define zzSET_SIZE 8
#include "antlr.h"
#include "ast.h"
#include "tokens.h"
#include "dlgdef.h"
#include "err.h"
ANTLRChar *zztokens[49]={
/* 00 */ "Invalid",
/* 01 */ "@",
/* 02 */ "GROUP",
/* 03 */ "LIST",
/* 04 */ "VAR",
/* 05 */ "STRUCT",
/* 06 */ "ICLDATAQ",
/* 07 */ "STR",
/* 08 */ "INT",
/* 09 */ "FLOAT",
/* 10 */ "TERM_LITERAL",
/* 11 */ "ICLDATAQ_LITERAL",
/* 12 */ "LBRACE",
/* 13 */ "RBRACE",
/* 14 */ "LBRACK",
/* 15 */ "RBRACK",
/* 16 */ "LPAREN",
/* 17 */ "RPAREN",
/* 18 */ "DBL_COLON",
/* 19 */ "TURNSTILE",
/* 20 */ "COLON",
/* 21 */ "SEMI",
/* 22 */ "COMMA",
/* 23 */ "PLUS",
/* 24 */ "MINUS",
/* 25 */ "STAR",
/* 26 */ "DIV",
/* 27 */ "EQUAL",
/* 28 */ "BACKSLASH",
/* 29 */ "BANG",
/* 30 */ "TILDE",
/* 31 */ "PIPE",
/* 32 */ "DOT",
/* 33 */ "NUM_INTONE",
/* 34 */ "NUM_INTTWO",
/* 35 */ "NUM_FLOATONE",
/* 36 */ "NUM_FLOATTWO",
/* 37 */ "WS",
/* 38 */ "NEWLINE",
/* 39 */ "SPECIAL_CHAR_LITERAL",
/* 40 */ "IDENT",
/* 41 */ "VARIABLE",
/* 42 */ "'",
/* 43 */ "\"",
/* 44 */ "''",
/* 45 */ "STRING_LITERAL",
/* 46 */ "[\\n\\r]",
/* 47 */ "~['\\n\\r]+",
/* 48 */ "DBLQUOTED"
};
SetWordType zzerr1[8] = {0x2,0x0,0x0,0x0, 0x1,0x0,0x0,0x0};
SetWordType zzerr2[8] = {0x0,0x4,0x0,0x0, 0x1,0x0,0x0,0x0};
SetWordType zzerr3[8] = {0x0,0x0,0x14,0x0, 0x0,0x0,0x0,0x0};
SetWordType setwd1[49] = {0x0,0x7f,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x0,0x0,0x0,0x78,0x0,
0x78,0x0,0x78,0x80,0x70,0x80,0x60,0x78,
0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,
0x0,0x78,0x0,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x0,0x0};
SetWordType zzerr4[8] = {0x0,0x0,0x80,0x1, 0x0,0x0,0x0,0x0};
SetWordType zzerr5[8] = {0x0,0x0,0x0,0x6, 0x0,0x0,0x0,0x0};
SetWordType zzerr6[8] = {0x0,0x5c,0xbd,0x3f, 0x9e,0x23,0x0,0x0};
SetWordType zzerr7[8] = {0x2,0xfc,0xff,0x3f, 0x9f,0x23,0x0,0x0};
SetWordType setwd2[49] = {0x0,0x95,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0xc0,0xc0,0xc0,0x95,0xc0,
0x95,0xc0,0x95,0xb4,0xf5,0xb4,0xf5,0x95,
0xf2,0xf2,0xe8,0xe8,0xf5,0xb5,0xe0,0x0,
0x0,0x95,0xc0,0xc0,0xc0,0xc0,0x0,0x0,
0xe0,0xe0,0xc0,0x0,0x0,0x0,0xe0,0x0,
0x0,0x0};
SetWordType zzerr8[8] = {0x0,0x0,0xbc,0x3f, 0x80,0x21,0x0,0x0};
SetWordType zzerr9[8] = {0x0,0xfc,0xbf,0x3f, 0x9e,0x23,0x0,0x0};
SetWordType zzerr10[8] = {0x0,0x0,0x0,0x0, 0x6,0x0,0x1,0x0};
SetWordType setwd3[49] = {0x0,0x83,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x8,0x8,0x8,0xb3,0x8,
0xb3,0x8,0xb7,0x8b,0x8b,0x8b,0x8b,0x83,
0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x8,0x0,
0x0,0x83,0x48,0x48,0x8,0x8,0x0,0x0,
0x8,0x8,0x8,0x0,0x0,0x0,0x8,0x0,
0x0,0x0};
SetWordType zzerr11[8] = {0x0,0x0,0x0,0x0, 0x6,0x0,0x0,0x0};
SetWordType zzerr12[8] = {0x0,0x0,0x0,0x0, 0x6,0x0,0x0,0x0};
SetWordType zzerr13[8] = {0x0,0x5c,0xa9,0x2f, 0x9e,0x23,0x0,0x0};
SetWordType zzerr14[8] = {0x0,0xc,0xa8,0x2f, 0x80,0x21,0x0,0x0};
SetWordType zzerr15[8] = {0x0,0x10,0x1,0x0, 0x0,0x0,0x0,0x0};
SetWordType setwd4[49] = {0x0,0xf0,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x4,0x4,0x8,0xf0,0x0,
0xf0,0x8,0xf3,0xf0,0xf4,0xf0,0xf4,0xf0,
0xf4,0xf4,0xf4,0xf4,0xf4,0xf0,0x4,0x0,
0x0,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,
0x4,0x4,0x0,0x0,0x0,0x0,0x4,0x0,
0x0,0x0};
SetWordType setwd5[49] = {0x0,0x1,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,
0x1,0x0,0x1,0x1,0x1,0x1,0x1,0x1,
0x1,0x1,0x1,0x1,0x1,0x1,0x0,0x0,
0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,
0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
0x0,0x0};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -