Use the right member of union arguments so that everything typechecks

This commit is contained in:
Peter De Wachter 2016-01-23 19:16:21 +01:00
parent 773dba638d
commit b9748cbe0e
4 changed files with 28 additions and 28 deletions

View File

@ -948,9 +948,9 @@ symbolDefineBIF(parameterList, kindOfFixup)
return(makeFailureValue()); return(makeFailureValue());
} else { } else {
syntheticDefineStatement = buildDefineStatement(stringValue-> syntheticDefineStatement = buildDefineStatement(stringValue->
value, parameterList->theOperand); value, parameterList->theOperand.expressionUnion);
} }
assembleDefineStatement(syntheticDefineStatement->statementBody); assembleDefineStatement(syntheticDefineStatement->statementBody.defineUnion);
freeStatement(syntheticDefineStatement); freeStatement(syntheticDefineStatement);
return(makeBooleanValue(TRUE)); return(makeBooleanValue(TRUE));
} }

View File

@ -204,15 +204,15 @@ printOperand(operand)
switch (operand->kindOfOperand) { switch (operand->kindOfOperand) {
case EXPRESSION_OPND: case EXPRESSION_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.expressionUnion);
break; break;
case IMMEDIATE_OPND: case IMMEDIATE_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.immediateUnion);
break; break;
case INDIRECT_OPND: case INDIRECT_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.indirectUnion);
break; break;
case A_REGISTER_OPND: case A_REGISTER_OPND:
@ -225,39 +225,39 @@ printOperand(operand)
break; break;
case POST_INDEXED_Y_OPND: case POST_INDEXED_Y_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.postIndexedYUnion);
break; break;
case PRE_INDEXED_X_OPND: case PRE_INDEXED_X_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.preIndexedXUnion);
break; break;
case X_INDEXED_OPND: case X_INDEXED_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.xIndexedUnion);
break; break;
case Y_INDEXED_OPND: case Y_INDEXED_OPND:
printExpression(operand->theOperand); printExpression(operand->theOperand.yIndexedUnion);
break; break;
case X_SELECTED_OPND: case X_SELECTED_OPND:
printIdentifierList(operand->theOperand); printIdentifierList(operand->theOperand.xSelectedUnion);
break; break;
case Y_SELECTED_OPND: case Y_SELECTED_OPND:
printIdentifierList(operand->theOperand); printIdentifierList(operand->theOperand.ySelectedUnion);
break; break;
case PRE_SELECTED_X_OPND: case PRE_SELECTED_X_OPND:
printIdentifierList(operand->theOperand); printIdentifierList(operand->theOperand.preSelectedUnion);
break; break;
case STRING_OPND: case STRING_OPND:
tab(); printf("(string: \"%s\")\n", operand->theOperand); tab(); printf("(string: \"%s\")\n", operand->theOperand.stringUnion);
break; break;
case BLOCK_OPND: case BLOCK_OPND:
printBlock(operand->theOperand); printBlock(operand->theOperand.blockUnion);
break; break;
default: default:

View File

@ -279,7 +279,7 @@ encodeOperand(operand)
case PRE_INDEXED_X_OPND: case PRE_INDEXED_X_OPND:
case X_INDEXED_OPND: case X_INDEXED_OPND:
case Y_INDEXED_OPND: case Y_INDEXED_OPND:
return(encodeExpression(operand->theOperand)); return(encodeExpression(operand->theOperand.expressionUnion));
case A_REGISTER_OPND: case A_REGISTER_OPND:
case X_REGISTER_OPND: case X_REGISTER_OPND:
@ -294,7 +294,7 @@ encodeOperand(operand)
return(FALSE); return(FALSE);
case STRING_OPND: case STRING_OPND:
return(encodeString(operand->theOperand)); return(encodeString(operand->theOperand.stringUnion));
case BLOCK_OPND: case BLOCK_OPND:
error(BLOCK_OPERAND_IN_OBJECT_EXPRESSION_ERROR); error(BLOCK_OPERAND_IN_OBJECT_EXPRESSION_ERROR);
@ -534,7 +534,7 @@ encodeMifStatement(mifStatement)
encodeByte(MIF_TAG) && encodeByte(MIF_TAG) &&
encodeExpression(mifStatement->mifCondition) && encodeExpression(mifStatement->mifCondition) &&
encodeBlock(mifStatement->mifConsequence) && encodeBlock(mifStatement->mifConsequence) &&
encodeBlock(mifStatement->mifContinuation) encodeBlock(mifStatement->mifContinuation.mifBlockUnion)
); );
} }
@ -637,7 +637,7 @@ encodeStatement(statement)
return(encodeFreturnStatement(statement->statementBody.freturnUnion)); return(encodeFreturnStatement(statement->statementBody.freturnUnion));
case GROUP_STATEMENT: case GROUP_STATEMENT:
return(encodeBlock(statement->statementBody)); return(encodeBlock(statement->statementBody.groupUnion));
case MDEFINE_STATEMENT: case MDEFINE_STATEMENT:
return(encodeMdefineStatement(statement->statementBody.defineUnion)); return(encodeMdefineStatement(statement->statementBody.defineUnion));

