Commit 3959cf0e authored by John van Groningen's avatar John van Groningen
Browse files

add extra attribute argument to BEFlatType and

the is_boxed_record argument to BERecordType,
use abstract type synonyms,
remove BEUpdateKind,
increment version number
parent cd73aed6
......@@ -4,39 +4,38 @@ definition module backend;
from StdString import String;
//3.1
:: CPtr :== Int;
:: CPtr (:== Int);
:: *UWorld :== Int;
:: *BackEnd; // :== CPtr;
:: BESymbolP; // :== CPtr;
:: BETypeNodeP; // :== CPtr;
:: BETypeArgP; // :== CPtr;
:: BETypeAltP; // :== CPtr;
:: BENodeP; // :== CPtr;
:: BEArgP; // :== CPtr;
:: BERuleAltP; // :== CPtr;
:: BEImpRuleP; // :== CPtr;
:: BETypeP; // :== CPtr;
:: BEFlatTypeP; // :== CPtr;
:: BETypeVarP; // :== CPtr;
:: BETypeVarListP; // :== CPtr;
:: BEConstructorListP; // :== CPtr;
:: BEFieldListP; // :== CPtr;
:: BENodeIdP; // :== CPtr;
:: BENodeDefP; // :== CPtr;
:: BEStrictNodeIdP; // :== CPtr;
:: BECodeParameterP; // :== CPtr;
:: BECodeBlockP; // :== CPtr;
:: BEStringListP; // :== CPtr;
:: BENodeIdListP; // :== CPtr;
:: BENodeIdRefCountListP; // :== CPtr;
:: BEUniVarEquations; // :== CPtr;
:: BEAttributeKindList; // :== CPtr;
:: *BackEnd (:== CPtr);
:: BESymbolP (:== CPtr);
:: BETypeNodeP (:== CPtr);
:: BETypeArgP (:== CPtr);
:: BETypeAltP (:== CPtr);
:: BENodeP (:== CPtr);
:: BEArgP (:== CPtr);
:: BERuleAltP (:== CPtr);
:: BEImpRuleP (:== CPtr);
:: BETypeP (:== CPtr);
:: BEFlatTypeP (:== CPtr);
:: BETypeVarP (:== CPtr);
:: BETypeVarListP (:== CPtr);
:: BEConstructorListP (:== CPtr);
:: BEFieldListP (:== CPtr);
:: BENodeIdP (:== CPtr);
:: BENodeDefP (:== CPtr);
:: BEStrictNodeIdP (:== CPtr);
:: BECodeParameterP (:== CPtr);
:: BECodeBlockP (:== CPtr);
:: BEStringListP (:== CPtr);
:: BENodeIdListP (:== CPtr);
:: BENodeIdRefCountListP (:== CPtr);
:: BEUniVarEquations (:== CPtr);
:: BEAttributeKindList (:== CPtr);
:: BEAnnotation :== Int;
:: BEAttribution :== Int;
:: BESymbKind :== Int;
:: BEArrayFunKind :== Int;
:: BESelectorKind :== Int;
:: BEUpdateKind :== Int;
:: BESpecialIdentIndex :== Int;
BEGetVersion :: (!Int,!Int,!Int);
// void BEGetVersion (int* current,int* oldestDefinition,int* oldestImplementation);
......@@ -204,12 +203,12 @@ BETypes :: !BETypeP !BETypeP !BackEnd -> (!BETypeP,!BackEnd);
// BETypeP BETypes (BETypeP type,BETypeP types);
BENoTypes :: !BackEnd -> (!BETypeP,!BackEnd);
// BETypeP BENoTypes ();
BEFlatType :: !BESymbolP !BETypeVarListP !BackEnd -> (!BEFlatTypeP,!BackEnd);
// BEFlatTypeP BEFlatType (BESymbolP symbol,BETypeVarListP arguments);
BEFlatType :: !BESymbolP !BEAttribution !BETypeVarListP !BackEnd -> (!BEFlatTypeP,!BackEnd);
// BEFlatTypeP BEFlatType (BESymbolP symbol,BEAttribution attribution,BETypeVarListP arguments);
BEAlgebraicType :: !BEFlatTypeP !BEConstructorListP !BackEnd -> BackEnd;
// void BEAlgebraicType (BEFlatTypeP lhs,BEConstructorListP constructors);
BERecordType :: !Int !BEFlatTypeP !BETypeNodeP !BEFieldListP !BackEnd -> BackEnd;
// void BERecordType (int moduleIndex,BEFlatTypeP lhs,BETypeNodeP constructorType,BEFieldListP fields);
BERecordType :: !Int !BEFlatTypeP !BETypeNodeP !Int !BEFieldListP !BackEnd -> BackEnd;
// void BERecordType (int moduleIndex,BEFlatTypeP lhs,BETypeNodeP constructorType,int is_boxed_record,BEFieldListP fields);
BEAbsType :: !BEFlatTypeP !BackEnd -> BackEnd;
// void BEAbsType (BEFlatTypeP lhs);
BEConstructors :: !BEConstructorListP !BEConstructorListP !BackEnd -> (!BEConstructorListP,!BackEnd);
......@@ -288,9 +287,9 @@ BEDeclareDynamicTypeSymbol :: !Int !Int !BackEnd -> BackEnd;
// void BEDeclareDynamicTypeSymbol (int typeIndex,int moduleIndex);
BEDynamicTempTypeSymbol :: !BackEnd -> (!BESymbolP,!BackEnd);
// BESymbolP BEDynamicTempTypeSymbol ();
kBEVersionCurrent:==0x02100400;
kBEVersionOldestDefinition:==0x02030407;
kBEVersionOldestImplementation:==0x02030407;
kBEVersionCurrent:==0x02100401;
kBEVersionOldestDefinition:==0x02100401;
kBEVersionOldestImplementation:==0x02100401;
kBEDebug:==1;
kPredefinedModuleIndex:==1;
BENoAnnot:==0;
......@@ -360,9 +359,6 @@ BESelector_U:==2;
BESelector_F:==3;
BESelector_L:==4;
BESelector_N:==5;
BEUpdateDummy:==0;
BEUpdate:==1;
BEUpdate_U:==2;
BESpecialIdentStdMisc:==0;
BESpecialIdentAbort:==1;
BESpecialIdentUndef:==2;
......
/* version info */
// increment this for every release
# define kBEVersionCurrent 0x02100400
# define kBEVersionCurrent 0x02100401
// change this to the same value as kBEVersionCurrent if the new release is
// not upward compatible (for example when a function is added)
# define kBEVersionOldestDefinition 0x02030407
# define kBEVersionOldestDefinition 0x02100401
// change this to the same value as kBEVersionCurrent if the new release is
// not downward compatible (for example when a function is removed)
# define kBEVersionOldestImplementation 0x02030407
# define kBEVersionOldestImplementation 0x02100401
# define kBEDebug 1
/* pointer types */
Clean (:: CPtr :== Int)
Clean (:: CPtr (:== Int))
Clean (:: *UWorld :== Int)
typedef struct BackEnd *BackEnd;
Clean (:: *BackEnd :== CPtr)
Clean (:: *BackEnd (:== CPtr))
typedef struct symbol *BESymbolP;
Clean (:: BESymbolP :== CPtr)
Clean (:: BESymbolP (:== CPtr))
typedef struct type_node *BETypeNodeP;
Clean (:: BETypeNodeP :== CPtr)
Clean (:: BETypeNodeP (:== CPtr))
typedef struct type_arg *BETypeArgP;
Clean (:: BETypeArgP :== CPtr)
Clean (:: BETypeArgP (:== CPtr))
typedef struct type_alt *BETypeAltP;
Clean (:: BETypeAltP :== CPtr)
Clean (:: BETypeAltP (:== CPtr))
typedef struct node *BENodeP;
Clean (:: BENodeP :== CPtr)
Clean (:: BENodeP (:== CPtr))
typedef struct arg *BEArgP;
Clean (:: BEArgP :== CPtr)
Clean (:: BEArgP (:== CPtr))
typedef struct rule_alt *BERuleAltP;
Clean (:: BERuleAltP :== CPtr)
Clean (:: BERuleAltP (:== CPtr))
typedef struct imp_rule *BEImpRuleP;
Clean (:: BEImpRuleP :== CPtr)
Clean (:: BEImpRuleP (:== CPtr))
typedef struct type *BETypeP;
Clean (:: BETypeP :== CPtr)
Clean (:: BETypeP (:== CPtr))
typedef struct flat_type *BEFlatTypeP;
Clean (:: BEFlatTypeP :== CPtr)
Clean (:: BEFlatTypeP (:== CPtr))
typedef struct type_var *BETypeVarP;
Clean (:: BETypeVarP :== CPtr)
Clean (:: BETypeVarP (:== CPtr))
typedef struct type_var_list *BETypeVarListP;
Clean (:: BETypeVarListP :== CPtr)
Clean (:: BETypeVarListP (:== CPtr))
typedef struct constructor_list *BEConstructorListP;
Clean (:: BEConstructorListP :== CPtr)
Clean (:: BEConstructorListP (:== CPtr))
typedef struct field_list *BEFieldListP;
Clean (:: BEFieldListP :== CPtr)
Clean (:: BEFieldListP (:== CPtr))
typedef struct node_id *BENodeIdP;
Clean (:: BENodeIdP :== CPtr)
Clean (:: BENodeIdP (:== CPtr))
typedef struct node_def *BENodeDefP;
Clean (:: BENodeDefP :== CPtr)
Clean (:: BENodeDefP (:== CPtr))
typedef struct strict_node_id *BEStrictNodeIdP;
Clean (:: BEStrictNodeIdP :== CPtr)
Clean (:: BEStrictNodeIdP (:== CPtr))
typedef struct parameter *BECodeParameterP;
Clean (:: BECodeParameterP :== CPtr)
Clean (:: BECodeParameterP (:== CPtr))
typedef struct code_block *BECodeBlockP;
Clean (:: BECodeBlockP :== CPtr)
Clean (:: BECodeBlockP (:== CPtr))
typedef struct string_list *BEStringListP;
Clean (:: BEStringListP :== CPtr)
Clean (:: BEStringListP (:== CPtr))
typedef struct node_id_list_element *BENodeIdListP;
Clean (:: BENodeIdListP :== CPtr)
Clean (:: BENodeIdListP (:== CPtr))
typedef struct node_id_ref_count_list *BENodeIdRefCountListP;
Clean (:: BENodeIdRefCountListP :== CPtr)
Clean (:: BENodeIdRefCountListP (:== CPtr))
typedef struct uni_var_equats *BEUniVarEquations;
Clean (:: BEUniVarEquations :== CPtr)
Clean (:: BEUniVarEquations (:== CPtr))
typedef struct attr_kind_list *BEAttributeKindList;
Clean (:: BEAttributeKindList :== CPtr)
Clean (:: BEAttributeKindList (:== CPtr))
/* constants */
/*
......@@ -155,12 +155,6 @@ enum {
BESelectorDummy, BESelector, BESelector_U, BESelector_F, BESelector_L, BESelector_N
};
typedef int BEUpdateKind;
Clean (::BEUpdateKind :== Int)
enum {
BEUpdateDummy, BEUpdate, BEUpdate_U
};
typedef int BESpecialIdentIndex;
Clean (::BESpecialIdentIndex :== Int)
enum {
......@@ -427,14 +421,14 @@ Clean (BETypes :: BETypeP BETypeP BackEnd -> (BETypeP, BackEnd))
BETypeP BENoTypes (void);
Clean (BENoTypes :: BackEnd -> (BETypeP, BackEnd))
BEFlatTypeP BEFlatType (BESymbolP symbol, BETypeVarListP arguments);
Clean (BEFlatType :: BESymbolP BETypeVarListP BackEnd -> (BEFlatTypeP, BackEnd))
BEFlatTypeP BEFlatType (BESymbolP symbol, BEAttribution attribution, BETypeVarListP arguments);
Clean (BEFlatType :: BESymbolP BEAttribution BETypeVarListP BackEnd -> (BEFlatTypeP, BackEnd))
void BEAlgebraicType (BEFlatTypeP lhs, BEConstructorListP constructors);
Clean (BEAlgebraicType:: BEFlatTypeP BEConstructorListP BackEnd -> BackEnd)
void BERecordType (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, BEFieldListP fields);
Clean (BERecordType :: Int BEFlatTypeP BETypeNodeP BEFieldListP BackEnd -> BackEnd)
void BERecordType (int moduleIndex, BEFlatTypeP lhs, BETypeNodeP constructorType, int is_boxed_record, BEFieldListP fields);
Clean (BERecordType :: Int BEFlatTypeP BETypeNodeP Int BEFieldListP BackEnd -> BackEnd)
void BEAbsType (BEFlatTypeP lhs);
Clean (BEAbsType :: BEFlatTypeP BackEnd -> BackEnd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment