Line 423... |
Line 423... |
break;
|
break;
|
case OP_BRV:
|
case OP_BRV:
|
BLD_BRANCH(op_brv,ZIPC_V)
|
BLD_BRANCH(op_brv,ZIPC_V)
|
break;
|
break;
|
case OP_CLR:
|
case OP_CLR:
|
|
if((m_cond == zp.ZIPC_ALWAYS))
|
in = zp.op_clr(m_opb);
|
in = zp.op_clr(m_opb);
|
|
else
|
|
in = zp.op_clrf(m_cond, m_opb);
|
break;
|
break;
|
case OP_TRAP:
|
case OP_TRAP:
|
if((m_opb == zp.ZIP_Rnone)&&(m_cond == zp.ZIPC_ALWAYS))
|
if((m_opb == zp.ZIP_Rnone)&&(m_cond == zp.ZIPC_ALWAYS))
|
in = zp.op_ldi(imm, zp.ZIP_CC);
|
in = zp.op_ldi(imm, zp.ZIP_CC);
|
else if((m_opb == zp.ZIP_Rnone)&&((imm&0x0ffff)==imm))
|
else if((m_opb == zp.ZIP_Rnone)&&((imm&0x0ffff)==imm))
|
Line 437... |
Line 440... |
else {
|
else {
|
yyerror("Illegal trap!");
|
yyerror("Illegal trap!");
|
in = zp.op_trap(m_cond, 0);
|
in = zp.op_trap(m_cond, 0);
|
}
|
}
|
break;
|
break;
|
|
case OP_RETN: in = zp.op_retn(m_cond); break;
|
case OP_HALT: in = zp.op_halt(m_cond); break;
|
case OP_HALT: in = zp.op_halt(m_cond); break;
|
case OP_RTU: in = zp.op_rtu(m_cond); break;
|
case OP_RTU: in = zp.op_rtu(m_cond); break;
|
case OP_BUSY: in = zp.op_busy(m_cond); break;
|
case OP_BUSY: in = zp.op_busy(m_cond); break;
|
case OP_BREAK: in = zp.op_break(); break;
|
case OP_BREAK: in = zp.op_break(); break;
|
case OP_NOOP: in = zp.op_noop(); break;
|
case OP_NOOP: in = zp.op_noop(); break;
|
Line 605... |
Line 609... |
SYMTABLE_ENTRY(const char *str) : m_recursion_check(0), m_name(str), m_value(NULL) {
|
SYMTABLE_ENTRY(const char *str) : m_recursion_check(0), m_name(str), m_value(NULL) {
|
trim(m_name);
|
trim(m_name);
|
} SYMTABLE_ENTRY(const char *str, AST *v) : m_recursion_check(0), m_name(str), m_value(v) {
|
} SYMTABLE_ENTRY(const char *str, AST *v) : m_recursion_check(0), m_name(str), m_value(v) {
|
trim(m_name);
|
trim(m_name);
|
} ~SYMTABLE_ENTRY(void) {
|
} ~SYMTABLE_ENTRY(void) {
|
|
if (m_value)
|
delete m_value;
|
delete m_value;
|
}
|
}
|
|
|
SYMTABLE_ENTRY &operator=(AST *new_value) {
|
SYMTABLE_ENTRY &operator=(AST *new_value) {
|
if (m_value)
|
if (m_value)
|
Line 662... |
Line 667... |
SYMBOL_TABLE(void) {}
|
SYMBOL_TABLE(void) {}
|
~SYMBOL_TABLE(void) {
|
~SYMBOL_TABLE(void) {
|
TBLT::iterator i = m_tbl.begin();
|
TBLT::iterator i = m_tbl.begin();
|
while(i != m_tbl.end()) {
|
while(i != m_tbl.end()) {
|
delete (*i);
|
delete (*i);
|
m_tbl.erase(i);
|
i = m_tbl.erase(i);
|
}
|
}
|
}
|
}
|
|
|
void define(const char *key, AST *value) {
|
void define(const char *key, AST *value) {
|
SYMTABLE_ENTRY *v = new SYMTABLE_ENTRY(key, value);
|
SYMTABLE_ENTRY *v = new SYMTABLE_ENTRY(key, value);
|
Line 715... |
Line 720... |
if ((file_context)&&(file_context->isdefined(key)))
|
if ((file_context)&&(file_context->isdefined(key)))
|
return true;
|
return true;
|
else
|
else
|
return global_context->isdefined(key);
|
return global_context->isdefined(key);
|
} int stb_value(const char *key) {
|
} int stb_value(const char *key) {
|
if (file_context->isdefined(key))
|
if ((file_context)&&(file_context->isdefined(key)))
|
return file_context->value(key);
|
return file_context->value(key);
|
else
|
else
|
return global_context->value(key);
|
return global_context->value(key);
|
} void stb_define(const char *key, AST *value) {
|
} void stb_define(const char *key, AST *value) {
|
file_context->define(key, value);
|
file_context->define(key, value);
|