View File

@ -151,14 +151,14 @@ duplicateOperandForFixup(operand, isSpecialFunctionOperand)
case X_INDEXED_OPND: case X_INDEXED_OPND:
case Y_INDEXED_OPND: case Y_INDEXED_OPND:
result->theOperand.expressionUnion = result->theOperand.expressionUnion =
duplicateExpressionForFixup(operand->theOperand, duplicateExpressionForFixup(operand->theOperand.expressionUnion,
FALSE, isSpecialFunctionOperand); FALSE, isSpecialFunctionOperand);
break; break;
case X_SELECTED_OPND: case X_SELECTED_OPND:
case Y_SELECTED_OPND: case Y_SELECTED_OPND:
case PRE_SELECTED_X_OPND: case PRE_SELECTED_X_OPND:
result->theOperand.expressionUnion = result->theOperand.expressionUnion =
duplicateExpressionForFixup(operand->theOperand, duplicateExpressionForFixup(operand->theOperand.xSelectedUnion,
FALSE, isSpecialFunctionOperand); FALSE, isSpecialFunctionOperand);
break; break;
case A_REGISTER_OPND: case A_REGISTER_OPND:
@ -195,7 +195,7 @@ freeOperand(operand)
case PRE_INDEXED_X_OPND: case PRE_INDEXED_X_OPND:
case X_INDEXED_OPND: case X_INDEXED_OPND:
case Y_INDEXED_OPND: case Y_INDEXED_OPND:
freeExpression(operand->theOperand); freeExpression(operand->theOperand.expressionUnion);
break; break;
case A_REGISTER_OPND: case A_REGISTER_OPND:
@ -206,15 +206,15 @@ freeOperand(operand)
case X_SELECTED_OPND: case X_SELECTED_OPND:
case Y_SELECTED_OPND: case Y_SELECTED_OPND:
case PRE_SELECTED_X_OPND: case PRE_SELECTED_X_OPND:
freeSelectionList(operand->theOperand); freeSelectionList(operand->theOperand.xSelectedUnion);
break; break;
case STRING_OPND: case STRING_OPND:
freeString(operand->theOperand); freeString(operand->theOperand.stringUnion);
break; break;
case BLOCK_OPND: case BLOCK_OPND:
freeBlock(operand->theOperand); freeBlock(operand->theOperand.blockUnion);
break; break;
default: default:
@ -302,7 +302,7 @@ evaluateOperand(operand)
case PRE_INDEXED_X_OPND: case PRE_INDEXED_X_OPND:
case X_INDEXED_OPND: case X_INDEXED_OPND:
case Y_INDEXED_OPND: case Y_INDEXED_OPND:
result = evaluateExpression(operand->theOperand, result = evaluateExpression(operand->theOperand.expressionUnion,
performingFixups ? NO_FIXUP : OPERAND_FIXUP); performingFixups ? NO_FIXUP : OPERAND_FIXUP);
if (operand->kindOfOperand != EXPRESSION_OPND) { if (operand->kindOfOperand != EXPRESSION_OPND) {
if (result->addressMode != EXPRESSION_OPND) { if (result->addressMode != EXPRESSION_OPND) {
@ -324,7 +324,7 @@ evaluateOperand(operand)
case X_SELECTED_OPND: case X_SELECTED_OPND:
case Y_SELECTED_OPND: case Y_SELECTED_OPND:
case PRE_SELECTED_X_OPND: case PRE_SELECTED_X_OPND:
result = evaluateSelectionList(operand->theOperand); result = evaluateSelectionList(operand->theOperand.xSelectedUnion);
if (result->addressMode != EXPRESSION_OPND) { if (result->addressMode != EXPRESSION_OPND) {
error(BAD_ADDRESS_MODE_ERROR); error(BAD_ADDRESS_MODE_ERROR);
result->kindOfValue = FAIL; result->kindOfValue = FAIL;
@ -334,7 +334,7 @@ evaluateOperand(operand)
break; break;
case STRING_OPND: case STRING_OPND:
result = newValue(STRING_VALUE, operand->theOperand, result = newValue(STRING_VALUE, operand->theOperand.stringUnion,
STRING_OPND); STRING_OPND);
break; break;
@ -342,7 +342,7 @@ evaluateOperand(operand)
if (standaloneExpansionFlag) if (standaloneExpansionFlag)
forceExpansion(); forceExpansion();
sideEffectFlag = TRUE; sideEffectFlag = TRUE;
assembleBlock(operand->theOperand); assembleBlock(operand->theOperand.blockUnion);
expansionOn(); expansionOn();
result = newValue(FAIL, 0, BLOCK_OPND); result = newValue(FAIL, 0, BLOCK_OPND);
break; break;