mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-31 09:11:13 +00:00
633a5b1aac
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3785 91177308-0d34-0410-b5e6-96231b3b80d8
49 lines
704 B
C
49 lines
704 B
C
char rcsid_operator[] = "$Id$";
|
|
|
|
#include "b.h"
|
|
#include <stdio.h>
|
|
|
|
int max_arity = -1;
|
|
|
|
List operators;
|
|
List leaves;
|
|
|
|
Operator
|
|
newOperator(name, num, arity) char *name; OperatorNum num; ArityNum arity;
|
|
{
|
|
Operator op;
|
|
|
|
assert(arity <= MAX_ARITY);
|
|
op = (Operator) zalloc(sizeof(struct operator));
|
|
assert(op);
|
|
op->name = name;
|
|
op->num = num;
|
|
op->arity = arity;
|
|
|
|
operators = newList(op, operators);
|
|
|
|
return op;
|
|
}
|
|
|
|
void
|
|
dumpOperator_s(op) Operator op;
|
|
{
|
|
printf("Op: %s(%d)=%d\n", op->name, op->arity, op->num);
|
|
}
|
|
|
|
void
|
|
dumpOperator(op, full) Operator op; int full;
|
|
{
|
|
dumpOperator_s(op);
|
|
if (full) {
|
|
dumpTable(op->table, 0);
|
|
}
|
|
}
|
|
|
|
void
|
|
dumpOperator_l(op) Operator op;
|
|
{
|
|
dumpOperator(op, 1);
|
|
}
|
|
|