[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-434-g4b78924
Benoit Sonntag
sonntag at icps.u-strasbg.fr
Fri Aug 21 18:32:07 UTC 2009
The following commit has been merged in the master branch:
commit 4b78924e589ff419a8f326be5847c21faf472d51
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date: Fri Aug 21 20:32:07 2009 +0200
a new bug...
diff --git a/lib/number/integer.li b/lib/number/integer.li
index c4caab4..970ced2 100644
--- a/lib/number/integer.li
+++ b/lib/number/integer.li
@@ -305,7 +305,6 @@ Section Public
+? {result == other.gcd self};
];
-
- is_prime : BOOLEAN <-
// TRUE if `Self' is prime
( + diviseur : INTEGER;
diff --git a/src/avoir.txt b/src/avoir.txt
index 139597f..3322e1a 100644
--- a/src/avoir.txt
+++ b/src/avoir.txt
@@ -1,2 +1,65 @@
-
-
+FAST_ARRAYoSTRINGo__ISD->
+FAST_ARRAYoStrict_STRING_CONSTANTo__ED->
+FAST_ARRAYoITM_TYPE_MONOo__5LB->
+FAST_ARRAYoTYPE_FULLo__BBY->
+FAST_ARRAYoLOCALo__4S2D->
+FAST_ARRAYoTYPEo__RSB->
+FAST_ARRAYoFAST_ARRAYoCASEoo__PHTM->
+FAST_ARRAYoSLOT_DATAo__5P0G->
+LIP_CODE__IC->
+FAST_ARRAYoSLOTo__ZLC->
+FAST_ARRAYoTYPE_IDo__1MC->
+TYPE_ID__RMB->
+ITM_TYPE_PARAMETER__FFZ->
+FAST_ARRAYoINSTRo__G24D->
+INSTR__XH->
+TYPE_NULL__LMB->
+TYPE_VOID__NMB->
+TYPE_CONTEXT__PMB->
+EXPR__BK->
+FAST_ARRAYoLIP_SLOT_DATAo__4QXC->
+READ__JE0H->
+FAST_ARRAYoCASEo__WTJJ->
+EXPR_AND_AND_LOGIC__N5RJ->
+EXPR_OR_OR_LOGIC__05RJ->
+FAST_ARRAYoLIP_CODEo__I5S->
+ENTRY_UNIX__Y4GD->
+FAST_ARRAYoITM_ARGUMENTo__F4YD->
+FAST_ARRAYoEXPRo__ILXC->
+FAST_ARRAYoPROFIL_SLOTo__X1WH->
+FAST_ARRAYoSLOT_CODEo__UAXL->
+FAST_ARRAYoWRITEo__H4JJ->
+FAST_ARRAYoITM_TYPE_PARAMETERo__HFZ->
+FAST_ARRAYoITM_CODEo__LEPC->
+ITM_ARGUMENT__WTSC->
+ITM_CODE__2COC->
+ITM_CONSTANT__AHPC->
+FAST_ARRAYoRESULTo__QANL->
+FAST_ARRAYoITM_LOCALo__V3PC->
+FAST_ARRAYoPROTOTYPEo__NVB->
+FAST_ARRAYoLIP_INTEGERo__YYW->
+FAST_ARRAYoLIP_STRINGo__EUW->
+FAST_ARRAYoFAST_ARRAYoLIP_CODEoo__E2FB->
+FAST_ARRAYoLIP_SLOT_CODEo__B3B->
+FAST_ARRAYoFAST_ARRAYoITM_TYPE_MONOoo__ORC->
+FAST_ARRAYoITM_TYPE_MULTIo__5IVC->
+FAST_ARRAYoITM_TYPE_BLOCKo__ABTC->
+FAST_ARRAYoITM_TYPE_GENERICo__1TC->
+FAST_ARRAYoITM_TYPE_STYLEo__WOC->
+FAST_ARRAYoFAST_ARRAYoITM_LOCALoo__KGQC->
+FAST_ARRAYoFAST_ARRAYoITM_CODEoo__WAQC->
+FAST_ARRAYoFAST_ARRAYoStrict_STRING_CONSTANToo__SHRC->
+FAST_ARRAYoFAST_ARRAYoITM_ARGUMENToo__3VZD->
+FAST_ARRAYoFAST_ARRAYoTYPE_FULLoo__WM1->
+FAST_ARRAYoTYPE_BLOCKo__SJLF->
+FAST_ARRAYoTYPES_TMPo__4FKG->
+FAST_ARRAYoPUT_TOo__CY5O->
+FAST_ARRAYoFAST_ARRAYoEXPRoo__FOXJ->
+FAST_ARRAYoPROFILo__XQB->
+FAST_ARRAYoFAST_ARRAYoINSTRoo__SKUJ->
+FAST_ARRAYoLISTo__WBGE->
+FAST_ARRAYoLOCAL_SEQo__PRXL->
+FAST_ARRAYoFAST_ARRAYoLOCALoo__MT2D->
+FAST_ARRAYoFAST_ARRAYoFAST_ARRAYoCASEooo__VDCN->
+FAST_ARRAYoFAST_ARRAYoSLOT_DATAoo__DQ0I->
+run `gcc lisaac.c -o lisaac -lm -lX11 '
diff --git a/src/profil_list.li b/src/profil_list.li
index c0e13f7..0ed58a6 100644
--- a/src/profil_list.li
+++ b/src/profil_list.li
@@ -141,6 +141,8 @@ Section Public
- execute_pass <-
(
+ TYPE.detect_alias;
+ TYPE_GENERIC.detect_alias;
VARIABLE.update;
life_limit := 0;
profil_slot := NULL;
diff --git a/src/type/type.li b/src/type/type.li
index 11184a9..899e72a 100644
--- a/src/type/type.li
+++ b/src/type/type.li
@@ -382,6 +382,63 @@ Section Public
+ detect_recursivity_generation:BOOLEAN;
+ //
+ // Detect Alias.
+ //
+
+ + alias_slot:SLOT_DATA;
+
+ - alias_type:TYPE <- alias_slot.type.raw;
+
+ - detect_alias <-
+ (
+ (dico_type.lower).to (dico_type.upper) do { j:INTEGER;
+ dico_type.item j.detect_alias_struct;
+ };
+ );
+
+ - detect_alias_struct <-
+ ( + slot:SLOT;
+ + i,nb:INTEGER;
+ + action:{SLOT_DATA; };
+
+ (alias_slot = NULL).if {
+
+ action := { s:SLOT_DATA;
+ ((s.ensure_count > 0) || {s.id_section.is_mapping}).if {
+ (nb = 0).if {
+ ((s.type.is_expanded) && {s.type.raw.type_c = NULL}).if {
+ alias_slot := s;
+ };
+ } else {
+ alias_slot := NULL;
+ };
+ nb := nb + 1;
+ };
+ };
+
+ i := slot_run.lower;
+ {(i <= slot_run.upper) && {nb < 2}}.while_do {
+ slot := slot_run.item i;
+ ((slot.style = '+') && {slot.lower_style = 0}).if {
+ (slot.slot_data_list != NULL).if {
+ (slot.slot_data_list.lower).to (slot.slot_data_list.upper) do { k:INTEGER;
+ action.value (slot.slot_data_list.item k);
+ };
+ };
+ action.value (slot.slot_data);
+ };
+ i := i + 1;
+ };
+ };
+ (
+ (alias_slot != NULL) &&
+ {! (is_late_binding -> alias_slot.type.raw.is_late_binding)}
+ ).if {
+ alias_slot := NULL;
+ };
+ );
+
- genere_struct <-
( + slot_data:SLOT_DATA;
+ slot:SLOT;
@@ -399,6 +456,7 @@ Section Public
semantic_error (position,string_tmp);
};
detect_recursivity_generation := TRUE;
+
// Depending.
(slot_run.lower).to (slot_run.upper) do { j:INTEGER;
slot := slot_run.item j;
@@ -685,11 +743,16 @@ Section Public
} else {
output_decl.append "struct ";
output_decl.append intern_name;
- output_decl.append "_struct";
+ output_decl.append "_struct";
};
output_decl.append " __";
output_decl.append intern_name;
- output_decl.append ";\n";
+ output_decl.add_last ';';
+ ((type_c = NULL) && {alias_slot != NULL}).if {
+ output_decl.append " // ALIAS with ";
+ output_decl.append (alias_type.intern_name);
+ };
+ output_decl.add_last '\n';
};
);
diff --git a/src/type/type_generic.li b/src/type/type_generic.li
index 7e6f856..13db107 100644
--- a/src/type/type_generic.li
+++ b/src/type/type_generic.li
@@ -60,7 +60,19 @@ Section Public
};
result
);
+
+ //
+ // Detect Alias.
+ //
+
+ - detect_alias <-
+ (
+ (dicog_type.lower).to (dicog_type.upper) do { j:INTEGER;
+ dicog_type.item j.detect_alias_struct;
+ };
+ );
+
//
// Import / Export
//
--
Lisaac compiler
More information about the Lisaac-commits
mailing list