[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-660-gf4b3c3c
ontologiae
ontologiae at gmail.com
Sun Nov 21 04:27:15 UTC 2010
The following commit has been merged in the master branch:
commit f4b3c3ce58f96d1b2ac5d9f8c8d77e4c0bff0c8d
Author: ontologiae <ontologiae at gmail.com>
Date: Sun Nov 21 05:25:51 2010 +0100
make.lip.sample added
diff --git a/.gitignore b/.gitignore
index a2de993..30243aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
*~
*.orig
-/make.lip
+/7636508058_le-grand-jury-du-14-nov-2010.mp3
/*.c
/*.patch
/.project
diff --git a/lib/internal/portable/number/numeric.li b/lib/internal/portable/number/numeric.li
index 98c9a7f..d02f08f 100644
--- a/lib/internal/portable/number/numeric.li
+++ b/lib/internal/portable/number/numeric.li
@@ -159,7 +159,6 @@ Section Public
//
// Looping.
//
-
- to limit_up:SELF do blc:{SELF;} <-
// Classical loop from `Self' to `limit_up'
(
diff --git a/make.lip.sample b/make.lip.sample
new file mode 100644
index 0000000..5abe603
--- /dev/null
+++ b/make.lip.sample
@@ -0,0 +1,383 @@
+///////////////////////////////////////////////////////////////////////////////
+// Lisaac Installer //
+// //
+// LSIIT - ULP - CNRS - INRIA - FRANCE //
+// //
+// This program is free software: you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation, either version 3 of the License, or //
+// (at your option) any later version. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program. If not, see <http://www.gnu.org/licenses/>. //
+// //
+// http://isaacproject.u-strasbg.fr/ //
+///////////////////////////////////////////////////////////////////////////////
+
+// file LIP : LIsaac Path directory and make LIsaac Project system.
+
+Section Private
+
+ //
+ // Compiler variables.
+ //
+
+ // File information (auto-loading variables).
+ + lisaac :STRING; // is environment variable value (auto-loading).
+ + input_file :STRING; // is input file name value without extension.
+ + output_file :STRING; // is output file name value without extension.
+ + output_extension:STRING; // is extension of `output_file'
+
+ // Debug information.
+ + debug_level:INTEGER := 15;
+ + debug_with_code:BOOLEAN := TRUE;
+ + is_all_warning:BOOLEAN;
+
+ // Optimization.
+ + is_optimization:BOOLEAN;
+ + inline_level:INTEGER := 5;
+
+ // Generate code.
+ + is_cop:BOOLEAN; // Correct value after compilation.
+ + is_library:BOOLEAN; // For build a lisaac library C
+ + is_coverage:BOOLEAN;// Generate coverage information
+ + execute_back_end:BOOLEAN := TRUE;
+ + execute_status_code:INTEGER := 0;
+
+ // Other.
+ + is_statistic:BOOLEAN;
+ + is_quiet:BOOLEAN;
+
+ //
+ // Other variables.
+ //
+
+ + option_gcc:STRING;
+ + lib_gcc:STRING;
+ + execute_file:STRING;
+
+ + target:STRING := "unix";
+
+ //
+ // Service
+ //
+
+ + exit_success_code:INTEGER := 0;
+
+ + exit_failure_code:INTEGER := 1;
+
+ + lib_os:STRING := "lib/internal/os_support/";
+
+ + lib_extra:STRING := "lib/extra/*";
+ + lib_unstable:STRING := "lib/unstable/*";
+
+ //
+ // Directory.
+ //
+
+ - standard_path <-
+ // Standard library.
+ (
+ path "lib/standard/*";
+ path "lib/internal/portable/*";
+ path lib_extra;
+ path lib_unstable;
+ );
+
+ //
+ // Target path.
+ //
+
+ - unix_target <-
+ (
+ path (lib_os + "unix/system/");
+ path (lib_os + "unix/file_system/");
+ path (lib_os + "unix/video/");
+ );
+
+ - windows_target <-
+ (
+ path (lib_os + "unix/system/");
+ path (lib_os + "windows/file_system/");
+ path (lib_os + "windows/video/");
+ );
+
+ - dos_target <-
+ (
+ path (lib_os + "unix/system/");
+ path (lib_os + "dos/file_system/");
+ path (lib_os + "dos/video/");
+ );
+
+ - get_target <-
+ (
+ (target = "dos").if {
+ dos_target;
+ };
+ (target = "windows").if {
+ windows_target;
+ };
+ (target = "unix").if {
+ unix_target;
+ };
+ (target = "").if {
+ "Target code needed.\n".print;
+ die_with_code exit_failure_code;
+ };
+ );
+
+ - add_lib lib:STRING <-
+ (
+ (target = "windows").if {
+ run "echo int main(){ return(1); } > __tmp__.c";
+ (run ("gcc __tmp__.c -o __tmp__ " + lib + " > NUL") = 0).if {
+ lib_gcc := lib_gcc + " " + lib;
+ run "del __tmp__.c __tmp__.exe";
+ } else {
+ "\nERROR: `" + lib + "' library for GCC not found.\n".print;
+ run "del __tmp__.c";
+ die_with_code exit_failure_code;
+ };
+ } else {
+ run "echo \"int main(){ return(1); }\" > __tmp__.c";
+ (run ("clang __tmp__.c -o __tmp__ " + lib + " 2> /dev/null") = 0).if {
+ lib_gcc := lib_gcc + " " + lib;
+ run "rm __tmp__.c __tmp__";
+ } else {
+ ("\nERROR: `" + lib + "' library for GCC not found.\n").print;
+ run "rm __tmp__.c";
+ die_with_code exit_failure_code;
+ };
+ };
+ );
+
+ - execute cmd:STRING <-
+ (
+ (! is_quiet).if {
+ "run `".print;
+ cmd.print;
+ "'\n".print;
+ };
+ execute_status_code := run cmd;
+ (execute_status_code != 0).if {
+ (is_quiet).if {
+ "FAILURE run `".print;
+ cmd.print;
+ "' (".print;
+ } else {
+ "FAILURE (".print;
+ };
+ execute_status_code.print;
+ ")\n".print;
+ };
+ );
+
+ - execute_fail cmd:STRING <-
+ (
+ execute cmd;
+ (execute_status_code > 255).if {
+ die_with_code exit_failure_code;
+ };
+ (execute_status_code != 0).if {
+ die_with_code execute_status_code;
+ };
+ );
+
+ //
+ // Execute function.
+ //
+
+ - general_front_end <-
+ (
+ standard_path;
+ get_target;
+ );
+
+ - general_back_end <-
+ (
+ (execute_back_end).if {
+ (is_cop).if {
+ lib_gcc := lib_gcc + " -lpthread";
+ };
+ ((target = "dos") | (target = "windows")).if {
+ execute_file := output_file + ".exe";
+ } else {
+ execute_file := output_file;
+ };
+ option_gcc := option_gcc + " -U_FORTIFY_SOURCE ";
+ (is_library).if {
+ execute_fail ("clang -Qunused-arguments " + output_file + output_extension + " -c " + option_gcc);
+ } else {
+ execute_fail ("clang -Qunused-arguments " + output_file + output_extension + " -o " + output_file + option_gcc + lib_gcc);
+ };
+ } else {
+ ("Written: " + output_file + output_extension + "\n").print;
+ };
+ );
+
+ - front_end <-
+ // Executed by compiler, before compilation step.
+ (
+ general_front_end;
+ );
+
+ - back_end <-
+ // Executed by compiler, after compilation step.
+ (
+ general_back_end;
+ );
+
+Section Public
+
+
+ //
+ // Debug information.
+ //
+
+ - no_debug <-
+ // No debug information.
+ (
+ debug_level := 0;
+ debug_with_code := FALSE;
+ );
+
+ - debug level:INTEGER <-
+ // Fix debug level (default: 15)
+ (
+ ((level < 1) | (level > 20)).if {
+ "Incorrect debug level.\n".print;
+ die_with_code exit_failure_code;
+ };
+ debug_level := level;
+ );
+
+ - without_source <-
+ // Debug mode without source code.
+ (
+ debug_with_code := FALSE;
+ );
+
+ - all_warning <-
+ // All warning (deferred detect, ...).
+ (
+ is_all_warning := TRUE;
+ );
+
+ - w_null <-
+ // Warn of every possible NULL call
+ (
+ add_flag "warn-null";
+ );
+
+ //
+ // Optimization.
+ //
+
+ - optim <-
+ // Full Lisaac optimization.
+ (
+ no_debug;
+ is_optimization := TRUE;
+ );
+
+ - boost <-
+ // Full optimization (lisaac and gcc).
+ (
+ optim;
+ option_gcc := option_gcc + " -O2 -fomit-frame-pointer";
+ );
+
+ - i level:INTEGER <-
+ // Inlining level [1..5000] (default: 15)
+ (
+ ((level < 1) | (level > 5000)).if {
+ "Incorrect inlining level.\n".print;
+ exit;
+ };
+ inline_level := level;
+ );
+
+ //
+ // Generate code.
+ //
+
+ - o outputfile:STRING <-
+ // Change output file (default: `input_file').
+ (
+ output_file := outputfile;
+ );
+
+ - target idf:STRING <-
+ // Target for backend (unix,windows,dos)
+ (
+ target := idf;
+ );
+
+ - gcc option:STRING <-
+ // Add option for GCC.
+ (
+ option_gcc := option_gcc + " " + option;
+ );
+
+ - partial <-
+ // Only generate C code and don't compile it with GCC
+ (
+ execute_back_end := FALSE;
+ );
+
+ //
+ // Other.
+ //
+
+ - add_path str:STRING <-
+ // Add the `str' path in the current list of path.
+ (
+ path str;
+ );
+
+ - q <-
+ // Quiet operation.
+ (
+ is_quiet := TRUE;
+ );
+
+ - build_library <-
+ // For to build library (`main' => `init')
+ (
+ is_library := TRUE;
+ );
+
+ - coverage <-
+ // Build coverage information
+ (
+ is_coverage := TRUE;
+ );
+
+ //
+ // Information.
+ //
+
+ - s <-
+ // Statistic information.
+ (
+ is_statistic := TRUE;
+ );
+
+ - help <-
+ // Help
+ (
+ help_command;
+ die_with_code exit_success_code;
+ );
+
+ - version <-
+ // Version
+ (
+ compiler_version;
+ die_with_code exit_success_code;
+ );
diff --git a/src/code_life/expr.li b/src/code_life/expr.li
index 6de854c..3c2ff1a 100644
--- a/src/code_life/expr.li
+++ b/src/code_life/expr.li
@@ -215,13 +215,13 @@ Section Public
// Difference between type_bloc and Profil_block is just a warning not an error
}.elseif { { (string_tmp2.has_substring "PROFIL_BLOCK") && {string_tmp3.has_substring "TYPE_BLOCK"} } ||
{ (string_tmp2.has_substring "TYPE_BLOCK") && {string_tmp3.has_substring "PROFIL_BLOCK"} } } then {
- string_tmp.copy "warning : Type `";
+ string_tmp.copy "PROFIL_BLOCK/TYPE_BLOCK error : Type `";
t.append_name_in string_tmp;
string_tmp.append "' is invalid with `";
static_type.append_name_in string_tmp;
string_tmp.append "'.";
//"You probably forgot to define a return type or you forgot a ';'.";
- POSITION.put_error warning text string_tmp;
+ POSITION.put_error semantic text string_tmp;
p.put_position;
position.put_position;
POSITION.send_error;
diff --git a/src/external/put_to.li b/src/external/put_to.li
index 9078715..ff9b75b 100644
--- a/src/external/put_to.li
+++ b/src/external/put_to.li
@@ -47,8 +47,10 @@ Section Public
- variable:VARIABLE <-
( + typ_gen:TYPE_GENERIC;
+ //"Rentré ici".println;
typ_gen ?= receiver.static_type.raw;
+ { typ_gen != NULL } -? "Type generic is NULL";
typ_gen.native_array_variable
);
@@ -65,13 +67,15 @@ Section Public
);
- make p:POSITION base rec:EXPR index idx:EXPR value v:EXPR <-
- (
+ ( + var : VARIABLE;
position := p;
receiver := rec;
index := idx;
value := v;
//
- variable.add_write Self;
+ var := variable;
+ {var != NULL} -? "variable is NULL";
+ var.add_write Self;
);
- my_copy:SELF <-
diff --git a/src/type/type_full.li b/src/type/type_full.li
index ffbf54e..514873e 100644
--- a/src/type/type_full.li
+++ b/src/type/type_full.li
@@ -85,13 +85,20 @@ Section TYPE
( + strtmp : STRING;
the_parent_type := typ;
flag := code;
- // { (is_expanded && {is_strict}).print; is_expanded -> (! is_strict)} -? "In TYPE_FULL : TYPE is expanded and strict.";
- /* (is_expanded -> (! is_strict)).if {
- //warning_error (raw.position,"Expanded AND Strict");
- (raw.prototype != NULL).if {
- "Expanded AND Strict, and raw.prototype is null".println;
- };
- };*/
+ (is_expanded && {is_strict}).if {
+ semantic_error (raw.position,"There's an object or a slot which use a Strict slot or object as Expanded. A Strict Object/slot can't be Expanded.");
+ };
+ { /*(raw.prototype != NULL).if {
+ raw.prototype.position.put_error warning text "in contract :";
+ raw.prototype.position.put_position;
+ raw.prototype.position.send_error;
+ }; */ //DEBUG
+ is_expanded -> (! is_strict)
+ }
+ -?
+ "In TYPE_FULL : TYPE is expanded and strict.";
+
+
);
Section Public
--
Lisaac compiler
More information about the Lisaac-commits
mailing list