Commit e8688ee4 authored by Erwan Jahier's avatar Erwan Jahier

lurette scade_gui.3 Fri, 08 Dec 2006 11:05:05 +0100 by jahier

Parent-Version:      scade_gui.2
Version-Log:         empty
Project-Description: Lurette
parent 78921d81
......@@ -87,7 +87,7 @@
(install/pixmaps/quit.xpm 494 1137765987 n/18_quit.xpm 1.1)
(examples/luckyDraw/ocaml/draw-ex.ml 545 1137765987 l/8_draw-ex.ml 1.1)
(examples/xlurette/heater/buggy_heater_ctrl.lus 219 1137765987 m/10_buggy_heat 1.1)
(Makefile 471 1149601549 d/13_Makefile 1.7.1.1)
(Makefile 575 1165572305 d/13_Makefile 1.7.1.2)
(xlurette/Scade/Images/lurun.bmp 822 1122044801 i/22_lurun.bmp 1.1)
(examples/xlurette/heater/temp_float.luc 704 1137765987 m/9_temp_float 1.1)
(install/pixmaps/config-params.xpm 2753 1137765987 n/12_config-par 1.1)
......@@ -177,7 +177,7 @@
(examples/xlurette/tram/test11.rif0 5063 1138025047 o/8_test11.rif 1.1)
(examples/xlurette/tram/test11.rif 4763 1138025047 o/3_test11.rif 1.1)
(source/lurette.plot 684 1137765987 n/37_lurette.pl 1.1)
(utils/lucky.el 6657 1137765987 f/7_lucky.el 1.14)
(utils/lucky.el 14222 1165572305 f/7_lucky.el 1.15)
(test/test_losange.lus 88 1149601549 r/22_test_losan 1.1)
(source/constraint.ml 3343 1137765987 c/19_constraint 1.14)
(examples/xlurette/Scade-sparc/Makefile 552 1137765987 l/10_Makefile 1.1)
......@@ -417,7 +417,7 @@
(source/lutin_caml.mli 3222 1122044801 i/35_lutin_caml 1.1)
(examples/lucky/other/losange-3d.luc 570 1137765987 k/46_losange-3d 1.1)
(examples/lucky/other/test1.rif.exp 33449 1137765987 k/41_test1.rif. 1.1)
(polka/Makefile.config 2233 1156325499 e/20_Makefile.c 1.11)
(polka/Makefile.config 2428 1165572305 e/20_Makefile.c 1.12)
(examples/xlurette/Scade-sparc/exo1.vsw 400 1137765987 l/16_exo1.vsw 1.1)
(examples/xlurette/fault-tolerant-heater/degradable-sensors.luc 1382 1137765987 h/15_wearing-se 1.3)
(examples/lucky/external_code/Makefile 1169 1137765987 j/24_Makefile 1.2)
......
......@@ -3,21 +3,27 @@
# to run after a checkout in a fresh WS
source: gen_version
./lnsw
cd polka; make all ; make install; cd ..
cd GBDDML; make all; make cp; cd ..
cd source; make install; cd ..
cd polka; make clean; make all ; make install; cd ..
cd GBDDML; make clean; make all; make cp; cd ..
cd source; make clean; make install; cd ..
cd install; autoconf; cd ..
./RUN_ME
VERSION:=$(shell prcs info ./lurette.prj | tail -n 1 | awk '{printf "%s\n", $$2}')
VERSION:=$(shell prcs info --sort date ./lurette.prj | tail -n 1 | awk '{printf "%s\n", $$2}')
gen_version:
rm -f source/version.ml
echo "let str=\"$(VERSION)\"" > source/version.ml
ci:
prcs checkin lurette.prj
make gen_version
touch:
cd test && make touch
log:
prcs info -r scade_gui -l lurette.prj
prcs info -r unstable_1_43 -l lurette.prj
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "Lurette")
(Project-Version lurette scade_gui 2)
(Parent-Version lurette scade_gui 1)
(Version-Log "
lurette.prj
OcamlMakefile
source/Makefile.lurettetop
source/Makefile.show_luc
source/Makefile.lucky
source/Makefile.gen_stubs
source/Makefile
polka/caml/Makefile
polka/C/cherni.c
polka/Makefile.config
xlurette/Scade/Makefile
examples/rml/Makefile
source/Makefile.lutinlib
Je n'ai pas reussi à compiler le bouzin sur le nouveau portable, à
cause de camlidl. le README de camlidl dit qu'il faut mvc++ sous
win32, c'est bizzare parce que ca a eu marché (???).
Je sauvegarde donc l'état courant et je tente une compilation via mvc++.
")
(Project-Version lurette scade_gui 3)
(Parent-Version lurette scade_gui 2)
(Version-Log "")
(New-Version-Log ""
)
(Checkin-Time "Wed, 23 Aug 2006 11:31:39 +0200")
(Checkin-Time "Fri, 08 Dec 2006 11:05:05 +0100")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -141,13 +119,13 @@ Je sauvegarde donc l'
;; Make files
(utils/lucky.el (lurette/f/7_lucky.el 1.14 644))
(utils/lucky.el (lurette/f/7_lucky.el 1.15 644))
(install/config.guess (lurette/f/25_config.gue 1.1 755))
(install/configure.in (lurette/d/11_configure. 1.24.1.1 644))
(OcamlMakefile (lurette/17_OcamlMakef 1.54.1.1 644))
(install/Makefile.lurette.in (lurette/b/38_Makefile.l 1.38 644))
(user-rules (lurette/c/14_myrules 1.74.1.1 644))
(Makefile (lurette/d/13_Makefile 1.7.1.1 644))
(Makefile (lurette/d/13_Makefile 1.7.1.2 644))
(source/Makefile.lurettetop (lurette/d/14_Makefile.l 1.10 644))
(source/Makefile.gen_fake_lutin (lurette/d/17_Makefile.g 1.6 644))
......@@ -219,7 +197,7 @@ Je sauvegarde donc l'
(polka/documentation/polka.texi (lurette/e/17_polka.texi 1.2 600))
(polka/documentation/Makefile (lurette/e/18_Makefile 1.1 600))
(polka/README (lurette/e/19_README 1.1 600))
(polka/Makefile.config (lurette/e/20_Makefile.c 1.11 644))
(polka/Makefile.config (lurette/e/20_Makefile.c 1.12 644))
(polka/Makefile (lurette/e/21_Makefile 1.2 600))
(polka/Changes (lurette/e/22_Changes 1.2 600))
......
......@@ -9,20 +9,55 @@
#CAML_INSTALL = $(HOME)/$(HOSTTYPE)
#CAMLIDL_INSTALL = $(HOME)/$(HOSTTYPE)
#GMP_INSTALL=$(HOME)/$(HOSTTYPE)
#---------------------------------------
# Flags
#---------------------------------------
# Use ICFLAGS to specify machine-independent compilation flags.
ICFLAGS = -I$(GMP_PREFIX)/include -I.. \
-Wall -Wconversion -Winline -Wimplicit-function-declaration \
-O3 -g -DNDEBUG
## xds-O3 -g -DNDEBUG
# Use XCFLAGS to specify machine-dependent compilation flags.
XCFLAGS =
# For debugging purpose
CFLAGS_DEBUG = -O0 -g -UNDEBUG
CFLAGS_PROF = -g -pg
# For the OCAML interface
MLFLAGS =
MLOPTFLAGS = -inline 20
CAML_CFLAGS_DEBUG = -O0 -g -UNDEBUG
CAML_CFLAGS_PROF = -g -pg
#---------------------------------------
# Flags
#---------------------------------------
ifeq ($(HOST_TYPE),win32)
HOME="/cygdrive/c/Documents and Settings/erwan"
GMP_INSTALL="/cygdrive/c/Documents and Settings/erwan/scade_gui/win32"
CC = gcc -mno-cygwin -I"$(OCAMLLIB)"
#CC = gcc -mno-cygwin -I"$(OCAMLLIB)"
CC=cl
CFLAGS=/nologo /MT /Zi
ICFLAGS=
CFLAGS_DEBUG =
CFLAGS_PROF =
CPP=cl /nologo /E
else
ifeq ($(HOST_TYPE),sparc-sun)
CC = gcc -I /usr/local/soft/ocaml/3.08/lib/ocaml
GMP_INSTALL=$(HOME)/$(HOSTTYPE)
CPP=gcc -E
else
CC = gcc
GMP_INSTALL=$(HOME)/$(HOSTTYPE)
CPP=gcc -E
endif
endif
......@@ -59,7 +94,6 @@ CAMLIDL_PREFIX ="$(OCAMLLIB)"
INSTALL = install
INSTALLd = install -d
# C compiler and C preprocessor
CPP = gcc -E
# LATEX and others
LATEX = latex
......@@ -77,25 +111,3 @@ OCAMLMKTOP = ocamlmktop
CAMLIDL = camlidl
#---------------------------------------
# Flags
#---------------------------------------
# Use ICFLAGS to specify machine-independent compilation flags.
ICFLAGS = -I$(GMP_PREFIX)/include -I.. \
-Wall -Wconversion -Winline -Wimplicit-function-declaration \
-O3 -g -DNDEBUG
## xds-O3 -g -DNDEBUG
# Use XCFLAGS to specify machine-dependent compilation flags.
XCFLAGS =
# For debugging purpose
CFLAGS_DEBUG = -O0 -g -UNDEBUG
CFLAGS_PROF = -g -pg
# For the OCAML interface
MLFLAGS =
MLOPTFLAGS = -inline 20
CAML_CFLAGS_DEBUG = -O0 -g -UNDEBUG
CAML_CFLAGS_PROF = -g -pg
......@@ -7,7 +7,7 @@
; version of lucky-mode
(defconst lucky-mode-version "0.4")
(defconst lucky-mode-version "0.3")
(defvar lucky-mode-map nil
......@@ -16,30 +16,20 @@
;;; Font-lock -----------------------------------------------------
(setq comment-start "(*")
(setq comment-end "*)")
(defvar lucky-font-lock-keywords nil
"Regular expression used by Font-lock mode.")
(defvar lucky-comment-ind-level nil 3)
(setq lucky-font-lock-keywords
'(("--.*$\\|//.*$" . font-lock-comment-face)
("(\\*\\(.\\|\n\\)*?\\*)" . font-lock-comment-face)
("\\<\\(weight\\|max\\|min\\|default\\|alias\\|init\\|cond\\|max\\)\\>" . font-lock-type-face)
("\"\\(.\\|\n\\)*?\"" . font-lock-string-face)
("\\<\\(+\\|*\\|-\\|/\\|mod\\)\\>"
. font-lock-keyword-face)
("[][;,()|{}@^!:#*=<>&/%+~?---]\\.?\\|\\.\\." . font-lock-function-name-face)
("\\<\\(true\\|abs\\|and\\|or\\|if\\|then\\|else\\|pre\\|||\\|not\\|false\\|!\\)\\>" . font-lock-reference-face)
("\\<\\(bool\\|int\\|real\\|float\\)\\(\\^.+\\)?\\>" . font-lock-variable-name-face)
("\\<\\(define\\|include\\)\\(\\^.+\\)?\\>" 0 'font-lock-preprocessor-face nil)
("~\\<\\(weight\\|max\\|min\\|default\\|alias\\|init\\|cond\\)\\>" . font-lock-string-face)
("\\<\\(+\\|*\\|-\\|/\\|mod\\)\\>" . font-lock-keyword-face)
("[][;,()|{}@^!:#*=<>&/%+~?---]\\.?\\|\\.\\." . font-lock-function-name-face)
("\\<\\(true\\|abs\\|and\\|or\\|if\\|then\\|else\\|pre\\|||\\|not\\|false\\|!\\)\\>" . font-lock-reference-face)
("\\<\\(bool\\|int\\|real\\|float\\)\\(\\^.+\\)?\\>" . font-lock-variable-name-face)
("\\<\\(define\\|include\\)\\(\\^.+\\)?\\>" 0 'font-lock-preprocessor-face nil)
("\\(\\<\\(inputs\\|outputs\\|libraries\\|functions\\|typedef\\|start_state\\|nodes\\|start_node\\|states\\|locals\\|transitions\\|transient\\|final\\|stable\\|arcs_nb\\|nodes_nb\\|=\\)\\>\\|->\\)" .
font-lock-function-name-face)))
("\\(\\<\\(inputs\\|outputs\\|typedef\\|start_node\\|nodes\\|locals\\|transitions\\|transient\\|final\\|stable\\|arcs_nb\\|nodes_nb\\|=\\)\\>\\|->\\)" . font-lock-function-name-face)))
......@@ -77,6 +67,30 @@ font-lock-function-name-face)))
result))
(defun electric-lucky-special-char ()
"Insert a space after ',' or ':' ."
(interactive)
(insert last-command-char)
(insert " "))
(defun electric-lucky-end-of-line ()
"Insert a newline."
(interactive)
(newline))
(defun electric-lucky-tab ()
"Indent current line ."
(interactive)
(let ((mark (make-marker)))
(set-marker mark (point))
(beginning-of-line)
(lucky-indent (lucky-compute-indent))
(goto-char (marker-position mark))
(set-marker mark nil)
)
(if (looking-at "^")
(skip-chars-forward " \t")))
(defun lucky-get-beginning-of-line (&optional arg)
"Returns position of the first non-space char of the current line,
......@@ -163,7 +177,9 @@ font-lock-function-name-face)))
(beginning-of-line)
(skip-chars-forward " \t")
(and
(looking-at "\\<\\(inputs\\|outputs\\|locals\\|nodes\\|transitions\\)\\>")
(looking-at
"\\<\\(inputs\\|outputs\\|locals\\|nodes\\|transitions\\)\\>")
(not (lucky-in-comment)))))
......@@ -184,9 +200,9 @@ font-lock-function-name-face)))
(setq beg (point))
(end-of-line)
(while (and (not (looking-at "^")) continue)
(if (and (looking-at "\\*)") (not (lucky-in-comment)))
(if (and (looking-at ")") (not (lucky-in-comment)))
(setq count-parent (- count-parent 1))
(if (and (looking-at "(\\*") (not (lucky-in-comment)))
(if (and (looking-at "(") (not (lucky-in-comment)))
(progn
(setq count-parent (+ count-parent 1))
(if (= count-parent 1)
......@@ -209,7 +225,7 @@ font-lock-function-name-face)))
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-forward " ")
(skip-chars-forward " \t")
(looking-at "[]a-zA-Z0-9~^[()]+")
)
)
......@@ -222,6 +238,235 @@ font-lock-function-name-face)))
(looking-at "$")))
(defun lucky-compute-indent ()
"Returns indentation of current line."
(interactive)
(cond
; if line is comment
((lucky-line-is-comment) lucky-comment-ind-level)
; if line begins with node,include...
((lucky-find-noindent-reg) 0)
; if line begins with 'then' or 'else'
((lucky-find-then-else-beg) (lucky-indent-then-else-beg))
; if previous line ends with 'then' or 'else'
((lucky-find-then-else-end) (+ (lucky-indent-then-else-end) 2))
; looks for an unmatched parenthese
((lucky-find-unmatching-parent) (+ (lucky-find-unmatching-parent) 1))
; if line is a declaration
((lucky-line-is-decl) (lucky-indent-decl))
; if previous line ends with '->'
((lucky-find-arrow) (lucky-indent-arrow-equal-bool))
; if previous line ends with '='
((lucky-find-equal-end) (lucky-indent-arrow-equal-bool))
; if previous line ends with a boolean operator
((lucky-find-bool-expr-end) (lucky-indent-arrow-equal-bool))
; if line is a 'normal line'
((lucky-indent-normal) 2)
; line is empty
((lucky-empty-line) 2)
; else ...
(t 0)))
(defun lucky-find-arrow ()
"non-nil means previous line ends with '->' ."
(interactive)
(save-excursion
(lucky-skip-commentary-lines)
(lucky-skip-comments)
(skip-chars-backward " \t")
(forward-char -2)
(and (looking-at "->") (not (lucky-in-comment)))))
(defun lucky-indent-arrow-equal-bool ()
"Find the level of indentation when previous line ends with '->',
'='
or a boolean (or, xor, and)."
(interactive)
(save-excursion
(lucky-skip-commentary-lines)
(+ (lucky-get-beginning-of-line) 2)))
(defun lucky-find-bool-expr-end ()
"non-nil means last line ends with 'and', 'xor' or 'or'."
(interactive)
(let ((result nil))
(save-excursion
(lucky-skip-commentary-lines)
(lucky-skip-comments)
(skip-chars-backward " \t")
(forward-char -2)
(setq result (and (looking-at "\\<or\\>")
(not (lucky-in-comment))))
(forward-char -1)
(or (and (looking-at "\\<\\(and\\|not\\|xor\\)\\>")
(not (lucky-in-comment)))
result))))
(defun lucky-find-then-else-beg ()
"non-nil means current line begins with 'then' or 'else' ."
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(and (looking-at "\\<\\(else\\|then\\)\\>")
(not (lucky-in-comment)))))
(defun lucky-find-then-else-end ()
"non-nil means last line ends with 'then' or 'else'."
(interactive)
(save-excursion
(lucky-skip-commentary-lines)
(lucky-skip-comments)
(skip-chars-backward " \t")
(forward-char -4)
(and (looking-at "\\<\\(else\\|then\\)\\>")
(not (lucky-in-comment)))))
(defun lucky-find-equal-end ()
"non-nil means last line ends with '=' ."
(interactive)
(save-excursion
(lucky-skip-commentary-lines)
(lucky-skip-comments)
(skip-chars-backward " \t")
(forward-char -1)
(and (looking-at "=")
(not (lucky-in-comment)))))
(defun lucky-indent-then-else-beg ()
"Returns the level of indentation of a line beginning with
'then' or 'else'."
(interactive)
(let ((beg nil)
(result nil)
(count-expr 0)
(continue t))
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(if (and (looking-at "\\<then\\>") (not (lucky-in-comment)))
(while continue
(lucky-skip-commentary-lines)
(setq beg (point))
(lucky-skip-comments)
(skip-chars-forward " \t")
(if (and (looking-at "\\<node\\|function\\>")
(not (lucky-in-comment)))
(setq continue nil))
(end-of-line)
(while (and (not (looking-at "^")) continue)
(if (and (looking-at "\\<then\\>")
(not (lucky-in-comment)))
(setq count-expr (- count-expr 1))
(if (and (looking-at "\\<\\(if\\|with\\)\\>")
(not (lucky-in-comment)))
(progn
(setq count-expr (+ count-expr 1))
(if (and (= count-expr 1) continue)
(progn
(setq continue nil)
(setq result (- (point) beg)))))))
(forward-char -1)))
(if (looking-at "\\<else\\>")
(while continue
(lucky-skip-commentary-lines)
(setq beg (point))
(lucky-skip-comments)
(skip-chars-forward " \t")
(if (and (looking-at "\\<node\\|function\\>")
(not (lucky-in-comment)))
(setq continue nil))
(end-of-line)
(while (and (not (looking-at "^")) continue)
(if (and (looking-at "\\<else\\>")
(not (lucky-in-comment)))
(setq count-expr (- count-expr 1))
(if (and (looking-at "\\<\\(if\\|with\\)\\>")
(not (lucky-in-comment)))
(progn
(setq count-expr (+ count-expr 1))
(if (and (= count-expr 1) continue)
(progn
(setq continue nil)
(setq result (- (point) beg)))))))
(forward-char -1))))))
result))
(defun lucky-indent-then-else-end ()
"Returns the level of indentation of a line ending with 'then' or
'else'."
(interactive)
(let ((beg nil)
(result nil)
(count-expr 1)
(continue t))
(save-excursion
(lucky-skip-commentary-lines)
(lucky-skip-comments)
(skip-chars-backward " \t")
(forward-char -4)
(if (and (looking-at "\\<then\\>") (not (lucky-in-comment)))
(progn
(forward-line 1)
(while continue
(forward-line -1)
(setq beg (point))
(skip-chars-forward " \t")
(if (and (looking-at "\\<node\\|function\\>")
(not (lucky-in-comment)))
(setq continue nil))
(end-of-line)
(while (and (not (looking-at "^")) continue)
(if (and (looking-at "\\<then\\>")
(not (lucky-in-comment)))
(setq count-expr (- count-expr 1))
(if (and (looking-at "\\<\\(if\\|with\\)\\>")
(not (lucky-in-comment)))
(progn
(setq count-expr (+ count-expr 1))
(if (and (= count-expr 1) continue)
(progn
(setq continue nil)
(setq result (- (point) beg)))))))
(forward-char -1))))
(if (and (looking-at "\\<else\\>") (not (lucky-in-comment)))
(progn
(forward-line 1)
(while continue
(forward-line -1)
(setq beg (point))
(skip-chars-forward " \t")
(if (and (looking-at "\\<node\\|function\\>")
(not (lucky-in-comment)))
(setq continue nil))
(end-of-line)
(while (and (not (looking-at "^")) continue)
(if (and (looking-at "\\<else\\>")
(not (lucky-in-comment)))
(setq count-expr (- count-expr 1))
(if (and (looking-at "\\<\\(if\\|with\\)\\>")
(not (lucky-in-comment)))
(progn
(setq count-expr (+ count-expr 1))
(if (and (= count-expr 1) continue)
(progn
(setq continue nil)
(setq result (- (point) beg)))))))
(forward-char -1)))))))
result))
;;; Major-mode
(add-to-list 'auto-mode-alist '("\\.luc$" . lucky-mode))
......@@ -236,10 +481,13 @@ font-lock-function-name-face)))
(setq mode-name "Lucky")
(use-local-map lucky-mode-map)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'electric-lustre-tab)
(run-hooks 'lucky-mode-hook)
)
(setq comment-start "(*")
(setq comment-end "*)")
(provide 'lucky)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment