Code read_stat(Pnode p) { Code result, specifiercode; int op; // Vincoli semantici Psymbol symbol = lookup(valname(p->child->brother)); if (symbol == NULL) semerror(p->child, "Unknown identifier"); if (p->child->child != NULL) { // Con specifier op = T_FGET; specifiercode = specifier(p->child); } else { op = T_GET; } Value v1; v1.ival = symbol->oid; Value v2; v2.sval = get_format(symbol->schema); result = makecode2(op, v1, v2); if (op == T_GET) return result; else return appcode(specifiercode, result); }
Code makecode3(Operator op, Value arg1, Value arg2, Value arg3) { Code code; code = makecode2(op, arg1, arg2); code.head->args[2] = arg3; return code; }
Code makecode3(Operator op, int arg1, int arg2, int arg3) { Code code; code = makecode2(op, arg1, arg2); code.head->args[2].ival = arg3; return(code); }