[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-494-ge781d72
matthieu
matthieu at Litote.u-strasbg.fr
Wed Sep 16 15:10:42 UTC 2009
The following commit has been merged in the master branch:
commit e781d727f13d2c3c8303524aac4e2b4fef5e5d1e
Author: matthieu <matthieu at Litote.u-strasbg.fr>
Date: Wed Sep 16 17:10:32 2009 +0200
clean
diff --git a/src/context/context.li b/src/context/context.li
deleted file mode 100644
index 7c77b33..0000000
--- a/src/context/context.li
+++ /dev/null
@@ -1,222 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// Lisaac Compiler //
-// //
-// 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/ //
-///////////////////////////////////////////////////////////////////////////////
-Section Header
-
- + name := CONTEXT;
-
- - copyright := "2003-2007 Benoit Sonntag";
-
-
- - author := "Sonntag Benoit (bsonntag at loria.fr)";
- - comment := "Create a new context for analyser";
-
- // BSBS: A revoir, car globalement, maintenant on compile
- // que un slot à la fois, donc, tu n'as plus besoin de ca...
-
-Section Inherit
-
- - parent_any:ANY := ANY;
-
-Section Private
-
- - stack:FAST_ARRAY(CONTEXT) := FAST_ARRAY(CONTEXT).create_with_capacity 16;
-
- - top:INTEGER := -1;
-
-Section Public
-
- //
- // Extern
- //
-
- - push_extern pos:POSITION profil prof:PROFIL_SLOT :LOCAL <-
- (
- top := top + 1;
- (top > stack.upper).if {
- stack.add_last clone;
- };
- stack.item top.elt_push_extern pos profil prof
- );
-
- - pop_extern <-
- (
- stack.item top.elt_pop_extern;
- top := top - 1;
- );
-
- //
- // Block.
- //
-
- - push_block p:POSITION profil prof:PROFIL_BLOCK :LOCAL <-
- (
- top := top + 1;
- (top > stack.upper).if {
- stack.add_last clone;
- };
- stack.item top.elt_push_block p profil prof
- );
-
- - pop_block <-
- (
- stack.item top.elt_pop_block;
- top := top - 1;
- );
-
- //
- // Intern
- //
-
- - push_intern p:POSITION <-
- (
- top := top + 1;
- (top > stack.upper).if {
- stack.add_last clone;
- };
- stack.item top.elt_push_intern p;
- );
-
- - limit_context:INTEGER <- stack.item top.local;
-
- - pop_intern <-
- (
- stack.item top.elt_pop_intern;
- top := top - 1;
- );
-
-Section Private
-
- + local:INTEGER;
-
- + result:INTEGER;
-
- + list:LIST;
-
- + profil:PROFIL;
-
- + old_profil_first:PROFIL_SLOT; // BSBS: NE DOIT PAS ETRE UTILE !
-
- + context_extern:LOCAL;
-
- //
- // Extern
- //
-
- - elt_push_extern pos:POSITION profil prof:PROFIL_SLOT :LOCAL <-
- ( + res:LOCAL;
-
- local := stack_local_lower;
- result := stack_result_lower;
- list := list_current;
- old_profil_first := profil_first;
- profil := profil_second;
- //
- stack_local_lower := stack_local.upper + 1;
- stack_result_lower := stack_result.upper + 1;
- list_current := LIST.create pos;
- profil_second := profil_first := prof;
- //
- (debug_level_option != 0).if {
- // Debug mode : Add context local.
- res := TYPE_CONTEXT.default.new_local pos name (ALIAS_STR.variable_context) style '+';
- res.set_ensure_count 1;
- list_current.add_last (PUSH.create pos context res first TRUE);
- };
- res
- );
-
- - elt_pop_extern <-
- (
- ITM_OBJECT.pop_stack_until stack_local_lower;
- stack_local_lower := local;
- stack_result.remove_since stack_result_lower;
- stack_result_lower := result;
- list_current := list;
- profil_second := profil;
- profil_first := old_profil_first;
- );
-
- //
- // Block
- //
-
- - elt_push_block p:POSITION profil prof:PROFIL_BLOCK :LOCAL <-
- ( + res:LOCAL;
- local := stack_local.upper + 1;
- result := stack_result_lower;
- list := list_current;
- profil := profil_second;
- profil_second := prof;
- //
- stack_result_lower := stack_result.upper + 1;
- list_current := LIST.create p;
- context_extern := ITM_OBJECT.context_extern;
- ITM_OBJECT.set_context_extern NULL;
- //
- (debug_level_option != 0).if {
- // Debug mode : Add context local.
- res := TYPE_CONTEXT.default.new_local p name (ALIAS_STR.variable_context) style '+';
- res.set_ensure_count 1;
- list_current.add_last (PUSH.create p context res first TRUE);
- };
- res
- );
-
- - elt_pop_block <-
- (
- list_current := list;
- ITM_OBJECT.pop_stack_until local;
- stack_result.remove_since stack_result_lower;
- stack_result_lower := result;
- (ITM_OBJECT.context_extern = NULL).if {
- ITM_OBJECT.set_context_extern context_extern;
- };
- profil_second := profil;
- );
-
- //
- // Intern
- //
-
- - elt_push_intern p:POSITION <-
- (
- local := stack_local.upper + 1;
- result := stack_result_lower;
- list := list_current;
- //profil := NULL;
- //
- stack_result_lower := stack_result.upper + 1;
- list_current := LIST.create p;
- context_extern := ITM_OBJECT.context_extern;
- ITM_OBJECT.set_context_extern NULL;
- );
-
- - elt_pop_intern <-
- (
- list_current := list;
- ITM_OBJECT.pop_stack_until local;
- stack_result.remove_since stack_result_lower;
- stack_result_lower := result;
- (ITM_OBJECT.context_extern = NULL).if {
- ITM_OBJECT.set_context_extern context_extern;
- };
- );
-
diff --git a/src/external/arithmetic/avoir.txt b/src/external/arithmetic/avoir.txt
deleted file mode 100644
index 723b123..0000000
--- a/src/external/arithmetic/avoir.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-expr_add.li: //-- 0 + E -> E
-expr_add.li: //-- E + 0 -> E
-expr_add.li: //-- C1 + C2 -> C3
-expr_and.li: //-- -1 & E -> E
-expr_and.li: //-- E & -1 -> E
-expr_and.li: //-- C1 & C2 -> C3
-expr_and.li: //-- E & E -> E
-expr_and.li: //-- 0 & E -> 0
-expr_and.li: //-- E & 0 -> 0
-expr_div.li: //-- E / 0 -> Error.
-expr_div.li: //-- E / 1 -> E
-expr_div.li: //-- E / -1 -> - E
-expr_div.li: //-- E / 2^n -> E >> n
-expr_div.li: //-- C1 / C2 -> C3
-expr_div.li: //-- E / E -> 1
-expr_div.li: //-- -E / E -> -1
-expr_div.li: //-- E / -E -> -1
-expr_div.li: //-- 0 / E -> 0
-expr_mod.li: //-- E % 0 -> Error
-expr_mod.li: //-- E % 2^n -> E & (2^n -1)
-expr_mod.li: //-- C1 % C2 -> C3
-expr_mod.li: //-- E % E -> 0
-expr_mod.li: //-- 0 % E -> 0
-expr_mod.li: //-- E % 1 -> 0
-expr_mod.li: //-- E % -1 -> 0
-expr_mul.li: //-- 1 * E -> E
-expr_mul.li: //-- -1 * E -> - E
-expr_mul.li: //-- 2^n * E -> E << n
-expr_mul.li: //-- E * 1 -> E
-expr_mul.li: //-- E * -1 -> - E
-expr_mul.li: //-- E * 2^n -> E << n
-expr_mul.li: //-- C1 * C2 -> C3
-expr_mul.li: //-- 0 * E -> 0
-expr_mul.li: //-- E * 0 -> 0
-expr_neg.li: //-- - - E -> E
-expr_neg.li: //-- - C1 -> C2
-expr_not.li: //-- ~ (~ E1 & ~ E2) -> E1 | E2
-expr_not.li: //-- ~ (~ E1 | ~ E2) -> E1 & E2
-expr_not.li: //-- ~ ~ E -> E
-expr_not.li: //-- ~ C1 -> C2
-expr_or.li: //-- 0 | E -> E
-expr_or.li: //-- E | 0 -> E
-expr_or.li: //-- C1 | C2 -> C3
-expr_or.li: //-- (! E1 & E2) | (E1 & ! E2) -> E1 ^ E2 (A lot of possibilities, but see '^' in NUMERIC)
-expr_or.li: //-- E | E -> E
-expr_or.li: //-- -1 | E -> -1
-expr_or.li: //-- E | -1 -> -1
-expr_shift_l.li: //-- E << 0 -> E
-expr_shift_l.li: //-- C1 << C2 -> C3
-expr_shift_l.li: //-- C1 << -C2 -> Error.
-expr_shift_l.li: //-- 0 << E -> 0
-expr_shift_l.li: //-- E << -C2 -> Error.
-expr_shift_r.li: //-- E >> 0 -> E
-expr_shift_r.li: //-- C1 >> C2 -> C3
-expr_shift_r.li: //-- C1 >> -C2 -> Error.
-expr_shift_r.li: //-- E(unsigned) >> E(unsigned) -> 0
-expr_shift_r.li: //-- 0 >> E -> 0
-expr_shift_r.li: //-- -1(signed) >> E -> -1(signed)
-expr_shift_r.li: //-- E >> -C2 -> Error.
-expr_sub.li: //-- E1 - - E2 -> E1 + E2
-expr_sub.li: //-- 0 - E -> - E
-expr_sub.li: //-- -1 - E -> ~ E
-expr_sub.li: //-- E - 0 -> E
-expr_sub.li: //-- -E - 1 -> ~ E
-expr_sub.li: //-- E - -C -> E + C
-expr_sub.li: //-- C1 - C2 -> C3
-expr_sub.li: //-- E - E -> 0
-expr_sub.li: //-- E1 - ((E1 / E2) * E2) -> E1 % E2
-expr_xor.li: //-- 0 ^ E -> E
-expr_xor.li: //-- -1 ^ E -> ~ E
-expr_xor.li: //-- E ^ 0 -> E
-expr_xor.li: //-- E ^ -1 -> ~ E
-expr_xor.li: //-- C1 ^ C2 -> C3
-expr_xor.li: //-- E ^ E -> 0
--
Lisaac compiler
More information about the Lisaac-commits
mailing list