lisaac_0.39_rc1/ 0000755 0001750 0001750 00000000000 11314031324 013424 5 ustar sonntag sonntag lisaac_0.39_rc1/Makefile 0000644 0001750 0001750 00000002513 11314031246 015070 0 ustar sonntag sonntag # This file is part of Lisaac compiler.
# http://isaacproject.u-strasbg.fr/
# 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 .
CC=gcc
CFLAGS=-O2
all: install_lisaac
./install_lisaac
install_lisaac:
$(CC) $(CFLAGS) install_lisaac.c -o install_lisaac
clean:
rm -f install_lisaac
rm -f bin/shorter.c bin/path.h bin/lisaac bin/shorter
rm -f src/shorter src/path.h
rm -rf doc/html
lisaac_0.39_rc1/install_lisaac.li 0000644 0001750 0001750 00000064577 11314031245 016761 0 ustar sonntag sonntag ///////////////////////////////////////////////////////////////////////////////
// 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://isaacproject.u-strasbg.fr/ //
///////////////////////////////////////////////////////////////////////////////
Section Header
+ name := INSTALL_LISAAC;
- comment := "Configure the system file and the PATH";
- external := `#include `;
Section Inherit
- parent_object:OBJECT <- OBJECT;
Section Private
- is_release:BOOLEAN := TRUE;
//
// Independance File System
//
- open_read n:ABSTRACT_STRING :POINTER <-
( + buf:NATIVE_ARRAY(CHARACTER);
string_tmp.copy n;
buf := string_tmp.to_external;
`fopen((char*)@buf,"rb")`:(POINTER)
);
- open_write n:ABSTRACT_STRING :POINTER <-
( + buf:NATIVE_ARRAY(CHARACTER);
string_tmp.copy n;
buf := string_tmp.to_external;
`fopen((char*)@buf,"wb")`:(POINTER)
);
- read f:POINTER in buf:STRING size sz:INTEGER :INTEGER <-
( + ptr:NATIVE_ARRAY(CHARACTER);
+ result:INTEGER;
ptr := buf.to_external;
result := `fread((void *)(@ptr),(size_t)(1), (size_t)(@sz),(FILE*)(@f))`:(INTEGER);
buf.from_external ptr;
result
);
- write f:POINTER with buf:STRING size sz:INTEGER :INTEGER <-
( + ptr:NATIVE_ARRAY(CHARACTER);
+ result:INTEGER;
ptr := buf.to_external;
result := `fwrite((void *)(@ptr),(size_t)(1), (size_t)(@sz),(FILE*)(@f))`:(INTEGER);
result
);
- close p:POINTER <- `fclose((FILE*)(@p))`;
- file_size p:POINTER :INTEGER <-
( + result:INTEGER;
`fseek((FILE*)(@p),0,SEEK_END)`;
result := `ftell((FILE *)@p)`:INTEGER;
`fseek((FILE*)(@p),0,SEEK_SET)`;
result
);
- make_file new_path:STRING :BOOLEAN <-
( + p:NATIVE_ARRAY(CHARACTER);
+ stream:POINTER;
+ result:BOOLEAN;
p := new_path.to_external;
stream := `fopen((char*)@p,"w+b")`:POINTER;
(result := (stream != NULL)).if {
close stream;
};
result
);
//
// Tools management.
//
- string_tmp:STRING := STRING.create 256;
- string_tmp2:STRING := STRING.create 256;
- error st:ABSTRACT_STRING <-
(
"Error: ".print;
st.print;
die_with_code exit_failure_code;
);
- step_count:INTEGER;
- title str:ABSTRACT_STRING count mx:INTEGER <-
(
step_count := step_count + 1;
'\n'.print;
(mx = 0).if {
string_tmp2.copy str;
} else {
string_tmp2.copy "Step ";
step_count.append_in string_tmp2;
string_tmp2.add_last '/';
mx.append_in string_tmp2;
string_tmp2.append " : ";
string_tmp2.append str;
};
string_tmp2.add_last '\n';
string_tmp2.print;
1.to (string_tmp2.count-1) do { j:INTEGER;
'='.print;
};
'\n'.print;
);
- question str:ABSTRACT_STRING :CHARACTER <-
( + result:CHARACTER;
str.print;
" (y/n) ".print;
{(result != 'y') && {result != 'n'}}.while_do {
result := IO.read_character;
};
IO.read_character;
result
);
- menu t:ABSTRACT_STRING text txt:ABSTRACT_STRING count n:INTEGER :INTEGER <-
( + result,tmp:INTEGER;
'\n'.print;
title t count 0;
txt.print;
"\n\nChoice:\n".print;
result := -1;
{
IO.read_line;
(IO.last_string.is_integer).if {
tmp := IO.last_string.to_integer;
(tmp.in_range 0 to n).if {
result := tmp;
} else {
"Incorrect range [0-".print;
n.print;
"]\n".print;
};
} else {
"Incorrect number.\n".print;
};
}.do_while {result = -1};
result
);
- update file:ABSTRACT_STRING idf id:STRING_CONSTANT
with new_text:ABSTRACT_STRING confirmation conf:BOOLEAN <-
( + index:INTEGER;
+ old_buffer,input:STRING;
+ std_file:POINTER;
+ size_file:INTEGER;
" A `".print;
file.print;
std_file := open_read file;
(std_file != NULL).if {
// Update file.
size_file := file_size std_file;
input := STRING.create (size_file + new_text.count);
read std_file in input size size_file;
close std_file;
//
index := input.first_substring_index id;
(index != 0).if {
// Update configuration.
old_buffer := STRING.create 200;
1.to (new_text.occurrences '\n') do { j:INTEGER;
{(index < input.upper) && {input.item index != '\n'}}.while_do {
old_buffer.add_last (input.item index);
input.remove index;
};
(index <= input.upper).if {
old_buffer.add_last (input.item index);
input.remove index;
};
};
(old_buffer == new_text).if {
"' file has no need to change. Current version is:\n".print;
} else {
"' file has been updated. Old value is:\n".print;
old_buffer.print;
" New value is:\n".print;
};
} else {
"' file has been updated with:\n".print;
index := input.upper + 1;
};
new_text.print;
// Append configuration.
input.insert_string new_text to index;
} else {
// Creation file.
"' file has been created with:\n".print;
new_text.print;
input := new_text;
(! make_file file).if {
error "Not create file!";
};
};
((! conf) || {question " Confirmation ?" = 'y'}).if {
(conf).if {
'\n'.print;
};
std_file := open_write file;
(std_file = NULL).if {
error "Not open file (Write protection) !";
};
write std_file with input size (input.count);
close std_file;
};
);
- execute str:ABSTRACT_STRING :BOOLEAN <-
( + result:BOOLEAN;
(ENVIRONMENT.execute_command str != 0).if {
"Error: execute `".print;
str.print;
"'\n".print;
} else {
result := TRUE;
};
result
);
//
// Global variable.
//
- path_current:STRING;
- path_home :STRING;
- shell :STRING;
- system :STRING_CONSTANT;
- file :STRING;
- comment :STRING_CONSTANT;
- path :STRING_CONSTANT;
- path_next :STRING_CONSTANT;
//
// Constant for environment variable & path.
//
- system_unix_bash:STRING_CONSTANT := "Unix - bash";
- system_unix_tcsh:STRING_CONSTANT := "Unix - tcsh";
- system_unix_zsh :STRING_CONSTANT := "Unix - zsh";
- system_unix_bsd :STRING_CONSTANT := "Unix - BSD or Mac";
- system_windows :STRING_CONSTANT := "Windows - DOS";
- system_unknown :STRING_CONSTANT := "Unknown";
- file_bashrc :STRING_CONSTANT := "/.bashrc";
- file_cshrc :STRING_CONSTANT := "/.cshrc";
- file_zshenv :STRING_CONSTANT := "/.zshenv";
- file_profile :STRING_CONSTANT := "/.profile";
- file_autoexec :STRING_CONSTANT := "C:\\autoexec.bat";
- file_msdos_sys:STRING_CONSTANT := "C:\\msdos.sys";
- comment_windows :STRING_CONSTANT := "\r\nREM **** LISAAC COMPILER ****\r\n";
- comment_unix :STRING_CONSTANT := "\n# **** LISAAC COMPILER ****\n";
- path_bash :STRING_CONSTANT := "export PATH=";
- path_tcsh :STRING_CONSTANT := "set path=(";
- path_windows:STRING_CONSTANT := "set path=";
- path_bash_next :STRING_CONSTANT := "/bin:$PATH\n\n";
- path_tcsh_next :STRING_CONSTANT := "/bin $path)\n\n";
- path_windows_next:STRING_CONSTANT := "\\bin;%path%\r\n\r\n";
//
// Detect system and install environment variables.
//
- detect_system <-
( + std_file :POINTER;
//
// Detect system
//
(shell != NULL).if {
file := STRING.create_from_string path_home;
(shell.is_empty).if {
" Error : SHELL environment variable is empty !\n".print;
system := system_unknown;
}.elseif {(shell.has_substring "bash") || {shell.has_suffix "/sh"}} then {
// Unix - bash
file.append file_bashrc;
system := system_unix_bash;
comment := comment_unix;
path := path_bash;
path_next := path_bash_next;
}.elseif {shell.has_substring "tcsh"} then {
// Unix - tcsh
file.append file_cshrc;
system := system_unix_tcsh;
comment := comment_unix;
path := path_tcsh;
path_next := path_tcsh_next;
}.elseif {shell.has_substring "zsh"} then {
// Unix - zsh
file.append file_zshenv;
system := system_unix_zsh;
comment := comment_unix;
path := path_bash;
path_next := path_bash_next;
} else {
// Unknown
" Shell not recognized: ".print;
shell.print;
'\n'.print;
system := system_unknown;
};
} else {
// On other shell
std_file := open_read file_msdos_sys;
(std_file != NULL).if {
// Windows
close std_file;
file := STRING.create_from_string file_autoexec;
system := system_windows;
comment := comment_windows;
path := path_windows;
path_next := path_windows_next;
} else {
// Unknown
system := system_unknown;
};
};
" System detect: ".print;
system.print;
);
- install_make_lip <-
(
(system != system_unknown).if {
(system = system_windows).if {
ENVIRONMENT.execute_command "copy make.lip.sample make.lip";
update "make.lip" idf " + target" with
" + target:STRING := \"windows\";\n" confirmation FALSE;
//
"\n Note: Use `mingw' for Windows.\n".print;
} else {
ENVIRONMENT.execute_command "cp make.lip.sample make.lip";
update "make.lip" idf " + target" with
" + target:STRING := \"unix\";\n" confirmation FALSE;
};
(is_release).if_false {
"\n Directory for library repository: ".print;
IO.read_line;
'\n'.print;
string_tmp2.copy " + lib_extra:STRING := \"";
string_tmp2.append (IO.last_string);
(string_tmp2.last = '/').if {
string_tmp2.add_last '*';
} else {
string_tmp2.append "/*";
};
string_tmp2.append "\";\n";
update "make.lip" idf " + lib_extra" with
string_tmp2 confirmation TRUE;
update "make.lip" idf " + lib_unstable" with
" + lib_unstable:STRING := \"\";\n" confirmation FALSE;
};
};
'\n'.print;
);
- install_variable <-
( + new_text :STRING;
title "Fix target variable in `make.lip'." count 5;
install_make_lip;
//
// Installation environment variable
//
title "Installation of environment variables." count 5;
(system = system_unknown).if {
// Fail.
" Auto-install fail !\n\
\ You have to change your environment variables as following: \n\
\ set path=".print;
path_current.print;
"\\bin;%path%\n\n".print;
} else {
// Creation environment variables.
new_text := STRING.create_from_string comment;
new_text.append path;
new_text.append path_current;
new_text.append path_next;
update file idf comment with new_text confirmation TRUE;
};
//
// Installation Library path
//
title "Installation of Lisaac library path." count 5;
new_text := STRING.create_from_string path_current;
(system = system_windows).if {
new_text.replace_all '\\' with '/';
};
new_text.prepend "#define LISAAC_DIRECTORY \"";
new_text.append "\"\n";
update "bin/path.h" idf "#define LISAAC_DIRECTORY" with new_text confirmation FALSE;
'\n'.print;
update "src/path.h" idf "#define LISAAC_DIRECTORY" with new_text confirmation FALSE;
'\n'.print;
);
//
// Install Editor.
//
- lisaac_mode_comment :STRING_CONSTANT := ";; **** LISAAC MODE ****";
- lisaac_mode_path :STRING_CONSTANT := "\n(setq load-path (cons \"";
- lisaac_mode_path_end:STRING_CONSTANT := "/editor/emacs/\" load-path))\n";
- lisaac_mode :STRING_CONSTANT :=
"(add-to-list 'auto-mode-alist '(\"\\\\.li\\\\'\" . lisaac-mode))\n\
\(add-to-list 'auto-mode-alist '(\"\\\\.lip\\\\'\" . lisaac-mode))\n\
\(autoload 'lisaac-mode \"lisaac-mode\" \"Major mode for Lisaac Programs\" t)\n\n";
- lisaac_vim:STRING_CONSTANT :=
"\nsyntax on \n\
\filetype plugin on \n\
\filetype indent on \n\
\au BufNewFile,BufRead *.li setf lisaac\n";
- install_emacs <-
( + file_name, new_text:STRING;
file_name := STRING.create 100;
(path_home = NULL).if {
file_name.copy "C:";
} else {
file_name.copy path_home;
};
file_name.append "/.emacs";
new_text := STRING.create_from_string lisaac_mode_comment;
new_text.append lisaac_mode_path;
new_text.append path_current;
(system = system_windows).if {
new_text.replace_all '\\' with '/';
};
new_text.append lisaac_mode_path_end;
new_text.append lisaac_mode;
update file_name idf lisaac_mode_comment with new_text confirmation TRUE;
);
- install_kate <-
(
(system = system_windows).if {
" Sorry, not Kate editor for windows.".print;
} else {
ENVIRONMENT.execute_command "mkdir -p ~/.kde/share/apps/katepart/syntax";
string_tmp.copy "cp -f editor/kate/lisaac_v2.xml ~/.kde/share/apps/katepart/syntax/.";
" `".print;
string_tmp.print;
"'\t".print;
(ENVIRONMENT.execute_command string_tmp != 0).if {
"\n Sorry, auto-install fail !\n\
\ You can to read the `editor/kate/README' file.".print;
} else {
"OK.".print;
};
};
);
- install_vim <-
( + char:CHARACTER;
+ file_name:STRING;
// TODO: Fix this since gvim exists on windows system
(system = system_windows).if {
" Sorry, not Vim editor for windows.\n\n".print;
} else {
ENVIRONMENT.execute_command "mkdir -p ~/.vim/syntax";
ENVIRONMENT.execute_command "mkdir -p ~/.vim/indent";
ENVIRONMENT.execute_command "mkdir -p ~/.vim/backup";
ENVIRONMENT.execute_command "mkdir -p ~/.vim/temp";
// Syntax hilightning support
string_tmp.copy "cp -f editor/vim/syntax/lisaac.vim ~/.vim/syntax/";
" `".print;
string_tmp.print;
"'\t".print;
(ENVIRONMENT.execute_command string_tmp != 0).if {
"\n Sorry, auto-install fail !\n\
\ You can read the `editor/vim/install_vim_plugin.sh' file.\n".print;
} else {
"OK.\n".print;
};
// Syntax indentation support
string_tmp.copy "cp -f editor/vim/indent/lisaac.vim ~/.vim/indent/";
" `".print;
string_tmp.print;
"'\t".print;
(ENVIRONMENT.execute_command string_tmp != 0).if {
"\n Sorry, auto-install fail !\n\
\ You can read the `editor/vim/install_vim_plugin.sh' file.\n".print;
} else {
"OK.\n".print;
};
// Install ~/.vimrc file
char := question
"\n It is recommanded to install the default vimrc file provided by the \n\
\ lisaac installer. \n\n\
\ If you choose not doing this action, your vimrc will only be updated \n\
\ Do you want to install the default config provided by lisaac installer ?";
(char = 'n').if {
file_name := STRING.create 100;
(path_home = NULL).if {
file_name.copy "C:";
} else {
file_name.copy path_home;
};
file_name.append "/.vimrc";
update file_name idf lisaac_vim with lisaac_vim confirmation TRUE;
} else {
string_tmp.copy "cp -f editor/vim/vimrc ~/.vimrc";
" `".print;
string_tmp.print;
"'\t".print;
(ENVIRONMENT.execute_command string_tmp != 0).if {
"\n Sorry, auto-install fail !\n\
\ You can read the `editor/vim/install_vim_plugin.sh' file.\n".print;
} else {
"OK.\n".print;
};
};
};
);
- install_hippoedit <-
(
(system = system_windows).if {
string_tmp.copy
"copy editor/hippoedit/lisaac_spec.xml \"C:\\Program Files\\HippoEDIT\\data\\syntax\"";
//
" Execute: `".print;
string_tmp.print;
"'\t".print;
(ENVIRONMENT.execute_command string_tmp != 0).if {
"Fail!".print;
} else {
"Ok.".print;
};
} else {
" Sorry, Hippoedit editor is only for Windows.".print;
};
);
- install_eclipse <-
(
" Prerequisite: you need the Eclipse package installed.\n\
\ Use the Eclipse Update Manager to install the Lisaac Mode with the URL:\n\
\ http://isaacproject.u-strasbg.fr/eclipse/update/\n\n\
\ Please, read `editor/eclipse/README' file for further information.\n".print;
);
//
// Install Compiler
//
- compile_file n:STRING_CONSTANT <-
(
string_tmp.copy "gcc -U_FORTIFY_SOURCE -O2 bin/";
string_tmp.append n;
string_tmp.append ".c -o bin/";
string_tmp.append n;
" Execute command `".print;
string_tmp.print;
"' (please wait ...)\n".print;
(ENVIRONMENT.execute_command string_tmp != 0).if {
" Auto-install fail !\n\
\ You want to compile a `bin/".print;
n.print;
".c' file.\n".print;
};
'\n'.print;
);
- compile_shorter is_root:BOOLEAN <-
( + rm,compile:STRING_CONSTANT;
" Compile `shorter' tools for your system (please wait ...)\n".print;
(is_root).if {
compile := "lisaac src/make.lip -shorter -q -boost -o bin/shorter -gcc -Ibin/.";
} else {
(system = system_windows).if {
rm := "del bin\\shorter.c";
compile := "bin\\lisaac src/make.lip -shorter -q -boost -o bin/shorter -gcc -Isrc/.";
} else {
rm := "rm bin/shorter.c";
compile := "bin/lisaac src/make.lip -shorter -q -boost -o bin/shorter -gcc -Isrc/.";
};
};
(ENVIRONMENT.execute_command compile = 0).if {
" Shorter ok!\n".print;
(rm != NULL).if {
ENVIRONMENT.execute_command rm;
};
} else {
" Sorry, `shorter' not ready...\n".print;
};
'\n'.print;
);
//
// Build lib doc.
//
- build_lib <-
(
string_tmp.clear;
(system = system_windows).if {
ENVIRONMENT.execute_command "mkdir doc\\html";
string_tmp.copy "bin\\shorter -d -f belinda -o doc\\html";
// BSBS: A ajouter internal mais sur le meme run shorter
} else {
ENVIRONMENT.execute_command "mkdir -p doc/html";
string_tmp.copy "bin/shorter -d -f belinda -o doc/html";
};
" Execute: `".print;
string_tmp.print;
"'\t".print;
(ENVIRONMENT.execute_command string_tmp = 0).if {
" OK\n\n\
\ Note: you'll find this documentation in `doc/html/index.html'\n".print;
} else {
" Fail!\n".print;
};
);
- user_install <-
( + choice,choice2:INTEGER;
{
choice := menu "Menu." text
"1- Compiler & Shorter Installation.\n\
\2- Editor Installation.\n\
\3- Build the librarie documentation (HTML).\n\
\0- Exit." count 3;
choice
.when 1 then {
step_count := 0;
install_variable;
title "Compilation of Lisaac compiler." count 5;
"*---------------------------------------------------------*\n\
\| Note: You need at least 768MB of memory. |\n\
\*---------------------------------------------------------*\n".print;
compile_file "lisaac";
title "Compilation of Shorter tool." count 5;
compile_shorter FALSE;
"Welcome to the Lisaac World ! \n\
\============================= \n\
\ Installation successfull. \n\
\ Run `lisaac' to compile. \n".print;
"*---------------------------------------------------------*\n\
\| Note: You'll have to reboot or reloaded environnement |\n\
\| to acknowledge the changes. |\n\
\| OR for bash users, doing a `source ~/.bashrc' should |\n\
\| do the job. |\n\
\*---------------------------------------------------------*\n".print;
}
.when 2 then {
{
choice2 := menu "Editor mode for Lisaac." text
"1- Emacs.\n\
\2- Vim.\n\
\3- Kate.\n\
\4- Hippoedit.\n\
\5- eFTE.\n\
\6- Eclipse.\n\
\0- Exit menu." count 6;
choice2
.when 1 then {
title "Installation of `lisaac-mode' for Emacs." count 0;
install_emacs;
}
.when 2 then {
title "Installation of `lisaac.vim' for Vim." count 0;
install_vim;
}
.when 3 then {
title "Installation of `lisaac_v2.xml' for Kate." count 0;
install_kate;
}
.when 4 then {
title "Installation of `lisaac_spec.xml' for Hippoedit." count 0;
install_hippoedit;
}
.when 5 then {
title "Installation of eFTE mode." count 0;
" Note: eFTE Lisaac mode is native.\n\
\ See: `http://efte.cowgar.com'".print;
}
.when 6 then {
title "Installation of Eclipse mode." count 0;
install_eclipse;
};
}.do_while {choice2 != 0};
}
.when 3 then {
title "Build the librarie documentation with Shorter (HTML format)." count 0;
build_lib;
};
}.do_while {choice != 0};
);
- path_bin:ABSTRACT_STRING := "/usr/bin";
- path_lib:ABSTRACT_STRING := "/usr/lib/lisaac";
- path_doc:ABSTRACT_STRING := "/usr/share/lisaac";
- path_man:ABSTRACT_STRING := "/usr/share/man/man1";
- ask_path msg:ABSTRACT_STRING default val:ABSTRACT_STRING :ABSTRACT_STRING <-
( + result:STRING;
+ car:CHARACTER;
msg.print;
" [".print;
val.print;
"] ? (y/n) ".print;
car := IO.read_character;
IO.read_character;
(car.to_lower = 'y').if {
result := val;
} else {
"\n new path : ".print;
IO.read_word;
result := IO.last_string;
result.remove_first 1;
};
result
);
- system_install <-
( + path:ABSTRACT_STRING;
+ create:{ (ABSTRACT_STRING,ABSTRACT_STRING,ABSTRACT_STRING,BOOLEAN); };
// path.h
string_tmp2.copy "#define LISAAC_DIRECTORY \"";
string_tmp2.append path_lib;
string_tmp2.append "\"\n";
update "bin/path.h" idf "#define LISAAC_DIRECTORY"
with string_tmp2 confirmation FALSE;
// compile
compile_file "lisaac";
//
create := { (msg,cpy,dft:ABSTRACT_STRING,ask:BOOLEAN);
(ask).if {
path := ask_path msg default dft;
} else {
path := dft;
};
string_tmp.copy "mkdir -p ";
string_tmp.append path;
execute string_tmp;
string_tmp.copy cpy;
string_tmp.append path;
execute string_tmp;
};
//
create.value (" binary path","cp bin/lisaac ",path_bin,TRUE);
//
create.value (" library path","cp -rf lib ",path_lib,FALSE);
install_make_lip;
string_tmp.copy "cp make.lip ";
string_tmp.append path_lib;
string_tmp.append "/.";
string_tmp.print; '\n'.print;
execute string_tmp;
//
compile_shorter TRUE;
create.value (NULL,"cp bin/shorter ",path_bin,FALSE);
//
create.value (" shorter's mode path","cp -rf shorter ",path_lib,FALSE);
build_lib;
create.value ("Documentation path","cp -rf doc/html/* ",path_doc,TRUE);
//
create.value ("Man path","cp -rf doc/man/* ",path_man,TRUE);
"\n*---------------------------------------------------------*\n\
\| Note: For Editor feature, please execute |\n\
\| `install_lisaac' in user mode. |\n\
\*---------------------------------------------------------*\n".print;
);
Section Public
- main <-
( + cwd:NATIVE_ARRAY(CHARACTER);
+ choice:INTEGER;
"\t\t================================\n\
\\t\t= Auto-Install Lisaac Compiler =\n\
\\t\t================================\n\n".print;
string_tmp.clear;
cwd := string_tmp.to_external;
`getcwd(@cwd,255)`;
string_tmp.from_external cwd;
path_current := STRING.create (string_tmp.count);
path_current.copy string_tmp;
path_home := ENVIRONMENT.get_environment_variable "HOME";
shell := ENVIRONMENT.get_environment_variable "SHELL";
title "Detection system." count 0;
detect_system;
(system != system_windows).if {
choice := menu "Menu." text
"1- User installation.\n\
\2- System installation (root).\n\
\0- Exit." count 2;
choice
.when 1 then {
user_install;
}
.when 2 then {
system_install;
};
} else {
user_install;
};
"\nBye.\n\n".print;
);
lisaac_0.39_rc1/COPYING.txt 0000644 0001750 0001750 00000112747 11314031243 015311 0 ustar sonntag sonntag GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
Lisaac Compiler RUNTIME LIBRARY EXCEPTION
Version 3.1, 31 March 2009
Copyright © 2009 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This Lisaac Compiler Runtime Library Exception ("Exception") is an additional permission
under section 7 of the GNU General Public License, version 3 ("GPLv3"). It
applies to a given file (the "Runtime Library") that bears a notice placed by
the copyright holder of the file stating that the file is governed by GPLv3
along with this Exception.
When you use Lisaac Compiler to compile a program, Lisaac Compiler may
combine portions of certain Lisaac Compiler header files and runtime
libraries with the compiled program. The purpose of this Exception is
to allow compilation of non-GPL (including proprietary) programs to
use, in this way, the header files and runtime libraries covered by
this Exception.
0. Definitions.
A file is an "Independent Module" if it either requires the Runtime Library for
execution after a Compilation Process, or makes use of an interface provided by
the Runtime Library, but is not otherwise based on the Runtime Library.
"GPL-compatible Software" is software whose conditions of propagation,
modification and use would permit combination with Lisaac Compiler in
accord with the license of Lisaac Compiler.
"Target Code" refers to output from any compiler for a real or virtual target
processor architecture, in executable form or suitable for input to an
assembler, loader, linker and/or execution phase. Notwithstanding that, Target
Code does not include data in any format that is used as a compiler intermediate
representation, or used for producing a compiler intermediate representation.
The "Compilation Process" transforms code entirely represented in
non-intermediate languages designed for human-written code, and/or in Java
Virtual Machine byte code, into Target Code. Thus, for example, use of source
code generators and preprocessors need not be considered part of the Compilation
Process, since the Compilation Process can be understood as starting with the
output of the generators or preprocessors.
A Compilation Process is "Eligible" if it is done using Lisaac
Compiler, alone or with other GPL-compatible software, or if it is
done without using any work based on Lisaac Compiler. For example,
using non-GPL-compatible Software to optimize any Lisaac Compiler
intermediate representations would not qualify as an Eligible
Compilation Process.
1. Grant of Additional Permission.
You have permission to propagate a work of Target Code formed by combining the
Runtime Library with Independent Modules, even if such propagation would
otherwise violate the terms of GPLv3, provided that all Target Code was
generated by Eligible Compilation Processes. You may then convey such a
combination under terms of your choice, consistent with the licensing of the
Independent Modules.
2. No Weakening of Lisaac Compiler Copyleft.
The availability of this Exception does not imply any general presumption that
third-party software is unaffected by the copyleft requirements of the license
of Lisaac Compiler.
lisaac_0.39_rc1/make.lip.sample 0000644 0001750 0001750 00000016764 11314031246 016350 0 ustar sonntag sonntag ///////////////////////////////////////////////////////////////////////////////
// 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://isaacproject.u-strasbg.fr/ //
///////////////////////////////////////////////////////////////////////////////
// file LIP : LIsaac Path directory and make LIsaac Project system.
Section Private
//
// Compiler variables.
//
// 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; // is output file name value without extension (auto-loading, if possible).
// 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
// Other.
+ is_statistic:BOOLEAN;
+ is_quiet:BOOLEAN;
//
// Other variables.
//
+ option_gcc:STRING;
+ lib_gcc:STRING;
+ execute_file:STRING;
+ target:STRING := "unix";
//
// Service
//
- path_li p:STRING <-
(
path (lisaac + p);
);
+ 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_li "lib/standard/*";
path_li "lib/internal/portable/*";
path_li lib_extra;
path_li lib_unstable;
);
//
// Target path.
//
- unix_target <-
(
path_li (lib_os + "unix/system/");
path_li (lib_os + "unix/file_system/");
path_li (lib_os + "unix/video/");
);
- windows_target <-
(
path_li (lib_os + "unix/system/");
path_li (lib_os + "windows/file_system/");
path_li (lib_os + "windows/video/");
);
- dos_target <-
(
path_li (lib_os + "unix/system/");
path_li (lib_os + "dos/file_system/");
path_li (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 ("gcc __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;
};
(run cmd != 0).if {
"FAILURE!\n".print;
};
);
//
// Execute function.
//
- general_front_end <-
(
standard_path;
get_target;
);
- general_back_end <-
(
(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 ("gcc " + output_file + ".c -c " + option_gcc);
} else {
execute ("gcc " + output_file + ".c -o " + output_file + option_gcc + lib_gcc);
};
);
- 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;
);
//
// Optimization.
//
- boost <-
// Full optimization.
(
no_debug;
is_optimization := TRUE;
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;
);
//
// 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;
);
//
// 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;
); lisaac_0.39_rc1/editor/ 0000755 0001750 0001750 00000000000 11314031253 014713 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/hippoedit/ 0000755 0001750 0001750 00000000000 11314031253 016700 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/hippoedit/lisaac_spec.xml 0000644 0001750 0001750 00000007570 11314031253 021701 0 ustar sonntag sonntag
true
()[]{}''""
\
?*-+/&*=<>!{}()[].
0-9A-Za-z_
2
lisaac_0.39_rc1/editor/hippoedit/README.txt 0000644 0001750 0001750 00000001524 11314031253 020400 0 ustar sonntag sonntag HippoEDIT
---------
http://hippoedit.com
From the website:
HippoEDIT is a powerful, fast and easy to use Windows text editor, primarily
targeted at power users and programmers. It has modern and lightweight user
interface, which supports different interface schemes, Multi Tab environment,
seamless web and help browser, File Explorer and Project Explorer, external
tools integration and more smart text editor functions.
It has a cool feature in that it very easily nests modes. So, in Lisaac,
when you use the back tick `, the code inside of the back ticks are
fully syntax highlighted as C code.
It also has slot navigation for Lisaac source files.
Installation
------------
1. Copy lisaac_spec.xml to C:\Program Files\HippoEDIT\data\syntax
2. Restart HippoEDIT.
.li and .lip files should now be syntax highlighted as Lisaac.
lisaac_0.39_rc1/editor/vim/ 0000755 0001750 0001750 00000000000 11314031253 015506 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/vim/jptemplate/ 0000755 0001750 0001750 00000000000 11314031253 017653 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/ 0000755 0001750 0001750 00000000000 11314031253 021107 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/for 0000644 0001750 0001750 00000000144 11314031253 021617 0 ustar sonntag sonntag ${initializer expression:0}.to (${loop test expression}) do { ${iterator:i}:INTEGER;
${cursor}
};
lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/if_else 0000644 0001750 0001750 00000000063 11314031253 022437 0 ustar sonntag sonntag (${test expression}).if {
${cursor}
} else {
};
lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/if 0000644 0001750 0001750 00000000051 11314031253 021424 0 ustar sonntag sonntag (${test expression}).if {
${cursor}
};
lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/do_while 0000644 0001750 0001750 00000000057 11314031253 022626 0 ustar sonntag sonntag {
${cursor}
}.do_while {${test expression}};
lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/while_do 0000644 0001750 0001750 00000000060 11314031253 022620 0 ustar sonntag sonntag {${test expression}}.while_do {
${cursor}
};
lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/if_elseif 0000644 0001750 0001750 00000000121 11314031253 022751 0 ustar sonntag sonntag (${test expression1}).if {
${cursor}
}.elseif {${test expression2}} then {
};
lisaac_0.39_rc1/editor/vim/jptemplate/lisaac/for_step 0000644 0001750 0001750 00000000160 11314031253 022650 0 ustar sonntag sonntag ${initializer expression:0}.to (${loop test expression}) by(${step}) do { ${iterator:i}:INTEGER;
${cursor}
};
lisaac_0.39_rc1/editor/vim/indent/ 0000755 0001750 0001750 00000000000 11314031253 016767 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/vim/indent/lisaac.vim 0000644 0001750 0001750 00000006433 11314031253 020746 0 ustar sonntag sonntag " Vim indent file
" Language: Lisaac
" Maintainer: Xavier Oswald
" Contributors: Matthieu Herrmann
" $Date: 2009/05/19 21:33:52
" $Revision: 1.0
" URL: http://isaacproject.u-strasbg.fr/
" TODO:
" - Improve string indent and if there are {, ( .... inside
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetLisaacIndent()
setlocal indentkeys+==Section,0),0},O]
setlocal nolisp " no lisp indent
setlocal nosmartindent " no start tab
setlocal nocindent " no C indent
setlocal nosmarttab " no start tab
setlocal expandtab " no tabs, real spaces
setlocal autoindent " Use indent from the previous line
setlocal tabstop=2 " tab spacing
setlocal softtabstop=2 " 2 spaces when pressing unify
setlocal shiftwidth=2 " unify
" Only define the function once.
if exists("*GetLisaacIndent")
finish
endif
function GetLisaacIndent()
let lnum = prevnonblank(v:lnum - 1)
let ind = indent(lnum)
let line = getline(lnum)
let linec = getline(v:lnum)
let pline = getline(pnum)
" At the start of the file use zero indent.
" if lnum == 0
" return 0
" endif
"""""""""""""""""
" NO INDENT "
"""""""""""""""""
" Whole line String
if linec =~ '^.\s*\\.*\\\s*$' || linec =~ '^\s*\\.*\"'
return ind
endif
" && and ||
if line =~ '^.*&&\s*$' || line =~ '^.*||\s*$' "|| line =~ '^\s*{.*}.*'
return ind
endif
"""""""""""""""""
" INDENT PART "
"""""""""""""""""
if line =~ '^.*($'
let ind = ind + &sw
return ind
endif
" Add a 'shiftwidth' after lines that start with a Section word
if line =~ '^\s*Section'
let ind = ind + &sw
return ind
endif
" Add a 'shiftwidth' after a "(" and no ")" and not in a string
if line =~ '^.*(' && line !~ '^.*(.*).*' && line !~ '^.*\".*(.*\".*'
let ind = ind + &sw
return ind
endif
" Add a 'shiftwidth' after a "{" and no "}" and not in a string
" .....{ OR ......{ code;
" No invariant (contract)
if line =~ '^.*{\s*$' || line =~'^.*{.*' && line !~ '^.*\".*{.*\".*' && line !~ '^.*\\.*{.*\".*' && line !~ '^.*?\s*{' && line !~ '^\s*{.*}.*'
let ind = ind + &sw
return ind
endif
" Add a 'shiftwidth' after a "[" and no "]" and not in a string
if line =~ '^.\s[' && line !~ '^.*\[ .* \].*'
let ind = ind + &sw
return ind
endif
"""""""""""""""""
" UNINDENT PART "
"""""""""""""""""
" Unindent end block and end string
if linec =~ '^\s*};\s*$'
let ind = ind - &sw
return ind
endif
if linec =~ '^\s*);\s*$' || linec =~ '^\s*).*'
let ind = ind - &sw
return ind
endif
" Unindent Sections :
if linec =~ '^\s*Section'
let ind = ind - &sw
return 0
endif
" Unindent for ")" and not in a string
if linec =~ '^.*)' && linec !~ '^.*(.*).*' && linec !~ '^.*\".*).*\".*'
let ind = ind - &sw
return ind
endif
" Unindent for "}" and not in a sting
"if linec =~ '^.*}.*' && linec !~ '^.*{.*}.*'
if linec =~ '^.*}.*' && linec !~ '^.*{.*' && linec !~ '^.*\".*}.*\".*'
let ind = ind - &sw
return ind
endif
if linec =~ '^\s*}.*'
let ind = ind - &sw
return ind
endif
" Unindent for "]" and not in a string
if linec =~ '^\s*]' && linec !~ '^.*\[ .* \] .*'
let ind = ind - &sw
return ind
endif
return ind
endfunction
" vim:sw=2
lisaac_0.39_rc1/editor/vim/plugin/ 0000755 0001750 0001750 00000000000 11314031253 017004 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/vim/plugin/jptemplate.vim 0000644 0001750 0001750 00000025063 11314031253 021674 0 ustar sonntag sonntag " jptemplate.vim:
"
" A simple yet powerful interactive templating system for VIM.
"
" Version 1.5 (released 2008-07-08).
"
" Copyright (c) 2008 Jannis Pohlmann .
"
" 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 2 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, write to the Free Software
" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
" MA 02111-1307 USA
" Reserved variable names
let s:reservedVariables = ['date','shell','interactive_shell']
" Variable value history
let s:rememberedValues = {}
" Characters to be escaped before the substitute() call
let s:escapeCharacters = '&~\'
function! jp:Initialize ()
" List for default configuration
let defaults = []
" Default configuration values
call add (defaults, ['g:jpTemplateDir', $HOME . '/.vim/jptemplate'])
call add (defaults, ['g:jpTemplateKey', ''])
call add (defaults, ['g:jpTemplateDateFormat', '%Y-%m-%d'])
call add (defaults, ['g:jpTemplateDefaults', {}])
call add (defaults, ['g:jpTemplateVerbose', 0])
" Set default configuration for non-existent variables
for var in filter (defaults, '!exists (v:val[0])')
exec 'let ' . var[0] . ' = ' . string (var[1])
endfor
endfunction
function! jp:GetTemplateInfo ()
" Prepare info dictionary
let info = {}
" Get part of the line before the cursor
let part = getline ('.')[0 : getpos ('.')[2]-1]
" Get start and end position of the template name
let info['start'] = match (part, '\(\w*\)$')
let info['end'] = matchend (part, '\(\w*\)$')
" Get template name
let info['name'] = part[info['start'] : info['end']]
" Throw exception if no template name could be found
if empty (info['name'])
throw 'No template name found at cursor'
endif
" Determine directory to load the template from (skip empty directories;
" each directory may override the ones before)
for dir in filter ([ 'general', &ft ], '!empty (v:val)')
let filename = g:jpTemplateDir .'/'. dir .'/'. info['name']
if filereadable (filename)
let info['filename'] = filename
endif
endfor
" Throw exception if the template file does not exist in any of these
" directories (or is not readable)
if !has_key (info, 'filename')
throw 'Template file not found'
endif
" Determine indentation
let info['indent'] = matchstr (part, '^\s\+')
" Return template name information
return info
endfunction
function! jp:ReadTemplate (name, filename)
" Try to read the template file and throw exception if that fails
try
return readfile (a:filename)
catch
throw 'Template "' . a:name . '" could not be found.'
endtry
endfunction
function! jp:UpdateCursorPosition (lines, endColumn)
" Define cursorPosition as the column to which the cursor is moved
let cursorPosition = -1
for cnt in range (0, a:lines)
" Search for ${cursor} in the current line
let str = getline (line ('.') + cnt)
let start = match (str, '${cursor}')
let end = matchend (str, '${cursor}')
let before = strpart (str, 0, start)
let after = strpart (str, end)
if start >= 0
" Remove ${cursor} and move the cursor to the desired position
call setline (line ('.') + cnt, before . after)
call cursor (line ('.') + cnt, start+1)
let cursorPosition = start
" We're done
break
endif
endfor
" Update cursor position in case no ${cursor} was found in the template
" and the resulting template was not empty
if cursorPosition == -1 && a:lines >= 0
if a:lines == 0
call cursor (line ('.'), a:endColumn + 1)
else
call cursor (line ('.') + a:lines, a:endColumn + 1)
endif
endif
" Return to insert mode (distinguish between 'in the middle of the line' and
" 'at the end of the line')
if col ('.') == len (getline ('.'))
startinsert!
else
startinsert
endif
endfunction
function! jp:ParseExpression (expr)
" Determine position of the separator between name and value
let valuepos = match (a:expr, ':')
" Extract name and value strings
let name = valuepos >= 0 ? strpart (a:expr, 0, valuepos) : a:expr
let value = valuepos >= 0 ? strpart (a:expr, valuepos + 1) : ''
" Return list with both strings
return [name, value]
endfunction
function! jp:EvaluateReservedVariable (name, value, variables)
let result = ''
if a:name == 'date'
let result = strftime (empty (a:value) ? g:jpTemplateDateFormat : a:value)
elseif a:name == 'shell'
if !empty (a:value)
let result = system (a:value)
endif
elseif a:name == 'interactive_shell'
let command = input ('interactive_shell: ', a:value)
if !empty (command)
let result = system (command)
endif
endif
return result
endfunction
function! jp:ExpandTemplate (info, template)
" Backup content before and after the template name
let before = strpart (getline ('.'), 0, a:info['start'])
let after = strpart (getline ('.'), a:info['end'])
" Merge lines of the template and then split them up again.
" This makes multi-line variable values possible
let mergedTemplate = split (join (a:template, "\n"), "\n")
" Define cnt as the number of inserted lines
let cnt = 0
" Remove template string if the resulting template is empty
if empty (mergedTemplate)
call setline (line ('.'), before . after)
call cursor (line ('.'), len (before) + 1)
let cnt = -1
else
" Insert template between before and after
for cnt in range (0, len (mergedTemplate) - 1)
if cnt == 0
call setline (line ('.'), before . mergedTemplate[cnt])
else
call append (line ('.') + cnt - 1, a:info['indent'] . mergedTemplate[cnt])
endif
if cnt == len (mergedTemplate) - 1
call setline (line ('.') + cnt, getline (line ('.') + cnt) . after)
endif
endfor
endif
" Define start and end columns of the template
let startColumn = len (before)
if empty (mergedTemplate)
let endColumn = startColumn
else
if cnt == 0
let endColumn = startColumn + len (mergedTemplate[0])
else
let endColumn = len (a:info['indent'] . mergedTemplate[len (mergedTemplate) - 1])
endif
endif
" Return number of inserted lines, start and end columns
return [cnt, startColumn, endColumn]
endfunction
function! jp:ProcessTemplate (info, template)
let matchpos = 0
let expressions = []
let variables = {}
let reserved = {}
" Make a string out of the template lines
let s:str = join (a:template, ' ')
" Detect all variable names of the template
while 1
" Find next variable start and end position
let start = match (s:str, '${[^{}]\+}', matchpos)
let end = matchend (s:str, '${[^{}]\+}', matchpos)
if start < 0
" Stop search if there is no variable left
break
else
" Extract variable expression (remove '${' and '}')
let expr = s:str[start+2 : end-2]
" Extract variable name and default value */
let [name, value] = jp:ParseExpression (expr)
if name == 'cursor'
" Skip the ${cursor} variable
elseif count (s:reservedVariables, name) > 0
let reserved[expr] = ''
else
" Only insert variables on their first appearance
if !has_key (variables, name)
" Add expression to the expression list
call add (expressions, expr)
" Set variable value to ''
let variables[name] = ''
endif
" Check whether local default value is defined or not
if empty (value)
" If not, check if variable value is empty
if empty (variables[name])
" If so, either set it to the last remembered value or the global
" default if it exists
if has_key (s:rememberedValues, name)
let variables[name] = s:rememberedValues[name]
elseif has_key (g:jpTemplateDefaults, name)
let variables[name] = g:jpTemplateDefaults[name]
endif
endif
else
" Use local default (first occurence in the template only)
let variables[name] = value
endif
endif
" Start next search at the end position of this expression
let matchpos = end
endif
endwhile
" Ask the user to enter values for all variables
for expr in expressions
let [name, value] = jp:ParseExpression (expr)
let variables[name] = input (name . ': ', variables[name])
let s:rememberedValues[name] = variables[name]
endfor
" Evaluate reserved variables
for expr in keys (reserved)
let [name, value] = jp:ParseExpression (expr)
let replacement = jp:EvaluateReservedVariable (name, value, variables)
let reserved[expr] = replacement
endfor
" Expand all variables (custom and reserved)
for index in range (len (a:template))
for expr in expressions
let [name, value] = jp:ParseExpression (expr)
let expr = '${' . name . '\(:[^{}]\+\)\?}'
let value = escape(variables[name], s:escapeCharacters)
let a:template[index] = substitute (a:template[index], expr, value, 'g')
endfor
for [expr, value] in items (reserved)
let expr = '${' . expr . '}'
let value = escape(value, s:escapeCharacters)
let a:template[index] = substitute (a:template[index], expr, value, 'g')
endfor
endfor
" Insert template into the code line by line
let [insertedLines, startColumn, endColumn] = jp:ExpandTemplate (a:info, a:template)
" Update the cursor position and return to insert mode
call jp:UpdateCursorPosition (insertedLines, endColumn)
endfunction
function! jp:InsertTemplate ()
try
" Detect bounds of the template name as well as the name itself
let info = jp:GetTemplateInfo ()
" Load the template file
let template = jp:ReadTemplate (info['name'], info['filename'])
" Do the hard work: Process the template
call jp:ProcessTemplate (info, template)
catch
" Inform the user about errors
echo g:jpTemplateVerbose ? v:exception . " (in " . v:throwpoint . ")" : v:exception
endtry
endfunction
" Initialize jptemplate configuration
call jp:Initialize ()
" Map keyboard shortcut to the template system
exec 'imap ' . g:jpTemplateKey . ' :call jp:InsertTemplate()'
lisaac_0.39_rc1/editor/vim/vimrc 0000644 0001750 0001750 00000011222 11314031253 016547 0 ustar sonntag sonntag """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" DEFAULT ~/.vimrc by Xavier Oswald (x.oswald@free.fr) "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set cf " enable error files and error jumping
set nocompatible " Use Vim settings, rather then Vi settings (much better!).
set autowrite " Automatically save before :next, :make etc.
set history=50 " 50 commands in the history
set viminfo='20,\"50 " read/write a .viminfo file, don't store more than 50
filetype plugin on " load filetype plugins
filetype indent on " load filetype indents
filetype on " detect the type of file
set backspace=indent,eol,start " more powerful backspacing
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Theme/Colors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on " active coloration
set background=light " default background
colorscheme default " default coloration theme
"NOTE: nice theme is 'colorsheme elflord' if you have a dark background
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Files/Backups
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set backup " make backup file
set backupdir=~/.vim/backup/ " where to put backup file
set directory=~/.vim/temp " directory is the directory for temp file
set makeef=error.err " When using make, where should it dump the file
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" GVim UI
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim UI
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set ruler " show the cursor position all the time
set cmdheight=2 " the command bar is 2 high
set hid " you can change buffer without saving
set backspace=2 " make backspace work normal
set report=0 " tell us when anything is changed via :...
set noerrorbells " don't make noise
set ignorecase " ignore case for searching
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Visual Cues
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set showmatch " show matching brackets
set mat=5 " how many tenths of a second to blink matching brackets for
set nohlsearch " do not highlight searched for phrases
set incsearch " BUT do highlight as you type you search phrase
set so=10 " Keep 10 lines (top/bottom) for scope
set novisualbell " don't blink
set noerrorbells " no noise
set laststatus=2 " always show the status line
set showcmd " display incomplete commands
set modeline " display the current mode
set nostartofline " keep the cursor in the same colon when changing line
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Menu
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set wildmenu " menu completion
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text Formatting/Layout
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set fo=tcrqn " See Help (complex)
set ai " autoindent
set si " smartindent
set cindent " do c-style identing
set tabstop=2 " tab spacing
set softtabstop=2 " 2 spaces when pressing unify
set shiftwidth=2 " unify
set noexpandtab " real tabs please!
set smarttab " use tabs at the start of a line, spaces elsewhere
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Perl
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let perl_extended_vars=1 " highlight advanced perl vars inside strings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
autocmd FileType text setlocal textwidth=80
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Lisaac special support
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
au BufNewFile,BufRead *.li setf lisaac
lisaac_0.39_rc1/editor/vim/install_vim_plugin.sh 0000644 0001750 0001750 00000004147 11314031253 021747 0 ustar sonntag sonntag #!/bin/bash
# +====================================================+
# | Vim plugin installation script for Lisaac |
# +====================================================+
# | |
# | This script will: |
# | ----------------- |
# | - add the lisaac.vim syntax file in your |
# | ~/.vim/syntax/ |
# | - add the lisaac.vim indent file in your |
# | ~/.vim/indent/ |
# | - add the detection if you edit an *.li file in |
# | your ~/.vimrc |
# | |
# | (c) 2007 by Xavier Oswald, all right reserved |
# | Licence GPL version 2 or later |
# +====================================================+
echo
echo "+=================================================+"
echo "| Vim plugin installation script for Lisaac |"
echo "+=================================================+"
echo
echo -n "-> Are you sure you want to install this plugin ?(y/n)"
read result
echo
if [ "$result" = "y" ]; then
echo "-> Copying lisaac.vim syntax file in your ~/.vim/syntax/ : OK"
mkdir -p ~/.vim/syntax/
cp -f syntax/lisaac.vim ~/.vim/syntax/
echo "-> Copying lisaac.vim indent file in your ~/.vim/indent/ : OK"
mkdir -p ~/.vim/indent/
cp -f indent/lisaac.vim ~/.vim/indent/
echo
echo -n "-> Do you want to install the default config provided by lisaac installer?(y/n)"
read result
if [ "$result" = "y" ]; then
echo "-> Copying the default vim config file in your ~/.vimrc : OK"
cp -f vimrc ~/.vimrc
else
if [ ! -f ~/.vimrc ]; then
touch ~/.vimr
fi
echo "syntax on" >> ~/.vimrc
echo "filetype plugin on" >> ~/.vimrc
echo "filetype indent on" >> ~/.vimrc
echo "au BufNewFile,BufRead *.li setf lisaac" >> ~/.vimrc
echo "-> Modification of your ~/.vimrc to support *.li files : OK"
fi
echo
echo "-> Installation finished : OK"
else
echo "-> Installation of the vim plugin aborted..."
fi
lisaac_0.39_rc1/editor/vim/syntax/ 0000755 0001750 0001750 00000000000 11314031253 017034 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/vim/syntax/lisaac.vim 0000644 0001750 0001750 00000010064 11314031253 021006 0 ustar sonntag sonntag " Vim syntax file
" Language: Lisaac
" Maintainer: Xavier Oswald
" URL: http://isaacproject.u-strasbg.fr/
" Last Change: 2008 November 06
" Filenames: *.li
" Quit when a syntax file was already loaded
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" we define it here so that included files can test for it
let main_syntax='li'
endif
" keyword definitions
" ===================
syn keyword liFunction while while_do if else when elseif then self by to do or downto if_true if_false shrink
syn keyword liKey Parallel Section Header Insert Inherit Public Private Mapping Interrupt Right Left Self Old Expanded Strict
syn keyword liSpecial TODO FIXME DEBUG NOTE not_yet_implemented die_with_code BSBS XOXO JBJB
" Support for String and Char
" ===========================
syn match liStringSpecial "^\s*\\"
syn match liStringSpecial "\\$"
syn match liStringSpecial "\\."
syn region liString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=liStringSpecial
" Operators
" =========
syn match liOperatorAffect "<-\|:=\|?=\|->"
syn match liOperatorCmp "<\|>\|*\|/=\|=\|&&\||\|!\|?\|-?\|+?"
syn match liOperator "+\|-\|*\|/"
" Quoted expression
" =================
syn match liExternalExpr "`[^`\n]*`"
syn region liQuotedExpr start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=liStringSpecial
" Others
" ======
syn match liPrototype "[A-Z][A-Z0-9_]*"
syn match liKey "Result\(_[0-9]*\)\="
syn match liSlot "^\(\s\|\t\|[(]\)*\(+\|-\)\D"
syn match liBlock "{\|}"
syn match liElement "\(\[\|\]\)"
syn match liSymbolDeclaration "(\|)"
syn match liContrat "^\(\s\|\t\)*\[\(\s\|\t\)*\(\.\.\.\)\=\|\]"
syn match liFunction "\.\w*"
syn keyword liBoolean TRUE FALSE BOOLEAN
" Support for decimal, real, binary, Hexadecimal and octal numbers
" ================================================================
" hexa
syn match liNumberHexa "\<\(\d\|[ABCDEF]\)\(_\|\d\|[ABCDEF]\)*[hH]\=\>"
" binary
syn match liNumberBinary "\<[01]\(\(_\|[01]*\)[01]\)*[bB]\=\>"
" decimal, binary, octal
syn match liNumberDecimal "\<\d\(\(_\|\d*\)\d\)*[dDbBoO]\=\>"
" real
syn match liNumberFloat "\<\d\(\(_\|\d*\)\d\)*\.\d*\(E-\=\)\=\(\(_\|\d*\)\d\)*[fF]\=\>"
" Comments
" ========
syn region liLinesComment start="/\*" end="\*/" contains=liSpecial
syn match liQuotedExprInComment contained "`[^']*'"
syn match liHiddenComment "//.*" contains=liQuotedExprInComment,liSpecial
" The default highlighting Coloration
" ===================================
if version >= 508 || !exists("did_li_syn_inits")
if version < 508
let did_li_syn_inits = 1
command -nargs=+ HiLink hi link
else
command -nargs=+ HiLink hi def link
endif
HiLink liNumberHexa Number
HiLink liNumberDecimal Number
HiLink liNumberBinary Number
HiLink liNumberFloat Float
HiLink liFunction Function
HiLink liBoolean Type
HiLink liKey Label
HiLink liString String
HiLink liStringSpecial SpecialChar
HiLink liSpecial Todo
HiLink liOperatorAffect Delimiter
HiLink liOperatorCmp Delimiter
HiLink liOperator Delimiter
HiLink liExternalExpr Define
HiLink liQuotedExpr Special
HiLink liPrototype Type
HiLink liSlot Keyword
HiLink liBlock Conditional
HiLink liElement keyword
HiLink liSymbolDeclaration Keyword
HiLink liContrat keyword
HiLink liNumber Number
HiLink liLinesComment Comment
HiLink liHiddenComment Comment
HiLink liQuotedExprInComment SpecialChar
delcommand HiLink
endif
let b:current_syntax = "li"
if main_syntax == 'li'
unlet main_syntax
endif
" vim: ts=8
lisaac_0.39_rc1/editor/emacs/ 0000755 0001750 0001750 00000000000 11314031253 016003 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/emacs/lisaac-mode.el 0000644 0001750 0001750 00000051344 11314031253 020512 0 ustar sonntag sonntag ;;
;; Mode Emacs for LISAAC language 0.2.2 by Sonntag Benoit.
;;
;;
;; LICENSE
;; 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 .;
;;
;; INSTALLATION
;; To install, simply copy this file into a directory in your
;; load-path and add the following two commands in your '.emacs' file:
;;
;; (add-to-list 'auto-mode-alist '("\\.li\\'" . lisaac-mode))
;; (autoload 'lisaac-mode "~/lisaac-mode" "Major mode for Lisaac Programs" t)
;;
;; NEW FUNCTION KEY
;; : Indent current line.
;; [F2] : Indent all lines.
;;
;; [F5] : Append the Licence Header.
;; [F6] : Append the Header section.
;; [F7] : Append a constructor.
;;
;; [F10] : Display Previous Buffer.
;; [F11] : Display the prototype pointed.
;; [F12] : Vertical split window and display the prototype pointed.
;;
;; G : Goto line.
;;
;; BUG REPORT
;; - Bug coloration with external `...`
;; - ( + to:INTEGER; truc.put 't' to 10; // to -> black!
;;
;; MODIFY FOR YOU :
(defvar li-user-name "Sonntag Benoit")
(defvar li-user-mail "sonntag@icps.u-strasbg.fr")
;;
;; Table abbrev.
;;
(defvar li-mode-abbrev-table nil
"Abbrev table used while in Lisaac mode.")
(define-abbrev-table 'li-mode-abbrev-table ())
;;
;; Color Expression.
;;
(defvar li-color 0)
(defvar li-comment 0)
(defvar li-string nil)
(defvar li-string2 nil)
(defvar li-test 0)
(defun li-message ()
""
;(insert (char-to-string (char-before (point))))
(setq li-point2 (point))
(setq li-string2 (match-string 0))
(setq li-char (char-before (- (point) (length li-string2))))
(if (and (>= li-char ?0) (<= li-char ?9))
(setq li-color font-lock-keyword-face)
(progn
(end-of-line)
(setq li-point3 (point))
(setq li-string (concat "....+[^a-z0-9_]" li-string2 "\\([ \t]*,[ \t]*[a-z0-9_]*\\)*[ \t]*:[^=]"))
(if (re-search-backward "^ \\(+\\|-\\)" (point-min) t 1)
(progn
(setq li-point4 (point))
(if (and (re-search-forward "<-\\|:=\\|?=\\|;" nil t 1)
(< li-point2 (point)))
(progn
(goto-char li-point4)
(if (re-search-forward li-string li-point3 t 1)
(setq li-color 0)
(setq li-color li-slot-face)
)
)
(progn
(goto-char li-point4)
(if (re-search-forward li-string li-point3 t 1)
(setq li-color 0)
(setq li-color font-lock-function-name-face)
)
)
)
)
)
;(setq li-color (get-char-property (point) 'face))
)
)
(goto-char li-point2)
li-color
)
(defun li-declaration ()
""
;; Detect local declaration.
(if (looking-at "[ \ta-z0-9_,]*:[^=]")
(setq li-color font-lock-warning-face)
(setq li-color font-lock-variable-name-face)
)
li-color
)
(defun li-type-color ()
""
;; Detect local declaration.
(setq li-string2 (concat (downcase (match-string 0)) ".li" ))
(setq li-test 0)
(while (and (< li-test (length (mapcar (function buffer-name) (buffer-list))))
(not (string-equal (nth li-test (mapcar (function buffer-name) (buffer-list))) li-string2))
)
(setq li-test (+ li-test 1))
)
(if (< li-test (length (mapcar (function buffer-name) (buffer-list))))
(setq li-color li-type-face)
(setq li-color font-lock-type-face)
)
li-color
)
(defconst li-font-lock-keywords
'(
;; External expression
("`[^`\n]*`" 0 highlight nil)
;; Quoted expression
("'[\\].[^'\n]*'" 0 font-lock-constant-face nil)
("'[^\\ '\n]'" 0 font-lock-constant-face nil)
;; quoted expr's in comments
("`[^'\n]*'" 0 font-lock-builtin-face t)
;; Block :
("\{\\|\}" 0 font-lock-comment-face nil)
;; Assignment :
("<-\\|:=\\|?=" 0 0 nil)
;; Float notation :
("[0-9_]+\.[0-9]*E[+-]?[0-9]+" 0 font-lock-keyword-face nil)
;; Symbol declaration :
("^ \\(\\+\\|-\\)" 0 font-lock-warning-face nil)
("\\+\\|-" 0 (li-declaration) nil)
;; Operators :
("[!@#$%^&<|=~/>?\\*\\]+" 0 font-lock-variable-name-face nil)
;; Major keywords :
("^Section[ \t]+[a-zA-Z,\t 0-9_]+\\|Right\\|Left\\|Expanded\\|Strict\\|Old\\|Self\\|Result\\(_[1-9]\\)?"
0 font-lock-keyword-face nil)
;; Hexa-number :
("[0-9][0-9_]*[A-F][0-9A-F_]*h" 0 font-lock-keyword-face nil)
;; Prototype :
("[A-Z][A-Z0-9_]*" 0 (li-type-color) nil)
;; Identifier :
("\\.[ \t\n]*[a-z][a-z0-9_]*" 0 font-lock-function-name-face nil)
("[a-z]+[a-z0-9_]*" 0 (li-message) nil)
;; Number :
("[0-9][0-9_]*" 0 font-lock-keyword-face nil)
("[0-9]+[0-9A-Fa-f_]*" 0 font-lock-keyword-face nil)
)
"Additional expressions to highlight in Lisaac mode.")
;;
;; Table de syntax.
;;
(defvar li-mode-syntax-table
(let ((st (make-syntax-table)))
;; Symbol
(modify-syntax-entry ?0 "." st)
(modify-syntax-entry ?2 "." st)
(modify-syntax-entry ?1 "." st)
(modify-syntax-entry ?! "." st)
(modify-syntax-entry ?@ "." st)
(modify-syntax-entry ?# "." st)
(modify-syntax-entry ?$ "." st)
(modify-syntax-entry ?% "." st)
(modify-syntax-entry ?^ "." st)
(modify-syntax-entry ?& "." st)
(modify-syntax-entry ?< "." st)
(modify-syntax-entry ?| "." st)
(modify-syntax-entry ?= "." st)
(modify-syntax-entry ?/ "." st)
(modify-syntax-entry ?> "." st)
(modify-syntax-entry ?\? "." st)
(modify-syntax-entry ?* "." st)
(modify-syntax-entry ?+ "." st)
(modify-syntax-entry ?- "." st)
;; String, character, external.
; (modify-syntax-entry ?\" "\"" st)
; (modify-syntax-entry ?\' "\"" st)
; (modify-syntax-entry ?` "$$ " st)
;; Identifier
(modify-syntax-entry ?_ "w" st)
;; Comment
(modify-syntax-entry ?\* ". 23" st)
(modify-syntax-entry ?/ ". 124b" st)
(modify-syntax-entry ?\n "> b" st)
st)
"Syntax table used while in Lisaac mode.")
;;
;; Definition press key.
;;
(defvar li-mode-map (make-sparse-keymap)
"Keymap used in Lisaac mode.")
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
(define-key li-mode-map "\t" 'li-indent-command)
(define-key li-mode-map "\r" 'li-newline-command)
(define-key li-mode-map [f2] 'li-indent-all-command)
(define-key li-mode-map [f5] 'li-header1-command)
(define-key li-mode-map [f6] 'li-header2-command)
(define-key li-mode-map [f7] 'li-header3-command)
;(define-key li-mode-map [f8] 'li-header4-command)
;(define-key li-mode-map [f9] 'li-while-command)
(define-key li-mode-map [f10] 'li-previous-buffer-command)
(define-key li-mode-map [f11] 'li-load-direct-prototype-command)
(define-key li-mode-map [f12] 'li-load-prototype-command)
;;
;; Insertion loop command.
;;
(defun li-previous-buffer-command ()
"Display prototype."
(interactive)
(set-window-buffer (selected-window) (nth 0 (mapcar (function buffer-name) (buffer-list))))
)
(defun li-load-direct-prototype-command ()
"Display prototype."
(interactive)
(if (face-equal (get-char-property (point) 'face) li-type-face)
(progn
(backward-word 1)
(looking-at "[A-Z][A-Z0-9_]*")
(setq li-string2 (concat (downcase (match-string 0)) ".li" ))
(set-window-buffer (selected-window) li-string2)
)
)
)
(defun li-load-prototype-command ()
"Display prototype."
(interactive)
(if (face-equal (get-char-property (point) 'face) li-type-face)
(progn
(backward-word 1)
(looking-at "[A-Z][A-Z0-9_]*")
(setq li-string2 (concat (downcase (match-string 0)) ".li" ))
(split-window-vertically)
(set-window-buffer (selected-window) li-string2)
)
)
)
(defun li-header1-command ()
"Insert header standard Lisaac."
(interactive)
(insert "///////////////////////////////////////////////////////////////////////////////\n")
(setq li-string "// Application //\n")
(when (string-match "isaacos" (buffer-file-name))
(setq li-string "// Isaac Opearting System //\n")
)
(when (string-match "lib" (buffer-file-name))
(setq li-string "// Lisaac Library //\n")
)
(when (string-match "src" (buffer-file-name))
(setq li-string "// Lisaac Compiler //\n")
)
(when (string-match "/example" (buffer-file-name))
(setq li-string "// Lisaac Example //\n")
)
(insert li-string)
(insert "// //\n")
(insert "// LSIIT - ULP - CNRS - INRIA - FRANCE //\n")
(insert "// //\n")
(insert "// This program is free software: you can redistribute it and/or modify //\n")
(insert "// it under the terms of the GNU General Public License as published by //\n")
(insert "// the Free Software Foundation, either version 3 of the License, or //\n")
(insert "// (at your option) any later version. //\n")
(insert "// //\n")
(insert "// This program is distributed in the hope that it will be useful, //\n")
(insert "// but WITHOUT ANY WARRANTY; without even the implied warranty of //\n")
(insert "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //\n")
(insert "// GNU General Public License for more details. //\n")
(insert "// //\n")
(insert "// You should have received a copy of the GNU General Public License //\n")
(insert "// along with this program. If not, see . //\n")
(insert "// //\n")
(insert "// http://isaacproject.u-strasbg.fr/ //\n")
(insert "///////////////////////////////////////////////////////////////////////////////\n")
)
(defun li-header2-command ()
"Insert header standard Lisaac."
(interactive)
(insert "Section Header")
(li-newline-command)
(insert "\n")
(insert " + name := ")
(insert (upcase (truncate-string-to-width (buffer-name) (- (length (buffer-name)) 3) 0)))
(insert ";\n")
(insert "\n")
(insert " - copyright := \"2003-")
(insert (format-time-string "%Y"))
(insert " ")
(insert li-user-name)
(insert "\";\n")
(insert "\n")
(insert " - author := \"")
(insert li-user-name)
(insert " (")
(insert li-user-mail)
(insert ")\";\n")
(insert " - comment := \"The main prototype\";\n")
(insert "\n")
(insert "Section Inherit\n")
(insert "\n")
(insert " - parent_object:OBJECT := OBJECT;\n")
(insert "\n")
(insert "Section Public\n")
)
(defun li-header3-command ()
"Insert header standard Lisaac."
(interactive)
(insert "\n //\n")
(insert " // Creation.\n")
(insert " //\n")
(insert "\n")
(insert " - create:SELF <-\n")
(insert " ( + result:SELF;\n")
(insert " result := clone;\n")
(insert " result.make;\n")
(insert " result\n")
(insert " );\n")
(insert "\n")
(insert " - make <-\n")
(insert " ( \n")
(insert "\n")
(insert " );\n")
(insert "\n")
(previous-line 3)
(li-indent-command)
)
;(defun li-while-command ()
; "Insert loop while Lisaac."
; (interactive)
; (insert ".while_do {")
; (li-newline-command)
; (li-newline-command)
; (insert "}; // while_do")
; (li-newline-command)
; (previous-line 2)
; (li-indent-command)
;)
;(defun li-until-command ()
; "Insert loop until Lisaac."
; (interactive)
; (insert ".until_do {")
; (li-newline-command)
; (li-newline-command)
; (insert "}; // until_do")
; (li-newline-command)
; (previous-line 2)
; (li-indent-command)
;)
;;
;; Insertion test command.
;;
;(defun li-cond1-command ()
; "Insert conditionnal Lisaac."
; (interactive)
; (insert ".if {")
; (li-newline-command)
; (li-newline-command)
; (insert "}; // if")
; (li-newline-command)
; (previous-line 2)
; (li-indent-command)
;)
;(defun li-cond2-command ()
; "Insert conditionnal Lisaac."
; (interactive)
; (insert ".if {")
; (li-newline-command)
; (li-newline-command)
; (insert "} else {")
; (li-newline-command)
; (li-newline-command)
; (insert "}; // if")
; (li-newline-command)
; (previous-line 4)
; (li-indent-command)
;)
(defvar li-count-all 0)
(defun li-indent-all-command ()
"All indent text"
(interactive)
;; Search first line.
(setq li-count-all 1)
(beginning-of-line)
(while (/= (point) (point-min))
(setq li-count-all (+ li-count-all 1))
(previous-line 1)
(beginning-of-line))
;; Indent each line.
(next-line 1)
(while (/= (point) (point-max))
(li-indent-command)
(next-line 1))
;; Return current line.
(goto-line li-count-all)
)
;;
;; Indentation.
;;
(defvar li-count-line 0)
(defvar li-point 0)
(defvar li-point2 0)
(defvar li-point3 0)
(defvar li-point4 0)
(defvar li-char ?b)
(defvar li-indent 0)
(defvar li-indent-2 0)
(defvar li-indent-base 0)
(require 'font-lock)
(defvar li-slot-face 'li-slot-face
"Face to use for slot major.")
(defvar li-type-face 'li-type-face
"Face to use for type file.")
(defun li-indent-previous ()
"Indent with previous line."
; Search a previous line.
(setq li-count-line 1)
(previous-line 1)
(beginning-of-line)
(while (looking-at "[ \t\n]*$")
(setq li-count-line (+ li-count-line 1))
(previous-line 1)
(beginning-of-line))
; Set position on begin of text.
(forward-to-indentation 0)
; Initialization.
(setq li-indent-base (current-column))
(setq li-indent 0)
(setq li-point (point))
; Particuliar case ...
(if (looking-at "^Section.*$")
(setq li-indent-base (+ li-indent-base 2)))
; Counter of () or {} or [], with previous line.
(setq li-test 0)
(while (= li-test 0)
(setq li-char (char-after li-point))
(if (= li-char ?[)
(setq li-indent (+ li-indent 2)))
(if (= li-char ?{)
(setq li-indent (+ li-indent 2)))
(if (= li-char ?()
(setq li-indent (+ li-indent 2)))
(if (= li-char ?})
(if (/= li-indent 0)
(setq li-indent (- li-indent 2))))
(if (= li-char ?))
(if (/= li-indent 0)
(setq li-indent (- li-indent 2))))
(if (= li-char ?])
(if (/= li-indent 0)
(setq li-indent (- li-indent 2))))
; ;; Virgule and End-of-line.
; (if (= li-char ?,)
; (if (= (char-after (+ li-point 1)) ?\n)
; (setq li-indent (+ li-indent 2))))
;; End-of-line.
(if (= li-char ?\n)
(setq li-test 1)) ;; Stop
;; Comment //
(if (= li-char ?/)
(if (= (char-after (+ li-point 1)) ?/)
(setq li-test 1))) ;; Stop
;; String " "
(if (= li-char ?")
(progn
(while (= li-test 0)
(setq li-point (+ li-point 1))
(setq li-char (char-after li-point))
(if (= li-char ?\n)
(setq li-test 1)) ;; Stop
(if (= li-char ?")
(setq li-test 1)) ;; Stop
)
(setq li-test 0))
)
;; String ' '
(if (= li-char ?')
(progn
(while (= li-test 0)
(setq li-point (+ li-point 1))
(setq li-char (char-after li-point))
(if (= li-char ?\n)
(setq li-test 1)) ;; Stop
(if (= li-char ?')
(setq li-test 1)) ;; Stop
)
(setq li-test 0))
)
;; Next character.
(setq li-point (+ li-point 1))
)
; Next line: Current Line.
(while (/= li-count-line 0)
(setq li-count-line (- li-count-line 1))
(next-line 1))
; Go to End of line.
(end-of-line)
; Initialization.
(setq li-indent-2 0)
(setq li-point (point))
; Count () or {} or [], of current line.
(setq li-test 0)
(while (= li-test 0)
(setq li-point (- li-point 1))
(setq li-char (char-after li-point))
(if (= li-char ?])
(setq li-indent-2 (+ li-indent-2 2)))
(if (= li-char ?})
(setq li-indent-2 (+ li-indent-2 2)))
(if (= li-char ?))
(setq li-indent-2 (+ li-indent-2 2)))
(if (= li-char ?{)
(if (/= li-indent-2 0)
(setq li-indent-2 (- li-indent-2 2))))
(if (= li-char ?()
(if (/= li-indent-2 0)
(setq li-indent-2 (- li-indent-2 2))))
(if (= li-char ?[)
(if (/= li-indent-2 0)
(setq li-indent-2 (- li-indent-2 2))))
(if (= li-char ?\n)
(setq li-test 1)) ;; Stop
(if (= li-char ?/)
(if (= (char-after (+ li-point 1)) ?/)
(setq li-indent-2 0)))
;; String " "
(if (= li-char ?")
(progn
(while (= li-test 0)
(setq li-point (- li-point 1))
(setq li-char (char-after li-point))
(if (= li-char ?\n)
(setq li-test 1)) ;; Stop
(if (= li-char ?")
(setq li-test 1)) ;; Stop
)
(setq li-test 0))
)
;; String ' '
(if (= li-char ?')
(progn
(while (= li-test 0)
(setq li-point (- li-point 1))
(setq li-char (char-after li-point))
(if (= li-char ?\n)
(setq li-test 1)) ;; Stop
(if (= li-char ?')
(setq li-test 1)) ;; Stop
)
(setq li-test 0))
)
)
; Deleted spaces
(beginning-of-line)
(delete-horizontal-space)
; Append indentation.
(setq li-indent (- li-indent li-indent-2))
(setq li-indent (+ li-indent li-indent-base))
(indent-to-column li-indent)
; Go to end of line.
(end-of-line)
)
(defun li-indent-command ()
"indent line for Lisaac mode."
(interactive)
(beginning-of-line)
(if (looking-at "[ \t]*Section.*$")
; then
(progn
(delete-horizontal-space)
(end-of-line))
;else
(li-indent-previous))
)
;;
;; Newline command.
;;
(defun li-newline-command ()
"indent line, append newline, indent line."
(interactive)
(if (looking-at "[ \t]*$")
; then
(progn
(li-indent-command)
(newline)
(li-indent-command))
; else
(newline))
)
;;
;; autoload
;;
(defun lisaac-mode ()
"Major mode for editing typical Lisaac code."
(interactive)
; In LaTeX-mode we want this
; (add-hook 'LaTeX-mode-hook
; (function (lambda ()
; (paren-toggle-matching-quoted-paren 1)
; (paren-toggle-matching-paired-delimiter 1))))
(autoload 'paren-toggle-matching-paired-delimiter "mic-paren" "" t)
;(paren-toggle-matching-quoted-paren 1)
; (paren-toggle-matching-paired-delimiter 1)
;(auto-overlay-load-definition
;'latex
;'(self ("\\$" (priority . 3) (face . (background-color . "green")))))
;(autoload 'latex-mode "Mode Latex" "jfh" t)
;(require 'font-latex)
;; compatibility MS-DOS
(replace-string "
" "")
; (global-font-lock-mode t)
(global-set-key "\M-g" 'goto-line)
(global-font-lock-mode t)
(kill-all-local-variables)
(setq mode-name "Lisaac")
(setq major-mode 'lisaac-mode)
(use-local-map li-mode-map)
(make-local-variable 'li-mode-syntax-table)
(set-syntax-table li-mode-syntax-table)
(make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments nil)
(make-local-variable 'font-lock-string-face)
(make-local-variable 'font-lock-defaults)
; Creation new face.
(make-face 'li-slot-face)
(set-face-foreground 'li-slot-face "blue")
;(set-face-bold-p 'li-slot-face t)
;(set-face-italic-p 'li-slot-face t)
(set-face-underline-p 'li-slot-face t)
;(set-face-background 'li-slot-face "black")
(make-face 'li-type-face)
(copy-face font-lock-type-face 'li-type-face)
(set-face-underline-p 'li-type-face t)
;(setq font-lock-string-face '(li-font-lock-string))
(setq font-lock-defaults '(li-font-lock-keywords))
;; No replace spaces by tabulations
(setq-default indent-tabs-mode nil)
; For use mouse Wheel.
(require 'mwheel)
(mwheel-install)
(run-hooks 'li--mode-hook))
;;
;; End of Lisaac mode.
;;
(provide 'lisaac-mode)
lisaac_0.39_rc1/editor/eclipse/ 0000755 0001750 0001750 00000000000 11314031253 016337 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/eclipse/plugin.xml 0000644 0001750 0001750 00000042216 11314031252 020363 0 ustar sonntag sonntag
%perspective.description.0
Create a "Hello World" Lisaac application from scratch.
while_do {
${cursor}
};
until_do {
${cursor}
};
if {
${cursor}
};
if {
${cursor}
} else {
};
if_false {
${cursor}
};
to ${cursor} do { i:INTEGER;
};
lisaac_0.39_rc1/editor/eclipse/help/ 0000755 0001750 0001750 00000000000 11314031252 017266 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/eclipse/help/testToc.xml 0000644 0001750 0001750 00000000255 11314031252 021437 0 ustar sonntag sonntag
lisaac_0.39_rc1/editor/eclipse/help/html/ 0000755 0001750 0001750 00000000000 11314031252 020232 5 ustar sonntag sonntag lisaac_0.39_rc1/editor/eclipse/help/html/toc.html 0000644 0001750 0001750 00000000421 11314031252 021702 0 ustar sonntag sonntag
Table of Contents
Table of Contents
Please enter your text here.