[SCM] Lisaac compiler branch, stable, updated. lisaac-0.12-482-gbec6f21

Mildred Ki'Lya silkensedai at online.fr
Sun Sep 6 12:07:11 UTC 2009


The following commit has been merged in the stable branch:
commit f7691125365d272d03f0d09bea8a0250071391bc
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Sun Sep 6 12:50:30 2009 +0200

    Added -o option to lisaac

diff --git a/make.lip b/make.lip
index 5d9301d..b35976a 100644
--- a/make.lip
+++ b/make.lip
@@ -30,6 +30,7 @@ Section Private
   // File information.
   + lisaac:STRING;      // is environment variable value (auto-loading).
   + input_file:STRING;  // is input file name value without extension (auto-loading, if possible).
+  + output_file:STRING;
     
   // Debug information.
   + debug_level:INTEGER := 15;
@@ -173,25 +174,25 @@ Section Private
       (is_cop).if {
         "Warning: COP not yet implemented\n".print;
       };
-      execute ("javac " + input_file + ".java");
+      execute ("javac " + output_file + ".java");
     };
     (target = "dos").if {
       (is_cop).if {
         "Warning: COP not yet implemented\n".print;
       };
-      execute ("gcc " + input_file + ".c -o " + input_file + ".exe " + option_gcc + lib_gcc); 
+      execute ("gcc " + output_file + ".c -o " + output_file + ".exe " + option_gcc + lib_gcc);
     };
     (target = "windows").if {
       (is_cop).if {
         "Warning: COP not yet implemented\n".print;
       };
-      execute ("gcc " + input_file + ".c -o " + input_file + ".exe -lgdi32 " + option_gcc + lib_gcc);
+      execute ("gcc " + output_file + ".c -o " + output_file + ".exe -lgdi32 " + option_gcc + lib_gcc);
     };
     (target = "unix").if {      
       (is_cop).if {
         lib_gcc := lib_gcc + " -lpthread";
       };
-      execute ("gcc " + input_file + ".c -o " + input_file + " -lm " + option_gcc + lib_gcc);
+      execute ("gcc " + output_file + ".c -o " + output_file + " -lm " + option_gcc + lib_gcc);
     };
   );
   
@@ -293,6 +294,12 @@ Section Public
   (
     option_gcc := option_gcc + " " + option;
   );
+
+  - o output:STRING <-
+  // Change output file
+  (
+    output_file := output;
+  );
   
   //
   // Other.
diff --git a/src/lisaac.li b/src/lisaac.li
index 0399b31..922dfdc 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -95,6 +95,8 @@ Section Public
 Section Private
 
   - output_name:STRING_CONSTANT;
+
+  - output_basename:STRING_CONSTANT;
   
   - input_name:STRING_CONSTANT;
 
@@ -300,6 +302,7 @@ Section Private
           LIP_CALL.load_directory (ALIAS_STR.get string_tmp) base_path NULL is_recursive FALSE;
           input_name := ALIAS_STR.get string_tmp2;
           LIP_CODE.put_string input_name to (ALIAS_STR.slot_input_file);
+          LIP_CODE.put_string input_name to (ALIAS_STR.slot_output_file);
         };
       };
       j := j+1;
@@ -334,6 +337,7 @@ Section Private
     
     // Loading variable.
     input_name         := LIP_CODE.get_string  (ALIAS_STR.slot_input_file);
+    output_basename    := LIP_CODE.get_string  (ALIAS_STR.slot_output_file);
     debug_level_option := LIP_CODE.get_integer (ALIAS_STR.slot_debug_level);
     debug_with_code    := LIP_CODE.get_boolean (ALIAS_STR.slot_debug_with_code);
     is_all_warning     := LIP_CODE.get_boolean (ALIAS_STR.slot_is_all_warning);
@@ -346,8 +350,12 @@ Section Private
     ((input_name = NULL) || {input_name.is_empty}).if {      
       "ERROR : `input_file' is empty.\n".print;
       display_usage;
-    };        
-    string_tmp.copy input_name;
+    };
+    ((output_basename = NULL) || {output_basename.is_empty}).if {
+      output_basename := input_name;
+      LIP_CODE.put_string output_basename to (ALIAS_STR.slot_output_file);
+    };
+    string_tmp.copy output_basename;
     (is_java).if {
       string_tmp.append ".java";
     } else {
diff --git a/src/tools/alias_str.li b/src/tools/alias_str.li
index 1f00475..7fada55 100644
--- a/src/tools/alias_str.li
+++ b/src/tools/alias_str.li
@@ -159,6 +159,7 @@ Section Public
   - slot_front_end    :STRING_CONSTANT := "front_end";
   - slot_back_end     :STRING_CONSTANT := "back_end";
   - slot_input_file   :STRING_CONSTANT := "input_file";
+  - slot_output_file  :STRING_CONSTANT := "output_file";
   - slot_debug_level  :STRING_CONSTANT := "debug_level";
   - slot_debug_with_code:STRING_CONSTANT := "debug_with_code";
   - slot_is_all_warning:STRING_CONSTANT := "is_all_warning";
@@ -451,6 +452,7 @@ Section Public
     list.add slot_path;
     list.add slot_front_end;
     list.add slot_back_end;
+    list.add slot_output_file;
     list.add slot_input_file;
     list.add slot_debug_level;
     list.add slot_debug_with_code;

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list