Commit b8e0c96e authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl

add BEExternalTypeSymbol for implementing generic functions using abstract...

add BEExternalTypeSymbol for implementing generic functions using abstract types defined in the same module
parent ae0920c3
......@@ -15,6 +15,7 @@ BEFunctionSymbol
BEConstructorSymbol
BEFieldSymbol
BETypeSymbol
BEExternalTypeSymbol
BEDontCareDefinitionSymbol
BEBoolSymbol
BELiteralSymbol
......
......@@ -15,6 +15,7 @@ BEConstructorSymbol
BEFieldSymbol
BETypeSymbol
BETypeSymbolNoMark
BEExternalTypeSymbol
BEDontCareDefinitionSymbol
BEBoolSymbol
BELiteralSymbol
......
......@@ -61,6 +61,8 @@ BETypeSymbol :: !Int !Int !BackEnd -> (!BESymbolP,!BackEnd);
// BESymbolP BETypeSymbol (int typeIndex,int moduleIndex);
BETypeSymbolNoMark :: !Int !Int !BackEnd -> (!BESymbolP,!BackEnd);
// BESymbolP BETypeSymbolNoMark (int typeIndex,int moduleIndex);
BEExternalTypeSymbol :: !Int !Int !BackEnd -> (!BESymbolP,!BackEnd);
// BESymbolP BEExternalTypeSymbol (int typeIndex,int moduleIndex);
BEDontCareDefinitionSymbol :: !BackEnd -> (!BESymbolP,!BackEnd);
// BESymbolP BEDontCareDefinitionSymbol ();
BEBoolSymbol :: !Bool !BackEnd -> (!BESymbolP,!BackEnd);
......
......@@ -130,6 +130,12 @@ BETypeSymbolNoMark a0 a1 a2 = code {
}
// BESymbolP BETypeSymbolNoMark (int typeIndex,int moduleIndex);
BEExternalTypeSymbol :: !Int !Int !BackEnd -> (!BESymbolP,!BackEnd);
BEExternalTypeSymbol a0 a1 a2 = code {
ccall BEExternalTypeSymbol "II:p:p"
}
// BESymbolP BEExternalTypeSymbol (int typeIndex,int moduleIndex);
BEDontCareDefinitionSymbol :: !BackEnd -> (!BESymbolP,!BackEnd);
BEDontCareDefinitionSymbol a0 = code {
ccall BEDontCareDefinitionSymbol ":p:p"
......
......@@ -880,6 +880,25 @@ BESymbolP BETypeSymbolNoMark (int typeIndex, int moduleIndex)
return &gBEState.be_modules [moduleIndex].bem_types [typeIndex];
}
BESymbolP
BEExternalTypeSymbol (int typeIndex, int moduleIndex)
{
SymbolP typeSymbol;
if (moduleIndex==main_dcl_module_n){
typeSymbol = &gBEState.be_modules[moduleIndex].bem_types[typeIndex];
typeSymbol->symb_def->sdef_isused = True;
if (typeIndex < gBEState.be_icl.beicl_dcl_module.bem_nTypes){
typeSymbol = &gBEState.be_icl.beicl_dcl_module.bem_types[typeIndex];
typeSymbol->symb_def->sdef_isused = True;
}
} else
typeSymbol = &gBEState.be_modules[moduleIndex].bem_types[typeIndex];
return typeSymbol;
}
BESymbolP
BEDontCareDefinitionSymbol (void)
{
......
......@@ -205,6 +205,9 @@ Clean (BETypeSymbol :: Int Int BackEnd -> (BESymbolP, BackEnd))
BESymbolP BETypeSymbolNoMark (int typeIndex, int moduleIndex);
Clean (BETypeSymbolNoMark :: Int Int BackEnd -> (BESymbolP, BackEnd))
BESymbolP BEExternalTypeSymbol (int typeIndex, int moduleIndex);
Clean (BEExternalTypeSymbol :: Int Int BackEnd -> (BESymbolP, BackEnd))
BESymbolP BEDontCareDefinitionSymbol (void);
Clean (BEDontCareDefinitionSymbol :: BackEnd -> (BESymbolP, BackEnd))
......
......@@ -16,6 +16,7 @@ EXPORTS
BEFieldSymbol
BETypeSymbol
BETypeSymbolNoMark
BEExternalTypeSymbol
BEDontCareDefinitionSymbol
BEBoolSymbol
BELiteralSymbol
......
......@@ -15,6 +15,7 @@
/EXPORT: BEFieldSymbol
/EXPORT: BETypeSymbol
/EXPORT: BETypeSymbolNoMark
/EXPORT: BEExternalTypeSymbol
/EXPORT: BEDontCareDefinitionSymbol
/EXPORT: BEBoolSymbol
/EXPORT: BELiteralSymbol
......
......@@ -14,6 +14,7 @@
/EXPORT:BEFieldSymbol
/EXPORT:BETypeSymbol
/EXPORT:BETypeSymbolNoMark
/EXPORT:BEExternalTypeSymbol
/EXPORT:BEDontCareDefinitionSymbol
/EXPORT:BEBoolSymbol
/EXPORT:BELiteralSymbol
......
Markdown is supported
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