i hate []
This commit is contained in:
parent
a196bf0577
commit
e637c944fe
5 changed files with 150 additions and 118 deletions
|
|
@ -6,39 +6,47 @@
|
|||
#define Extern extern
|
||||
#include "acid.h"
|
||||
|
||||
static char *binop[] =
|
||||
static char *binop[NUMO];
|
||||
|
||||
static void
|
||||
initbinop(void)
|
||||
{
|
||||
[OMUL] "*",
|
||||
[ODIV] "/",
|
||||
[OMOD] "%",
|
||||
[OADD] "+",
|
||||
[OSUB] "-",
|
||||
[ORSH] ">>",
|
||||
[OLSH] "<<",
|
||||
[OLT] "<",
|
||||
[OGT] ">",
|
||||
[OLEQ] "<=",
|
||||
[OGEQ] ">=",
|
||||
[OEQ] "==",
|
||||
[ONEQ] "!=",
|
||||
[OLAND] "&",
|
||||
[OXOR] "^",
|
||||
[OLOR] "|",
|
||||
[OCAND] "&&",
|
||||
[OCOR] "||",
|
||||
[OASGN] " = ",
|
||||
binop[OMUL]= "*";
|
||||
binop[ODIV]= "/";
|
||||
binop[OMOD]= "%";
|
||||
binop[OADD]= "+";
|
||||
binop[OSUB]= "-";
|
||||
binop[ORSH]= ">>";
|
||||
binop[OLSH]= "<<";
|
||||
binop[OLT]= "<";
|
||||
binop[OGT]= ">";
|
||||
binop[OLEQ]= "<=";
|
||||
binop[OGEQ]= ">=";
|
||||
binop[OEQ]= "==";
|
||||
binop[ONEQ]= "!=";
|
||||
binop[OLAND]= "&";
|
||||
binop[OXOR]= "^";
|
||||
binop[OLOR]= "|";
|
||||
binop[OCAND]= "&&";
|
||||
binop[OCOR]= "||";
|
||||
binop[OASGN]= " = ";
|
||||
};
|
||||
|
||||
static char *tabs = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
|
||||
char *typenames[] =
|
||||
{
|
||||
[TINT] "integer",
|
||||
[TFLOAT] "float",
|
||||
[TSTRING] "string",
|
||||
[TLIST] "list",
|
||||
[TCODE] "code",
|
||||
char *typenames[] = {
|
||||
"integer",
|
||||
"float",
|
||||
"string",
|
||||
"list",
|
||||
"code",
|
||||
};
|
||||
|
||||
void
|
||||
initprint(void)
|
||||
{
|
||||
initbinop();
|
||||
}
|
||||
|
||||
int
|
||||
cmp(const void *va, const void *vb)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue