// Initialize to null by default.
trans::access *record::initializer() {
static trans::bltinAccess a(run::pushNullRecord);
return &a;
}
dummyRecord::dummyRecord(symbol name)
: record(name, new frame(name, 0,0))
{
// Encode the instructions to put an placeholder instance of the record
// on the stack.
trans::coder c(nullPos, this, 0);
c.closeRecord();
}
dummyRecord::dummyRecord(string s)
: record (symbol::trans(s), new frame(s,0,0))
{
// Encode the instructions to put an placeholder instance of the record
// on the stack.
trans::coder c(nullPos, this, 0);
c.closeRecord();
}
void dummyRecord::add(string name, ty *t, trans::access *a,
trans::permission perm) {
e.addVar(symbol::trans(name),
new trans::varEntry(t, a, perm, this, this, nullPos));
}
void dummyRecord::add(string name, function *t, vm::bltin f,
trans::permission perm) {
REGISTER_BLTIN(f, name);
add(name, t, new trans::bltinAccess(f), perm);
}