Improved output formatting, and added more instruction support

This commit is contained in:
Michael Hansen
2009-08-03 23:13:50 +00:00
parent 17f962e9f1
commit 7bb356d00a
8 changed files with 261 additions and 75 deletions

View File

@@ -17,12 +17,22 @@ void ASTNodeList::removeFirst()
}
/* ASTUnary */
const char* ASTUnary::op_str() const
{
static const char* s_op_strings[] = {
"+", "-", "~", "not"
};
return s_op_strings[op()];
}
/* ASTBinary */
const char* ASTBinary::op_str() const
{
static const char* s_op_strings[] = {
"**", "*", "/", "%", "+", "-", "<<", ">>", "&", "^", "|", "//",
"<ATTR>"
".", " ** ", " * ", " / ", " // ", " % ", " + ", " - ",
" << ", " >> ", " & ", " ^ ", " | ", " and ", " or "
};
return s_op_strings[op()];
}