[SCM] Lisaac compiler branch, mildred-backend, updated. lisaac-0.12-516-gd4d602b

Mildred Ki'Lya silkensedai at online.fr
Tue Aug 25 17:27:43 UTC 2009


The following commit has been merged in the mildred-backend branch:
commit 0ede7de8b6c75401e4ba03d8a4293186f651cbc3
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Tue Aug 25 17:34:16 2009 +0200

    fix merge errors

diff --git a/src/code_life/switch.li b/src/code_life/switch.li
index 408ea29..87e6b02 100644
--- a/src/code_life/switch.li
+++ b/src/code_life/switch.li
@@ -261,7 +261,7 @@ Section Public
   ( + first_case:INTEGER;
     + c1,c2:CASE;
     + cases:FAST_ARRAY(FAST_ARRAY(CASE));
-    + gen_switch:{};
+    + gen_switch:{BOOLEAN; };
 
     gen_switch := { is_genered:BOOLEAN;
       (first_case <= list.upper).if {
@@ -279,7 +279,7 @@ Section Public
 	  };
 	};
 	(c1 != NULL).if {
-	  generate_if c1 else c2 in buffer;
+	  backend.generate_simple_if c1 else c2 expr expr in buffer;
 	} else {
 	  polymorphic_counter := polymorphic_counter + 1;
 	  backend.generate_switch cases for Self first_case first_case in buffer;
diff --git a/src/tools/backend.li b/src/tools/backend.li
index 26ab106..a27faba 100644
--- a/src/tools/backend.li
+++ b/src/tools/backend.li
@@ -326,10 +326,10 @@ Section Public
     buffer.add_last '}';
   );
 
-  - generate_if c1:CASE else c2:CASE in buffer:STRING <-
+  - generate_simple_if c1:CASE else c2:CASE expr expr:EXPR in buffer:STRING <-
   (
     buffer.append "if (";
-    c1.id.put_access_id (sw.expr) in buffer;
+    c1.id.put_access_id expr in buffer;
     buffer.append "==";
     c1.id.put_id buffer;
     buffer.append ") ";
@@ -340,13 +340,12 @@ Section Public
 
   - generate_switch cases:FAST_ARRAY(FAST_ARRAY(CASE)) for sw:SWITCH first_case first_case:INTEGER in buffer:STRING <-
   [
-    -? { switch_can_fusion };
-    -? { case != NULL };
+    -? { cases != NULL };
   ]
   ( + lst_case:FAST_ARRAY(CASE);
 
     buffer.append "switch (";
-    sw.list.item first_case.id.put_access_id expr in buffer;
+    sw.list.item first_case.id.put_access_id (sw.expr) in buffer;
     buffer.append ") {\n";
 
     (cases.lower).to (cases.upper) do { j:INTEGER;
@@ -601,7 +600,7 @@ Section Public
   - generate_push p:PUSH id id:UINTEGER_32 in buffer:STRING <-
   ( + idf:STRING_CONSTANT;
 
-    idf := ALIASER_LOCAL.push Self;
+    idf := ALIASER_LOCAL.push p;
     p.is_first.if {
       buffer.append "push_first(&";
     } else {
diff --git a/src/tools/backend_c.li b/src/tools/backend_c.li
index 0f67964..671450b 100644
--- a/src/tools/backend_c.li
+++ b/src/tools/backend_c.li
@@ -53,7 +53,7 @@ Section Public
     buf.add_last ';';
     ((t.type_c = NULL) && {t.alias_slot != NULL}).if {
       output_decl.append " // ALIAS with ";
-      output_decl.append (alias_type.intern_name);
+      output_decl.append (t.alias_type.intern_name);
     };
     buf.add_last '\n';
   );
@@ -279,15 +279,15 @@ Section Public
 
       t  := read.slot.receiver_type;
       (t.alias_slot != NULL).if {
-	tf2 := slot.type;
+	tf2 := read.slot.type;
 	ptr  := (! tf .is_expanded) || {tf .is_expanded_ref} || {tf .is_strict};
 	ptr2 := (! tf2.is_expanded) || {tf2.is_expanded_ref} || {tf2.is_strict};
 	(ptr != ptr2).if {
 	  add_end := TRUE;
 	  (ptr).if {
-	    buffer.append "(*(";
+	    buf.append "(*(";
 	  } else {
-	    buffer.append "(&(";
+	    buf.append "(&(";
 	  };
 	};
       };
@@ -304,13 +304,13 @@ Section Public
       };
       (t.alias_slot = NULL).if {
         ((tf.is_expanded) && {! tf.is_expanded_ref} && {! tf.is_strict}).if {
-	  buffer.add_last '.';
+	  buf.add_last '.';
 	} else {
-	  buffer.append "->";
+	  buf.append "->";
 	};
-	buffer.append (read.variable.intern_name);
+	buf.append (read.variable.intern_name);
       }.elseif {add_end} then {
-	buffer.append "))";
+	buf.append "))";
       };
     };
   );
@@ -320,10 +320,10 @@ Section Public
     + t:TYPE;
 
     // Receiver.
-    (quiet_generation).if {
-      buffer.append "/* WRTOK */";
+    (write.quiet_generation).if {
+      buf.append "/* WRTOK */";
     } else {
-      buffer.append "/* WRTNO */";
+      buf.append "/* WRTNO */";
     };
     tf := write.receiver.static_type;
     ((tf.is_strict) || {tf.is_expanded_ref}).if {
diff --git a/src/tools/backend_java.li b/src/tools/backend_java.li
index 8465ced..b249ed1 100644
--- a/src/tools/backend_java.li
+++ b/src/tools/backend_java.li
@@ -61,7 +61,7 @@ Section Public
 
   - generate_type_struct_for t:TYPE in buf:STRING <-
   ( + slot_data:SLOT_DATA;
-    + tab:FAST_ARRAY[SLOT_DATA];
+    + tab:FAST_ARRAY(SLOT_DATA);
     + count_slot:SLOT_DATA;
     + storage_slot:SLOT_DATA;
     + num_slots :INTEGER;
@@ -291,10 +291,10 @@ Section Public
   - generate_write_slot_for write:WRITE_SLOT in buf:STRING <-
   (
     // Receiver.
-    (quiet_generation).if {
-      buffer.append "/* WRTOK */";
+    (write.quiet_generation).if {
+      buf.append "/* WRTOK */";
     } else {
-      buffer.append "/* WRTNO */";
+      buf.append "/* WRTNO */";
     };
     write.receiver.genere buf;
     buf.add_last '.';
diff --git a/src/type/type.li b/src/type/type.li
index 0d28185..9edad71 100644
--- a/src/type/type.li
+++ b/src/type/type.li
@@ -532,41 +532,6 @@ Section Public
             action := { s:SLOT_DATA;
               (s.ensure_count > 0).if {
               };
-|||||||
-            output_decl.append ")\n  {\n    ";
-            (is_late_binding).if {
-              output_decl.append "__id = pid;\n";
-            } else {
-              output_decl.append "super();\n";
-            };
-            output_decl.append "  };\n};\n";  
-          } else {            
-            output_decl.append "struct ";
-            output_decl.append intern_name;
-            output_decl.append "_struct {\n";
-            output_decl.append string_tmp;
-            (prototype.is_mapping).if {
-              output_decl.append "} __attribute__ ((packed));\n";
-            } else {
-              output_decl.append "};\n";
-=======
-            output_decl.append ")\n  {\n    ";
-            (is_late_binding).if {
-              output_decl.append "__id = pid;\n";
-            } else {
-              output_decl.append "super();\n";
-            };
-            output_decl.append "  };\n};\n";  
-          }.elseif {alias_slot = NULL} then {                        
-            output_decl.append "struct ";
-            output_decl.append intern_name;
-            output_decl.append "_struct {\n";
-            output_decl.append string_tmp;
-            (prototype.is_mapping).if {
-              output_decl.append "} __attribute__ ((packed));\n";
-            } else {
-              output_decl.append "};\n";
->>>>>>> mildred-projects:src/type/type.li
             };
             (slot.slot_data_list != NULL).if {
               (slot.slot_data_list.lower).to (slot.slot_data_list.upper) do { k:INTEGER;

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list