Big refactoring for new syntax.

This commit is contained in:
David Anderson 2014-06-19 22:15:42 -07:00
parent f3c37fdc91
commit 27c1e3cf14
8 changed files with 467 additions and 275 deletions

View File

@ -728,18 +728,20 @@ functag public SQLTxnSuccess(Handle:db, any:data, numQueries, Handle:results[],
*/
functag public SQLTxnFailure(Handle:db, any:data, numQueries, const String:error[], failIndex, any:queryData[]);
/**
* Adds a query to a transaction object.
*
* @param txn A transaction handle.
* @param query Query string.
* @param data Extra data value to pass to the final callback.
* @return The index of the query in the transaction's query list.
* @error Invalid transaction handle.
*/
native SQL_AddQuery(Transaction:txn, const String:query[], any:data=0);
methodmap Transaction < Handle
{
/**
* Adds a query to a transaction object.
*
* @param txn A transaction handle.
* @param query Query string.
* @param data Extra data value to pass to the final callback.
* @return The index of the query in the transaction's query list.
* @error Invalid transaction handle.
*/
AddQuery = native SQL_AddQuery(Transaction:txn, const String:query[], any:data=0);
public AddQuery = SQL_AddQuery;
};
/**

View File

@ -81,8 +81,8 @@ native Handle:CloneHandle(Handle:hndl, Handle:plugin=INVALID_HANDLE);
*/
methodmap Handle
{
Clone = CloneHandle;
Close = CloseHandle;
public Clone = CloneHandle;
public Close = CloseHandle;
};
/**

View File

@ -11,7 +11,7 @@ compiler.includes += [
]
if compiler.cc.behavior == 'gcc':
compiler.cflags += ['-Wno-format']
compiler.cflags += ['-std=c99', '-Wno-format']
if builder.target_platform == 'linux':
compiler.postlink += ['-lgcc', '-lm']
elif compiler.cc.behavior == 'msvc':

View File

@ -150,7 +150,6 @@ typedef struct s_symbol {
char *documentation; /* optional documentation string */
} symbol;
/* Possible entries for "ident". These are used in the "symbol", "value"
* and arginfo structures. Not every constant is valid for every use.
* In an argument list, the list is terminated with a "zero" ident; labels
@ -255,6 +254,14 @@ typedef struct svalue_s {
int lvalue;
} svalue;
/* For parsing declarations. */
typedef struct {
char type[sNAMEMAX + 1];
constvalue *enumroot;
int tag;
char usage;
} declinfo_t;
/* "while" statement queue (also used for "for" and "do - while" loops) */
enum {
wqBRK, /* used to restore stack for "break" */
@ -290,6 +297,13 @@ typedef struct s_stringpair {
char *documentation;
} stringpair;
// Helper for token info.
typedef struct {
int id;
cell val;
char *str;
} token_t;
/* macros for code generation */
#define opcodes(n) ((n)*sizeof(cell)) /* opcode size */
#define opargs(n) ((n)*sizeof(cell)) /* size of typical argument */
@ -350,6 +364,7 @@ enum {
tFUNCTAG,
tGOTO,
tIF,
tINT,
tMETHODMAP,
tNATIVE,
tNEW,
@ -365,6 +380,7 @@ enum {
tSWITCH,
tTAGOF,
tTHEN,
tVOID,
tWHILE,
/* compiler directives */
tpASSERT, /* #assert */
@ -479,10 +495,12 @@ typedef enum s_optmark {
int pc_compile(int argc, char **argv);
int pc_addconstant(char *name,cell value,int tag);
int pc_addtag(char *name);
int pc_addtag_flags(char *name, int flags);
int pc_findtag(const char *name);
int pc_addfunctag(char *name);
int pc_enablewarning(int number,int enable);
const char *pc_tagname(int tag);
int parse_decl(declinfo_t *decl, const token_t *first, int flags);
/*
* Functions called from the compiler (to be implemented by you)
@ -567,11 +585,13 @@ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths); /
SC_FUNC void preprocess(void);
SC_FUNC void lexinit(void);
SC_FUNC int lex(cell *lexvalue,char **lexsym);
SC_FUNC int lextok(token_t *tok);
SC_FUNC void lexpush(void);
SC_FUNC void lexclr(int clreol);
SC_FUNC int matchtoken(int token);
SC_FUNC int tokeninfo(cell *val,char **str);
SC_FUNC int needtoken(int token);
SC_FUNC int expecttoken(int id, token_t *tok);
SC_FUNC void litadd(cell value);
SC_FUNC void litinsert(cell value,int pos);
SC_FUNC int alphanum(char c);
@ -847,7 +867,8 @@ SC_VDECL int sc_curstates; /* ID of the current state list */
SC_VDECL int pc_optimize; /* (peephole) optimization level */
SC_VDECL int pc_memflags; /* special flags for the stack/heap usage */
SC_VDECL int pc_functag; /* global function tag */
SC_VDECL int pc_tag_string; /* global string tag */
SC_VDECL int pc_tag_string; /* global String tag */
SC_VDECL int pc_tag_void; /* global void tag */
SC_VDECL int pc_anytag; /* global any tag */
SC_VDECL int glbstringread; /* last global string read */

View File

@ -76,6 +76,7 @@
int pc_anytag = 0;
int pc_functag = 0;
int pc_tag_string = 0;
int pc_tag_void = 0;
static void resetglobals(void);
static void initglobals(void);
@ -138,7 +139,7 @@ static void dogoto(void);
static void dolabel(void);
static void doreturn(void);
static void dofuncenum(int listmode);
static void domethodmap();
static void domethodmap(LayoutSpec spec);
static void dobreak(void);
static void docont(void);
static void dosleep(void);
@ -658,9 +659,8 @@ int pc_findtag(const char *name)
#endif
int pc_addtag(char *name)
{
cell val;
constvalue *ptr;
int last,tag;
int val;
int flags = 0;
if (name==NULL) {
/* no tagname was given, check for one */
@ -670,6 +670,18 @@ int pc_addtag(char *name)
} /* if */
} /* if */
if (isupper(*name))
flags |= FIXEDTAG;
return pc_addtag_flags(name, flags);
}
int pc_addtag_flags(char *name, int flags)
{
cell val;
constvalue *ptr;
int last,tag;
assert(strchr(name,':')==NULL); /* colon should already have been stripped */
last=0;
ptr=tagname_tab.next;
@ -686,8 +698,7 @@ int pc_addtag(char *name)
/* tagname currently unknown, add it */
tag=last+1; /* guaranteed not to exist already */
if (isupper(*name))
tag |= (int)FIXEDTAG;
tag|=flags;
append_constval(&tagname_tab,name,(cell)tag,0);
return tag;
}
@ -1351,6 +1362,8 @@ static void setconstants(void)
pc_anytag = pc_addtag("any");
pc_functag = pc_addfunctag("Function");
pc_tag_string = pc_addtag("String");
pc_tag_void = pc_addtag_flags("void", FIXEDTAG);
sc_rationaltag = pc_addtag("Float");
add_constant("true",1,sGLOBAL,1); /* boolean flags */
add_constant("false",0,sGLOBAL,1);
@ -1514,7 +1527,7 @@ static void parse(void)
dofuncenum(TRUE);
break;
case tMETHODMAP:
domethodmap();
domethodmap(Layout_MethodMap);
break;
case tFUNCTAG:
dofuncenum(FALSE);
@ -3242,24 +3255,217 @@ static void declstruct(void)
matchtoken(';'); /* eat up optional semicolon */
}
int parse_typeexpr(declinfo_t *decl, const token_t *first, int flags)
{
token_t tok;
if (first) {
tok = *first;
} else {
lextok(&tok);
}
if (tok.id == tCONST) {
decl->usage |= uCONST;
lextok(&tok);
}
if (tok.id == tLABEL || tok.id == '[')
return FALSE;
switch (tok.id) {
case tINT:
strcpy(decl->type, "int");
decl->tag = 0;
break;
case tCHAR:
strcpy(decl->type, "char");
decl->tag = pc_tag_string;
break;
case tVOID:
strcpy(decl->type, "void");
decl->tag = pc_tag_void;
break;
case tSYMBOL:
strcpy(decl->type, tok.str);
if (strcmp(decl->type, "float") == 0) {
decl->tag = sc_rationaltag;
} else {
decl->tag = pc_findtag(decl->type);
if (decl->tag == sc_rationaltag)
error(98, "Float", "float");
else if (decl->tag == pc_tag_string)
error(98, "String", "char");
else if (decl->tag == 0)
error(98, "_", "int");
}
default:
return FALSE;
}
return TRUE;
}
// Parse a new-style declaration. If the name was already fetched (because we
// didn't have enough lookahead), it can be given ahead of time.
int parse_decl(declinfo_t *decl, const token_t *first, int flags)
{
memset(decl, 0, sizeof(*decl));
if (!parse_typeexpr(decl, first, flags))
return FALSE;
return TRUE;
}
methodmap_method_t *parse_method(methodmap_t *map)
{
int is_dtor = 0;
int is_bind = 0;
int is_native = 0;
char ident[sNAMEMAX + 1] = "<unknown>";
char bindname[sNAMEMAX + 1] = "<unknown>";
const char *decltype = layout_spec_name(map->spec);
needtoken(tPUBLIC);
token_t tok;
declinfo_t decl;
if (matchtoken('~')) {
// We got something like "public ~Blah = X"
is_bind = 1;
is_dtor = 1;
if (needtoken(tSYMBOL)) {
tokeninfo(&tok.val, &tok.str);
strcpy(ident, tok.str);
}
needtoken('=');
} else {
is_native = matchtoken(tNATIVE);
if (is_native) {
// If we have a native, we should always get a type expression next.
parse_decl(&decl, NULL, 0);
} else {
// Parsing "public Clone =" and "public Handle Clone = " requires two tokens
// of lookahead. By the time we see the '=' in the first example, we'd have
// expected a function name, but it's too late to back up - _lexpush is only
// one token deep.
//
// If we see a symbol and a '=', we know it's a simple binding. Otherwise,
// we have to take the token we got from lextok() and ask parse_decl() to
// start parsing it as a type expression.
int is_symbol = (lextok(&tok) == tSYMBOL);
if (is_symbol) {
// Save the string because matchtoken() will overwrite the token buffer.
// Note we also have to repoint tok so parse_decl will point at our
// local copy.
strcpy(ident, tok.str);
tok.str = ident;
if (matchtoken('=')) {
// Grab the name we're binding to.
is_bind = 1;
if (!expecttoken(tSYMBOL, &tok))
return NULL;
strcpy(bindname, tok.str);
}
}
if (!is_bind) {
// We didn't find an '=', so proceed with a normal function signature.
parse_decl(&decl, &tok, 0);
is_dtor = matchtoken('~');
if (lextok(&tok) != tSYMBOL) {
// Error, and if EOF, return. The lexpush is so we don't accidentally
// skip over a terminator or something, since we scan to the end of the
// line.
lexpush();
error(111);
if (tok.id == 0)
return NULL;
}
strcpy(ident, tok.str);
} // if (tok == symbol && matchtoken('='))
} // if (is_native)
} // if (matchtoken('~'))
symbol *target = NULL;
if (is_bind) {
target = findglb(bindname, sGLOBAL);
if (!target)
error(17, ident);
else if (target->ident != iFUNCTN)
error(10);
} else {
error(10);
}
if (!target)
return NULL;
// Check the implicit this parameter. Currently we only allow scalars. As
// to not encourage enum-structs, we will not allow those either.
const arginfo *first_arg = &target->dim.arglist[0];
if (first_arg->ident == 0 ||
first_arg->ident != iVARIABLE ||
(first_arg->usage & uCONST) ||
first_arg->hasdefault ||
first_arg->numtags != 1)
{
error(108, decltype, map->name);
}
// Ensure the methodmap tag is compatible with |this|.
int ok = 0;
for (methodmap_t *mapptr = map; mapptr; mapptr = mapptr->parent) {
if (first_arg->tags[0] == mapptr->tag) {
ok = 1;
break;
}
}
if (!ok)
error(108, decltype, map->name);
methodmap_method_t *method = (methodmap_method_t *)calloc(1, sizeof(methodmap_method_t));
strcpy(method->name, ident);
method->target = target;
return method;
}
static int consume_line()
{
int val;
char *str;
// First check for EOF.
if (lex(&val, &str) == 0)
return FALSE;
lexpush();
while (!matchtoken(tTERM)) {
// Check for EOF.
if (lex(&val, &str) == 0)
return FALSE;
}
return TRUE;
}
/**
* domethodmap - declare a method map for OO-ish syntax.
*
* methodmap ::= "methodmap" symbol ("<" symbol)? "{" methodmap-body? "}"
* methodmap-body ::= symbol "=" methodmap-method term (, methodmap-body)*
* methodmap-method ::= native-decl|symbol
*/
static void domethodmap()
static void domethodmap(LayoutSpec spec)
{
int val;
char *str;
LayoutSpec spec;
int val, extends;
char mapname[sNAMEMAX + 1];
methodmap_t *map;
methodmap_t *parent = NULL;
const char *decltype = "methodmap";
const char *decltype = layout_spec_name(spec);
// Get the tag.
// methodmap ::= "methodmap" symbol ("<" symbol)? "{" methodmap-body "}"
char mapname[sNAMEMAX + 1];
if (lex(&val, &str) != tSYMBOL)
error(93);
strcpy(mapname, str);
@ -3267,12 +3473,13 @@ static void domethodmap()
if (!isupper(*mapname))
error(109, decltype);
spec = deduce_layout_spec_by_name(mapname);
if (!can_redef_layout_spec(spec, Layout_MethodMap))
error(110, mapname, layout_spec_name(spec));
LayoutSpec old_spec = deduce_layout_spec_by_name(mapname);
if (!can_redef_layout_spec(spec, old_spec))
error(110, mapname, layout_spec_name(old_spec));
extends = matchtoken('<');
if (extends) {
methodmap_t *parent = NULL;
if (matchtoken('<')) {
if (lex(&val, &str) != tSYMBOL) {
error(93);
return;
@ -3283,76 +3490,26 @@ static void domethodmap()
}
}
map = (methodmap_t *)calloc(1, sizeof(methodmap_t));
methodmap_t *map = (methodmap_t *)calloc(1, sizeof(methodmap_t));
map->parent = parent;
map->tag = pc_addtag(mapname);
map->spec = Layout_MethodMap;
map->spec = spec;
strcpy(map->name, mapname);
methodmap_add(map);
needtoken('{');
while (!matchtoken('}')) {
int tok;
symbol *target;
methodmap_t *mapptr;
const arginfo *first_arg;
char ident[sNAMEMAX + 1];
methodmap_method_t *method;
methodmap_method_t **methods;
tok = lex(&val, &str);
if (tok != tSYMBOL) {
// Error, and if EOF, return.
error(93);
if (tok == 0)
if ((method = parse_method(map)) == NULL) {
if (!consume_line())
return;
}
strcpy(ident, str);
needtoken('=');
tok = lex(&val, &str);
if (tok == tNATIVE) {
if ((target = funcstub(TRUE)) == NULL)
return;
} else if (tok == tSYMBOL) {
target = findglb(str, sGLOBAL);
if (!target)
error(17, str);
else if (target->ident != iFUNCTN)
error(10);
} else {
error(10);
}
if (!target || target->ident != iFUNCTN) {
matchtoken(';');
continue;
}
// Check the implicit this parameter. Currently we only allow scalars. As
// to not encourage enum-structs, we will not allow those either.
first_arg = &target->dim.arglist[0];
if (first_arg->ident == 0 ||
first_arg->ident != iVARIABLE ||
(first_arg->usage & uCONST) ||
first_arg->hasdefault ||
first_arg->numtags != 1)
{
error(108, decltype, mapname);
}
// Ensure the methodmap tag is compatible with |this|.
tok = 0;
for (mapptr = map; mapptr; mapptr = mapptr->parent) {
if (first_arg->tags[0] == mapptr->tag) {
tok = 1;
break;
}
}
if (!tok)
error(108, decltype, mapname);
needtoken(tTERM);
methods = (methodmap_method_t **)realloc(map->methods, sizeof(methodmap_method_t *) * map->nummethods);
if (!methods) {
@ -3360,20 +3517,10 @@ static void domethodmap()
return;
}
map->methods = methods;
method = (methodmap_method_t *)calloc(1, sizeof(methodmap_method_t));
if (!method) {
error(123);
return;
}
map->methods[map->nummethods++] = method;
strcpy(method->name, ident);
method->target = target;
matchtoken(';');
}
matchtoken(';');
needtoken(tTERM);
}
/**

View File

@ -1928,8 +1928,8 @@ char *sc_tokens[] = {
"...", "..", "::",
"assert", "*begin", "break", "case", "cellsof", "chars", "const", "continue", "default",
"defined", "do", "else", "*end", "enum", "exit", "for", "forward", "funcenum", "functag", "goto",
"if", "methodmap", "native", "new", "decl", "operator", "public", "return", "sizeof",
"sleep", "static", "stock", "struct", "switch", "tagof", "*then", "while",
"if", "int", "methodmap", "native", "new", "decl", "operator", "public", "return", "sizeof",
"sleep", "static", "stock", "struct", "switch", "tagof", "*then", "void", "while",
"#assert", "#define", "#else", "#elseif", "#emit", "#endif", "#endinput",
"#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma",
"#tryinclude", "#undef",
@ -3012,3 +3012,18 @@ static char itohstr[30];
return itohstr;
}
SC_FUNC int lextok(token_t *tok)
{
tok->id = lex(&tok->val, &tok->str);
return tok->id;
}
SC_FUNC int expecttoken(int id, token_t *tok)
{
int rval = needtoken(id);
if (rval) {
tok->id = tokeninfo(&tok->val, &tok->str);
return rval;
}
return FALSE;
}

View File

@ -52,8 +52,8 @@
static unsigned char warndisable[(NUM_WARNINGS + 7) / 8]; /* 8 flags in a char */
static int errflag;
static int errstart; /* line number at which the instruction started */
static int errline; /* forced line number for the error message */
static int errstart; /* line number at which the instruction started */
static int sErrLine; /* forced line number for the error message */
/* error
*
@ -75,6 +75,12 @@ static short lastfile;
char *msg,*pre;
va_list argptr;
// sErrLine is used to temporarily change the line number of reported errors.
// Pawn has an upstream bug where this is not reset on early-return, which
// can lead to broken line numbers in error messages.
int errline = sErrLine;
sErrLine = -1;
/* errflag is reset on each semicolon.
* In a two-pass compiler, an error should not be reported twice. Therefore
* the error reporting is enabled only in the second pass (and only when
@ -148,7 +154,6 @@ static short lastfile;
longjmp(errbuf,2); /* fatal error, quit */
} /* if */
errline=-1;
/* check whether we are seeing many errors on the same line */
if ((errstart<0 && lastline!=fline) || lastline<errstart || lastline>fline || fcurrent!=lastfile)
errorcount=0;
@ -176,10 +181,10 @@ SC_FUNC void errorset(int code,int line)
break;
case sEXPRRELEASE:
errstart=-1; /* forget start line number */
errline=-1;
sErrLine=-1;
break;
case sSETPOS:
errline=line;
sErrLine=line;
break;
} /* switch */
}

View File

@ -32,13 +32,13 @@ SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned ch
/*-*SCPACK start of pair table, do not change or remove this line */
unsigned char errstr_table [][2] = {
{101,32}, {116,32}, {111,110}, {105,110}, {97,114}, {115,32}, {100,32}, {116,105}, {101,114}, {37,115}, {101,110}, {97,108}, {135,130}, {34,137}, {141,34}, {110,111},
{117,110}, {114,101}, {97,110}, {121,32}, {115,105}, {97,116}, {111,114}, {109,98}, {32,142}, {115,116}, {143,129}, {109,138}, {100,101}, {41,10}, {101,134}, {98,108},
{140,32}, {111,108}, {114,97}, {144,99}, {116,104}, {102,163}, {118,139}, {115,121}, {167,151}, {97,32}, {168,161}, {117,115}, {150,32}, {132,162}, {103,32}, {136,32},
{103,117}, {115,148}, {176,155}, {97,159}, {132,178}, {99,104}, {105,134}, {166,182}, {111,102}, {101,120}, {102,131}, {165,160}, {131,183}, {101,100}, {101,133}, {105,133},
{170,152}, {118,132}, {184,32}, {105,179}, {193,195}, {116,111}, {173,147}, {109,97}, {109,101}, {99,130}, {171,129}, {180,129}, {115,10}, {112,145}, {109,202}, {104,97},
{116,97}, {98,128}, {153,149}, {44,32}, {130,32}, {156,186}, {132,97}, {152,10}, {101,10}, {99,146}, {109,149}, {192,157}, {40,219}, {100,105}, {102,105}, {99,111},
{196,128}, {217,154}, {34,32}, {139,32}, {119,105}, {117,108}, {97,115}, {148,122}, {116,136}, {110,32}, {146,32}, {98,101}, {108,111}, {111,112}, {118,128}, {201,153},
{131,32}, {131,174}, {218,181}, {58,215}, {100,111}, {109,112}, {108,128}, {237,136}, {165,140}, {239,146}, {164,32}, {208,174}, {205,177}, {206,209}, {105,99}
{117,110}, {114,101}, {97,110}, {121,32}, {115,105}, {111,114}, {97,116}, {109,98}, {32,142}, {115,116}, {100,101}, {143,129}, {109,138}, {41,10}, {101,134}, {98,108},
{140,32}, {111,108}, {114,97}, {144,99}, {116,104}, {102,163}, {118,139}, {97,32}, {115,121}, {168,151}, {169,161}, {117,115}, {136,32}, {149,32}, {132,162}, {103,32},
{103,117}, {105,134}, {115,148}, {97,159}, {176,156}, {132,180}, {99,104}, {101,120}, {166,177}, {111,102}, {102,131}, {165,160}, {131,184}, {101,100}, {101,133}, {105,133},
{170,152}, {118,132}, {185,32}, {105,179}, {193,195}, {116,111}, {115,10}, {174,147}, {109,97}, {109,101}, {98,128}, {99,130}, {171,129}, {181,129}, {112,145}, {109,204},
{104,97}, {116,97}, {132,97}, {153,150}, {44,32}, {130,32}, {154,186}, {102,105}, {152,10}, {101,10}, {99,146}, {109,150}, {192,157}, {40,220}, {100,105}, {117,108},
{99,111}, {196,128}, {218,155}, {34,32}, {139,32}, {119,105}, {97,115}, {148,122}, {116,136}, {110,32}, {131,32}, {146,32}, {98,101}, {108,111}, {111,112}, {118,128},
{203,153}, {131,175}, {219,182}, {58,216}, {100,111}, {109,112}, {108,128}, {238,136}, {165,140}, {240,146}, {102,149}, {164,32}, {209,175}, {206,178}, {207,202}
};
/*-*SCPACK end of pair table, do not change or remove this line */
@ -141,7 +141,7 @@ static char *errmsg[] = {
/*095*/ "cannot have required parameters after optional parameters\n",
/*096*/ "could not find member \"%s\" in struct \"%s\"\n",
/*097*/ "symbol \"%s\" does not have a matching type\n",
/*098*/ "UNUSED\n",
/*098*/ "type \"%s\" should be \"%s\" in new declarations\n",
/*099*/ "member \"%s\" appears more than once in struct \"%s\"\n",
/*100*/ "function prototypes do not match\n",
/*101*/ "specify either all dimensions or only the last dimension\n",
@ -154,117 +154,119 @@ static char *errmsg[] = {
/*108*/ "method must have a first argument compatible with the %s type (%s)\n",
/*109*/ "%s name must start with an uppercase letter\n",
/*110*/ "%s has already been defined as a %s\n",
/*111*/ "expected identifier - did you forget a type?\n",
#else
"\271pect\236\305k\212:\230\323bu\201fo\220\206\216\012",
"\202l\223\251s\203g\366\322e\233\201(\254\271\374\202) \331 f\241\354w ea\265 \042c\346e\042\012",
"\234cl\326\240\302\251\354c\343\340\316appe\204 \360\251\337\365o\220\206\237ock\012",
"\370\230 \277\232i\365le\233t\275\012",
"\273\307\223\232\317\356\264t\314",
"\375a\261gn\236\305 \352\255y\012",
"\367\225\254\341\321\221\325\275\012",
"\375\251\371\201\271\374\202; \346sum\236z\210o\012",
"\274\306\347\200(nega\207ve\323z\210o \254ou\201\302bo\220ds\235",
"\274\273\254\234cl\326\214\012",
"\274out\224d\200\370\314",
"\274\273c\213l\323\232\251\267add\221s\314",
"\217 \212tr\223po\203\201(\217 pu\237\376 \370s\235",
"\274\322e\233t; \232\360s\344t\265\012",
"\042\234fa\345t\342c\346\200\375\244\200l\346\201c\346\200\360s\344t\265 \322e\233t\012",
"m\345\207p\366\234fa\345t\205\360\042s\344t\265\042\012",
"\220\325\236\300\012",
"\203i\207\213iza\240d\225\251\271ce\275\205\234cl\204\236\347\330",
"\232\251la\353l\363",
"\267pect\236\305k\212:\230\324bu\201fo\220\206\216\012",
"\202l\223\247s\203g\366\323e\234\201(\255\267\375\202) \332 f\241\355w ea\266 \042c\346e\042\012",
"\232cl\322\240\302\247\355c\344\341\317appe\204 \352\247\340\365o\220\206\237ock\012",
"\370\230 \277\233i\365le\234t\275\012",
"\273\310\223\233\320\357\265t\306",
"\376a\262gn\236\305 \353\256y\012",
"\367\226\255\342\312\221\326\275\012",
"\376\247\371\201\267\375\202; \346sum\236z\210o\012",
"\274\307\347\200(nega\207ve\324z\210o \255ou\201\302bo\220ds\235",
"\274\273\255\232cl\322\214\012",
"\274out\224d\200\370\306",
"\274\273c\213l\324\233\247\270add\221s\306",
"\217 \212tr\223po\203\201(\217 pu\237ic \370s\235",
"\274\323e\234t; \233\352s\345t\266\012",
"\042\232fa\337t\343c\346\200\376\244\200l\346\201c\346\200\352s\345t\266 \323e\234t\012",
"m\337\207p\366\232fa\337t\205\352\042s\345t\266\042\012",
"\220\326\236\300\012",
"\203i\207\213iza\240d\226\247\267ce\275\205\232cl\204\236\347\331",
"\233\247la\354l\363",
"\274\252 nam\200\216\012",
"\252 \213\221ad\223\325\275\363",
"\375l\246u\200(n\202-\371t\235",
"\306a\261gn\233\201\375\224\365\366a\261gn\233t\012",
"\042b\221ak\342\254\042\311t\203ue\342\277ou\201\302\311t\271t\012",
"\273head\361\335ff\210\205from pro\305typ\330",
"\252 \213\221ad\223\326\275\363",
"\376l\246u\200(n\202-\371t\235",
"\307a\262gn\234\201\376\224\365\366a\262gn\234t\012",
"\042b\221ak\343\255\042\313t\203ue\343\277ou\201\302\313t\267t\012",
"\273head\361\336ff\210\205from pro\305typ\331",
"\217 \362\361\042#if...\042\012",
"\274\265\326ct\257\371t\012",
"\274subscrip\201(\232\352\306\254\305o m\222\223subscripts)\363",
"\274\271\374\202\323\346sum\236z\210o\012",
"\337\365o\220\206\322e\233\201\232c\354s\236a\201\244\200\212\206\302\336\366(\231\204t\236a\201l\203\200%d\235",
"\220k\217w\351\335\221c\207v\330",
"\306\203\234x ou\201\302bo\220d\205(\340\216\235",
"\306\375\203\234x\236(\340\216\235",
"\313\364\276\232\317\356\251\234fa\345\201\246u\200(\313%d\235",
"\313typ\200mis\362 (\313%d\235",
"e\365t\223\322e\233t\012",
"\274\231r\361(po\261\237\223n\202-\350m\203\225\236\231r\203g\235",
"\271t\242 \265\326c\350\205\324l\203\330",
"\371\201\252 \317\205\217 \347\330",
"dupl\376\225\200\042c\346e\342la\353l (\246u\200%d\235",
"\274ellip\224s\323\306\347\200\277\232k\217wn\012",
"\274\337\227\203a\240\302cl\346\205speci\336\210\314",
"\265\326ct\257\371\201\271ce\275\205r\222g\200f\254pack\236\231r\203g\012",
"po\224\214\343p\326\310\350\205\316\315c\275\200\213l nam\236p\326\310\350\314",
"\305o m\222\223\273\264t\314",
"\220k\217w\351\306\347\200(\340\216\235",
"\306\347\276\364 \232\362\323\254\234\231\203a\240\306\277\305o sm\213l\012",
"\306(\205\364 \232\362\012",
"\274l\203\200\311t\203ua\214\012",
"\274r\222g\330",
"\274subscript\323\253\200\042[ ]\342\367\225\226\205\324\307j\254\335\233\224\202\314",
"m\345\207-\335\233\224\202\343\255y\205\375f\345l\223\203i\207\213iz\275\012",
"\271ce\275\361\307ximum nu\227\257\302\335\233\224\202\314",
"\220\362\236c\354s\361b\242c\200(\042}\042\235",
"\231\204\201\302\273bod\223\344\244ou\201\273head\210\012",
"\255ys\323\354c\343\304\276\222\206\273\264t\205\341\321pu\237\376 (\340\216\235",
"\220\272ish\236\271\374\324\353f\226\200\337\365il\257\335\221c\207v\330",
"dupl\376\225\200\264t; sam\200\313\277p\346s\236t\344c\330",
"\273\313\307\223\232\317\356\251\234fa\345\201\246u\200(\340\216\235",
"m\345\207p\366\042#else\342\335\221c\207v\276\353twe\212 \042#if ... #\212\335f\042\012",
"\042#elseif\342\335\221c\207\356f\241\354w\205\352\042#else\342\335\221c\207v\330",
"nu\227\257\302\367\222d\205\364\276\232\336\201\244\200\367\225\226\012",
"\273\221s\345\201\373\302\367\225\226\230 \375\216\012",
"\341\265\222g\200\315\325\236\367\225\226\314",
"\273\313\307\223\202l\223\317\356\251s\203g\366\373(\313%d\235",
"\273\313\307\223\232\321\251\221f\210\212c\200\313\254\352\306(\313\216\235",
"\340\341\321bo\372\251\221f\210\212c\200\222\206\352\306(\340\216\235",
"\274\242\214\343nu\227\257\315ci\224\324\360#p\242g\307\012",
"\242\214\343nu\227\257f\226\307\201\213\221ad\223\325\275\012",
"\242\214\343nu\227\257supp\226\201wa\205\232\212\263\275\012",
"\253\210-\325\236\367\225\254\375\234cl\204\236\353f\226\200\253\200(\370\230\235",
"\042\347e\270\342\367\225\254\277\274\324\042\370\342\252\314",
"\273\313\375\352\306(\313\216\235",
"#\325\200p\225\350\351\316\231\204\201\344\372\352\213p\317\353\207c \265\326c\350\012",
"\203pu\201l\203\200\305o l\202\256(aft\257subs\207tu\214s\235",
"\247n\320x \210r\254\360\244\200\271\374\202\323\254\274\273c\213l\012",
"m\213f\226m\236UTF-8 \212\337d\203g\323\254c\226rupt\236\336le: \211\012",
"\273\253\276bo\372\042\221turn\342\222\206\042\221tur\351<\246ue>\042\012",
"\203\311\224\231\212\201\221tur\351typ\276(\306& n\202-\255y\235",
"\220k\217w\351\252\323\254\232\251\371\201\252 \334",
"\341\320k\200\251\373a\205\251\234fa\345\201\246u\200f\254\352\203\234x\236\306p\326\310t\257\334",
"\253\210-\325\236\367\225\226\205\222\206na\207\356\370\205\307\223\232\317\356\322e\314",
"\251\273\254\340\307\223\202l\223\353l\202\256\305 \251s\203g\366au\305\332\324\334",
"\322\200\311fl\376t: \202\200\302\244\200\322\276\277\213\221ad\223a\261gn\236\305 a\217\244\257i\365le\233\320\240\334",
"\217 \322\276\204\200\325\236f\254\300\012",
"\220k\217w\351au\305\332\202\327",
"\220k\217w\351\322\200\216 f\254au\305\332\202\327",
"pu\237\376 \304\276\222\206\354c\343\304\276\307\223\232\317\356\322\276\334",
"\322\200\304\276\307\223\232\321\203i\207\213iz\236\334",
"pu\237\376 \370\205\307\223\232\221tur\351\255y\205\334",
"a\227i\260ou\205\371t; \373ov\210rid\200\277\221qui\221\206\334",
"nu\227\257\302\264t\205\364\276\232\362 \325i\214\012",
"\271pect\236\373nam\200id\212\207\336\210\012",
"\273\212um\210a\240\221qui\221\205\220iqu\200\320g\012",
"\341\317\356\221qui\221\206p\326\310\350\205aft\257\355\214\343p\326\310\350\314",
"\337\345\206\232\272\206\310\227\210\230 \360\231ruc\201\216\012",
"\300 \364\276\232\317\356\251\362\361typ\330",
"\274\266\322ct\254\371t\012",
"\274subscrip\201(\233\353\307\255\305o m\222\223subscripts)\363",
"\274\267\375\202\324\346sum\236z\210o\012",
"\340\365o\220\206\323e\234\201\233c\355s\236a\201\244\200\212\206\302\327\366(\231\204t\236a\201l\203\200%d\235",
"\220k\217w\351\336\221c\207v\331",
"\307\203\232x ou\201\302bo\220d\205(\341\216\235",
"\307\376\203\232x\236(\341\216\235",
"\315\364\276\233\320\357\247\232fa\337\201\246u\200(\315%d\235",
"\315typ\200mis\362 (\315%d\235",
"e\365t\223\323e\234t\012",
"\274\231r\361(po\262\237\223n\202-\350m\203\226\236\231r\203g\235",
"\267t\242 \266\322c\350\205\325l\203\331",
"\371\201\252 \320\205\217 \347\331",
"duplic\226\200\042c\346e\343la\354l (\246u\200%d\235",
"\274ellip\224s\324\307\347\200\277\233k\217wn\012",
"\274\340\227\203a\240\302cl\346\205speci\327\210\306",
"\266\322ct\254\371\201\267ce\275\205r\222g\200f\255pack\236\231r\203g\012",
"po\224\214\344p\322\311\350\205\317\316c\275\200\213l nam\236p\322\311\350\306",
"\305o m\222\223\273\265t\306",
"\220k\217w\351\307\347\200(\341\216\235",
"\307\347\276\364 \233\362\324\255\232\231\203a\240\307\277\305o sm\213l\012",
"\307(\205\364 \233\362\012",
"\274l\203\200\313t\203ua\214\012",
"\274r\222g\331",
"\274subscript\324\253\200\042[ ]\343\367\226\225\205\325\310j\255\336\234\224\202\306",
"m\337\207-\336\234\224\202\344\256y\205\376f\337l\223\203i\207\213iz\275\012",
"\267ce\275\361\310ximum nu\227\254\302\336\234\224\202\306",
"\220\362\236c\355s\361b\242c\200(\042}\042\235",
"\231\204\201\302\273bod\223\345\244ou\201\273head\210\012",
"\256ys\324\355c\344\304\276\222\206\273\265t\205\342\312pu\237ic (\341\216\235",
"\220\272ish\236\267\375\325\354\372\200\340\365il\254\336\221c\207v\331",
"duplic\226\200\265t; sam\200\315\277p\346s\236t\345c\331",
"\273\315\310\223\233\320\357\247\232fa\337\201\246u\200(\341\216\235",
"m\337\207p\366\042#else\343\336\221c\207v\276\354twe\212 \042#if ... #\212\336f\042\012",
"\042#elseif\343\336\221c\207\357f\241\355w\205\353\042#else\343\336\221c\207v\331",
"nu\227\254\302\367\222d\205\364\276\233\327\201\244\200\367\226\225\012",
"\273\221s\337\201\374\302\367\226\225\230 \376\216\012",
"\342\266\222g\200\316\326\236\367\226\225\306",
"\273\315\310\223\202l\223\320\357\247s\203g\366\374(\315%d\235",
"\273\315\310\223\233\312\247\221f\210\212c\200\315\255\353\307(\315\216\235",
"\341\342\312bo\373\247\221f\210\212c\200\222\206\353\307(\341\216\235",
"\274\242\214\344nu\227\254\316ci\224\325\352#p\242g\310\012",
"\242\214\344nu\227\254\372\310\201\213\221ad\223\326\275\012",
"\242\214\344nu\227\254supp\225\201wa\205\233\212\263\275\012",
"\253\210-\326\236\367\226\255\376\232cl\204\236\354\372\200\253\200(\370\230\235",
"\042\347e\271\343\367\226\255\277\274\325\042\370\343\252\306",
"\273\315\376\353\307(\315\216\235",
"#\326\200p\226\350\351\317\231\204\201\345\373\353\213p\320\354\207c \266\322c\350\012",
"\203pu\201l\203\200\305o l\202\257(aft\254subs\207tu\214s\235",
"\250n\321x \210r\255\352\244\200\267\375\202\324\255\274\273c\213l\012",
"m\213\372m\236UTF-8 \212\340d\203g\324\255c\225rupt\236\327le: \211\012",
"\273\253\276bo\373\042\221turn\343\222\206\042\221tur\351<\246ue>\042\012",
"\203\313\224\231\212\201\221tur\351typ\276(\307& n\202-\256y\235",
"\220k\217w\351\252\324\255\233\247\371\201\252 \335",
"\342\321k\200\247\374a\205\247\232fa\337\201\246u\200f\255\353\203\232x\236\307p\322\311t\254\335",
"\253\210-\326\236\367\226\225\205\222\206na\207\357\370\205\310\223\233\320\357\323e\306",
"\247\273\255\341\310\223\202l\223\354l\202\257\305 \247s\203g\366au\305\333\325\335",
"\323\200\313flict: \202\200\302\244\200\323\276\277\213\221ad\223a\262gn\236\305 a\217\244\254i\365le\234\321\240\335",
"\217 \323\276\204\200\326\236f\255\300\012",
"\220k\217w\351au\305\333\202\330",
"\220k\217w\351\323\200\216 f\255au\305\333\202\330",
"pu\237ic \304\276\222\206\355c\344\304\276\310\223\233\320\357\323\276\335",
"\323\200\304\276\310\223\233\312\203i\207\213iz\236\335",
"pu\237ic \370\205\310\223\233\221tur\351\256y\205\335",
"a\227i\260ou\205\371t; \374ov\210rid\200\277\221qui\221\206\335",
"nu\227\254\302\265t\205\364\276\233\362 \326i\214\012",
"\267pect\236\374nam\200id\212\207\327\210\012",
"\273\212um\210a\240\221qui\221\205\220iqu\200\321g\012",
"\342\320\357\221qui\221\206p\322\311\350\205aft\254\356\214\344p\322\311\350\306",
"\340\337\206\233\272\206\311\227\210\230 \352\231ruc\201\216\012",
"\300 \364\276\233\320\357\247\362\361typ\331",
"typ\200\216 sho\337\206\312\216 \352new \232cl\322\214\306",
"\311\227\210\230 appe\204\205m\225\200\244\353\202c\200\352\231ruc\201\216\012",
"\273pro\305typ\276\364 \233\362\012",
"specif\223ei\244\254\213l \336\234\224\202\205\255\202l\223\244\200l\346\201\336\234\224\202\012",
"\342\272\206%\205\211\012",
"UNUSED\012",
"\310\227\210\230 appe\204\205m\226\200\244\352\202c\200\360\231ruc\201\216\012",
"\273pro\305typ\276\364 \232\362\012",
"specif\223ei\244\257\213l \335\233\224\202\205\254\202l\223\244\200l\346\201\335\233\224\202\012",
"\341\272\206%\205\211\012",
"UNUSED\012",
"\341\272\206\222\223\310\244od\205f\254\211\012",
"\341\272\206\310\244o\206\211.\211\012",
"\341c\213l \310\244od\205\324\352\255y\012",
"\341c\213l \310\244od\205\324\251\370\012",
"\310\244o\206\316\317\356\251\336rs\201\313\337\365a\207\237\200\344\372\244\200%\205typ\200(\211\235",
"%\205nam\200\316\231\204\201\344\372\352upp\210c\346\200let\350\012",
"%\205\317\205\213\221ad\223\353\212 \325\236a\205\251\211\012"
"\342\272\206\222\223\311\244od\205f\255\211\012",
"\342\272\206\311\244o\206\211.\211\012",
"\342c\213l \311\244od\205\325\353\256y\012",
"\342c\213l \311\244od\205\325\247\370\012",
"\311\244o\206\317\320\357\247\327rs\201\315\340\365a\207\237\200\345\373\244\200%\205typ\200(\211\235",
"%\205nam\200\317\231\204\201\345\373\353upp\210c\346\200let\350\012",
"%\205\320\205\213\221ad\223\354\212 \326\236a\205\247\211\012",
"\267pect\236id\212\207\327\254- d\261you \372ge\201\247type?\012"
#endif
};
@ -289,18 +291,18 @@ static char *fatalmsg[] = {
/*130*/ "assertion failed: %s\n",
/*131*/ "user error: %s\n",
#else
"\341\221a\206from \336le\363",
"\341writ\200\305 \336le\363",
"t\263\200ov\210f\354w\363",
"\203suf\336ci\212\201\310m\226y\012",
"\274\346se\227l\257\203\231ruc\214\327",
"num\210\376 ov\210f\354w\323\271ce\275\361capacity\012",
"\337\365il\236scrip\201\271ce\275\205\244\200\307ximum \310m\226\223\347\200(%l\206bytes\235",
"\305o m\222\223\210r\254\310ssag\276\324\202\200l\203\330",
"\337\234pag\200\307pp\361\336\366\232fo\220d\012",
"\274p\225h\363",
"\342\221a\206from \327le\363",
"\342writ\200\305 \327le\363",
"t\263\200ov\210f\355w\363",
"\203suf\327ci\212\201\311m\225y\012",
"\274\346se\227l\254\203\231ruc\214\330",
"num\210ic ov\210f\355w\324\267ce\275\361capacity\012",
"\340\365il\236scrip\201\267ce\275\205\244\200\310ximum \311m\225\223\347\200(%l\206bytes\235",
"\305o m\222\223\210r\255\311ssag\276\325\202\200l\203\331",
"\340\232pag\200\310pp\361\327\366\233fo\220d\012",
"\274p\226h\363",
"\346s\210\240fail\275: \211\012",
"\253\257\210r\226: \211\012"
"\253\254\210r\225: \211\012"
#endif
};
@ -344,43 +346,43 @@ static char *warnmsg[] = {
/*235*/ "public function lacks forward declaration (symbol \"%s\")\n",
/*236*/ "unknown parameter in substitution (incorrect #define pattern)\n"
#else
"\300 \277tr\243\225\236\305 %\206\265\326c\350\314",
"\221\325i\240\302\371t/\307cro \334",
"nu\227\257\302\264t\205\364\276\232\362 \325i\214\012",
"\252 \277nev\257\253\275\363",
"\252 \277a\261gn\236\251\246u\200\244a\201\277nev\257\253\275\363",
"\221d\220d\222\201\337\234: \371\201\271\374\324\277z\210o\012",
"\221d\220d\222\201te\231: \371\201\271\374\324\277n\202-z\210o\012",
"\220k\217w\351#p\242g\307\012",
"\273\344\372\373\221s\345\201\253\236\353f\226\200\325i\214\323f\226c\361\221p\204s\330",
"\370\230 sho\345\206\221tur\351\251\246u\330",
"po\261\237\200\253\200\302\252 \353f\226\200\203i\207\213iza\214\363",
"po\261\237\223\220\203t\212\234\206a\261gn\233t\012",
"po\261\237\223\220\203t\212\234\206bit\344s\200\367a\214\012",
"\373mis\362\012",
"po\261\237\223\251\042\357\342\306\313wa\205\203t\212\234d\363",
"\271\374\324\317\205\217 effect\012",
"ne\231\236\337m\233t\012",
"\354os\200\203d\212\320\214\012",
"\241\206\231y\366pro\305typ\276\253\236\344\372\355\214\343sem\376\241umn\314",
"\354c\343\340\216 s\317\364w\205\251\340a\201\251\315c\275\361level\012",
"\271\374\324\344\372\373ov\210rid\200\316appe\204 \353twe\212 p\204\212\244ese\314",
"la\353l nam\200\216 s\317\364w\205\373na\310\012",
"nu\227\257\302\335git\205\271ce\275\205\242\214\343nu\227\257\315ci\224\202\012",
"\221d\220d\222\201\042\347e\270\042: \313\347\200\277\213way\2051 \334",
"\203\234\350m\203\225\200\306\347\200\360\042\347e\270\342\271\374\324\334",
"\220\221a\265\263\200\337\234\012",
"\251\340\277a\261gn\236\305 itself \334",
"m\226\200\203i\207\213iz\210\205\244\352\212um \336eld\314",
"l\212g\372\302\203i\207\213iz\257\271ce\275\205\347\200\302\244\200\212um \336eld\012",
"\203\234x \373mis\362 \334",
"\217 i\365le\233\320\240f\254\322\200\216 \360\370\230\323\217 f\213l-back\012",
"\322\200speci\336ca\240\324f\226w\204\206\234cl\326\240\277ig\217\221d\012",
"outpu\201\336\366\277writt\212\323bu\201\344\372\337\365ac\201\212\337d\361\335s\263\275\012",
"\322\200\340\216 s\317\364w\205\251g\354b\343\304\330",
"\300 \277m\204k\236a\205\234\315c\225\275: \211\012",
"pu\237\376 \273lack\205f\226w\204\206\234cl\326\240\334",
"\220k\217w\351p\326\310t\257\360subs\207tu\240(\203c\226\221c\201#\325\200p\225\350n\235"
"\300 \277tr\243\226\236\305 %\206\266\322c\350\306",
"\221\326i\240\302\371t/\310cro \335",
"nu\227\254\302\265t\205\364\276\233\362 \326i\214\012",
"\252 \277nev\254\253\275\363",
"\252 \277a\262gn\236\247\246u\200\244a\201\277nev\254\253\275\363",
"\221d\220d\222\201\340\232: \371\201\267\375\325\277z\210o\012",
"\221d\220d\222\201te\231: \371\201\267\375\325\277n\202-z\210o\012",
"\220k\217w\351#p\242g\310\012",
"\273\345\373\374\221s\337\201\253\236\354\372\200\326i\214\324\372c\361\221p\204s\331",
"\370\230 sho\337\206\221tur\351\247\246u\331",
"po\262\237\200\253\200\302\252 \354\372\200\203i\207\213iza\214\363",
"po\262\237\223\220\203t\212\232\206a\262gn\234t\012",
"po\262\237\223\220\203t\212\232\206bit\345s\200\367a\214\012",
"\374mis\362\012",
"po\262\237\223\247\042\360\343\307\315wa\205\203t\212\232d\363",
"\267\375\325\320\205\217 effect\012",
"ne\231\236\340m\234t\012",
"\355os\200\203d\212\321\214\012",
"\241\206\231y\366pro\305typ\276\253\236\345\373\356\214\344semic\241umn\306",
"\355c\344\341\216 s\320\364w\205\247\341a\201\247\316c\275\361level\012",
"\267\375\325\345\373\374ov\210rid\200\317appe\204 \354twe\212 p\204\212\244ese\306",
"la\354l nam\200\216 s\320\364w\205\374na\311\012",
"nu\227\254\302\336git\205\267ce\275\205\242\214\344nu\227\254\316ci\224\202\012",
"\221d\220d\222\201\042\347e\271\042: \315\347\200\277\213way\2051 \335",
"\203\232\350m\203\226\200\307\347\200\352\042\347e\271\343\267\375\325\335",
"\220\221a\266\263\200\340\232\012",
"\247\341\277a\262gn\236\305 itself \335",
"m\225\200\203i\207\213iz\210\205\244\353\212um \327eld\306",
"l\212g\373\302\203i\207\213iz\254\267ce\275\205\347\200\302\244\200\212um \327eld\012",
"\203\232x \374mis\362 \335",
"\217 i\365le\234\321\240f\255\323\200\216 \352\370\230\324\217 f\213l-back\012",
"\323\200speci\327ca\240\325\372w\204\206\232cl\322\240\277ig\217\221d\012",
"outpu\201\327\366\277writt\212\324bu\201\345\373\340\365ac\201\212\340d\361\336s\263\275\012",
"\323\200\341\216 s\320\364w\205\247g\355b\344\304\331",
"\300 \277m\204k\236a\205\232\316c\226\275: \211\012",
"pu\237ic \273lack\205\372w\204\206\232cl\322\240\335",
"\220k\217w\351p\322\311t\254\352subs\207tu\240(\203c\225\221c\201#\326\200p\226\350n\235"
#endif
};