Commit cedfd53a authored by Erwan Jahier's avatar Erwan Jahier

mv utils/simec_trap, utils/read-rif.sh, etc., into rdbg where it makes more sense.

parent 8d69d9ed
Pipeline #17392 failed with stages
in 4 minutes and 2 seconds
......@@ -97,10 +97,10 @@ x:
echo $(OPAM_FILE_TEST)
i:
opam-installer Lutin.install --prefix=$(OPAM_DIR)
opam-installer lutin.install --prefix=$(OPAM_DIR)
opam : $(WWW)/pool/$(PACKNAME).tgz
cd $(WWW)/opam-repository/packages && \
cd $(WWW)/opam-repository/packages/lutin && \
oasis2opam $(HTTP)/pool/$(PACKNAME).tgz && \
cp ~/lurette/opam $(OPAM_FILE) && \
cd .. ; opam-admin check && opam-admin make -g && \
......
OASISFormat: 0.4
Name: Lutin
Version: 2.63
Name: lutin
Version: 2.64
Authors: Erwan Jahier, Pascal Raymond, Bertrand Jeannnet (polka), Yvan Roux
Maintainers: erwan.jahier@univ-grenoble-alpes.fr
License: CeCILL
......@@ -14,7 +14,6 @@ Description:
automated testing of reactive systems with Lurette.
BuildTools: ocamlbuild
PreBuildCommand: make lutin/src/version.ml
PostInstallCommand: cp utils/simec_trap $exec_prefix/bin; cp utils/read-rif.sh $exec_prefix/bin
SourceRepository "master"
Type: git
......
......@@ -4,10 +4,6 @@ etc: [
"setup.log"
]
bin: [
"utils/simec_trap"
"utils/read-rif.sh"
]
doc: [
"doc/lutin-man/lutin-man.pdf"
......
let str="2.63"
let sha="104415c4"
let str="2.64"
let sha="8d69d9ed"
#!/bin/sh
saofdm=$1
dir=`dirname $saofdm`
l_fic=/tmp/l.$$
sed -n -e "/^MODEL.*$/,/^LIBRARY.*$/ p" $saofdm \
| sed -n -e "/^MODEL.*$/,/^NOTES_TYPE.*$/ p" \
| sed -n -e "/^MODEL.*$/,/^DIAG_SEM.*$/ p" \
| sed -n -e "/^MODEL.*$/,/^DIAG_MET.*$/ p" \
| egrep -v "(^$|^MODEL|^LIBRARY|^NOTES_TYPE|^DIAG_SEM|^DIAG_MET)" > $l_fic.s
for saofd in `cat $l_fic.s`
do
sed -n -e "s/^node *\([^ (]*\) *(.*/\1/p" $dir/$saofd.saofd
done
;;; lucky.el - Major mode for lucky files in Emacs
;;
;; Very very basic: provides only colors for keywords
(require 'font-lock)
; version of lucky-mode
(defconst lucky-mode-version "0.4")
(defvar lucky-mode-map nil
"Keymap for lucky major mode.")
;;; 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)
("\\(\\<\\(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)))
(defun lucky-font-mode ()
"Initialisation of font-lock for Lucky mode."
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
'(lucky-font-lock-keywords t)))
; font-lock isn't used if in a console
(if window-system
(prog2
(add-hook 'lucky-mode-hook
'turn-on-font-lock)
(add-hook 'lucky-mode-hook
'lucky-font-mode)))
;;; indentation code ----------------------------------------------
;; copy-pasted from lustre.el;
;; It does not work as i would like, but better than nothing...
(defun lucky-indent-decl ()
"Returns the indentation of a declaration line. "
(interactive)
(let ((result 2))
(save-excursion
(if (re-search-backward "^\\<\\(cond\\|outputs\\|locals\\|nodes\\|start_node\\|transitions\\)\\>" 0 t)
(cond
((looking-at "^\\<cond\\>") (setq result 4))
((looking-at "^\\<~\\>") (setq result 6))))
)
result))
(defun lucky-get-beginning-of-line (&optional arg)
"Returns position of the first non-space char of the current line,
or line (arg - 1) if optional argument is given."
(interactive)
(save-excursion
(beginning-of-line arg)
(let ((deb (point)))
(skip-chars-forward " \t")
(let ((fin (point)))
(- fin deb)))))
(defun lucky-get-point-of-line ()
"Returns position of the first char of the current line."
(interactive)
(save-excursion
(beginning-of-line)
(point)))
(defun lucky-skip-comments ()
"set point before the commentary of the current line (if any)."
(interactive)
(beginning-of-line)
(while (not (or (looking-at "$")
(looking-at "--")))
(forward-char 1)))
(defun lucky-line-is-comment (&optional arg)
"non-nil means line is only a commentary."
(interactive)
(save-excursion
(beginning-of-line arg)
(skip-chars-forward " \t")
(looking-at "--")))
(defun lucky-line-is-decl ()
"non-nil means current line is a declaration. "
(interactive)
(save-excursion
(let ((res nil)
(continue t))
(while continue
(if (= (point) 1)
(setq continue nil))
(re-search-backward
"\\<\\(inputs\\|outputs\\|locals\\|nodes\\|start_node\\|transitions\\)\\>" 1 t)
(if (not (lucky-line-is-comment))
(setq continue nil)))
(if (looking-at "\\<\\(~init\\).+\\>")
(setq res t))
res)))
(defun lucky-in-comment ()
"non-nil means point is inside a comment."
(interactive)
(save-excursion
(re-search-backward "--" (lucky-get-point-of-line) t)))
(defun lucky-skip-commentary-lines ()
"set point to the beginnig of the first non-commemtary line before
the current line."
(interactive)
(forward-line -1)
(while (and (lucky-line-is-comment) (> (point) 1))
(forward-line -1)))
(defun lucky-indent (niveau)
"Indents current line ."
(interactive "p")
(beginning-of-line)
(delete-char (lucky-get-beginning-of-line))
(let ((ind niveau))
(while (> ind 0)
(insert " ")
(setq ind (- ind 1)))))
(defun lucky-find-noindent-reg ()
"non-nil means current line begins with:
inputs, outputs, locals, nodes, start_node, transitions."
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(and
(looking-at "\\<\\(inputs\\|outputs\\|locals\\|nodes\\|transitions\\)\\>")
(not (lucky-in-comment)))))
(defun lucky-find-unmatching-parent ()
"Looks for an unmatched parenthese, and returns its position.
(or nil if there isn't any). "
(interactive)
(let ((continue t)
(result nil)
(beg nil)
(count-parent 0))
(save-excursion
(beginning-of-line)
(if (= (point) 1)
(setq continue nil))
(while continue
(forward-line -1)
(setq beg (point))
(end-of-line)
(while (and (not (looking-at "^")) continue)
(if (and (looking-at "\\*)") (not (lucky-in-comment)))
(setq count-parent (- count-parent 1))
(if (and (looking-at "(\\*") (not (lucky-in-comment)))
(progn
(setq count-parent (+ count-parent 1))
(if (= count-parent 1)
(progn
(setq result (- (point) beg))
(setq continue nil))))))
(forward-char -1))
(skip-chars-forward " \t")
(if (and (looking-at "\\<const\\|var\\|type\\|node\\|function\\>")
(not (lucky-in-comment)))
(setq continue nil))
(beginning-of-line)
(if (= (point) 1)
(setq continue nil))))
result))
(defun lucky-indent-normal ()
"non-nil means indent normally."
(interactive)
(save-excursion
(beginning-of-line)
(skip-chars-forward " ")
(looking-at "[]a-zA-Z0-9~^[()]+")
)
)
(defun lucky-empty-line ()
"non-nil means line is empty."
(interactive)
(save-excursion
(skip-chars-forward " \t")
(looking-at "$")))
;;; Major-mode
(add-to-list 'auto-mode-alist '("\\.luc$" . lucky-mode))
(defun lucky-mode ()
" emacs mode for lucky programs "
(interactive)
(kill-all-local-variables)
(setq major-mode 'lucky-mode)
(setq mode-name "Lucky")
(use-local-map lucky-mode-map)
(make-local-variable 'indent-line-function)
(run-hooks 'lucky-mode-hook)
)
(provide 'lucky)
;;; lucky.el ends here...
" Vim syntax file
" Language: lucky
" Maintainer: Nicolas FRANCOIS
" Last Change: 2004 Jul 12
" For version 5.X: Clear all syntax items
" For version 6.x: quit when a syntax file was already loaded
if version < 600
syn clear
elseif exists("b:current_syntax")
finish
endif
syn match luckyFlag "\~\(min\|max\|default\|alias\|init\)\>"
syn match luckyTransFlag "\~\(weight\|cond\)\>"
syn match luckyTransition "->"
syn keyword luckyStructure typedef inputs outputs locals
syn keyword luckyStructure nodes start_node transitions
syn keyword luckyNodeMode transient stable final
syn keyword luckyOperator not and or nor xor mod div abs pre
syn keyword luckyType bool int float real
syn keyword luckyBoolean true false
syn keyword luckyInt infinity
syn match luckyInt "\<-\=\d\+\>"
syn match luckyFloat "\<-\=\d\+\.\d*\([eE][-+]\=\d\+\)\=\>"
syn keyword luckyConditional if else then
syn keyword luckyTodo contained TODO NOTE
syn region Comment start="/\*" end="\*/" contains=luckyTodo
syn match luckyComment "//.*$" contains=luckyTodo
syn match luckyComment "--.*$" contains=luckyTodo
if !exists("did_lucky_syntax_inits")
let did_lucky_syntax_inits = 1
" The default methods for highlighting. Can be overridden later
hi link luckyFlag Special
hi link luckyTransition Delimiter
hi link luckyTransFlag Special
hi link luckyOperator Operator
hi link luckyConditional Conditional
hi link luckyNodeMode Special
hi link luckyBoolean Boolean
hi link luckyInt Number
hi link luckyFloat Float
hi link luckyStructure Structure
hi link luckyType Type
hi link luckyComment Comment
hi link luckyTodo Todo
endif
let b:current_syntax = "lucky"
#!/bin/sh
#
# a little sed script that transforms lucky-like comments into C-like ones
# before calling cpp
#
FILE=$1
OUT=$2
shift
shift
OPTIONS=$@
sed -e 's/--/\/\//g' -e 's/(\*/\/\*/g' -e 's/\*)/\*\//g' $FILE | cpp $OPTIONS | sed -e 's/# /-- #line /g' -e 's/\/\//--/g' > $OUT
sed -e 's/--/\/\//g' -e 's/(\*/\/\*/g' -e 's/\*)/\*\//g' %1 | cpp | sed -e 's/# /-- #line /g' -e 's/\/\//--/g' > %2
#!/bin/sh
#
# a little sed script to generate color latex version of lucky files
#
FILE=$1
sed -e 's/type /\\kwd{type} /g' $FILE \
| sed -e 's/{/\\{/g' \
| sed -e 's/}/\\}/g' \
| sed -e 's/--\(.*\)$/\\commentaire{--\1}/g' \
| sed -e 's/inputs/\\kwd{inputs}/' \
| sed -e 's/outputs/\\kwd{outputs}/' \
| sed -e 's/typedef/\\kwd{typedef}/' \
| sed -e 's/start_node/\\kwd{start_node}/' \
| sed -e 's/locals/\\kwd{locals}/g' \
| sed -e 's/transitions/\\kwd{transitions}/' \
| sed -e 's/transient/\\kwddd{transient}/g' \
| sed -e 's/stable/\\kwddd{stable}/g' \
| sed -e 's/final/\\kwddd{final}/g' \
| sed -e 's/arcs_nb/\\kwd{arcs_nb}/' \
| sed -e 's/nodes_nb/\\kwd{nodes_nb}/' \
| sed -e 's/nodes/\\kwd{nodes}/' \
| sed -e 's/true/\\kwdd{true}/g' \
| sed -e 's/ or / \\kwdd{or} /g' \
| sed -e 's/ abs / \\kwdd{abs} /g' \
| sed -e 's/ if / \\kwdd{if} /g' \
| sed -e 's/bool/\\kwdd{bool}/g' \
| sed -e 's/float/\\kwdd{float}/g' \
| sed -e 's/int/\\kwdd{int}/g' \
| sed -e 's/then / \\kwdd{then} /g' \
| sed -e 's/ else / \\kwdd{else} /g' \
| sed -e 's/ pre / \\kwdd{pre} /g' \
| sed -e 's/ and / \\kwdd{and} /g' \
| sed -e 's/ not / \\kwdd{not} /g' \
| sed -e 's/ false /\\kwdd{false}/g' \
| sed -e 's/~weight/\\kwddd{~weight}/g' \
| sed -e 's/~max/\\kwddd{~max}/g' \
| sed -e 's/~min/\\kwddd{~min}/g' \
| sed -e 's/~default/\\kwddd{~default}/g' \
| sed -e 's/~alias/\\kwddd{~alias}/g' \
| sed -e 's/~init/\\kwddd{~init}/g' \
| sed -e 's/~cond/\\kwddd{~cond}/g' \
> $FILE.tex
This diff is collapsed.
;;; lutin.el - Major mode for editing lustre source in Emacs
(require 'font-lock)
; version of lutin-mode
(defconst lutin-mode-version "0.0")
;;; Hooks
(defvar lutin-mode-hook nil
"functions called when entering Lutin Mode.")
;;; Key-map for Lutin-mode
(defvar lutin-mode-map nil
"Keymap for lutin major mode.")
;;; Font-lock -----------------------------------------------------
(defvar lutin-font-lock-keywords nil
"Regular expression used by Font-lock mode.")
(setq lutin-font-lock-keywords
'(
("--.*$" . font-lock-comment-face)
("\\<\\(loop\\|fby\\||raise\\|try\\|trap\\|catch\\|do\\)\\>" . font-lock-builtin-face)
("\\<\\(const\\|extern\\|node\\|run\\|include\\|returns\\|type\\)\\>" . font-lock-keyword-face)
("\\<\\(let\\|assert\\|exist\\|in\\|if\\|then\\|else\\)\\>" . font-lock-keyword-face)
("\\<\\(true\\|and\\|or\\|not\\|false\\)\\>" . font-lock-reference-face)
("\\<\\(trace\\|bool\\|int\\|ref\\|real\\)\\(\\^.+\\)?\\>" . font-lock-type-face)
("\\<\\(pre\\)\\>" . font-lock-constant-face)
))
(defun lutin-font-mode ()
"Initialisation of font-lock for Lutin mode."
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
'(lutin-font-lock-keywords t)))
; font-lock isn't used if in a console
(if window-system
(prog2
(add-hook 'lutin-mode-hook
'turn-on-font-lock)
(add-hook 'lutin-mode-hook
'lutin-font-mode)))
(defun lutin-line-is-comment (&optional arg)
"non-nil means line is only a commentary."
(interactive)
(save-excursion
(beginning-of-line arg)
(skip-chars-forward " \t")
(looking-at "--")))
(setq comment-start "(*")
(setq comment-end "*)")
(setq comment-start "-- ")
(setq comment-end "")
;;; Major-mode
(defun lutin-mode ()
"Major mode for editing Lutin files.
Only keywords colaraition for the moment...
"
(interactive)
(kill-all-local-variables)
(setq major-mode 'lutin-mode)
(setq mode-name "Lutin")
(use-local-map lutin-mode-map)
(run-hooks 'lutin-mode-hook))
(provide 'lutin)
;;; lutin .el ends here...
#!/bin/sh
#
# to generate colored latex version of lutin files
FILE=$1
sed -e 's/type /\\kwd{type} /g' $FILE \
| sed -e 's/{/\\{/g' \
| sed -e 's/}/\\}/g' \
| sed -e 's/--\(.*\)$/\\commentaire{--\1}/g' \
| sed -e 's/\"\(.*\)"/\\commentaire{\"\1\"}/g' \
| sed -e 's/loop/\\kwd{loop}/g' \
| sed -e 's/ \:=/\\kwd{ \:=}/g' \
| sed -e 's/ fby/\\kwd{ fby}/g' \
| sed -e 's/\&\>/\\kwd{\&\>}/g' \
| sed -e 's/try /\\kwd{try }/g' \
| sed -e 's/trap /\\kwd{trap }/g' \
| sed -e 's/catch /\\kwd{catch }/g' \
| sed -e 's/do /\\kwd{do }/g' \
| sed -e 's/const/\\kwd{const}/g' \
| sed -e 's/extern/\\kwd{extern}/g' \
| sed -e 's/node/\\kwd{node}/g' \
| sed -e 's/run /\\kwd{run }/g' \
| sed -e 's/include/\\kwd{include}/g' \
| sed -e 's/returns/\\kwd{returns}/g' \
| sed -e 's/type /\\kwd{type }/g' \
| sed -e 's/let /\\kwd{let }/g' \
| sed -e 's/assert /\\kwd{assert }/g' \
| sed -e 's/exist /\\kwd{exist }/g' \
| sed -e 's/ in/\\kwd{ in}/g' \
| sed -e 's/if /\\kwd{if }/g' \
| sed -e 's/then/\\kwd{then}/g' \
| sed -e 's/else/\\kwd{else}/g' \
| sed -e 's/ or / \\kwddd{ or} /g' \
| sed -e 's/ if / \\kwddd{ if } /g' \
| sed -e 's/trace/\\kwddd{trace}/g' \
| sed -e 's/bool/\\kwddd{bool}/g' \
| sed -e 's/real/\\kwddd{real}/g' \
| sed -e 's/int/\\kwddd{int}/g' \
| sed -e 's/then / \\kwddd{then } /g' \
| sed -e 's/ else/ \\kwddd{ else} /g' \
| sed -e 's/ pre/ \\kwddd{ pre} /g' \
| sed -e 's/ and/ \\kwddd{ and} /g' \
| sed -e 's/ not/ \\kwddd{ not} /g' \
| sed -e 's/ true/\\kwddd{ true}/g' \
| sed -e 's/ false/\\kwddd{ false}/g' \
> $FILE.tex
#!/bin/sh
#
# pre-process rif files for gnuplot-rif
riffile=$1
cat $riffile | \
grep -e '#outs' -e '#step' | \
sed -e 's/True[ \t$]/1 /g' -e 's/true[ \t$]/1 /g' -e 's/t[ \t$]/1 /g' -e 's/T[ \t$]/1 /g' | \
sed -e 's/[ \t]True/ 1 /g' -e 's/[ \t]true/ 1/g' -e 's/[ \t]t/ 1/g' -e 's/[ \t]T/ 1/g' | \
sed -e 's/False[ \t$]/0 /g' -e 's/false[ \t$]/0 /g' -e 's/f[ \t$]/0 /g' -e 's/F[ \t$]/0 /g' | \
sed -e 's/[ \t]False/ 0/g' -e 's/[ \t]false/ 0/g' -e 's/[ \t]f/ 0/g' -e 's/[ \t]F/ 0/g' | \
sed -e 'N; s/#step \([0-9]*\)\(.*\)\(^.*\)#outs \(.*\)/\1 \3 \4/g'
# sed -e 'N; s/#step \([0-9]*\)\([^0-9\-]*\)\(.*\)#outs \(.*\)/\1 \3 \4/g'
;;; rif.el - Major mode for rif files in Emacs
;;
;; Very very basic: provides only colors for keywords
;;;; to put in your .emacs:
; (autoload 'rif-mode
; "rif" "Major mode for editing rif file." t)
(require 'font-lock)
; version of rif-mode
(defconst rif-mode-version "0.3")
(defvar rif-mode-map nil
"Keymap for rif major mode.")
;;; Font-lock -----------------------------------------------------
(defvar rif-font-lock-keywords nil
"Regular expression used by Font-lock mode.")
(setq rif-font-lock-keywords
'(("--.*$" . font-lock-comment-face)
("\\<\\(inputs\\|step\\|locs\\|outs\\|inputs\\|outputs\\)\\>" . font-lock-string-face)
("[][#]\\.?\\|\\.\\." . font-lock-function-name-face)
("\\<\\(true\\|T\\|F\\|f\\|t\\|false\\)\\>" . font-lock-reference-face)
("\\<\\(bool\\|int\\|real\\|float\\)\\(\\^.+\\)?\\>" . font-lock-variable-name-face)
("\\(\\<\\(xxx\\|yyy\\)\\>\\|->\\)" .
font-lock-function-name-face)))
(defun rif-font-mode ()
"Initialisation of font-lock for Rif mode."
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
'(rif-font-lock-keywords t)))
; font-lock isn't used if in a console
(if window-system
(prog2
(add-hook 'rif-mode-hook
'turn-on-font-lock)
(add-hook 'rif-mode-hook
'rif-font-mode)))
;;; Major-mode
(add-to-list 'auto-mode-alist '("\\.rif$" . rif-mode))
(defun rif-mode ()
" emacs mode for rif programs "
(interactive)
(kill-all-local-variables)
(setq major-mode 'rif-mode)
(setq mode-name "Rif")
(use-local-map rif-mode-map)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'electric-lustre-tab)
(run-hooks 'rif-mode-hook)
)
(setq comment-start "#")
(provide 'rif)
;;; rif .el ends here...
#!/bin/sh
# Call simec and kills its calling process (second arguments) on termination
dro_file=$1
ppid=$2
cleanup() {
# Luciole (simec) terminates; we inform its caller
echo "#quit\n"
# kill -9 $ppid
}
trap "cleanup" 0 1 2 3 6 9 15
simec $dro_file
#!/bin/sh
# Call simec and sends '#quit' on termination
dro_file=$1
ppid=$2
trap 'printf "#quit\n"; exit 4 ' 0 1 2 3 9 15
exec 'simec $dro_file || printf "#quit\n"'
echo "simec_trap2: bye."
\ No newline at end of file
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