mirror of
https://github.com/Museum-of-Art-and-Digital-Entertainment/macross.git
synced 2025-02-18 09:30:50 +00:00
Move Macross's local extern function references into ANSI C headers full of prototypes
This commit is contained in:
parent
75ff8459e5
commit
cbad3bfb15
@ -30,8 +30,13 @@
|
|||||||
|
|
||||||
#include "macrossTypes.h"
|
#include "macrossTypes.h"
|
||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
|
#include "expressionSemantics.h"
|
||||||
|
#include "operandStuff.h"
|
||||||
|
#include "semanticMisc.h"
|
||||||
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Helper routines to return values into the Macross expression evaluation
|
Helper routines to return values into the Macross expression evaluation
|
||||||
environment
|
environment
|
||||||
@ -41,7 +46,6 @@
|
|||||||
makeBooleanValue(test)
|
makeBooleanValue(test)
|
||||||
int test;
|
int test;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
return(newValue(ABSOLUTE_VALUE, test!=0, EXPRESSION_OPND));
|
return(newValue(ABSOLUTE_VALUE, test!=0, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -49,7 +53,6 @@ makeBooleanValue(test)
|
|||||||
valueType *
|
valueType *
|
||||||
makeFailureValue()
|
makeFailureValue()
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
return(newValue(FAIL, 0, EXPRESSION_OPND));
|
return(newValue(FAIL, 0, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -58,7 +61,6 @@ makeFailureValue()
|
|||||||
makeIntegerValue(integer)
|
makeIntegerValue(integer)
|
||||||
int integer;
|
int integer;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
return(newValue(ABSOLUTE_VALUE, integer, EXPRESSION_OPND));
|
return(newValue(ABSOLUTE_VALUE, integer, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -67,7 +69,6 @@ makeIntegerValue(integer)
|
|||||||
makeOperandValue(operand)
|
makeOperandValue(operand)
|
||||||
operandType *operand;
|
operandType *operand;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
return(newValue(OPERAND_VALUE, operand, EXPRESSION_OPND));
|
return(newValue(OPERAND_VALUE, operand, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -76,7 +77,6 @@ makeOperandValue(operand)
|
|||||||
makeStringValue(string)
|
makeStringValue(string)
|
||||||
stringType *string;
|
stringType *string;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
return(newValue(STRING_VALUE, string, STRING_OPND));
|
return(newValue(STRING_VALUE, string, STRING_OPND));
|
||||||
}
|
}
|
||||||
@ -84,7 +84,6 @@ makeStringValue(string)
|
|||||||
valueType *
|
valueType *
|
||||||
makeUndefinedValue()
|
makeUndefinedValue()
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
return(newValue(UNDEFINED_VALUE, 0, EXPRESSION_OPND));
|
return(newValue(UNDEFINED_VALUE, 0, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -105,10 +104,9 @@ addressModeBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeIntegerValue(evaluatedParameter->addressMode));
|
return(makeIntegerValue(evaluatedParameter->addressMode));
|
||||||
} else {
|
} else {
|
||||||
return(makeIntegerValue(-1));
|
return(makeIntegerValue(-1));
|
||||||
@ -126,13 +124,12 @@ applyBIF(parameterList, kindOfFixup)
|
|||||||
macroTableEntryType *macroToCall;
|
macroTableEntryType *macroToCall;
|
||||||
|
|
||||||
macroTableEntryType *lookupMacroName();
|
macroTableEntryType *lookupMacroName();
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList == NULL) {
|
if (parameterList == NULL) {
|
||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "apply");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "apply");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "apply");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "apply");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -154,11 +151,10 @@ arrayLengthBIF(parameterList, kindOfFixup)
|
|||||||
fixupKindType kindOfFixup;
|
fixupKindType kindOfFixup;
|
||||||
{
|
{
|
||||||
valueType *testObjectValue;
|
valueType *testObjectValue;
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeIntegerValue(0));
|
return(makeIntegerValue(0));
|
||||||
testObjectValue = evaluateOperand(parameterList, NO_FIXUP_OK);
|
testObjectValue = evaluateOperand(parameterList);
|
||||||
if (testObjectValue->kindOfValue == STRING_VALUE) {
|
if (testObjectValue->kindOfValue == STRING_VALUE) {
|
||||||
return(makeIntegerValue(strlen(testObjectValue->value)));
|
return(makeIntegerValue(strlen(testObjectValue->value)));
|
||||||
} else if (testObjectValue->kindOfValue == ARRAY_VALUE) {
|
} else if (testObjectValue->kindOfValue == ARRAY_VALUE) {
|
||||||
@ -201,11 +197,10 @@ atasciiBIF(parameterList, kindOfFixup)
|
|||||||
stringType *string;
|
stringType *string;
|
||||||
stringType *newString;
|
stringType *newString;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeStringValue(""));
|
return(makeStringValue(""));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "atascii");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "atascii");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -232,16 +227,15 @@ atasciiColorBIF(parameterList, kindOfFixup)
|
|||||||
stringType *newString;
|
stringType *newString;
|
||||||
byte testChar;
|
byte testChar;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeStringValue(""));
|
return(makeStringValue(""));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
parameterList = parameterList->nextOperand;
|
parameterList = parameterList->nextOperand;
|
||||||
if (parameterList == NULL) {
|
if (parameterList == NULL) {
|
||||||
color = 0;
|
color = 0;
|
||||||
} else {
|
} else {
|
||||||
colorValue = evaluateOperand(parameterList, NO_FIXUP);
|
colorValue = evaluateOperand(parameterList);
|
||||||
if (colorValue->kindOfValue != ABSOLUTE_VALUE) {
|
if (colorValue->kindOfValue != ABSOLUTE_VALUE) {
|
||||||
error(BAD_COLOR_ARGUMENT_TO_ATASCII_COLOR_ERROR);
|
error(BAD_COLOR_ARGUMENT_TO_ATASCII_COLOR_ERROR);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -314,10 +308,9 @@ isAbsoluteValueBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
ABSOLUTE_VALUE));
|
ABSOLUTE_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -333,10 +326,9 @@ isBlockBIF(parameterList, kindOfFixup) /* questionable */
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
BLOCK_VALUE));
|
BLOCK_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -352,10 +344,9 @@ isBuiltInFunctionBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
BUILT_IN_FUNCTION_VALUE));
|
BUILT_IN_FUNCTION_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -371,10 +362,9 @@ isConditionCodeBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
CONDITION_VALUE));
|
CONDITION_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -448,10 +438,9 @@ isFieldBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
FIELD_VALUE));
|
FIELD_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -467,10 +456,9 @@ isFunctionBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
FUNCTION_VALUE));
|
FUNCTION_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -486,10 +474,9 @@ isRelocatableValueBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
RELOCATABLE_VALUE || evaluatedParameter->
|
RELOCATABLE_VALUE || evaluatedParameter->
|
||||||
kindOfValue == DATA_VALUE));
|
kindOfValue == DATA_VALUE));
|
||||||
@ -506,10 +493,9 @@ isStringBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
STRING_VALUE));
|
STRING_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -525,10 +511,9 @@ isStructBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
return(makeBooleanValue(evaluatedParameter->kindOfValue ==
|
||||||
STRUCT_VALUE));
|
STRUCT_VALUE));
|
||||||
} else {
|
} else {
|
||||||
@ -604,7 +589,7 @@ makeArrayBIF(parameterList, kindOfFixup)
|
|||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "makeArray");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "makeArray");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
lengthValue = evaluateOperand(parameterList, NO_FIXUP);
|
lengthValue = evaluateOperand(parameterList);
|
||||||
if (lengthValue->kindOfValue != ABSOLUTE_VALUE) {
|
if (lengthValue->kindOfValue != ABSOLUTE_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_ABSOLUTE_VALUE_ERROR,
|
error(BIF_NTH_ARGUMENT_IS_NOT_ABSOLUTE_VALUE_ERROR,
|
||||||
"makeArray", 1);
|
"makeArray", 1);
|
||||||
@ -619,8 +604,7 @@ makeArrayBIF(parameterList, kindOfFixup)
|
|||||||
parameterList = parameterList->nextOperand;
|
parameterList = parameterList->nextOperand;
|
||||||
for (i=0; i<length; ++i) {
|
for (i=0; i<length; ++i) {
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
arrayContents[i] = evaluateOperand(parameterList,
|
arrayContents[i] = evaluateOperand(parameterList);
|
||||||
NO_FIXUP);
|
|
||||||
parameterList = parameterList->nextOperand;
|
parameterList = parameterList->nextOperand;
|
||||||
} else {
|
} else {
|
||||||
arrayContents[i] = NULL;
|
arrayContents[i] = NULL;
|
||||||
@ -644,11 +628,10 @@ nthCharBIF(parameterList, kindOfFixup)
|
|||||||
valueType *stringValue;
|
valueType *stringValue;
|
||||||
stringType *string;
|
stringType *string;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "nthChar");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "nthChar");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -657,7 +640,7 @@ nthCharBIF(parameterList, kindOfFixup)
|
|||||||
if (parameterList == NULL) {
|
if (parameterList == NULL) {
|
||||||
position = 0;
|
position = 0;
|
||||||
} else {
|
} else {
|
||||||
positionValue = evaluateOperand(parameterList, NO_FIXUP);
|
positionValue = evaluateOperand(parameterList);
|
||||||
if (positionValue->kindOfValue != ABSOLUTE_VALUE) {
|
if (positionValue->kindOfValue != ABSOLUTE_VALUE) {
|
||||||
error(BAD_POSITION_ARGUMENT_TO_NTH_CHAR_ERROR);
|
error(BAD_POSITION_ARGUMENT_TO_NTH_CHAR_ERROR);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -685,11 +668,10 @@ printfBIF(parameterList, kindOfFixup)
|
|||||||
int argument[20];
|
int argument[20];
|
||||||
valueType *result;
|
valueType *result;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
result = makeFailureValue();
|
result = makeFailureValue();
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(PRINTF_FORMAT_IS_NOT_A_STRING_ERROR);
|
error(PRINTF_FORMAT_IS_NOT_A_STRING_ERROR);
|
||||||
return(result);
|
return(result);
|
||||||
@ -726,7 +708,7 @@ strcatBIF(parameterList, kindOfFixup)
|
|||||||
|
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeStringValue(""));
|
return(makeStringValue(""));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcat", 1);
|
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcat", 1);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -735,7 +717,7 @@ strcatBIF(parameterList, kindOfFixup)
|
|||||||
parameterList = parameterList->nextOperand;
|
parameterList = parameterList->nextOperand;
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeStringValue(string1));
|
return(makeStringValue(string1));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcat", 2);
|
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcat", 2);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -762,7 +744,7 @@ strcmpBIF(parameterList, kindOfFixup)
|
|||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "strcmp");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "strcmp");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmp", 1);
|
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmp", 1);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -771,7 +753,7 @@ strcmpBIF(parameterList, kindOfFixup)
|
|||||||
parameterList = parameterList->nextOperand;
|
parameterList = parameterList->nextOperand;
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeStringValue(string1));
|
return(makeStringValue(string1));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmp", 2);
|
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmp", 2);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -795,7 +777,7 @@ strcmplcBIF(parameterList, kindOfFixup)
|
|||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "strcmplc");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "strcmplc");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmplc", 1);
|
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmplc", 1);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -804,7 +786,7 @@ strcmplcBIF(parameterList, kindOfFixup)
|
|||||||
parameterList = parameterList->nextOperand;
|
parameterList = parameterList->nextOperand;
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeStringValue(string1));
|
return(makeStringValue(string1));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmplc", 2);
|
error(BIF_NTH_ARGUMENT_IS_NOT_A_STRING_ERROR, "strcmplc", 2);
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -823,7 +805,7 @@ strlenBIF(parameterList, kindOfFixup)
|
|||||||
|
|
||||||
if (parameterList == NULL)
|
if (parameterList == NULL)
|
||||||
return(makeIntegerValue(-1));
|
return(makeIntegerValue(-1));
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "strlen");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "strlen");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -851,7 +833,7 @@ substrBIF(parameterList, kindOfFixup)
|
|||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "substr");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "substr");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "substr");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "substr");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -864,7 +846,7 @@ substrBIF(parameterList, kindOfFixup)
|
|||||||
error(TOO_FEW_ARGUMENTS_TO_BIF_ERROR, "substr");
|
error(TOO_FEW_ARGUMENTS_TO_BIF_ERROR, "substr");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
startValue = evaluateOperand(parameterList, NO_FIXUP);
|
startValue = evaluateOperand(parameterList);
|
||||||
if (startValue->kindOfValue != ABSOLUTE_VALUE) {
|
if (startValue->kindOfValue != ABSOLUTE_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_ABSOLUTE_VALUE_ERROR, "substr",
|
error(BIF_NTH_ARGUMENT_IS_NOT_ABSOLUTE_VALUE_ERROR, "substr",
|
||||||
2);
|
2);
|
||||||
@ -883,7 +865,7 @@ substrBIF(parameterList, kindOfFixup)
|
|||||||
if (backwards)
|
if (backwards)
|
||||||
length = -length;
|
length = -length;
|
||||||
} else {
|
} else {
|
||||||
lengthValue = evaluateOperand(parameterList, NO_FIXUP);
|
lengthValue = evaluateOperand(parameterList);
|
||||||
if (lengthValue->kindOfValue != ABSOLUTE_VALUE) {
|
if (lengthValue->kindOfValue != ABSOLUTE_VALUE) {
|
||||||
error(BIF_NTH_ARGUMENT_IS_NOT_ABSOLUTE_VALUE_ERROR,
|
error(BIF_NTH_ARGUMENT_IS_NOT_ABSOLUTE_VALUE_ERROR,
|
||||||
"substr", 3);
|
"substr", 3);
|
||||||
@ -928,7 +910,7 @@ symbolLookupBIF(parameterList, kindOfFixup)
|
|||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "symbolLookup");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "symbolLookup");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "symbolLookup");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "symbolLookup");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -952,7 +934,7 @@ symbolDefineBIF(parameterList, kindOfFixup)
|
|||||||
error(NO_ARGUMENTS_TO_BIF_ERROR, "symbolDefine");
|
error(NO_ARGUMENTS_TO_BIF_ERROR, "symbolDefine");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
}
|
}
|
||||||
stringValue = evaluateOperand(parameterList, NO_FIXUP);
|
stringValue = evaluateOperand(parameterList);
|
||||||
if (stringValue->kindOfValue != STRING_VALUE) {
|
if (stringValue->kindOfValue != STRING_VALUE) {
|
||||||
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "symbolDefine");
|
error(BIF_ARGUMENT_IS_NOT_A_STRING_ERROR, "symbolDefine");
|
||||||
return(makeFailureValue());
|
return(makeFailureValue());
|
||||||
@ -1042,10 +1024,9 @@ valueTypeBIF(parameterList, kindOfFixup)
|
|||||||
{
|
{
|
||||||
valueType *evaluatedParameter;
|
valueType *evaluatedParameter;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
if (parameterList != NULL) {
|
if (parameterList != NULL) {
|
||||||
evaluatedParameter = evaluateOperand(parameterList, NO_FIXUP);
|
evaluatedParameter = evaluateOperand(parameterList);
|
||||||
return(makeIntegerValue(evaluatedParameter->kindOfValue));
|
return(makeIntegerValue(evaluatedParameter->kindOfValue));
|
||||||
} else {
|
} else {
|
||||||
return(makeIntegerValue(-1));
|
return(makeIntegerValue(-1));
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
|
|
||||||
|
void printExpression(expressionType *expression);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Print out the parse-tree.
|
Print out the parse-tree.
|
||||||
*/
|
*/
|
||||||
@ -274,7 +276,6 @@ printArrayTerm(arrayTerm)
|
|||||||
arrayTermType *arrayTerm;
|
arrayTermType *arrayTerm;
|
||||||
{
|
{
|
||||||
void printIdentifier();
|
void printIdentifier();
|
||||||
void printExpression();
|
|
||||||
|
|
||||||
nullPrint(arrayTerm);
|
nullPrint(arrayTerm);
|
||||||
tab(); printf("(array\n");
|
tab(); printf("(array\n");
|
||||||
@ -289,7 +290,6 @@ printArrayTerm(arrayTerm)
|
|||||||
printAssignmentTerm(assignmentTerm)
|
printAssignmentTerm(assignmentTerm)
|
||||||
binopTermType *assignmentTerm;
|
binopTermType *assignmentTerm;
|
||||||
{
|
{
|
||||||
void printExpression();
|
|
||||||
|
|
||||||
nullPrint(assignmentTerm);
|
nullPrint(assignmentTerm);
|
||||||
tab(); printf("(assignment [");
|
tab(); printf("(assignment [");
|
||||||
@ -307,7 +307,6 @@ printBinopTerm(binopTerm)
|
|||||||
binopTermType *binopTerm;
|
binopTermType *binopTerm;
|
||||||
{
|
{
|
||||||
void printIdentifier();
|
void printIdentifier();
|
||||||
void printExpression();
|
|
||||||
|
|
||||||
nullPrint(binopTerm);
|
nullPrint(binopTerm);
|
||||||
tab(); printf("(binop [");
|
tab(); printf("(binop [");
|
||||||
@ -391,8 +390,6 @@ printPreopTerm(preopTerm)
|
|||||||
printUnopTerm(unopTerm)
|
printUnopTerm(unopTerm)
|
||||||
unopTermType *unopTerm;
|
unopTermType *unopTerm;
|
||||||
{
|
{
|
||||||
void printExpression();
|
|
||||||
|
|
||||||
nullPrint(unopTerm);
|
nullPrint(unopTerm);
|
||||||
tab(); printf("(unop [");
|
tab(); printf("(unop [");
|
||||||
printToken(unopTerm->unop);
|
printToken(unopTerm->unop);
|
||||||
|
16
emitBranch.h
Normal file
16
emitBranch.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef EMIT_BRANCH_H_
|
||||||
|
#define EMIT_BRANCH_H_
|
||||||
|
|
||||||
|
#include "macrossTypes.h"
|
||||||
|
|
||||||
|
#if TARGET_CPU == CPU_6502
|
||||||
|
void emitRelativeBranch(conditionType condition, valueType *target, valueType fixupLocation[COMPOUND_BRANCH_MAX]);
|
||||||
|
#elif TARGET_CPU == CPU_68000
|
||||||
|
void emitRelativeBranch(conditionType condition, valueType *target, valueType *fixupLocation);
|
||||||
|
#else
|
||||||
|
#error Missing or invalid TARGET_CPU
|
||||||
|
#endif
|
||||||
|
|
||||||
|
simpleFixupListType *emitJump(valueType *target, simpleFixupListType *previousFixups);
|
||||||
|
|
||||||
|
#endif
|
3
encode.c
3
encode.c
@ -31,6 +31,7 @@
|
|||||||
#include "macrossTypes.h"
|
#include "macrossTypes.h"
|
||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
|
#include "semanticMisc.h"
|
||||||
#include "slinkyExpressions.h"
|
#include "slinkyExpressions.h"
|
||||||
|
|
||||||
#define nullEncode(thing) if (thing==NULL) return(TRUE);
|
#define nullEncode(thing) if (thing==NULL) return(TRUE);
|
||||||
@ -133,8 +134,6 @@ encodeFunctionCall(functionCall)
|
|||||||
symbolInContextType *workingContext;
|
symbolInContextType *workingContext;
|
||||||
operandListType *parameterList;
|
operandListType *parameterList;
|
||||||
|
|
||||||
symbolInContextType *getWorkingContext();
|
|
||||||
|
|
||||||
nullEncode(functionCall);
|
nullEncode(functionCall);
|
||||||
workingContext = getWorkingContext(functionCall->functionName);
|
workingContext = getWorkingContext(functionCall->functionName);
|
||||||
if (isFunction(workingContext)) {
|
if (isFunction(workingContext)) {
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include "macrossTypes.h"
|
#include "macrossTypes.h"
|
||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
|
#include "expressionSemantics.h"
|
||||||
|
#include "semanticMisc.h"
|
||||||
|
|
||||||
operandType *dbOperand; /* safe temps for dbx hacking */
|
operandType *dbOperand; /* safe temps for dbx hacking */
|
||||||
expressionType *dbExpression;
|
expressionType *dbExpression;
|
||||||
@ -71,8 +73,6 @@ arrayLookup(arrayTerm, kindOfThing)
|
|||||||
int index;
|
int index;
|
||||||
stringType *string;
|
stringType *string;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
*kindOfThing = FAIL;
|
*kindOfThing = FAIL;
|
||||||
arrayValue = evaluateExpression(arrayTerm->arrayName, NO_FIXUP);
|
arrayValue = evaluateExpression(arrayTerm->arrayName, NO_FIXUP);
|
||||||
if (arrayValue->kindOfValue == FAIL)
|
if (arrayValue->kindOfValue == FAIL)
|
||||||
@ -133,9 +133,6 @@ evaluateArrayTerm(arrayTerm)
|
|||||||
environmentType *saveEnvironment;
|
environmentType *saveEnvironment;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
valueType *newValue();
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
|
|
||||||
expansionOff();
|
expansionOff();
|
||||||
resultThing = arrayLookup(arrayTerm, &kindOfResult);
|
resultThing = arrayLookup(arrayTerm, &kindOfResult);
|
||||||
expansionOn();
|
expansionOn();
|
||||||
@ -187,15 +184,6 @@ evaluateAssignmentTerm(assignmentTerm, kindOfFixup)
|
|||||||
char *charPtr;
|
char *charPtr;
|
||||||
char objectChar;
|
char objectChar;
|
||||||
|
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
valueType *evaluateExpressionInternally();
|
|
||||||
valueKindType addValueKind();
|
|
||||||
valueKindType selectValueKind();
|
|
||||||
valueKindType subValueKind();
|
|
||||||
valueKindType opValueKind();
|
|
||||||
valueType *makeUndefinedValue();
|
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
nullEvaluate(assignmentTerm);
|
nullEvaluate(assignmentTerm);
|
||||||
sideEffectFlag = TRUE;
|
sideEffectFlag = TRUE;
|
||||||
stringAssign = FALSE;
|
stringAssign = FALSE;
|
||||||
@ -386,11 +374,6 @@ evaluateBinopTerm(binopTerm, isTopLevel, kindOfFixup)
|
|||||||
operandKindType resultAddressMode;
|
operandKindType resultAddressMode;
|
||||||
valueType *result;
|
valueType *result;
|
||||||
|
|
||||||
symbolInContextType *getWorkingContext();
|
|
||||||
valueType *evaluateExpressionInternally();
|
|
||||||
valueType *newValue();
|
|
||||||
valueType *makeUndefinedValue();
|
|
||||||
|
|
||||||
nullEvaluate(binopTerm);
|
nullEvaluate(binopTerm);
|
||||||
if (binopTerm->binop != SUB && binopTerm->binop != ADD)
|
if (binopTerm->binop != SUB && binopTerm->binop != ADD)
|
||||||
isTopLevel = FALSE;
|
isTopLevel = FALSE;
|
||||||
@ -598,8 +581,6 @@ evaluateBinopTerm(binopTerm, isTopLevel, kindOfFixup)
|
|||||||
evaluateCondition(condition)
|
evaluateCondition(condition)
|
||||||
conditionType condition;
|
conditionType condition;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
expand(moreExpression("%s", conditionString(condition)));
|
expand(moreExpression("%s", conditionString(condition)));
|
||||||
return(newValue(CONDITION_VALUE, condition, EXPRESSION_OPND));
|
return(newValue(CONDITION_VALUE, condition, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -633,10 +614,6 @@ evaluateFunctionCall(functionCall, kindOfFixup, isStandalone)
|
|||||||
valueType *result;
|
valueType *result;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
symbolInContextType *getWorkingContext();
|
|
||||||
valueType *evaluateBuiltInFunctionCall();
|
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
nullEvaluate(functionCall);
|
nullEvaluate(functionCall);
|
||||||
sideEffectFlag = TRUE;
|
sideEffectFlag = TRUE;
|
||||||
pushEnvironment(newEnvironment);
|
pushEnvironment(newEnvironment);
|
||||||
@ -705,7 +682,6 @@ evaluateFunctionCall(functionCall, kindOfFixup, isStandalone)
|
|||||||
valueType *
|
valueType *
|
||||||
evaluateHere()
|
evaluateHere()
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
valueType *result;
|
valueType *result;
|
||||||
|
|
||||||
expand(moreExpression("here"));
|
expand(moreExpression("here"));
|
||||||
@ -727,11 +703,6 @@ evaluateIdentifier(identifier, isTopLevel, kindOfFixup)
|
|||||||
environmentType *saveEnvironment;
|
environmentType *saveEnvironment;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
valueType *newValue();
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
symbolInContextType *getWorkingContext();
|
|
||||||
symbolTableEntryType *generateLocalLabel();
|
|
||||||
|
|
||||||
nullEvaluate(identifier);
|
nullEvaluate(identifier);
|
||||||
identifier->referenceCount++;
|
identifier->referenceCount++;
|
||||||
if (symbName(identifier)[0] == '$')
|
if (symbName(identifier)[0] == '$')
|
||||||
@ -851,8 +822,6 @@ evaluateIdentifier(identifier, isTopLevel, kindOfFixup)
|
|||||||
evaluateNumber(number)
|
evaluateNumber(number)
|
||||||
numberTermType number;
|
numberTermType number;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
expand(moreExpression("0x%x", number));
|
expand(moreExpression("0x%x", number));
|
||||||
return(newValue(ABSOLUTE_VALUE, number, EXPRESSION_OPND));
|
return(newValue(ABSOLUTE_VALUE, number, EXPRESSION_OPND));
|
||||||
}
|
}
|
||||||
@ -868,9 +837,6 @@ evaluatePostopTerm(postopTerm)
|
|||||||
symbolInContextType *workingContext;
|
symbolInContextType *workingContext;
|
||||||
symbolTableEntryType *targetSymbol;
|
symbolTableEntryType *targetSymbol;
|
||||||
|
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
symbolInContextType *getWorkingContext();
|
|
||||||
|
|
||||||
nullEvaluate(postopTerm);
|
nullEvaluate(postopTerm);
|
||||||
sideEffectFlag = TRUE;
|
sideEffectFlag = TRUE;
|
||||||
if (postopTerm->postOpArgument->kindOfTerm == IDENTIFIER_EXPR) {
|
if (postopTerm->postOpArgument->kindOfTerm == IDENTIFIER_EXPR) {
|
||||||
@ -939,9 +905,6 @@ evaluatePreopTerm(preopTerm)
|
|||||||
symbolInContextType *workingContext;
|
symbolInContextType *workingContext;
|
||||||
symbolTableEntryType *targetSymbol;
|
symbolTableEntryType *targetSymbol;
|
||||||
|
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
symbolInContextType *getWorkingContext();
|
|
||||||
|
|
||||||
nullEvaluate(preopTerm);
|
nullEvaluate(preopTerm);
|
||||||
sideEffectFlag = TRUE;
|
sideEffectFlag = TRUE;
|
||||||
if (preopTerm->preOpArgument->kindOfTerm == IDENTIFIER_EXPR) {
|
if (preopTerm->preOpArgument->kindOfTerm == IDENTIFIER_EXPR) {
|
||||||
@ -1003,7 +966,6 @@ evaluatePreopTerm(preopTerm)
|
|||||||
evaluateString(string)
|
evaluateString(string)
|
||||||
stringType *string;
|
stringType *string;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
stringType *newString;
|
stringType *newString;
|
||||||
|
|
||||||
expand(moreExpression("\"%s\"", string));
|
expand(moreExpression("\"%s\"", string));
|
||||||
@ -1023,11 +985,6 @@ evaluateUnopTerm(unopTerm, kindOfFixup)
|
|||||||
operandKindType resultAddressMode;
|
operandKindType resultAddressMode;
|
||||||
valueType *result;
|
valueType *result;
|
||||||
|
|
||||||
valueKindType unopValueKind();
|
|
||||||
valueType *newValue();
|
|
||||||
valueType *evaluateExpressionInternally();
|
|
||||||
valueType *makeUndefinedValue();
|
|
||||||
|
|
||||||
nullEvaluate(unopTerm);
|
nullEvaluate(unopTerm);
|
||||||
expand(moreExpression("%s", tokenString(unopTerm->unop)));
|
expand(moreExpression("%s", tokenString(unopTerm->unop)));
|
||||||
theOperand = evaluateExpressionInternally(unopTerm->unopArgument,
|
theOperand = evaluateExpressionInternally(unopTerm->unopArgument,
|
||||||
@ -1213,10 +1170,6 @@ evaluateExpressionStandalone(expression)
|
|||||||
evaluateDefineExpression(expression)
|
evaluateDefineExpression(expression)
|
||||||
expressionType *expression;
|
expressionType *expression;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
expressionType *generateFixupExpression();
|
|
||||||
operandType *buildOperand();
|
|
||||||
|
|
||||||
nullEvaluate(expression);
|
nullEvaluate(expression);
|
||||||
return(newValue(OPERAND_VALUE, buildOperand(EXPRESSION_OPND,
|
return(newValue(OPERAND_VALUE, buildOperand(EXPRESSION_OPND,
|
||||||
generateFixupExpression(expression)), EXPRESSION_OPND));
|
generateFixupExpression(expression)), EXPRESSION_OPND));
|
||||||
@ -1227,7 +1180,6 @@ evaluateSelectionList(selectionList)
|
|||||||
selectionListType *selectionList;
|
selectionListType *selectionList;
|
||||||
{
|
{
|
||||||
int offset;
|
int offset;
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
offset = 0;
|
offset = 0;
|
||||||
while (selectionList != NULL) {
|
while (selectionList != NULL) {
|
||||||
|
25
expressionSemantics.h
Normal file
25
expressionSemantics.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#ifndef EXPRESSION_SEMANTICS_H_
|
||||||
|
#define EXPRESSION_SEMANTICS_H_
|
||||||
|
#include "macrossTypes.h"
|
||||||
|
|
||||||
|
anyOldThing *arrayLookup(arrayTermType *arrayTerm, valueKindType *kindOfThing);
|
||||||
|
valueType *evaluateArrayTerm(arrayTermType *arrayTerm);
|
||||||
|
valueType *evaluateAssignmentTerm(binopTermType *assignmentTerm, fixupKindType kindOfFixup);
|
||||||
|
valueType *evaluateBinopTerm(binopTermType *assignmentTerm, bool isTopLevel, fixupKindType kindOfFixup);
|
||||||
|
valueType *evaluateCondition(conditionType condition);
|
||||||
|
valueType *evaluateBuiltInFunctionCall(symbolInContextType *workingContext, operandListType *parameters, fixupKindType kindOfFixup);
|
||||||
|
valueType *evaluateFunctionCall(functionCallTermType *functionCall, fixupKindType kindOfFixup, bool isStandalone);
|
||||||
|
valueType *evaluateHere();
|
||||||
|
valueType *evaluateIdentifier(symbolTableEntryType *identifier, bool isTopLevel, fixupKindType kindOfFixup);
|
||||||
|
valueType *evaluateNumber(numberTermType number);
|
||||||
|
valueType *evaluatePostopTerm(postOpTermType *postopTerm);
|
||||||
|
valueType *evaluatePreopTerm(preOpTermType *preopTerm);
|
||||||
|
valueType *evaluateString(stringType *string);
|
||||||
|
valueType *evaluateUnopTerm(unopTermType* unopTerm, fixupKindType kindOfFixup);
|
||||||
|
valueType *evaluateExpressionInternally(expressionType *expression, bool isToplevel, fixupKindType kindOfFixup, bool isStandalone);
|
||||||
|
valueType *evaluateExpression(expressionType *expression, fixupKindType kindOfFixup);
|
||||||
|
void evaluateExpressionStandalone(expressionType *expression);
|
||||||
|
valueType *evaluateDefineExpression(expressionType *expression);
|
||||||
|
valueType *evaluateSelectionList(selectionListType *selectionList);
|
||||||
|
|
||||||
|
#endif
|
1
lexer.c
1
lexer.c
@ -31,6 +31,7 @@
|
|||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
#include "lexerTables.h"
|
#include "lexerTables.h"
|
||||||
|
#include "parserMisc.h"
|
||||||
|
|
||||||
extern int yylval;
|
extern int yylval;
|
||||||
extern int yydebug;
|
extern int yydebug;
|
||||||
|
24
listing.c
24
listing.c
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "macrossTypes.h"
|
#include "macrossTypes.h"
|
||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
|
#include "listing.h"
|
||||||
|
|
||||||
static char lineBuffer1[LINE_BUFFER_SIZE];
|
static char lineBuffer1[LINE_BUFFER_SIZE];
|
||||||
static char lineBuffer2[LINE_BUFFER_SIZE];
|
static char lineBuffer2[LINE_BUFFER_SIZE];
|
||||||
@ -43,8 +44,6 @@ static int nextMacroDepth;
|
|||||||
void
|
void
|
||||||
outputListing()
|
outputListing()
|
||||||
{
|
{
|
||||||
void generateListing();
|
|
||||||
|
|
||||||
rewind(saveFileForPass2);
|
rewind(saveFileForPass2);
|
||||||
rewind(indexFileForPass2);
|
rewind(indexFileForPass2);
|
||||||
rewind(macroFileForPass2);
|
rewind(macroFileForPass2);
|
||||||
@ -122,9 +121,6 @@ generateListing()
|
|||||||
int numberOfBytesListed;
|
int numberOfBytesListed;
|
||||||
char *tempText;
|
char *tempText;
|
||||||
|
|
||||||
void readIndexFileLine();
|
|
||||||
void readSourceFileLine();
|
|
||||||
|
|
||||||
sourceLineNumber = 1;
|
sourceLineNumber = 1;
|
||||||
alreadyListingMacroExpansion = FALSE;
|
alreadyListingMacroExpansion = FALSE;
|
||||||
readSourceFileLine(&sourceAddress, &sourceDepth, sourceText,
|
readSourceFileLine(&sourceAddress, &sourceDepth, sourceText,
|
||||||
@ -362,8 +358,6 @@ printListingLine(numberOfBytes, byteAddress, text, kind)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
void tabPrint();
|
|
||||||
|
|
||||||
if (kind != BLOCK_STATEMENT)
|
if (kind != BLOCK_STATEMENT)
|
||||||
numberOfBytes = (numberOfBytes < 4) ? numberOfBytes : 4;
|
numberOfBytes = (numberOfBytes < 4) ? numberOfBytes : 4;
|
||||||
|
|
||||||
@ -484,10 +478,8 @@ printNTimes(aChar, times)
|
|||||||
char aChar;
|
char aChar;
|
||||||
int times;
|
int times;
|
||||||
{
|
{
|
||||||
void moreText();
|
|
||||||
|
|
||||||
while (times-- > 0)
|
while (times-- > 0)
|
||||||
moreText("%c", aChar);
|
moreText("%c", aChar, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -595,9 +587,9 @@ expandExpression(toBuffer, toBufferPtr)
|
|||||||
char **toBufferPtr;
|
char **toBufferPtr;
|
||||||
{
|
{
|
||||||
if (toBuffer == NULL)
|
if (toBuffer == NULL)
|
||||||
moreText("%s", expressionString);
|
moreText("%s", expressionString, 0, 0);
|
||||||
else
|
else
|
||||||
addText(toBuffer, toBufferPtr, "%s", expressionString);
|
addText(toBuffer, toBufferPtr, "%s", expressionString, 0, 0);
|
||||||
flushExpressionString();
|
flushExpressionString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,14 +599,14 @@ expandNum(buffer, bufferPtr, n)
|
|||||||
char **bufferPtr;
|
char **bufferPtr;
|
||||||
int n;
|
int n;
|
||||||
{
|
{
|
||||||
moreTextOptional(buffer, bufferPtr, "%d", n);
|
moreTextOptional(buffer, bufferPtr, "%d", n, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
flushOperand(n)
|
flushOperand(n)
|
||||||
int n;
|
int n;
|
||||||
{
|
{
|
||||||
moreText("%s", operandBuffer[n]);
|
moreText("%s", operandBuffer[n], 0, 0);
|
||||||
operandBuffer[n][0] = '\0';
|
operandBuffer[n][0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -627,7 +619,7 @@ expandOperands(op)
|
|||||||
if (op > 0) {
|
if (op > 0) {
|
||||||
flushOperand(0);
|
flushOperand(0);
|
||||||
for (i=1; i<op; i++) {
|
for (i=1; i<op; i++) {
|
||||||
moreText(", ");
|
moreText(", ", 0, 0, 0);
|
||||||
flushOperand(i);
|
flushOperand(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -636,7 +628,7 @@ expandOperands(op)
|
|||||||
void
|
void
|
||||||
expandLabel()
|
expandLabel()
|
||||||
{
|
{
|
||||||
moreText("%s", labelString);
|
moreText("%s", labelString, 0, 0);
|
||||||
labelStringPtr = labelString;
|
labelStringPtr = labelString;
|
||||||
*labelStringPtr = '\0';
|
*labelStringPtr = '\0';
|
||||||
}
|
}
|
||||||
|
41
listing.h
Normal file
41
listing.h
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#ifndef LISTING_H_
|
||||||
|
#define LISTING_H_
|
||||||
|
|
||||||
|
/* TODO: Functions here that have "format" arguments should actually
|
||||||
|
* be varargs. In 1984 it probably wasn't standardized, but here in
|
||||||
|
* Glorious Future Year 1989 the vprintf function does almost exactly
|
||||||
|
* what we want. */
|
||||||
|
|
||||||
|
void outputListing();
|
||||||
|
void terminateListingFiles();
|
||||||
|
void generateListing();
|
||||||
|
int printMacroLine(int numberOfBytes, int byteAddress, statementKindType kind);
|
||||||
|
void readSourceFileLine(int *sourceAddressPtr, int *sourceDepthPtr, char lineBuffer[], FILE *file);
|
||||||
|
void readIndexFileLine(statementKindType *statementKindPtr, int *indexAddressPtr, int *indexLineNumberPtr);
|
||||||
|
int printListingLine(int numberOfBytes, int byteAddress, char *text, statementKindType kind);
|
||||||
|
bool isBlockOpener(statementKindType statementKind);
|
||||||
|
bool isBlankStatment(statementKindType statementKind);
|
||||||
|
void tabPrint(stringType *text);
|
||||||
|
void printNTimes (char aChar, int times);
|
||||||
|
void tabIndent();
|
||||||
|
bool labeledLine();
|
||||||
|
void addText(char *buffer, char **bufferPtr, char *format, int arg1, int arg2, int arg3);
|
||||||
|
void moreTextOptional(char *buffer, char **bufferPtr, char *format, int arg1, int arg2, int arg3);
|
||||||
|
void moreText(char *format, int arg1, int arg2, int arg3);
|
||||||
|
void moreLabel(char *format, int arg1, int arg2, int arg3);
|
||||||
|
void startLine();
|
||||||
|
void endLine();
|
||||||
|
void flushExpressionString();
|
||||||
|
void expandExpression(char *toBuffer, char **toBufferPtr);
|
||||||
|
void expandNum(char *buffer, char **bufferPtr, int n);
|
||||||
|
void flushOperand(int n);
|
||||||
|
void expandOperands(int op);
|
||||||
|
void expandLabel();
|
||||||
|
void moreExpression(char *format, int arg1, int arg2, int arg3);
|
||||||
|
void startLineMarked();
|
||||||
|
bool notListable(statementKindType statementKind);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -28,6 +28,9 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef MACROSS_TYPES_H_
|
||||||
|
#define MACROSS_TYPES_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1093,3 +1096,5 @@ typedef enum {/* horrible kludge due to C compiler bug on Sun */
|
|||||||
/* Boy, is this macro useful! */
|
/* Boy, is this macro useful! */
|
||||||
|
|
||||||
#define typeAlloc(type) (type *)malloc(sizeof(type))
|
#define typeAlloc(type) (type *)malloc(sizeof(type))
|
||||||
|
|
||||||
|
#endif
|
||||||
|
21
operandStuff.h
Normal file
21
operandStuff.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#ifndef OPERAND_STUFF_H_
|
||||||
|
#define OPERAND_STUFF_H_
|
||||||
|
|
||||||
|
#include "macrossTypes.h"
|
||||||
|
|
||||||
|
#if TARGET_CPU == CPU_6502
|
||||||
|
operandType *buildOperand(operandKindType kindOfOperand, anyOldThing *arg);
|
||||||
|
#elif TARGET_CPU == CPU_68000
|
||||||
|
operandType *buildOperand(operandKindType kindOfOperand, int arg1, int arg2, int arg3, int arg4);
|
||||||
|
#else
|
||||||
|
#error Unknown or undefined processor type
|
||||||
|
#endif
|
||||||
|
|
||||||
|
operandListType *duplicateOperandForFixup(operandListType *operand, bool isSpecialFunctionOperand);
|
||||||
|
void expandOperand(operandKindType addressMode, char *buffer);
|
||||||
|
void freeOperand(operandType *operand);
|
||||||
|
valueType *evaluateOperand(operandType *operand);
|
||||||
|
conditionType invertConditionCode(conditionType conditionCode);
|
||||||
|
bool shouldParethesize(operandType *operand);
|
||||||
|
|
||||||
|
#endif
|
@ -229,8 +229,9 @@ freeOperand(operand)
|
|||||||
/* corresponds to routines in listing.c */
|
/* corresponds to routines in listing.c */
|
||||||
|
|
||||||
void
|
void
|
||||||
expandOperand(addressMode)
|
expandOperand(addressMode, buffer)
|
||||||
operandKindType addressMode;
|
operandKindType addressMode;
|
||||||
|
char * buffer;
|
||||||
{
|
{
|
||||||
switch (addressMode) {
|
switch (addressMode) {
|
||||||
case IMMEDIATE_OPND: moreText("#"); break;
|
case IMMEDIATE_OPND: moreText("#"); break;
|
||||||
|
23
parserMisc.c
23
parserMisc.c
@ -32,6 +32,7 @@
|
|||||||
#include "macrossTypes.h"
|
#include "macrossTypes.h"
|
||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
|
#include "parserMisc.h"
|
||||||
|
|
||||||
statementType *
|
statementType *
|
||||||
addLabelToStatement(labelList, statement)
|
addLabelToStatement(labelList, statement)
|
||||||
@ -46,12 +47,16 @@ addLabelToStatement(labelList, statement)
|
|||||||
return(statement);
|
return(statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO: This should be a varargs function. In 1984 it probably wasn't
|
||||||
|
* standardized, but here in Glorious Future Year 1989 the vprintf
|
||||||
|
* function does almost exactly what we want. */
|
||||||
|
|
||||||
void
|
void
|
||||||
botch(message, arg1, arg2, arg3)
|
botch(message, arg1, arg2, arg3)
|
||||||
char *message;
|
char *message;
|
||||||
anyOldThing *arg1;
|
int arg1;
|
||||||
anyOldThing *arg2;
|
int arg2;
|
||||||
anyOldThing *arg3;
|
int arg3;
|
||||||
{
|
{
|
||||||
printf("Macross horrible terrible internal botch: ");
|
printf("Macross horrible terrible internal botch: ");
|
||||||
printf(message, arg1, arg2, arg3);
|
printf(message, arg1, arg2, arg3);
|
||||||
@ -72,7 +77,7 @@ convertDefineToMdefine(defineStatement)
|
|||||||
{
|
{
|
||||||
if (defineStatement->kindOfStatement != DEFINE_STATEMENT)
|
if (defineStatement->kindOfStatement != DEFINE_STATEMENT)
|
||||||
botch("convertDefineToMdefine got statement kind: %d\n",
|
botch("convertDefineToMdefine got statement kind: %d\n",
|
||||||
defineStatement->kindOfStatement);
|
defineStatement->kindOfStatement, 0, 0);
|
||||||
defineStatement->kindOfStatement = MDEFINE_STATEMENT;
|
defineStatement->kindOfStatement = MDEFINE_STATEMENT;
|
||||||
return(defineStatement);
|
return(defineStatement);
|
||||||
}
|
}
|
||||||
@ -85,9 +90,9 @@ extractIfBody(ifStatement)
|
|||||||
|
|
||||||
result = ifStatement->statementBody.ifUnion;
|
result = ifStatement->statementBody.ifUnion;
|
||||||
if (ifStatement->labels != NULL)
|
if (ifStatement->labels != NULL)
|
||||||
botch("extract if body with non-null labels\n");
|
botch("extract if body with non-null labels\n", 0, 0, 0);
|
||||||
else if (ifStatement->nextStatement != NULL)
|
else if (ifStatement->nextStatement != NULL)
|
||||||
botch("extract if body with non-null next\n");
|
botch("extract if body with non-null next\n", 0, 0, 0);
|
||||||
else
|
else
|
||||||
qfree(ifStatement);
|
qfree(ifStatement);
|
||||||
return(result);
|
return(result);
|
||||||
@ -101,9 +106,9 @@ extractMifBody(mifStatement)
|
|||||||
|
|
||||||
result = mifStatement->statementBody.mifUnion;
|
result = mifStatement->statementBody.mifUnion;
|
||||||
if (mifStatement->labels != NULL)
|
if (mifStatement->labels != NULL)
|
||||||
botch("extract mif body with non-null labels\n");
|
botch("extract mif body with non-null labels\n", 0, 0, 0);
|
||||||
else if (mifStatement->nextStatement != NULL)
|
else if (mifStatement->nextStatement != NULL)
|
||||||
botch("extract mif body with non-null next\n");
|
botch("extract mif body with non-null next\n", 0, 0, 0);
|
||||||
else
|
else
|
||||||
qfree(mifStatement);
|
qfree(mifStatement);
|
||||||
return(result);
|
return(result);
|
||||||
@ -117,7 +122,7 @@ extractString(textExpression)
|
|||||||
|
|
||||||
if (textExpression->kindOfOperand != STRING_OPND)
|
if (textExpression->kindOfOperand != STRING_OPND)
|
||||||
botch("extract string got handed an opnd kind: %d\n",
|
botch("extract string got handed an opnd kind: %d\n",
|
||||||
textExpression->kindOfOperand);
|
textExpression->kindOfOperand, 0, 0);
|
||||||
result = textExpression->theOperand.stringUnion;
|
result = textExpression->theOperand.stringUnion;
|
||||||
qfree(textExpression);
|
qfree(textExpression);
|
||||||
return(result);
|
return(result);
|
||||||
|
16
parserMisc.h
Normal file
16
parserMisc.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef PARSER_MISC_H_
|
||||||
|
#define PARSER_MISC_H_
|
||||||
|
#include "macrossTypes.h"
|
||||||
|
|
||||||
|
statementType *addLabelToSatement(labelListType *labelList, statementType *statement);
|
||||||
|
void botch(char *message, int arg1, int arg2, int arg3);
|
||||||
|
void checkDefineAssignmentOperator(assignmentKindType assignmentOperator);
|
||||||
|
void convertDefineToMDefine(statementType *defineStatement);
|
||||||
|
ifStatementBodyType *extractIfBody(statementType *ifStatement);
|
||||||
|
mifStatementBodyType *extractMifBody(statementType *mifStatement);
|
||||||
|
stringType *extractString(operandType *textExpression);
|
||||||
|
void popMacroOrFunctionNestingDepth();
|
||||||
|
void pushMacroOrFunctionNestingDepth();
|
||||||
|
char *saveString(char *s);
|
||||||
|
|
||||||
|
#endif
|
@ -32,6 +32,9 @@
|
|||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
#include "y.tab.h"
|
#include "y.tab.h"
|
||||||
|
|
||||||
|
#include "semanticMisc.h"
|
||||||
|
#include "expressionSemantics.h"
|
||||||
|
|
||||||
#define expansionOff() {saveExpansion=expandMacros; expandMacros=FALSE;}
|
#define expansionOff() {saveExpansion=expandMacros; expandMacros=FALSE;}
|
||||||
#define expansionOn() expandMacros=saveExpansion;
|
#define expansionOn() expandMacros=saveExpansion;
|
||||||
|
|
||||||
@ -219,7 +222,6 @@ booleanTest(expression)
|
|||||||
bool result;
|
bool result;
|
||||||
valueType *expressionResult;
|
valueType *expressionResult;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
expansionOff();
|
expansionOff();
|
||||||
expressionResult = evaluateExpression(expression, NO_FIXUP);
|
expressionResult = evaluateExpression(expression, NO_FIXUP);
|
||||||
@ -1009,7 +1011,6 @@ noteReference(expression, kindOfFixup, location, codeMode)
|
|||||||
performFixups(fixups)
|
performFixups(fixups)
|
||||||
fixupListType *fixups;
|
fixupListType *fixups;
|
||||||
{
|
{
|
||||||
valueType *evaluateExpression();
|
|
||||||
valueType *valueToPoke;
|
valueType *valueToPoke;
|
||||||
|
|
||||||
performingFixups = TRUE;
|
performingFixups = TRUE;
|
||||||
|
@ -13,7 +13,7 @@ bool booleanTest(expressionType *expression);
|
|||||||
int countArguments(functionDefinitionType *function);
|
int countArguments(functionDefinitionType *function);
|
||||||
int countParameters(operandListType *parameterList);
|
int countParameters(operandListType *parameterList);
|
||||||
arrayType *allocArray(int size, valueType ***contentsPtr);
|
arrayType *allocArray(int size, valueType ***contentsPtr);
|
||||||
valueType *createArray(expresionType *dimension, expressionListType *initializers);
|
valueType *createArray(expressionType *dimension, expressionListType *initializers);
|
||||||
bool decrementable(valueType *value);
|
bool decrementable(valueType *value);
|
||||||
int expressionListLength(expressionListType *expressionList);
|
int expressionListLength(expressionListType *expressionList);
|
||||||
int fieldValue(symbolTableEntryType *symbol);
|
int fieldValue(symbolTableEntryType *symbol);
|
||||||
|
@ -30,6 +30,12 @@
|
|||||||
|
|
||||||
#include "macrossTypes.h"
|
#include "macrossTypes.h"
|
||||||
#include "macrossGlobals.h"
|
#include "macrossGlobals.h"
|
||||||
|
#include "emitBranch.h"
|
||||||
|
#include "expressionSemantics.h"
|
||||||
|
#include "operandStuff.h"
|
||||||
|
#include "parserMisc.h"
|
||||||
|
#include "semanticMisc.h"
|
||||||
|
#include "statementSemantics.h"
|
||||||
|
|
||||||
operandType *dbOperand; /* safe temps for dbx hacking */
|
operandType *dbOperand; /* safe temps for dbx hacking */
|
||||||
expressionType *dbExpression;
|
expressionType *dbExpression;
|
||||||
@ -52,8 +58,6 @@ bool nullStatementFlag = FALSE;
|
|||||||
assembleBlock(block)
|
assembleBlock(block)
|
||||||
blockType *block;
|
blockType *block;
|
||||||
{
|
{
|
||||||
simpleFixupListType *assembleStatement();
|
|
||||||
|
|
||||||
nullAssemble(block);
|
nullAssemble(block);
|
||||||
assembleStatement(block, FALSE, NULL);
|
assembleStatement(block, FALSE, NULL);
|
||||||
}
|
}
|
||||||
@ -63,8 +67,6 @@ assembleBlockInsideIf(block, ongoingFixupList)
|
|||||||
blockType *block;
|
blockType *block;
|
||||||
simpleFixupListType *ongoingFixupList;
|
simpleFixupListType *ongoingFixupList;
|
||||||
{
|
{
|
||||||
simpleFixupListType *assembleStatement();
|
|
||||||
|
|
||||||
nullAssembleNULL(block);
|
nullAssembleNULL(block);
|
||||||
return(assembleStatement(block, TRUE, ongoingFixupList));
|
return(assembleStatement(block, TRUE, ongoingFixupList));
|
||||||
}
|
}
|
||||||
@ -98,9 +100,6 @@ assembleMachineInstruction(opcode, operands)
|
|||||||
valueType *evaluatedOperands[MAX_NUMBER_OF_OPERANDS];
|
valueType *evaluatedOperands[MAX_NUMBER_OF_OPERANDS];
|
||||||
valueType *value;
|
valueType *value;
|
||||||
|
|
||||||
valueType *evaluateOperand();
|
|
||||||
addressType addressValue();
|
|
||||||
|
|
||||||
nullAssemble(opcode);
|
nullAssemble(opcode);
|
||||||
expand(moreText("%s\t", opcode->mnemonic));
|
expand(moreText("%s\t", opcode->mnemonic));
|
||||||
for (op=1; operands!=NULL && op<=opcode->maxNumberOfOperands;
|
for (op=1; operands!=NULL && op<=opcode->maxNumberOfOperands;
|
||||||
@ -193,9 +192,6 @@ assembleAlignStatement(alignStatement)
|
|||||||
int alignment;
|
int alignment;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
int intValue();
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(alignStatement);
|
nullAssemble(alignStatement);
|
||||||
expansionOff();
|
expansionOff();
|
||||||
alignment = intValue(evaluateExpression(alignStatement, NO_FIXUP));
|
alignment = intValue(evaluateExpression(alignStatement, NO_FIXUP));
|
||||||
@ -229,8 +225,6 @@ assembleAssertStatement(assertStatement)
|
|||||||
valueType *message;
|
valueType *message;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
expansionOff();
|
expansionOff();
|
||||||
test = evaluateExpression(assertStatement->condition, NO_FIXUP);
|
test = evaluateExpression(assertStatement->condition, NO_FIXUP);
|
||||||
expansionOn();
|
expansionOn();
|
||||||
@ -261,9 +255,6 @@ assembleBlockStatement(blockStatement)
|
|||||||
valueType *blockIncrement;
|
valueType *blockIncrement;
|
||||||
int blockSize;
|
int blockSize;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
int intValue();
|
|
||||||
|
|
||||||
blockSize = 0;
|
blockSize = 0;
|
||||||
nullAssemble(blockStatement);
|
nullAssemble(blockStatement);
|
||||||
expand(moreText("block\t"));
|
expand(moreText("block\t"));
|
||||||
@ -300,8 +291,6 @@ assembleByteStatement(byteStatement)
|
|||||||
{
|
{
|
||||||
valueType *byteValue;
|
valueType *byteValue;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(byteStatement);
|
nullAssemble(byteStatement);
|
||||||
expand(moreText("byte\t"));
|
expand(moreText("byte\t"));
|
||||||
while (byteStatement != NULL) {
|
while (byteStatement != NULL) {
|
||||||
@ -331,8 +320,6 @@ assembleConstrainStatement(constrainStatement)
|
|||||||
addressType endAddress;
|
addressType endAddress;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
expansionOff();
|
expansionOff();
|
||||||
constraintValue = evaluateExpression(constrainStatement->constraint,
|
constraintValue = evaluateExpression(constrainStatement->constraint,
|
||||||
NO_FIXUP);
|
NO_FIXUP);
|
||||||
@ -373,9 +360,6 @@ assembleDbyteStatement(dbyteStatement)
|
|||||||
{
|
{
|
||||||
valueType *wordValue;
|
valueType *wordValue;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
valueType *swabValue();
|
|
||||||
|
|
||||||
nullAssemble(dbyteStatement);
|
nullAssemble(dbyteStatement);
|
||||||
expand(moreText("dbyte\t"));
|
expand(moreText("dbyte\t"));
|
||||||
while (dbyteStatement != NULL) {
|
while (dbyteStatement != NULL) {
|
||||||
@ -399,10 +383,6 @@ assembleDefineStatement(defineStatement)
|
|||||||
symbolInContextType *contextToDefine;
|
symbolInContextType *contextToDefine;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
valueType *evaluateDefineExpression();
|
|
||||||
valueType *newValue();
|
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
|
|
||||||
nullAssemble(defineStatement);
|
nullAssemble(defineStatement);
|
||||||
symbolToDefine = effectiveSymbol(defineStatement->theSymbol,
|
symbolToDefine = effectiveSymbol(defineStatement->theSymbol,
|
||||||
&contextToDefine);
|
&contextToDefine);
|
||||||
@ -442,8 +422,6 @@ assembleDoUntilStatement(doUntilStatement)
|
|||||||
{
|
{
|
||||||
valueType topOfLoop;
|
valueType topOfLoop;
|
||||||
|
|
||||||
simpleFixupListType *emitJump();
|
|
||||||
|
|
||||||
nullAssemble(doUntilStatement);
|
nullAssemble(doUntilStatement);
|
||||||
topOfLoop = currentLocationCounter;
|
topOfLoop = currentLocationCounter;
|
||||||
if (doUntilStatement->doUntilCondition == NEVER_COND)
|
if (doUntilStatement->doUntilCondition == NEVER_COND)
|
||||||
@ -469,8 +447,6 @@ assembleDoWhileStatement(doWhileStatement)
|
|||||||
{
|
{
|
||||||
valueType topOfLoop;
|
valueType topOfLoop;
|
||||||
|
|
||||||
simpleFixupListType *emitJump();
|
|
||||||
|
|
||||||
nullAssemble(doWhileStatement);
|
nullAssemble(doWhileStatement);
|
||||||
topOfLoop = currentLocationCounter;
|
topOfLoop = currentLocationCounter;
|
||||||
if (doWhileStatement->doWhileCondition == ALWAYS_COND)
|
if (doWhileStatement->doWhileCondition == ALWAYS_COND)
|
||||||
@ -497,9 +473,6 @@ assembleExternStatement(externStatement)
|
|||||||
symbolInContextType *context;
|
symbolInContextType *context;
|
||||||
symbolTableEntryType *theSymbol;
|
symbolTableEntryType *theSymbol;
|
||||||
|
|
||||||
symbolInContextType *getBaseContext();
|
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
|
|
||||||
expand(moreText("extern\t"));
|
expand(moreText("extern\t"));
|
||||||
while (externStatement != NULL) {
|
while (externStatement != NULL) {
|
||||||
theSymbol = effectiveSymbol(externStatement->theSymbol,
|
theSymbol = effectiveSymbol(externStatement->theSymbol,
|
||||||
@ -539,10 +512,6 @@ assembleFunctionStatement(functionStatement)
|
|||||||
functionDefinitionType *newFunction;
|
functionDefinitionType *newFunction;
|
||||||
symbolInContextType *context;
|
symbolInContextType *context;
|
||||||
|
|
||||||
symbolTableEntryType *lookupOrEnterSymbol();
|
|
||||||
valueType *newValue();
|
|
||||||
symbolInContextType *getBaseContext();
|
|
||||||
|
|
||||||
nullAssemble(functionStatement);
|
nullAssemble(functionStatement);
|
||||||
if (currentEnvironment != &globalEnvironment) {
|
if (currentEnvironment != &globalEnvironment) {
|
||||||
error(FUNCTION_DEFINITION_INSIDE_FUNCTION_ERROR);
|
error(FUNCTION_DEFINITION_INSIDE_FUNCTION_ERROR);
|
||||||
@ -595,9 +564,6 @@ assembleIfStatement(ifStatement, terminalIf, ongoingFixupList)
|
|||||||
valueType fixupLocation1[COMPOUND_BRANCH_MAX];
|
valueType fixupLocation1[COMPOUND_BRANCH_MAX];
|
||||||
simpleFixupListType *fixupLocation2;
|
simpleFixupListType *fixupLocation2;
|
||||||
|
|
||||||
simpleFixupListType *emitJump();
|
|
||||||
void assembleIfStatementOldStyle();
|
|
||||||
|
|
||||||
if (backwardsCompatibleIfFlag) {
|
if (backwardsCompatibleIfFlag) {
|
||||||
assembleIfStatementOldStyle(ifStatement);
|
assembleIfStatementOldStyle(ifStatement);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -649,8 +615,6 @@ assembleIfStatementOldStyle(ifStatement)
|
|||||||
valueType fixupLocation1[COMPOUND_BRANCH_MAX];
|
valueType fixupLocation1[COMPOUND_BRANCH_MAX];
|
||||||
simpleFixupListType *fixupLocation2;
|
simpleFixupListType *fixupLocation2;
|
||||||
|
|
||||||
simpleFixupListType *emitJump();
|
|
||||||
|
|
||||||
nullAssemble(ifStatement);
|
nullAssemble(ifStatement);
|
||||||
if (ifStatement->ifCondition != ALWAYS_COND) {
|
if (ifStatement->ifCondition != ALWAYS_COND) {
|
||||||
emitRelativeBranch(invertConditionCode(ifStatement->
|
emitRelativeBranch(invertConditionCode(ifStatement->
|
||||||
@ -684,8 +648,6 @@ assembleIncludeStatement(includeStatement)
|
|||||||
stringType *fileName;
|
stringType *fileName;
|
||||||
valueType *possibleFileName;
|
valueType *possibleFileName;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
valueType *evaluateExpression();
|
|
||||||
stringType *saveString();
|
|
||||||
|
|
||||||
expansionOff();
|
expansionOff();
|
||||||
possibleFileName = evaluateExpression(includeStatement, NO_FIXUP);
|
possibleFileName = evaluateExpression(includeStatement, NO_FIXUP);
|
||||||
@ -727,7 +689,7 @@ assembleInstructionStatement(instructionStatement, cumulativeLineNumber)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
botch("bad instruction type=%d\n", instructionStatement->
|
botch("bad instruction type=%d\n", instructionStatement->
|
||||||
kindOfInstruction);
|
kindOfInstruction, 0, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -738,8 +700,6 @@ assembleLongStatement(longStatement)
|
|||||||
{
|
{
|
||||||
valueType *longValue;
|
valueType *longValue;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(longStatement);
|
nullAssemble(longStatement);
|
||||||
expand(moreText("long\t"));
|
expand(moreText("long\t"));
|
||||||
while (longStatement != NULL) {
|
while (longStatement != NULL) {
|
||||||
@ -761,8 +721,6 @@ assembleMacroStatement(macroStatement)
|
|||||||
{
|
{
|
||||||
macroTableEntryType *newMacro;
|
macroTableEntryType *newMacro;
|
||||||
|
|
||||||
macroTableEntryType *installMacro();
|
|
||||||
|
|
||||||
nullAssemble(macroStatement);
|
nullAssemble(macroStatement);
|
||||||
if (currentEnvironment != &globalEnvironment) {
|
if (currentEnvironment != &globalEnvironment) {
|
||||||
error(MACRO_DEFINITION_INSIDE_MACRO_ERROR);
|
error(MACRO_DEFINITION_INSIDE_MACRO_ERROR);
|
||||||
@ -785,7 +743,6 @@ assembleMdefineStatement(mdefineStatement)
|
|||||||
defineStatementBodyType *mdefineStatement;
|
defineStatementBodyType *mdefineStatement;
|
||||||
{
|
{
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
valueType *evaluateDefineExpression();
|
|
||||||
|
|
||||||
nullAssemble(mdefineStatement);
|
nullAssemble(mdefineStatement);
|
||||||
expansionOff();
|
expansionOff();
|
||||||
@ -879,7 +836,6 @@ assembleMswitchStatement(mswitchStatement)
|
|||||||
expressionListType *tagExpressionList;
|
expressionListType *tagExpressionList;
|
||||||
valueType *tagValue;
|
valueType *tagValue;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
expansionOff();
|
expansionOff();
|
||||||
switchValue = evaluateExpression(mswitchStatement->switchExpression,
|
switchValue = evaluateExpression(mswitchStatement->switchExpression,
|
||||||
@ -939,9 +895,6 @@ assembleMvariableStatement(mvariableStatement)
|
|||||||
int initCount;
|
int initCount;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
|
|
||||||
valueType *createArray();
|
|
||||||
int expressionListLength();
|
|
||||||
|
|
||||||
nullAssemble(mvariableStatement);
|
nullAssemble(mvariableStatement);
|
||||||
expansionOff();
|
expansionOff();
|
||||||
if (mvariableStatement->theDimension == NULL) {
|
if (mvariableStatement->theDimension == NULL) {
|
||||||
@ -990,7 +943,6 @@ assembleOrgStatement(orgStatement)
|
|||||||
{
|
{
|
||||||
valueType *orgAddress;
|
valueType *orgAddress;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(orgStatement);
|
nullAssemble(orgStatement);
|
||||||
targetOffset = 0;
|
targetOffset = 0;
|
||||||
@ -1018,8 +970,6 @@ assembleOrgStatement(orgStatement)
|
|||||||
assemblePerformStatement(performStatement)
|
assemblePerformStatement(performStatement)
|
||||||
performStatementBodyType *performStatement;
|
performStatementBodyType *performStatement;
|
||||||
{
|
{
|
||||||
void evaluateExpressionStandalone();
|
|
||||||
|
|
||||||
nullAssemble(performStatement);
|
nullAssemble(performStatement);
|
||||||
sideEffectFlag = FALSE;
|
sideEffectFlag = FALSE;
|
||||||
evaluateExpressionStandalone(performStatement);
|
evaluateExpressionStandalone(performStatement);
|
||||||
@ -1045,10 +995,6 @@ assembleRelStatement(relStatement)
|
|||||||
assembleStartStatement(startStatement)
|
assembleStartStatement(startStatement)
|
||||||
startStatementBodyType *startStatement;
|
startStatementBodyType *startStatement;
|
||||||
{
|
{
|
||||||
valueType *evaluateExpression();
|
|
||||||
addressType addressValue();
|
|
||||||
expressionType *generateFixupExpression();
|
|
||||||
|
|
||||||
nullAssemble(startStatement);
|
nullAssemble(startStatement);
|
||||||
expand(moreText("start\t"));
|
expand(moreText("start\t"));
|
||||||
if (haveUserStartAddress) {
|
if (haveUserStartAddress) {
|
||||||
@ -1079,8 +1025,6 @@ assembleStringStatement(stringStatement)
|
|||||||
{
|
{
|
||||||
valueType *byteValue;
|
valueType *byteValue;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(stringStatement);
|
nullAssemble(stringStatement);
|
||||||
expand(moreText("string\t"));
|
expand(moreText("string\t"));
|
||||||
while (stringStatement != NULL) {
|
while (stringStatement != NULL) {
|
||||||
@ -1118,7 +1062,6 @@ assembleTargetStatement(targetStatement)
|
|||||||
{
|
{
|
||||||
valueType *targetAddress;
|
valueType *targetAddress;
|
||||||
bool saveExpansion;
|
bool saveExpansion;
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(targetStatement);
|
nullAssemble(targetStatement);
|
||||||
targetOffset = 0;
|
targetOffset = 0;
|
||||||
@ -1141,8 +1084,6 @@ assembleTargetStatement(targetStatement)
|
|||||||
assembleUndefineStatement(undefineStatement)
|
assembleUndefineStatement(undefineStatement)
|
||||||
undefineStatementBodyType *undefineStatement;
|
undefineStatementBodyType *undefineStatement;
|
||||||
{
|
{
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
|
|
||||||
expand(moreText("undefine\t"));
|
expand(moreText("undefine\t"));
|
||||||
while (undefineStatement != NULL) {
|
while (undefineStatement != NULL) {
|
||||||
expand(moreText("%s", symbName(undefineStatement->theSymbol)));
|
expand(moreText("%s", symbName(undefineStatement->theSymbol)));
|
||||||
@ -1162,10 +1103,6 @@ assembleVariableStatement(variableStatement)
|
|||||||
symbolInContextType *contextForVariable;
|
symbolInContextType *contextForVariable;
|
||||||
int initCount;
|
int initCount;
|
||||||
|
|
||||||
symbolTableEntryType *effectiveSymbol();
|
|
||||||
valueType *createArray();
|
|
||||||
int expressionListLength();
|
|
||||||
|
|
||||||
nullAssemble(variableStatement);
|
nullAssemble(variableStatement);
|
||||||
newVariable = effectiveSymbol(variableStatement->theSymbol,
|
newVariable = effectiveSymbol(variableStatement->theSymbol,
|
||||||
&contextForVariable);
|
&contextForVariable);
|
||||||
@ -1243,8 +1180,6 @@ assembleWordStatement(wordStatement)
|
|||||||
{
|
{
|
||||||
valueType *word;
|
valueType *word;
|
||||||
|
|
||||||
valueType *evaluateExpression();
|
|
||||||
|
|
||||||
nullAssemble(wordStatement);
|
nullAssemble(wordStatement);
|
||||||
expand(moreText("word\t"));
|
expand(moreText("word\t"));
|
||||||
while (wordStatement != NULL) {
|
while (wordStatement != NULL) {
|
||||||
@ -1468,7 +1403,7 @@ assembleStatementBody(kind, body, cumulativeLineNumber, worryAboutIf,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
botch("assembleStatementBody doesn't know kind %d\n", kind);
|
botch("assembleStatementBody doesn't know kind %d\n", kind, 0, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* return(result);*/
|
/* return(result);*/
|
||||||
@ -1479,8 +1414,6 @@ assembleStatementBody(kind, body, cumulativeLineNumber, worryAboutIf,
|
|||||||
assembleLabelList(labelList)
|
assembleLabelList(labelList)
|
||||||
labelListType *labelList;
|
labelListType *labelList;
|
||||||
{
|
{
|
||||||
valueType *newValue();
|
|
||||||
|
|
||||||
while (labelList != NULL) {
|
while (labelList != NULL) {
|
||||||
if (structNestingDepth == 0)
|
if (structNestingDepth == 0)
|
||||||
valueLabel(labelList->theLabel,
|
valueLabel(labelList->theLabel,
|
||||||
|
54
statementSemantics.h
Normal file
54
statementSemantics.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#ifndef STATEMENT_SEMANTICS_H_
|
||||||
|
#define STATEMENT_SEMANTICS_H_
|
||||||
|
|
||||||
|
#include "macrossTypes.h"
|
||||||
|
|
||||||
|
void assembleBlock(blockType *block);
|
||||||
|
simpleFixupListType *assembleBlockInsideIf(blockType *block, simpleFixupListType *ongoingFixupList);
|
||||||
|
bool operandCheck(opcodeTableEntryType *opcode, int numberOfOperands, valueType *evaluatedOperands[]);
|
||||||
|
void assembleMachineInstruction(opcodeTableEntryType *opcode, operandListType *operands);
|
||||||
|
void assembleMacro(macroTableEntryType *macroInstruction, operandListType *operands);
|
||||||
|
void assembleAlignStatement(alignStatementBodyType *alignStatement);
|
||||||
|
void assembleAssertStatement(assertStatementBodyType *assertStatement);
|
||||||
|
void assembleBlockStatement(blockStatementBodyType *blockStatement);
|
||||||
|
void assembleByteStatement(byteStatementBodyType *byeStatement);
|
||||||
|
void assembleConstrainStatement(constrainStatementBodyType *constrainStatement);
|
||||||
|
void assembleDbyteStatement(dbyteStatementBodyType *dbyteStatement);
|
||||||
|
void assembleDefineStatement(defineStatementBodyType *defineStatement);
|
||||||
|
void assembleDoUntilStatement(doUntilStatementBodyType *doUntilStatement);
|
||||||
|
void assembleDoWhileStatement(doWhileStatementBodyType *doWhileStatement);
|
||||||
|
void assembleExternStatement(externStatementBodyType *externStatement);
|
||||||
|
void assembleFReturnStatement(freturnStatementBodyType *freturnStatement);
|
||||||
|
void assembleFunctionStatement(functionStatementBodyType *functionStatement);
|
||||||
|
void assembleGroupStatement(blockType *groupStatement);
|
||||||
|
simpleFixupListType *assembleIfStatement(ifStatementBodyType *ifStatement, bool terminalIf, simpleFixupListType *ongoingFixupList);
|
||||||
|
void assembleIfStatementOldStyle(ifStatementBodyType *ifStatement);
|
||||||
|
void assembleIncludeStatement(includeStatementBodyType *includeStatement);
|
||||||
|
void assembleInstructionStatement(instructionStatementBodyType *Statement, int cumulativeLineNumber);
|
||||||
|
void assembleLongStatement(longStatementBodyType *longStatement);
|
||||||
|
void assembleMacroStatement(macroStatementBodyType *macroStatement);
|
||||||
|
void assembleMdefineStatement(defineStatementBodyType *mdefineStatement);
|
||||||
|
void assembleMdoUntilStatement(mdoUntilStatementBodyType *mdoUntilStatement);
|
||||||
|
void assembleMdoWhileStatement(mdoWhileStatementBodyType *mdoWhileStatement);
|
||||||
|
void assembleMforStatement(mforStatementBodyType *mforStatement);
|
||||||
|
void assembleMifStatement(mifStatementBodyType *mifStatement, int cumulativeLineNumber);
|
||||||
|
void assembleMswitchStatement(mswitchStatementBodyType *mswitchStatement);
|
||||||
|
void assembleMvariableStatement(mvariableStatementBodyType *mvariableStatement);
|
||||||
|
void assembleMwhileStatement(mwhileStatementBodyType *mwhileStatement);
|
||||||
|
void assembleOrgStatement(orgStatementBodyType *orgStatement);
|
||||||
|
void assemblePerformStatement(performStatementBodyType *performStatement);
|
||||||
|
void assembleRelStatement(relStatementBodyType *relStatement);
|
||||||
|
void assembleStartStatement(startStatementBodyType *startStatement);
|
||||||
|
void assembleStringStatement(stringStatementBodyType *stringStatement);
|
||||||
|
void assembleStructStatement(structStatementBodyType *structStatement);
|
||||||
|
void assembleTargetStatement(targetStatementBodyType *targetStatement);
|
||||||
|
void assembleUndefineStatement(undefineStatementBodyType *undefineStatement);
|
||||||
|
void assembleVariableStatement(variableStatementBodyType *variableStatement);
|
||||||
|
void assembleWhileStatement(whileStatementBodyType *whileStatement);
|
||||||
|
void assembleWordStatement(wordStatementBodyType *wordStatement);
|
||||||
|
bool assembleStatementBody(statementKindType kind, statementBodyType body, int cumulativeLineNumber, bool worryAboutIf, simpleFixupListType **ifFixupList);
|
||||||
|
void assembleLabelList(labelListType *labelList);
|
||||||
|
simpleFixupListType *assembleStatement(statementType *statement, bool insideIf, simpleFixupListType *ongoingFixupList);
|
||||||
|
void eatStatement(statementType *statement);
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user