Beispiel #1
0
void printExpression(FILE* file, IR_myExp exp, int spaceNum)
{
    newline(file), indentSpace(file, spaceNum);
    if (exp == NULL)
        return printNull(file);
    
    switch (exp->kind)
    {
        case IR_BinOperation:
            return printBinOperation(file, exp, spaceNum);
        case IR_Call:
            return printCall(file, exp, spaceNum);
        case IR_Const:
            return printConst(file, exp, spaceNum);
        case IR_ESeq:
            return printESeq(file, exp, spaceNum);
        case IR_Mem:
            return printMem(file, exp, spaceNum);
        case IR_Name:
            return printName(file, exp, spaceNum);
        case IR_Temp:
            return printTemp(file, exp, spaceNum);
        default:    assert (false);
    }
}
Beispiel #2
0
void showConnectionICON(void){
    
    // display special characters for:
    // -> Xbee 'X'
    // -> PC 'P'
    // -> Debug 'D'
    // -> Storage 'S'
    // case statement
    
    switch (Connection) {
        case 'X':
            // print the xbe symbol to the lcd
            printXbeeSymbol();
            break;
        case 'P':
            // print the usb symbol
            printPCSymbol();
            break;
        case 'D':
            // print a big d for debug
            printDebugSymbol();
            break;
        default:
            // print nothing
            printNull();
            break;
    }
    switch (Store) {
        case 'S':
            // print the storing icon
            printUSB();
            break;
        default:
            // print nothing
            printNull();
            break;
    } 
}
Beispiel #3
0
void
printBlock(std::ostream& out, int level, Statement *block)
{
    if (block == NULL)
        printNull(out,level+1);
    else if (block->isBlock())
        block->print(out,level);
    else
    {
        block->print(out,level+1);
        if (block->needSemicolon())
            out << ";";
    }
}
Beispiel #4
0
void printStatement(FILE* file, IR_myStatement statement, int spaceNum)
{
    newline(file), indentSpace(file, spaceNum);

    if (statement == NULL) 
        return printNull(file);

    switch (statement->kind)
    {
        case IR_Seq:
            return printSeqStatement(file, statement, spaceNum);
        case IR_CJump:
            return printCJumpStatement(file, statement, spaceNum);
        case IR_Exp:
            return printExpStatement(file, statement, spaceNum);
        case IR_Jump:
            return printJumpStatement(file, statement, spaceNum);
        case IR_Label:
            return printLabelStatement(file, statement, spaceNum);
        case IR_Move:
            return printMoveStatement(file, statement, spaceNum);
        default:        assert (false);
    }
}