[SCM] Lisaac compiler branch, master, updated. 820dc9b73887fe4b2c65195692f137baa50acb54
Benoit Sonntag
sonntag at icps.u-strasbg.fr
Mon Aug 3 16:48:39 UTC 2009
The following commit has been merged in the master branch:
commit 820dc9b73887fe4b2c65195692f137baa50acb54
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date: Mon Aug 3 18:48:32 2009 +0200
before bootstrap
diff --git a/example/base/hello_world.li b/example/base/hello_world.li
index e1f666c..89f2958 100644
--- a/example/base/hello_world.li
+++ b/example/base/hello_world.li
@@ -33,6 +33,7 @@ Section Inherit
Section Public
- main <-
- (
+ ( + t:STRING;
"Hello world !\n".print;
+ t.print;
);
diff --git a/lib2/collection/low_level/collection2.li b/lib2/collection/low_level/collection2.li
index dcd4de4..ebef4f3 100644
--- a/lib2/collection/low_level/collection2.li
+++ b/lib2/collection/low_level/collection2.li
@@ -130,7 +130,7 @@ Section Public
(lower1 <= line) && { line <= upper1}
)
[
- +? { Result = (lower1 <= line) && { line <= upper1 } };
+ +? { Result = ((lower1 <= line) && { line <= upper1 }) };
];
- valid_index1 line:INTEGER :BOOLEAN <-
@@ -139,11 +139,11 @@ Section Public
);
- valid_column column:INTEGER :BOOLEAN <-
- (
- (lower2 <= column) && {column <= upper2}
+ (
+ (lower2 <= column) && {column <= upper2}
)
- [
- +? { Result = (lower2 <= column) && {column <= upper2} };
+ [
+ +? { Result = ((lower2 <= column) && {column <= upper2}) };
];
- valid_index2 column:INTEGER :BOOLEAN <-
@@ -157,7 +157,7 @@ Section Public
{lower2 <= column} && {column <= upper2}
)
[
- +? { Result = (valid_line line) && {valid_column column} };
+ +? { Result = ((valid_line line) && {valid_column column}) };
];
//
diff --git a/src/any.li b/src/any.li
index 4996c61..2ef47be 100644
--- a/src/any.li
+++ b/src/any.li
@@ -150,7 +150,7 @@ Section Public
- stack_local:FAST_ARRAY[LOCAL] := FAST_ARRAY[LOCAL].create_with_capacity 64;
- profil_slot:PROFIL_SLOT; // Principal slot.
- - profil_current:PROFIL; // Sub-profil or (profil = profil_slot)
+ - profil_current:PROFIL; // Sub-profil or (profil = profil_slot)
- display_stack_local <-
(
diff --git a/src/dispatcher/dta.li b/src/dispatcher/dta.li
index 207133a..d78c362 100644
--- a/src/dispatcher/dta.li
+++ b/src/dispatcher/dta.li
@@ -39,7 +39,9 @@ Section Public
+ slot:SLOT;
+ self_arg:EXPR;
-
+
+ + context:LOCAL;
+
//
// Service
//
diff --git a/src/dispatcher/dta_block.li b/src/dispatcher/dta_block.li
index f253a50..f7f29d0 100644
--- a/src/dispatcher/dta_block.li
+++ b/src/dispatcher/dta_block.li
@@ -34,8 +34,6 @@ Section Inherit
Section Public
- + context:PROFIL;
-
+ result_expr:EXPR;
// Add.
@@ -48,7 +46,6 @@ Section Public
- create mod:TYPE_BLOCK with larg:FAST_ARRAY[EXPR] :SELF <-
( + result:SELF;
- context := profil_current;
result := clone;
result.make mod with larg;
result
@@ -56,6 +53,11 @@ Section Public
- make mod:TYPE_BLOCK with larg:FAST_ARRAY[EXPR] <-
(
+ (profil_current = NULL).if {
+ context := context_main;
+ } else {
+ context := profil_current.context;
+ };
model := mod;
argument_list := larg;
result_expr := mod.get_expr_for (mod.position);
diff --git a/src/dispatcher/dta_rd.li b/src/dispatcher/dta_rd.li
index 64285a3..1673176 100644
--- a/src/dispatcher/dta_rd.li
+++ b/src/dispatcher/dta_rd.li
@@ -70,6 +70,11 @@ Section Public
self_arg := arg;
result_expr := get_expr_result;
is_intern := flag;
+ (profil_current = NULL).if {
+ context := context_main;
+ } else {
+ context := profil_current.context;
+ };
);
//
diff --git a/src/dispatcher/dta_rd_args.li b/src/dispatcher/dta_rd_args.li
index 0878652..5319a2c 100644
--- a/src/dispatcher/dta_rd_args.li
+++ b/src/dispatcher/dta_rd_args.li
@@ -76,7 +76,12 @@ Section Public
slot := sl;
argument_list := args;
result_expr := get_expr_result;
- is_intern := flag;
+ is_intern := flag;
+ (profil_current = NULL).if {
+ context := context_main;
+ } else {
+ context := profil_current.context;
+ };
);
//
diff --git a/src/dispatcher/node_style.li b/src/dispatcher/node_style.li
index 38ce374..ec47135 100644
--- a/src/dispatcher/node_style.li
+++ b/src/dispatcher/node_style.li
@@ -137,7 +137,7 @@ Section Private
+ type:TYPE_FULL;
+ my_profil:PROFIL;
+ wrt_lst:FAST_ARRAY[WRITE];
- //+ ctext:LOCAL;
+ + ctext:LOCAL;
+ new_type_self:TYPE_FULL;
+ data_rd:DTA_RD;
+ cop_arg:EXPR;
@@ -228,19 +228,16 @@ Section Private
type := new_larg.first.static_type;
? {type != NULL};
//
- (debug_level_option != 0).if {
- not_yet_implemented;
+ (debug_level_option != 0).if {
// BSBS: Poser le PUSH avant le NODE
- /*
(data.context = NULL).if {
ctext := context_main;
} else {
- ctext := data.context.context;
+ ctext := data.context;
};
result.add_last (
PUSH.create position context ctext first FALSE
- );
- */
+ );
};
//
rd ?= new_larg.first;
diff --git a/src/external/comparison/expr_binary_cmp.li b/src/external/comparison/expr_binary_cmp.li
index 44c177d..c4dd322 100644
--- a/src/external/comparison/expr_binary_cmp.li
+++ b/src/external/comparison/expr_binary_cmp.li
@@ -178,13 +178,13 @@ Section Public
- genere buffer:STRING <-
(
- (static_type.raw = type_pointer).if {
- buffer.append "(void *)";
- };
buffer.add_last '(';
- (static_type.raw = type_pointer).if {
+ (
+ (left.static_type.raw = type_pointer) &&
+ {ALIAS_STR.is_integer (right.static_type.raw.name)}
+ ).if {
buffer.append "(unsigned long)";
- }.elseif {! left.static_type.is_expanded} then {
+ }.elseif {! left.static_type.is_expanded} then {
buffer.append "(void *)"; // BSBS: A virer quand tu auras optim '=='
};
((left.static_type.raw = TYPE_NULL) && {right.static_type.raw.is_block}).if {
@@ -198,7 +198,11 @@ Section Public
buffer.add_last ' ';
buffer.append symbol;
buffer.add_last ' ';
- (static_type.raw = type_pointer).if {
+
+ (
+ (ALIAS_STR.is_integer (left.static_type.raw.name)) &&
+ {right.static_type.raw = type_pointer}
+ ).if {
buffer.append "(unsigned long)";
}.elseif {! right.static_type.is_expanded} then {
buffer.append "(void *)"; // BSBS: A virer quand tu auras optim '=='
diff --git a/src/external/comparison/expr_sup.li b/src/external/comparison/expr_sup.li
index 63f8b19..81b4c5d 100644
--- a/src/external/comparison/expr_sup.li
+++ b/src/external/comparison/expr_sup.li
@@ -55,6 +55,18 @@ Section Public
result
);
+ - exec_left left_cst :INTEGER_CST :EXPR <-
+ //-- 0 > E (unsigned) -> FALSE
+ ( + result:EXPR;
+
+ ((left_cst.value = 0) && {right.static_type.raw.name.first = 'U'}).if {
+ result := PROTOTYPE_CST.create position type (type_false.default);
+ left .remove;
+ right.remove;
+ };
+ result
+ );
+
- exec:EXPR <-
//-- E > E -> FALSE
( + result:PROTOTYPE_CST;
diff --git a/src/external/logic/expr_binary_logic.li b/src/external/logic/expr_binary_logic.li
index f321ad2..689d9bd 100644
--- a/src/external/logic/expr_binary_logic.li
+++ b/src/external/logic/expr_binary_logic.li
@@ -189,7 +189,7 @@ Section Public
- genere buffer:STRING <-
(
- buffer.add_last '(';
+ buffer.add_last '(';
left.genere buffer;
buffer.add_last ' ';
buffer.append symbol;
diff --git a/src/lisaac.li b/src/lisaac.li
index 271cfca..5eb154e 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -352,7 +352,7 @@ Section Private
\\n";
} else {
buf.append
- "int print_string(char *str) \n\
+ "void print_string(char *str) \n\
\{ \n\
\ while (*str!=0) {\n\
\ print_char(*str); \n\
diff --git a/src/tools/alias_str.li b/src/tools/alias_str.li
index c80219a..87c65f7 100644
--- a/src/tools/alias_str.li
+++ b/src/tools/alias_str.li
@@ -243,7 +243,8 @@ Section Public
{n = prototype_integer_64 } ||
{n = prototype_integer_32 } ||
{n = prototype_integer_16 } ||
- {n = prototype_integer_8 }
+ {n = prototype_integer_8 } ||
+ {n = prototype_integer }
);
- is_section n:STRING_CONSTANT :BOOLEAN <-
--
Lisaac compiler
More information about the Lisaac-commits
mailing list