├── jar └── js.jar ├── emulisp ├── pil-rjs.bat ├── pil-njs.bat ├── pil-njs ├── pil-rjs ├── emulisp_js.js └── int.js ├── ersatz ├── picolisp.jar ├── pil-j ├── pil-j.bat ├── COPYING └── README ├── start_processing.sh ├── web ├── blockly │ └── media │ │ ├── 1x1.gif │ │ ├── click.mp3 │ │ ├── click.ogg │ │ ├── click.wav │ │ ├── delete.mp3 │ │ ├── delete.ogg │ │ ├── delete.wav │ │ ├── handopen.cur │ │ ├── quote0.png │ │ ├── quote1.png │ │ ├── sprites.png │ │ └── handclosed.cur ├── css-ninja-tree │ ├── document.png │ ├── toggle-small.png │ ├── folder-horizontal.png │ ├── toggle-small-expand.png │ └── css-ninja-tree.css ├── jquery.textcomplete.css ├── showup.js ├── parenedit.css ├── jquery.terminal.css ├── showup.css ├── parenedit.js ├── style.css ├── tabIndent.js └── showdown.js ├── exemples ├── test_demander.malg ├── test_read.l ├── test_demander3.malg ├── test_demander2.malg ├── test_echappements.malg ├── test_listes.malg ├── test_logique.malg ├── test_tortue.malg ├── test_accents.malg ├── test_sequence_nb_pseudo_aleat.malg ├── test_tests.malg ├── test_algues.malg └── test_millisecondes.malg ├── microalg_tests_ersatz.bat ├── microalg_tests_nodejs_emulisp.bat ├── microalg_tests_rhino_emulisp.bat ├── microalg_tests_ersatz.sh ├── .gitignore ├── microalg_tests_rhino_emulisp.sh ├── editeurs └── scite │ ├── malg-j-scite.bat │ ├── malg-clj-scite.bat │ ├── malg-njs-scite.bat │ ├── malg-rjs-scite.bat │ ├── malg_abbrev.properties │ ├── SciTEGlobal.properties │ ├── malg.api │ └── microalg.lua ├── microalg_tests_nodejs_emulisp.sh ├── install_scripts ├── fix_lettuce.sh └── install_picolisp.sh ├── microalg_tests_features.sh ├── start_processing.bat ├── malg-clj.bat ├── microalg_tests_picolisp.sh ├── malg-j-repl.bat ├── .travis.yml ├── malg-rjs-repl.bat ├── malg-j.bat ├── malg-njs-repl.bat ├── .gitattributes ├── malg-rjs.bat ├── malg-njs.bat ├── microalg_tests.sh ├── malg ├── malg-j ├── malg-njs ├── malg-rjs ├── lib └── xml.l ├── microalg_export_arbreninja.l ├── microalg_export_arbresvg.l ├── microalg_export_arbretxt.l ├── dev ├── nouvelle_commande.txt ├── diff.microalg.info.sh └── version_suivante.txt ├── features ├── invocations.feature ├── interactions.feature ├── hello.feature └── cli.py ├── visuels ├── logo_microalg.malg ├── archi.svg └── archi.malg ├── microalg_export.l ├── faq.html ├── pde └── microalg │ └── microalg.pde ├── microalg_export_javascript.l ├── microalg_export_ti.l ├── microalg_export_python.l ├── microalg_export_casio.l ├── microalg_export_microalg.l ├── microalg_export_processing.l ├── ide.html └── README.md /jar/js.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/jar/js.jar -------------------------------------------------------------------------------- /emulisp/pil-rjs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Emulisp 3 | java -jar %~dp0\..\jar\js.jar %~dp0\pil-rjs -------------------------------------------------------------------------------- /ersatz/picolisp.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/ersatz/picolisp.jar -------------------------------------------------------------------------------- /start_processing.sh: -------------------------------------------------------------------------------- 1 | processing-java --run --force --sketch=pde/microalg --output=pde/microalg.out 2 | -------------------------------------------------------------------------------- /web/blockly/media/1x1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/1x1.gif -------------------------------------------------------------------------------- /exemples/test_demander.malg: -------------------------------------------------------------------------------- 1 | (Afficher "Votre nom ?") 2 | (Afficher (Concatener "Salut " (Demander))) 3 | -------------------------------------------------------------------------------- /microalg_tests_ersatz.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo "Testing with Ersatz..." 3 | malg-j.bat microalg_tests.malg 4 | -------------------------------------------------------------------------------- /web/blockly/media/click.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/click.mp3 -------------------------------------------------------------------------------- /web/blockly/media/click.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/click.ogg -------------------------------------------------------------------------------- /web/blockly/media/click.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/click.wav -------------------------------------------------------------------------------- /exemples/test_read.l: -------------------------------------------------------------------------------- 1 | (println "Votre nom ?") 2 | (println (pack "Salut " (in NIL (read " !")))) 3 | (bye) 4 | -------------------------------------------------------------------------------- /web/blockly/media/delete.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/delete.mp3 -------------------------------------------------------------------------------- /web/blockly/media/delete.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/delete.ogg -------------------------------------------------------------------------------- /web/blockly/media/delete.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/delete.wav -------------------------------------------------------------------------------- /web/blockly/media/handopen.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/handopen.cur -------------------------------------------------------------------------------- /web/blockly/media/quote0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/quote0.png -------------------------------------------------------------------------------- /web/blockly/media/quote1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/quote1.png -------------------------------------------------------------------------------- /web/blockly/media/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/sprites.png -------------------------------------------------------------------------------- /exemples/test_demander3.malg: -------------------------------------------------------------------------------- 1 | (Afficher "Un nombre ?") 2 | (Demander_un_nombre) 3 | (Afficher (+ nombre_demandé 1)) 4 | -------------------------------------------------------------------------------- /web/blockly/media/handclosed.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/blockly/media/handclosed.cur -------------------------------------------------------------------------------- /web/css-ninja-tree/document.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/css-ninja-tree/document.png -------------------------------------------------------------------------------- /exemples/test_demander2.malg: -------------------------------------------------------------------------------- 1 | (Afficher "Votre nom ?") 2 | (Demander) 3 | (Afficher (Concatener "Salut " texte_demandé)) 4 | -------------------------------------------------------------------------------- /web/css-ninja-tree/toggle-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/css-ninja-tree/toggle-small.png -------------------------------------------------------------------------------- /microalg_tests_nodejs_emulisp.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo "Testing with NodeJS + EmuLisp..." 3 | malg-njs.bat microalg_tests.malg 4 | -------------------------------------------------------------------------------- /microalg_tests_rhino_emulisp.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo "Testing with NodeJS + EmuLisp..." 3 | malg-rjs.bat microalg_tests.malg 4 | -------------------------------------------------------------------------------- /web/css-ninja-tree/folder-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/css-ninja-tree/folder-horizontal.png -------------------------------------------------------------------------------- /web/css-ninja-tree/toggle-small-expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Microalg/microalg/HEAD/web/css-ninja-tree/toggle-small-expand.png -------------------------------------------------------------------------------- /microalg_tests_ersatz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PATH=$PATH:`pwd`/ersatz 4 | echo "Testing with Ersatz..." 5 | ./malg-j microalg_tests.malg 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.pyc 3 | /editeurs/scite/*.exe 4 | /pde/microalg.out 5 | /picolisp/ 6 | /visuels/logo_microalg.svg 7 | /visuels/archi.svg 8 | -------------------------------------------------------------------------------- /exemples/test_echappements.malg: -------------------------------------------------------------------------------- 1 | (Afficher "Il a dit :^J\"Bonjour\" \^\^") 2 | (Afficher "") 3 | (Afficher "Ah bon ? Il a dit : 4 | \"Bonjour\" ? :\\") -------------------------------------------------------------------------------- /ersatz/pil-j: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 29nov10abu 3 | 4 | # Run Ersatz PicoLisp 5 | exec java -DPID=$$ -cp .:tmp:${0%/*}/picolisp.jar PicoLisp ${0%/*}/lib.l "$@" 6 | -------------------------------------------------------------------------------- /microalg_tests_rhino_emulisp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PATH=$PATH:`pwd`/emulisp 4 | echo "Testing with Rhino + Emulisp..." 5 | ./malg-rjs microalg_tests.malg 6 | 7 | -------------------------------------------------------------------------------- /editeurs/scite/malg-j-scite.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET NO_PAUSE=SVP 3 | SET SCITE_DIR=%~dp0 4 | SET MICROALG_DIR=%SCITE_DIR%..\.. 5 | %MICROALG_DIR%\malg-j.bat "%1" 6 | -------------------------------------------------------------------------------- /microalg_tests_nodejs_emulisp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PATH=$PATH:`pwd`/emulisp 4 | echo "Testing with NodeJS + Emulisp..." 5 | ./malg-njs microalg_tests.malg 6 | 7 | -------------------------------------------------------------------------------- /editeurs/scite/malg-clj-scite.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET NO_PAUSE=SVP 3 | SET SCITE_DIR=%~dp0 4 | SET MICROALG_DIR=%SCITE_DIR%..\.. 5 | %MICROALG_DIR%\malg-clj.bat "%1" 6 | -------------------------------------------------------------------------------- /editeurs/scite/malg-njs-scite.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET NO_PAUSE=SVP 3 | SET SCITE_DIR=%~dp0 4 | SET MICROALG_DIR=%SCITE_DIR%..\.. 5 | %MICROALG_DIR%\malg-njs.bat "%1" 6 | -------------------------------------------------------------------------------- /editeurs/scite/malg-rjs-scite.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET NO_PAUSE=SVP 3 | SET SCITE_DIR=%~dp0 4 | SET MICROALG_DIR=%SCITE_DIR%..\.. 5 | %MICROALG_DIR%\malg-rjs.bat "%1" 6 | -------------------------------------------------------------------------------- /install_scripts/fix_lettuce.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sed -i -e 's/self.wrt(str(reason.step))/self.wrt(unicode(reason.step))/' /usr/local/lib/python2.7/dist-packages/lettuce/plugins/reporter.py 3 | -------------------------------------------------------------------------------- /microalg_tests_features.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -z `which lettuce` ] 3 | then 4 | pip install lettuce 5 | fi 6 | 7 | PATH=$PATH:`pwd`:`pwd`/picolisp:`pwd`/ersatz:`pwd`/emulisp 8 | lettuce --verbosity=2 9 | -------------------------------------------------------------------------------- /start_processing.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET MICROALG_DIR=%~dp0 3 | %MICROALG_DIR%\processing\processing-java.exe --run --force --sketch=%MICROALG_DIR%\pde\microalg --output=%MICROALG_DIR%\pde\microalg.out 4 | exit -------------------------------------------------------------------------------- /exemples/test_listes.malg: -------------------------------------------------------------------------------- 1 | (Exemples_de Retirer_de 2 | (Liste 3 | (? (Liste 1 2)) 2 4 | (? (Liste 1 2 3)) 3 5 | ) 6 | ) 7 | (Tester Retirer_de) 8 | (!!! "Ajouter_a est intestable car ne retourne rien.") 9 | -------------------------------------------------------------------------------- /emulisp/pil-njs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set NODE_PATH=%USERPROFILE%\AppData\Roaming\npm\node_modules;"%NODE_PATH%" 3 | echo Emulisp 4 | node %~dp0\pil-njs %1 %2 %3 %4 %5 %6 5 | pause>nul|set/p="Une touche pour quitter."&echo( 6 | -------------------------------------------------------------------------------- /malg-clj.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo MicroAlg-clj (Clojure) 3 | echo. 4 | SET MICROALG_DIR=%~dp0 5 | java -jar %MICROALG_DIR%/jar\microalg-clj.jar %1 6 | IF NOT DEFINED NO_PAUSE pause>nul|set/p="Une touche pour quitter."&echo( 7 | -------------------------------------------------------------------------------- /microalg_tests_picolisp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -n "${TRAVIS+x}" ] 4 | then 5 | ./install_scripts/install_picolisp.sh 6 | fi 7 | PATH=$PATH:`pwd`/picolisp 8 | echo "Testing with PicoLisp..." 9 | ./malg microalg_tests.malg 10 | 11 | -------------------------------------------------------------------------------- /malg-j-repl.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo MicroAlg 0.4.07 (Ersatz) 3 | echo Taper (bye) pour quitter. 4 | echo. 5 | SET MICROALG_DIR=%~dp0 6 | SET ERSATZ_DIR=%MICROALG_DIR%\ersatz 7 | java -DPID=42 -jar %ERSATZ_DIR%\picolisp.jar %ERSATZ_DIR%\lib.l %MICROALG_DIR%microalg.l %1 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | install: 2 | - sudo apt-get update -qq 3 | - sudo apt-get install gcc-multilib 4 | - npm install readline-sync 5 | - sudo pip install pexpect 6 | - sudo pip install lettuce 7 | - sudo ./install_scripts/fix_lettuce.sh 8 | script: sh microalg_tests.sh 9 | -------------------------------------------------------------------------------- /malg-rjs-repl.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo MicroAlg 0.4.07 (Rhino + EmuLisp) 3 | echo Taper (bye) pour quitter. 4 | echo. 5 | SET MICROALG_DIR=%~dp0 6 | SET EMULISP_DIR=%MICROALG_DIR%\emulisp 7 | java -jar %MICROALG_DIR%\jar\js.jar %EMULISP_DIR%\pil-rjs %MICROALG_DIR%\microalg.l 8 | -------------------------------------------------------------------------------- /exemples/test_logique.malg: -------------------------------------------------------------------------------- 1 | (Exemples_de Non 2 | (Liste 3 | (? Faux) Vrai 4 | (? Vrai) Faux 5 | ) 6 | ) 7 | (Tester Non) 8 | 9 | (Exemples_de Ou 10 | (Liste 11 | (? Faux Faux) Faux 12 | (? Faux Vrai) Vrai 13 | (? Vrai Faux) Vrai 14 | ) 15 | ) 16 | (Tester Ou) 17 | -------------------------------------------------------------------------------- /install_scripts/install_picolisp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Installing Picolisp..." 3 | VERSION=3.1.6 4 | wget "http://software-lab.de/picoLisp-$VERSION.tgz" 5 | tar xzf "picoLisp-$VERSION.tgz" 6 | mv picoLisp picolisp 7 | rm "picoLisp-$VERSION.tgz" 8 | 9 | cd picolisp/src 10 | make 11 | cd - 12 | -------------------------------------------------------------------------------- /malg-j.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo MicroAlg 0.4.07 (Ersatz) 3 | echo. 4 | SET MICROALG_DIR=%~dp0 5 | SET ERSATZ_DIR=%MICROALG_DIR%\ersatz 6 | java -DPID=42 -jar %ERSATZ_DIR%\picolisp.jar %ERSATZ_DIR%\lib.l %MICROALG_DIR%microalg.l %1 -bye 7 | IF NOT DEFINED NO_PAUSE pause>nul|set/p="Une touche pour quitter."&echo( 8 | -------------------------------------------------------------------------------- /exemples/test_tortue.malg: -------------------------------------------------------------------------------- 1 | (RAZ) 2 | (Declarer longueur i De_type "nombre") 3 | (Affecter_a longueur 100) 4 | (TD 30) 5 | (AV longueur) 6 | (TD 120) 7 | (AV longueur) 8 | (TD 30) 9 | (Affecter_a i 0) 10 | (Tant_que (<= i 4) Faire 11 | (AV longueur) 12 | (TD 90) 13 | (Affecter_a i (+ i 1)) 14 | ) 15 | -------------------------------------------------------------------------------- /malg-njs-repl.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set NODE_PATH=%USERPROFILE%\AppData\Roaming\npm\node_modules;"%NODE_PATH%" 3 | echo MicroAlg 0.4.07 (NodeJS + EmuLisp) 4 | echo Taper (bye) pour quitter. 5 | echo. 6 | SET MICROALG_DIR=%~dp0 7 | SET EMULISP_DIR=%MICROALG_DIR%\emulisp 8 | node %EMULISP_DIR%\pil-njs %MICROALG_DIR%\microalg.l 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | emulisp/* linguist-vendored 2 | web/blockly/* linguist-vendored 3 | web/jquery.terminal* linguist-vendored 4 | web/parenedit* linguist-vendored 5 | web/showdown.js linguist-vendored 6 | web/showup* linguist-vendored 7 | tuto* linguist-vendored 8 | -------------------------------------------------------------------------------- /malg-rjs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo MicroAlg 0.4.07 (Rhino + EmuLisp) 3 | echo. 4 | SET MICROALG_DIR=%~dp0 5 | SET EMULISP_DIR=%MICROALG_DIR%\emulisp 6 | java -jar %MICROALG_DIR%\jar\js.jar %EMULISP_DIR%\pil-rjs %MICROALG_DIR%\microalg.l "%1" -bye 7 | IF NOT DEFINED NO_PAUSE pause>nul|set/p="Une touche pour quitter."&echo( 8 | -------------------------------------------------------------------------------- /exemples/test_accents.malg: -------------------------------------------------------------------------------- 1 | (Afficher (Concatener "uno " "dos")) 2 | (Declarer txt1 De_type "texte") 3 | (Affecter_a txt1 "uno") 4 | (Afficher txt1) 5 | (Afficher (Concatener txt1 "!")) 6 | 7 | (Afficher (Concaténer "uno " "dos")) 8 | (Declarer txt2 De_type "texte") 9 | (Affecter_à txt2 "dos") 10 | (Afficher txt2) 11 | (Afficher (Concaténer txt2 "!")) -------------------------------------------------------------------------------- /malg-njs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set NODE_PATH=%USERPROFILE%\AppData\Roaming\npm\node_modules;"%NODE_PATH%" 3 | echo MicroAlg 0.4.07 (NodeJS + EmuLisp) 4 | echo. 5 | SET MICROALG_DIR=%~dp0 6 | SET EMULISP_DIR=%MICROALG_DIR%\emulisp 7 | node %EMULISP_DIR%\pil-njs %MICROALG_DIR%\microalg.l "%1" -bye 8 | IF NOT DEFINED NO_PAUSE pause>nul|set/p="Une touche pour quitter."&echo( 9 | -------------------------------------------------------------------------------- /microalg_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sh microalg_tests_picolisp.sh 3 | EXIT_MALG=$? 4 | sh microalg_tests_ersatz.sh 5 | EXIT_MALG_J=$? 6 | sh microalg_tests_nodejs_emulisp.sh 7 | EXIT_MALG_NJS=$? 8 | sh microalg_tests_rhino_emulisp.sh 9 | EXIT_MALG_RJS=$? 10 | #sh microalg_tests_features.sh 11 | EXIT_FEATURES=0 12 | exit $(($EXIT_MALG | $EXIT_MALG_J | $EXIT_MALG_NJS | $EXIT_MALG_RJS | $EXIT_FEATURES)) 13 | -------------------------------------------------------------------------------- /ersatz/pil-j.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Ersatz PicoLisp 3 | REM Inspiration for this file: 4 | REM https://www.mail-archive.com/picolisp@software-lab.de/msg02076.html 5 | REM You have to install Java and/or may have to tweak your PATH. 6 | REM See here: https://www.java.com/en/download/help/path.xml 7 | REM e.g. add ; (separator) then "C:\Program Files (x86)\Java\jre7\bin" 8 | java -DPID=42 -jar %~dp0\picolisp.jar %~dp0\lib.l %1 %2 %3 %4 %5 %6 9 | pause 10 | -------------------------------------------------------------------------------- /exemples/test_sequence_nb_pseudo_aleat.malg: -------------------------------------------------------------------------------- 1 | (Declarer i De_type "nombre") 2 | 3 | (Definir (Afficher_10_des_de_6) 4 | "Affiche dix tirages de dés à 6 faces." 5 | "ProfGra" 6 | (Affecter_a i 0) 7 | (Tant_que (< i 10) Faire 8 | (Afficher (Entier@ 1 6)) 9 | (Affecter_a i (+ i 1)) 10 | ) 11 | ) 12 | (Afficher_10_des_de_6) 13 | (Afficher "---------") 14 | (Affecter_a sequence_tirages@ (Liste 1 2 3 4)) 15 | (Afficher_10_des_de_6) 16 | (Afficher "---------") 17 | (Affecter_a sequence_tirages@ (Liste)) 18 | (Afficher_10_des_de_6) 19 | -------------------------------------------------------------------------------- /malg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "MicroAlg 0.4.07 (PicoLisp)" 4 | echo 5 | 6 | # http://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides#1638397 7 | SCRIPT=$(readlink -f "$0") 8 | SCRIPTPATH=$(dirname "$SCRIPT") 9 | 10 | if [ -n "${1+x}" ] 11 | then 12 | # Un arg est reçu. 13 | if [ -f "$1" ] 14 | then 15 | # Si l’arg est un nom valide de fichier, on lit ce fichier. 16 | pil $SCRIPTPATH/microalg.l $1 -bye 17 | else 18 | # Sinon, erreur. 19 | echo "$1: ce fichier n'existe pas." 20 | fi 21 | else 22 | # Sans arg, on lance le REPL. 23 | pil $SCRIPTPATH/microalg.l 24 | fi 25 | -------------------------------------------------------------------------------- /malg-j: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "MicroAlg 0.4.07 (Ersatz)" 4 | echo 5 | 6 | # http://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides#1638397 7 | SCRIPT=$(readlink -f "$0") 8 | SCRIPTPATH=$(dirname "$SCRIPT") 9 | 10 | if [ -n "${1+x}" ] 11 | then 12 | # Un arg est reçu. 13 | if [ -f "$1" ] 14 | then 15 | # Si l’arg est un nom valide de fichier, on lit ce fichier. 16 | pil-j $SCRIPTPATH/microalg.l $1 -bye 17 | else 18 | # Sinon, erreur. 19 | echo "$1: ce fichier n'existe pas." 20 | fi 21 | else 22 | # Sans arg, on lance le REPL. 23 | pil-j $SCRIPTPATH/microalg.l 24 | fi 25 | -------------------------------------------------------------------------------- /malg-njs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "MicroAlg 0.4.07 (NodeJS + EmuLisp)" 4 | echo 5 | 6 | # http://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides#1638397 7 | SCRIPT=$(readlink -f "$0") 8 | SCRIPTPATH=$(dirname "$SCRIPT") 9 | 10 | if [ -n "${1+x}" ] 11 | then 12 | # Un arg est reçu. 13 | if [ -f "$1" ] 14 | then 15 | # Si l’arg est un nom valide de fichier, on lit ce fichier. 16 | pil-njs $SCRIPTPATH/microalg.l $1 -bye 17 | else 18 | # Sinon, erreur. 19 | echo "$1: ce fichier n'existe pas." 20 | fi 21 | else 22 | # Sans arg, on lance le REPL. 23 | pil-njs $SCRIPTPATH/microalg.l 24 | fi 25 | -------------------------------------------------------------------------------- /malg-rjs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "MicroAlg 0.4.07 (RhinoJS + EmuLisp)" 4 | echo 5 | 6 | # http://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides#1638397 7 | SCRIPT=$(readlink -f "$0") 8 | SCRIPTPATH=$(dirname "$SCRIPT") 9 | 10 | if [ -n "${1+x}" ] 11 | then 12 | # Un arg est reçu. 13 | if [ -f "$1" ] 14 | then 15 | # Si l’arg est un nom valide de fichier, on lit ce fichier. 16 | pil-rjs $SCRIPTPATH/microalg.l $1 -bye 17 | else 18 | # Sinon, erreur. 19 | echo "$1: ce fichier n'existe pas." 20 | fi 21 | else 22 | # Sans arg, on lance le REPL. 23 | pil-rjs $SCRIPTPATH/microalg.l 24 | fi 25 | -------------------------------------------------------------------------------- /web/jquery.textcomplete.css: -------------------------------------------------------------------------------- 1 | /* Based on https://github.com/yuku-t/jquery-textcomplete/blob/master/doc/style.md */ 2 | .textcomplete-dropdown { 3 | border: 1px solid #ddd; 4 | background-color: white; 5 | padding: 0; 6 | margin: 0; 7 | } 8 | 9 | .textcomplete-dropdown li { 10 | list-style: none; 11 | border-top: 1px solid #ddd; 12 | padding: 2px 5px; 13 | margin: 0; 14 | } 15 | 16 | .textcomplete-dropdown li:first-child { 17 | border-top: none; 18 | } 19 | 20 | .textcomplete-dropdown li:hover, 21 | .textcomplete-dropdown .active { 22 | background-color: rgb(160, 223, 160); 23 | } 24 | 25 | .textcomplete-dropdown a { 26 | border-bottom: none; 27 | } 28 | 29 | .textcomplete-dropdown a:hover { 30 | cursor: pointer; 31 | } -------------------------------------------------------------------------------- /lib/xml.l: -------------------------------------------------------------------------------- 1 | # https://www.mail-archive.com/picolisp@software-lab.de/msg00510.html 2 | # https://www.mail-archive.com/picolisp@software-lab.de/msg04592.html 3 | 4 | (de Lst 5 | ( Lst) ) 6 | 7 | (de (Lst) 8 | (let Tag (pop 'Lst) 9 | (prin "<" Tag) 10 | (while (and Lst (atom (car Lst))) 11 | (prin " " (pop 'Lst) "=\"") 12 | (escXml (eval (pop 'Lst) 1)) 13 | (prin "\"") ) 14 | (ifn Lst 15 | (prin "/>") 16 | (prin ">") 17 | (run Lst 1) 18 | (prin "") ) ) ) 19 | (de escXml (X) 20 | (for C (chop X) 21 | (case C 22 | ("\"" (prin """)) 23 | ("&" (prin "&")) 24 | ("<" (prin "<")) 25 | (">" (prin ">")) 26 | (T (prin C)) ) ) ) 27 | -------------------------------------------------------------------------------- /microalg_export_arbreninja.l: -------------------------------------------------------------------------------- 1 | (setq *id 0) 2 | (de arbreninja malg_src 3 | (pack "
  1. " 4 | (mapcar 'arbreninja_rec malg_src) 5 | "
" 6 | ) 7 | ) 8 | 9 | (de arbreninja_rec (malg_src) 10 | (cond 11 | ((atom malg_src) (pack "
  • " 12 | (ifn (str? malg_src) malg_src 13 | (pack "« " malg_src " »") ) 14 | "
  • ")) 15 | (T (let (cmd (car malg_src) 16 | args (cdr malg_src)) 17 | (inc '*id) 18 | (pack "" 19 | "" 20 | (if args 21 | (pack "
      " (mapcar 'arbreninja_rec args) "
    ")) 22 | ) 23 | ) 24 | ) 25 | ) 26 | ) -------------------------------------------------------------------------------- /exemples/test_tests.malg: -------------------------------------------------------------------------------- 1 | (Definir (Double x) 2 | "Retourne le double du paramètre `x`." 3 | "Profgra" 4 | (Retourner (* 2 x)) 5 | ) 6 | (!!! "La commande suivante «attache» à `Double` une liste d’exemples.") 7 | (!!! "Cette liste contient des appels et les retours correspondants.") 8 | (!!! "Vous êtes invitée à «casser» les tests, juste pour voir...") 9 | (Exemples_de Double 10 | (Liste 11 | (? 1) 2 12 | (? 2) 4 13 | (? 3) 6 14 | ) 15 | ) 16 | (Afficher "Les exemples de `Double` sont :") 17 | (Afficher (Exemples_de Double)) 18 | (!!! "Vérifions que la commande `Double` respecte les exemples.") 19 | (Tester Double) 20 | (Afficher "Voilà, c’est testé.") 21 | 22 | (!!! "Attention, utilisation avancée !") 23 | (!!! "Une commande peut récupérer les exemples d’une autre commande.") 24 | (Exemples_de Plus_un (Exemples_de Double)) 25 | (Afficher "Les exemples de `Plus_un` sont :") 26 | (Afficher (Exemples_de Plus_un)) 27 | -------------------------------------------------------------------------------- /exemples/test_algues.malg: -------------------------------------------------------------------------------- 1 | (RAZ) 2 | (Epaisseur 2) 3 | (Remplissage (Liste 255 255 255)) 4 | (Declarer n x y r decalage De_type "nombre") 5 | (Affecter_a n 1) 6 | (Affecter_a x 0) 7 | (Tant_que (<= n 5) 8 | Faire 9 | (Affecter_a credit_iterations 300) 10 | (Affecter_a x (+ (* n 50) 150)) 11 | (Affecter_a y 200) 12 | (Affecter_a r 25) 13 | (Affecter_a decalage 0) 14 | (Tant_que (>= r 4) 15 | Faire 16 | (Contour (Liste (Entier@ 0 255) (Entier@ 0 255) (Entier@ 0 255))) 17 | (Cercle (Liste x y) r) 18 | (Affecter_a decalage (+ decalage (Entier@ -1 1))) 19 | (Si (< decalage -2) Alors 20 | (Affecter_a decalage -2) 21 | ) 22 | (Si (> decalage 2) Alors 23 | (Affecter_a decalage -2) 24 | ) 25 | (Affecter_a x (+ x decalage)) 26 | (Affecter_a y (+ y 2)) 27 | (Si (= 1 (Entier@ 1 6)) Alors 28 | (Affecter_a r (- r 2)) 29 | ) 30 | ) 31 | (Affecter_a n (+ n 1)) 32 | ) 33 | -------------------------------------------------------------------------------- /microalg_export_arbresvg.l: -------------------------------------------------------------------------------- 1 | (de arbresvg malg_src 2 | (push 'malg_src 'Programme) 3 | (arbresvg_rec malg_src) 4 | ) 5 | 6 | (de arbresvg_rec (malg_src !indent_level !node_str) 7 | (cond 8 | ((atom malg_src) (pack "{\"label\":\"" 9 | (ifn (str? malg_src) 10 | (pack " " malg_src " ") 11 | (pack "«" malg_src "»") ) 12 | "\"}")) 13 | (T (let (cmd (car malg_src) 14 | args (cdr malg_src)) 15 | (pack "{\"label\":\"" 16 | cmd 17 | "\", \"children\": [" 18 | (glue ", " (mapcar 'arbresvg_rec args)) 19 | "]}" 20 | ) 21 | ) 22 | ) 23 | ) 24 | ) 25 | 26 | (ifn glue 27 | (de glue (c l) 28 | (cond 29 | ((not (<> 0 (length l))) "") 30 | ((not (<> 1 (length l))) (car l)) 31 | (T (pack (car l) c (glue c (cdr l)))) 32 | ) 33 | ) 34 | ) -------------------------------------------------------------------------------- /microalg_export_arbretxt.l: -------------------------------------------------------------------------------- 1 | (de arbretxt malg_src 2 | (pack (mapcar 'arbretxt_rec malg_src)) 3 | ) 4 | 5 | (de arbretxt_rec (malg_src !indent_level !node_str) 6 | (ifn !indent_level (setq !indent_level 0)) 7 | (pack 8 | (if (gt0 !indent_level) (pack (need (dec !indent_level) "│ ") !node_str)) 9 | (cond 10 | ((atom malg_src) (pack (if (str? malg_src) (pack "\"" malg_src "\"") malg_src) "^J")) 11 | (T (let (cmd (car malg_src) 12 | rev_args (reverse (cdr malg_src)) 13 | args_but_last (reverse (cdr rev_args)) 14 | last_arg (car rev_args) 15 | length_but_last (length args_but_last)) 16 | (pack cmd "^J" 17 | (if rev_args (pack 18 | (mapcar 'arbretxt_rec args_but_last (need length_but_last (inc !indent_level)) (need length_but_last "├─")) 19 | (arbretxt_rec last_arg (inc !indent_level) "└─"))) 20 | ) 21 | ) 22 | ) 23 | ) 24 | ) 25 | ) -------------------------------------------------------------------------------- /dev/nouvelle_commande.txt: -------------------------------------------------------------------------------- 1 | # Check-list pour ajouter une commande dans MicroAlg: 2 | 3 | * microalg.l 4 | * doc de la commande dans `'doc` 5 | * implémentation de la commande en elle même 6 | * nouvelles erreurs (+ explications dans doc.html) 7 | * entrée dans la liste `symboles` 8 | * alias si accents 9 | * microalg_tests.malg 10 | * abréviation 11 | * `editeurs/scite/malg_abbrev.properties` 12 | * `web/ide_injections.js` 13 | * `doc.html` 14 | * Blockly 15 | * `web/blockly_microalg.js` 16 | * reserved words 17 | * config 18 | * génération 19 | * toolbox dans `web/ide_injections.js` 20 | * exports 21 | * microalg_export_blockly.l (/!\ Next) 22 | * microalg_export_casio.l 23 | * microalg_export_javascript.l 24 | * microalg_export_microalg.l 25 | * microalg_export_processing.l 26 | * microalg_export_python.l 27 | * microalg_export_ti.l 28 | * tutos 29 | * doc.html 30 | * penser à la section accents 31 | * liste syms par thèmes 32 | * doc spécifique à Blockly 33 | -------------------------------------------------------------------------------- /ersatz/COPYING: -------------------------------------------------------------------------------- 1 | PicoLisp Copyright (c) Software Lab. Alexander Burger 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /editeurs/scite/malg_abbrev.properties: -------------------------------------------------------------------------------- 1 | # Voir aussi dans web/ide_injections.js. 2 | 3 | (Af=(Affecter_a |)\n 4 | (Afe=(Affecter_a | En_position )\n 5 | (A=(Afficher |)\n 6 | (Aj=(Ajouter_a |)\n 7 | (Al=(!!! "Algo |")\n(!!! "Fin algo ")\n 8 | (At=(Afficher "|")\n 9 | (Co=(Concatener |) 10 | (D=(Declarer | De_type "")\n 11 | (De=(Definir (|)\n "..."\n "..."\n (Retourner )\n)\n 12 | (Di=(Diff |) 13 | (Dm=(Demander)| 14 | (Dn=(Demander_un_nombre)| 15 | (Dnp=(Demander_un_nombre_pour |)\n 16 | (E=(Exemples_de |\n (Liste\n (? )\n (? )\n )\n)\n 17 | (E@=(Entier@ |) 18 | # Pour Faire, deux lignes pour aider à penser au compteur. 19 | (F=(Faire\n (|)\n ()\n Tant_que ()\n)\n 20 | (I@=(Initialiser@ |)\n 21 | (Li=(Liste |) 22 | (Lo=(Longueur |) 23 | (M=(Millisecondes)| 24 | (Ni=(Nieme |) 25 | (N@=(Nieme@ |) 26 | (No=(Nombre |) 27 | (Pr=(Produit |) 28 | (Pu=(Puissance |) 29 | (Q=(Quotient |) 30 | (R=(Repeter | Fois\n ()\n)\n 31 | (Ra=(Racine |) 32 | (Rd=(Retirer_de |) 33 | (Re=(Retourner |)\n 34 | (Rp=(Repere |)\n 35 | (Rs=(Reste |) 36 | (S=(Si (|) Alors\n ()\n)\n 37 | (So=(Somme |) 38 | (Ss=(Si (|)\n Alors ()\n Sinon ()\n)\n 39 | (Te=(Tester |)\n 40 | # Pour Tant_que, deux lignes pour aider à penser au compteur. 41 | (Tq=(Tant_que (|)\n Faire\n ()\n ()\n)\n 42 | -------------------------------------------------------------------------------- /features/invocations.feature: -------------------------------------------------------------------------------- 1 | # language: fr 2 | Fonctionnalité: Invocation des interpréteurs et leur sortie 3 | Pour pouvoir utiliser les interpréteurs 4 | En tant qu’utilisateurs 5 | Il faut pouvoir les invoquer et en sortir. 6 | 7 | Scénario: Avec l’interpréteur officiel de PicoLisp (écrit en ASM et C). 8 | Le programme pil 9 | Ayant démarré 10 | Avec interaction (bye) 11 | Doit afficher «: (bye)» 12 | 13 | Scénario: Avec l’interpréteur en Java de PicoLisp (nommé Ersatz). 14 | Le programme pilj 15 | Ayant démarré 16 | Avec interaction (bye) 17 | Doit afficher «: (bye)» 18 | 19 | Scénario: Avec l’interpréteur en Javascript (NodeJS + Emulisp) de PicoLisp. 20 | Le programme piljs 21 | Ayant démarré 22 | Avec interaction (bye) 23 | Doit afficher «: (bye)» 24 | 25 | Scénario: Avec l’interpréteur de MicroAlg sur 'pil'. 26 | Le programme malg 27 | Ayant démarré 28 | Avec interaction (bye) 29 | Doit afficher «: (bye)» 30 | 31 | Scénario: Avec l’interpréteur de MicroAlg sur 'pilj' (Java). 32 | Le programme malgj 33 | Ayant démarré 34 | Avec interaction (bye) 35 | Doit afficher «: (bye)» 36 | 37 | Scénario: Avec l’interpréteur de MicroAlg sur 'piljs' (Javascript). 38 | Le programme malgjs 39 | Ayant démarré 40 | Avec interaction (bye) 41 | Doit afficher «: (bye)» 42 | 43 | -------------------------------------------------------------------------------- /web/css-ninja-tree/css-ninja-tree.css: -------------------------------------------------------------------------------- 1 | /* http://www.thecssninja.com/demo/css_tree/ */ 2 | 3 | ol.tree 4 | { 5 | padding: 0 0 0 30px; 6 | width: 300px; 7 | } 8 | ol.tree li 9 | { 10 | position: relative; 11 | margin-left: -15px; 12 | list-style: none; 13 | } 14 | ol.tree li input 15 | { 16 | position: absolute; 17 | left: 0; 18 | margin-left: 0; 19 | opacity: 0; 20 | z-index: 2; 21 | cursor: pointer; 22 | height: 1em; 23 | width: 1em; 24 | top: 0; 25 | } 26 | ol.tree li input + ol 27 | { 28 | background: url(toggle-small-expand.png) 50px -3px no-repeat; 29 | margin: -0.938em 0 0 -44px; /* 15px */ 30 | height: 1em; 31 | } 32 | ol.tree li input + ol > li { display: none; margin-left: -14px !important; padding-left: 1px; } 33 | ol.tree li label:before 34 | { 35 | content: "("; 36 | } 37 | ol.tree li label 38 | { 39 | cursor: pointer; 40 | display: block; 41 | padding-left: 24px; 42 | margin-bottom: 0; 43 | font-weight: normal; 44 | font-size: 100%; 45 | } 46 | 47 | ol.tree li input:checked + ol 48 | { 49 | background: url(toggle-small.png) 50px 0px no-repeat; 50 | margin: -1.25em 0 0 -44px; /* 20px */ 51 | padding: 1.563em 0 0 80px; 52 | height: auto; 53 | } 54 | ol.tree li input:checked + ol > li { display: block; margin: 0 0 0.125em; /* 2px */} 55 | ol.tree li input:checked + ol > li:last-child { margin: 0 0 0.063em; /* 1px */ } 56 | 57 | /* Because of Skeleton */ 58 | .tree ul ul, ul ol, ol ol, ol ul { 59 | font-size: 100%; 60 | } 61 | -------------------------------------------------------------------------------- /exemples/test_millisecondes.malg: -------------------------------------------------------------------------------- 1 | (Affecter_a credit_iterations 2000) 2 | 3 | (Declarer depart apres_la_boucle apres_la_2eme_boucle De_type "nombre") 4 | (Declarer i De_type "nombre") 5 | (Declarer texte De_type "texte") 6 | 7 | (Affecter_a depart (Millisecondes)) 8 | (Afficher (Concatener 9 | (Texte depart) 10 | " millisecondes écoulées avant l’exécution de la première ligne." 11 | )) 12 | (Affecter_a i 0) 13 | (Affecter_a texte "") 14 | (Tant_que (< i 500) 15 | Faire 16 | (Ajouter_a texte "a") 17 | (Affecter_a i (+ i 1)) 18 | ) 19 | (Affecter_a apres_la_boucle (Millisecondes)) 20 | (Afficher (Concatener 21 | "Nous en sommes à " 22 | (Texte apres_la_boucle) 23 | " millisecondes après 500 Ajouter_a." 24 | )) 25 | (Afficher (Concatener 26 | "Soit " 27 | (Texte (- apres_la_boucle depart)) 28 | " millisecondes pour 1ère la boucle." 29 | )) 30 | (Affecter_a i 0) 31 | (Affecter_a texte "") 32 | (Tant_que (< i 500) 33 | Faire 34 | (Ajouter_a texte "a") 35 | (Affecter_a i (+ i 1)) 36 | ) 37 | (Affecter_a apres_la_2eme_boucle (Millisecondes)) 38 | (Afficher (Concatener 39 | "Nous en sommes à " 40 | (Texte apres_la_2eme_boucle) 41 | " millisecondes après 500 autres Ajouter_a." 42 | )) 43 | (Afficher (Concatener 44 | "Soit " 45 | (Texte (- apres_la_2eme_boucle apres_la_boucle)) 46 | " millisecondes pour 2ème la boucle." 47 | )) 48 | -------------------------------------------------------------------------------- /dev/diff.microalg.info.sh: -------------------------------------------------------------------------------- 1 | diff -rq . ../microalg.github.io | \ 2 | grep -v "Only in .: diff.microalg.info.sh" | \ 3 | grep -v swp | \ 4 | grep -v /\.git | \ 5 | grep -v .gitignore | \ 6 | grep -v README | \ 7 | grep -v LICENSE | \ 8 | grep -v INSTALL | \ 9 | grep -v CNAME | \ 10 | grep -v "Only in .: editeurs" | \ 11 | grep -v "Only in ./emulisp: emulisp_cv.js" | \ 12 | grep -v "Only in ./emulisp: emulisp_js.js" | \ 13 | grep -v "Only in ./emulisp: piljs.bat" | \ 14 | grep -v "Only in ./emulisp: pil-njs" | \ 15 | grep -v "Only in ./emulisp: pil-rjs" | \ 16 | grep -v "Only in .: ersatz" | \ 17 | grep -v "Only in .: ersatz_repl.l" | \ 18 | grep -v "Only in .: exemples" | \ 19 | grep -v "Only in .: features" | \ 20 | grep -v "Only in .: geogebra" | \ 21 | grep -v "Only in .: install_scripts" | \ 22 | grep -v "Only in .: lib" | \ 23 | grep -v "Only in .: malg" | \ 24 | grep -v "Only in .: netlogo" | \ 25 | grep -v "Only in .: picolisp" | \ 26 | grep -v "Only in .: todo" | \ 27 | grep -v "Only in .: .travis.yml" | \ 28 | grep -v "Only in ../microalg.github.io: 404.html" | \ 29 | grep -v "Only in ../microalg.github.io: comparaison.html" | \ 30 | grep -v "Only in ../microalg.github.io: images" | \ 31 | grep -v "Only in ../microalg.github.io: index.html" | \ 32 | grep -v "Only in ../microalg.github.io: logos.html" | \ 33 | grep -v "Only in ../microalg.github.io: params.json" | \ 34 | grep -v "Only in ../microalg.github.io: rapport_" | \ 35 | grep -v "Only in ../microalg.github.io: stylesheets" | \ 36 | grep -v "Only in .: microalg_tests" | \ 37 | grep -v "Only in .: .gitattributes" | \ 38 | tee 39 | -------------------------------------------------------------------------------- /editeurs/scite/SciTEGlobal.properties: -------------------------------------------------------------------------------- 1 | # Options générales facultatives mais recommandées 2 | position.maximize=1 3 | save.session=1 4 | save.recent=1 5 | use.tabs=0 6 | code.page=65001 7 | autocompleteword.automatic=1 8 | line.margin.visible=1 9 | line.margin.width=2+ 10 | title.full.path=2 11 | split.vertical=1 12 | output.horizontal.size=500 13 | edge.mode=1 14 | edge.column=80 15 | fold.symbols=3 16 | # Apparence des caractères 17 | my_size=size:12 18 | font.quality=2 19 | # Chasse fixe, voir http://fr.wikipedia.org/wiki/Chasse_%28typographie%29 20 | font.base=$(font.monospace),$(my_size) 21 | font.small=$(font.monospace),$(my_size) 22 | font.comment=$(font.monospace),$(my_size) 23 | font.text=$(font.monospace),$(my_size) 24 | font.text.comment=$(font.monospace),$(my_size) 25 | font.embedded.base=$(font.monospace),$(my_size) 26 | font.embedded.comment=$(font.monospace),$(my_size) 27 | font.vbs=$(font.monospace),$(my_size) 28 | # Apparence du curseur 29 | caret.fore=#FF0000 30 | caret.line.back=#000000 31 | caret.line.back.alpha=10 32 | caret.width=2 # 1, 2 ou 3 33 | # Apparence du panneau de sortie 34 | output.wrap=2 35 | output.scroll=2 36 | 37 | # Options concernant MicroAlg 38 | # Pas besoin si vous utilisez Windows: 39 | microalg_path=/opt/microalg 40 | # Comment est stylé un fichier avant son enregistrement: 41 | default.file.ext=.malg 42 | # Simplification du menu Langages: 43 | menu.language=MicroAlg|malg||Text|txt|| 44 | # Filtres pour Fichier/Ouvrir 45 | open.filter=Tous les fichiers (*.*)|*|Fichiers MicroAlg (*.malg)|*.malg| 46 | # Chargement 47 | if PLAT_WIN 48 | ext.lua.startup.script=$(SciteDefaultHome)\microalg.lua 49 | if PLAT_GTK 50 | ext.lua.startup.script=$(microalg_path)/editeurs/scite/microalg.lua 51 | -------------------------------------------------------------------------------- /web/showup.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Showup.js jQuery Plugin 3 | * http://github.com/jonschlinkert/showup 4 | * 5 | * Copyright (c) 2013 Jon Schlinkert, contributors 6 | * Licensed under the MIT License (MIT). 7 | */ 8 | 9 | 10 | (function( $ ) { 11 | $.fn.showUp = function(ele, options) { 12 | options = options || {}; 13 | 14 | var target = $(ele); 15 | var down = options.down || 'navbar-hide'; 16 | var up = options.up || 'navbar-show'; 17 | var btnHideShow = options.btnHideShow || '.btn-hide-show'; 18 | var hideOffset = options.offset || 110; 19 | var previousScroll = 0; 20 | 21 | $(window).scroll(function () { 22 | // var currentScroll = $(this).scrollTop(); 23 | if ($(this).scrollTop() > hideOffset) { 24 | if ($(this).scrollTop() > previousScroll) { 25 | // Action on scroll down 26 | target.removeClass(up).addClass(down); 27 | } else { 28 | // Action on scroll up 29 | target.removeClass(down).addClass(up); 30 | } 31 | } 32 | previousScroll = $(this).scrollTop(); 33 | }); 34 | 35 | // Toggle visibility of target on click 36 | $(btnHideShow).click(function () { 37 | if (target.hasClass(down)) { 38 | target.removeClass(down).addClass(up); 39 | } else { 40 | target.removeClass(up).addClass(down); 41 | } 42 | }); 43 | }; 44 | })( jQuery ); 45 | 46 | // TODO: make customizable 47 | $(document).ready(function () { 48 | var duration = 420; 49 | var showOffset = 220; 50 | var btnFixed = '.btn-fixed-bottom'; 51 | var btnToTopClass = '.back-to-top'; 52 | 53 | $(window).scroll(function () { 54 | if ($(this).scrollTop() > showOffset) { 55 | $(btnFixed).fadeIn(duration); 56 | } else { 57 | $(btnFixed).fadeOut(duration); 58 | } 59 | }); 60 | 61 | $(btnToTopClass).click(function (event) { 62 | event.preventDefault(); 63 | $('html, body').animate({ 64 | scrollTop: 0 65 | }, duration); 66 | return false; 67 | }); 68 | }); 69 | 70 | -------------------------------------------------------------------------------- /features/interactions.feature: -------------------------------------------------------------------------------- 1 | # language: fr 2 | Fonctionnalité: Invocation des interpréteurs, interactions puis sortie 3 | Pour pouvoir faire travailler les interpréteurs interactivement 4 | En tant qu’utilisateurs 5 | Il faut pouvoir les invoquer, taper des instructions, et en sortir. 6 | 7 | Scénario: Avec «pil», je peux faire une simple addition. 8 | Le programme pil 9 | Ayant démarré 10 | Avec interaction (+ 2 2) 11 | Avec interaction (bye) 12 | Doit afficher « 13 | """ 14 | : (+ 2 2) 15 | -> 4 16 | : (bye) 17 | """ 18 | 19 | Scénario: Avec «pilj», je peux faire une simple addition. 20 | Le programme pilj 21 | Ayant démarré 22 | Avec interaction (+ 2 2) 23 | Avec interaction (bye) 24 | Doit afficher « 25 | """ 26 | : (+ 2 2) 27 | -> 4 28 | : (bye) 29 | """ 30 | 31 | Scénario: Avec «piljs», je peux faire une simple addition. 32 | Le programme piljs 33 | Ayant démarré 34 | Avec interaction (+ 2 2) 35 | Avec interaction (bye) 36 | Doit afficher « 37 | """ 38 | : (+ 2 2) 39 | -> 4 40 | : (bye) 41 | """ 42 | 43 | Scénario: Avec «malg», je peux faire une simple addition. 44 | Le programme malg 45 | Ayant démarré 46 | Avec interaction (+ 2 2) 47 | Avec interaction (bye) 48 | Doit afficher « 49 | """ 50 | : (+ 2 2) 51 | -> 4 52 | : (bye) 53 | """ 54 | 55 | Scénario: Avec «malgj», je peux faire une simple addition. 56 | Le programme malgj 57 | Ayant démarré 58 | Avec interaction (+ 2 2) 59 | Avec interaction (bye) 60 | Doit afficher « 61 | """ 62 | : (+ 2 2) 63 | -> 4 64 | : (bye) 65 | """ 66 | 67 | Scénario: Avec «malgjs», je peux faire une simple addition. 68 | Le programme malgjs 69 | Ayant démarré 70 | Avec interaction (+ 2 2) 71 | Avec interaction (bye) 72 | Doit afficher « 73 | """ 74 | : (+ 2 2) 75 | -> 4 76 | : (bye) 77 | """ 78 | 79 | -------------------------------------------------------------------------------- /visuels/logo_microalg.malg: -------------------------------------------------------------------------------- 1 | (load "lib/xml.l") 2 | (setq W "#FFF") # blanc 3 | (setq R "#e11d21") # rouge 4 | (setq J "#fbca04") # jaune 5 | (setq V "#009800") # vert 6 | (setq B "#0052cc") # bleu 7 | (setq N "#000") # noir 8 | (setq L/2 200) 9 | (setq L 400) 10 | (setq fond_blanc '( rect x 0 y 0 width L height L fill W)) 11 | ( svg width L height L xmlns "http://www.w3.org/2000/svg" xmlns:svg "http://www.w3.org/2000/svg" 12 | ( defs 13 | ( mask id "masque-r" maskUnits "userSpaceOnUse" x 0 y 0 width L height L 14 | (eval fond_blanc) 15 | ( ellipse cx L/2 cy L/2 rx 190 ry 125 fill N) 16 | ( ellipse cx L cy L/2 rx 150 ry 95 fill N) 17 | ( ellipse cx 0 cy L/2 rx 150 ry 95 fill N) 18 | ) 19 | ( mask id "masque-j" maskUnits "userSpaceOnUse" x 0 y 0 width L height L 20 | (eval fond_blanc) 21 | ( ellipse cx L/2 cy L/2 rx 160 ry 95 fill N) 22 | ( ellipse cx L cy L/2 rx 150 ry 75 fill N) 23 | ( ellipse cx 0 cy L/2 rx 150 ry 75 fill N) 24 | ) 25 | ( mask id "masque-v" maskUnits "userSpaceOnUse" x 0 y 0 width L height L 26 | (eval fond_blanc) 27 | ( ellipse cx L/2 cy L/2 rx 130 ry 65 fill N) 28 | ( ellipse cx L cy L/2 rx 150 ry 55 fill N) 29 | ( ellipse cx 0 cy L/2 rx 150 ry 55 fill N) 30 | ) 31 | ( mask id "masque-b" maskUnits "userSpaceOnUse" x 0 y 0 width L height L 32 | (eval fond_blanc) 33 | ( ellipse cx L/2 cy L/2 rx 95 ry 35 fill N) 34 | ( ellipse cx L cy L/2 rx 150 ry 35 fill N) 35 | ( ellipse cx 0 cy L/2 rx 150 ry 35 fill N) 36 | ) 37 | ) 38 | ( g id "logo-microalg" stroke-opacity 0 transform (pack "rotate(-45 " L/2 " " L/2 ")") 39 | ( ellipse id "rouge" fill R cx L/2 cy L/2 rx 190 ry 150 mask "url(#masque-r)") 40 | ( ellipse id "jaune" fill J cx L/2 cy L/2 rx 160 ry 120 mask "url(#masque-j)") 41 | ( ellipse id "vert" fill V cx L/2 cy L/2 rx 130 ry 90 mask "url(#masque-v)") 42 | ( ellipse id "bleu" fill B cx L/2 cy L/2 rx 100 ry 60 mask "url(#masque-b)") 43 | ) 44 | ) 45 | (bye) 46 | -------------------------------------------------------------------------------- /ersatz/README: -------------------------------------------------------------------------------- 1 | 08may13abu 2 | (c) Software Lab. Alexander Burger 3 | 4 | 5 | Ersatz PicoLisp 6 | =============== 7 | 8 | Ersatz PicoLisp is a version of PicoLisp completely written in Java. It requires 9 | a 1.6 Java Runtime Environment. 10 | 11 | It should be the last resort when there is no other way to run a "real" 12 | PicoLisp. Also, it may be used to bootstrap the 64-bit version, which requires a 13 | running PicoLisp to build from the sources. 14 | 15 | Unfortunately, ErsatzLisp lacks everything which makes up "true" PicoLisp: 16 | Speed, small memory footprint, and simple internal structures. 17 | 18 | Performance is rather poor. It is 5 to 10 times slower, allocates a huge amount 19 | of memory at startup (600 MB vs. 3 MB), and needs 2.5 to 4 times the space for 20 | runtime Lisp data. But efficiency was not a major goal. Instead, performance was 21 | often sacrificed in favor of simpler or more modular structures. 22 | 23 | There is no support for 24 | 25 | -- raw console input ('key') and line editing 26 | -- child processes ('fork') 27 | -- interprocess communication ('tell', 'hear', 'ipc', 'udp' etc.) 28 | -- databases (external symbols) 29 | -- signal handling 30 | 31 | 32 | Invocation 33 | ---------- 34 | 35 | Ersatz PicoLisp can be started - analog to 'pil' - as 36 | 37 | $ ersatz/pil 38 | 39 | This includes slightly simplified versions of the standard libraries as loaded 40 | by the "real" 'pil' (without database, but with Pilog and XML support). 41 | 42 | To start it in debug mode, use 43 | 44 | $ ersatz/pil + 45 | 46 | 47 | On non-Unix systems, you might start 'java' directly, e.g.: 48 | 49 | java -DPID=42 -cp .;tmp;picolisp.jar PicoLisp lib.l 50 | 51 | Instead of '42' some other number may be passed. It is used to simulate a 52 | "process ID", so it should be different for every running instance of Ersatz 53 | PicoLisp. 54 | 55 | 56 | Building the JAR file 57 | --------------------- 58 | 59 | The actual source files are 60 | 61 | sys.src # The system 62 | fun.src # Function definitions 63 | 64 | The PicoLisp script "mkJar" will read them, generate the Java source file 65 | "PicoLisp.java", compile that with 'javac', and pack the result into a JAR (Java 66 | Archive) file. "mkJar" expects to be run in the "ersatz/" directory, e.g.: 67 | 68 | $ (cd ersatz; ./mkJar) 69 | -------------------------------------------------------------------------------- /emulisp/pil-njs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@" 3 | 4 | // Helper file to run EmuLisp on NodeJS. 5 | 6 | fs = require('fs') 7 | path = require('path') 8 | 9 | // Override _stdPrint with the official mechanism. 10 | function stdPrint(text) { 11 | console.log(text.replace(/\n$/g,'')); 12 | } 13 | // Override _warn with the official mechanism. 14 | function warn(msg) { 15 | console.log(msg); 16 | } 17 | 18 | var NO_DEBUG = "piljs -> no debug yet"; 19 | 20 | // Load int.js. 21 | var int_src = fs.readFileSync( 22 | path.resolve(__dirname, 'int.js')).toString(); 23 | eval(int_src); 24 | 25 | // Load EmuLisp. 26 | var emulisp_src = fs.readFileSync( 27 | path.resolve(__dirname, 'emulisp_core.js')).toString(); 28 | eval(emulisp_src); 29 | 30 | // Process command line args. 31 | // TODO http://www.software-lab.de/doc/refL.html#load 32 | var arglist = process.argv.slice(2); 33 | while (true) { 34 | var arg = arglist.shift(); 35 | if (typeof arg == 'undefined') { 36 | // Now all command line args have been consumed. 37 | break; 38 | } 39 | var src; 40 | if (arg.slice(0, 1) == '-') { 41 | // Interpret arg as source code. 42 | src = '(' + arg.slice(1) + ')'; 43 | } else { 44 | // Interpret arg as a file to read. 45 | if(fs.existsSync(arg)) { 46 | src = fs.readFileSync(arg).toString(); 47 | } else { 48 | if (arg == '+') { 49 | console.log("+ not supported (yet)"); 50 | } else { 51 | console.log(arg + " not found."); 52 | } 53 | } 54 | } 55 | try { 56 | EMULISP_CORE.eval(src); 57 | } catch(e) { 58 | console.log(e.message) 59 | EMULISP_CORE.eval("(run *Err)"); 60 | console.log("? (" + NO_DEBUG + ")"); 61 | } 62 | } 63 | 64 | // REPL 65 | var readlinesync = require('readline-sync'); 66 | readlinesync.setPrompt(": "); 67 | while (true) { 68 | var user_input = readlinesync.prompt(); 69 | try { 70 | var result = EMULISP_CORE.eval(user_input); 71 | console.log('-> ' + result); 72 | } catch(e) { 73 | console.log("!? " + user_input) 74 | console.log(e.message) 75 | EMULISP_CORE.eval("(run *Err)"); 76 | console.log("? (" + NO_DEBUG + ")"); 77 | } 78 | } 79 | 80 | // vim: filetype=javascript 81 | -------------------------------------------------------------------------------- /features/hello.feature: -------------------------------------------------------------------------------- 1 | # language: fr 2 | Fonctionnalité: Invocation des interpréteurs sur un script 'Hello World!' 3 | Pour pouvoir faire travailler les interpréteurs non-interactivement 4 | En tant qu’utilisateurs 5 | Il faut pouvoir les invoquer sur un fichier. 6 | 7 | Scénario: Avec «pil», je peux lire l’exemple test_read.l. 8 | Le programme pil 9 | Avec argument exemples/test_read.l 10 | Ayant démarré 11 | Avec interaction tout le monde! 12 | Doit afficher « 13 | """ 14 | ""Votre nom ?"" 15 | tout le monde! 16 | ""Salut tout le monde!"" 17 | """ 18 | 19 | Scénario: Avec «pilj», je peux lire l’exemple test_read.l. 20 | Le programme pilj 21 | Avec argument exemples/test_read.l 22 | Ayant démarré 23 | Avec interaction tout le monde! 24 | Doit afficher « 25 | """ 26 | ""Votre nom ?"" 27 | tout le monde! 28 | ""Salut tout le monde!"" 29 | """ 30 | 31 | Scénario: Avec «piljs», je peux lire l’exemple test_read.l. 32 | Le programme piljs 33 | Avec argument exemples/test_read.l 34 | Ayant démarré 35 | Avec interaction tout le monde! 36 | Doit afficher « 37 | """ 38 | ""Votre nom ?"" 39 | tout le monde! 40 | ""Salut tout le monde!"" 41 | """ 42 | 43 | Scénario: Avec «malg», je peux lire l’exemple test_demander.malg. 44 | Le programme malg 45 | Avec argument exemples/test_demander.malg 46 | Ayant démarré 47 | Avec interaction tout le monde! 48 | Doit afficher « 49 | """ 50 | ""Votre nom ?"" 51 | tout le monde! 52 | ""Salut tout le monde!"" 53 | """ 54 | 55 | Scénario: Avec «malgj», je peux lire l’exemple test_demander.malg. 56 | Le programme malgj 57 | Avec argument exemples/test_demander.malg 58 | Ayant démarré 59 | Avec interaction tout le monde! 60 | Doit afficher « 61 | """ 62 | ""Votre nom ?"" 63 | tout le monde! 64 | ""Salut tout le monde!"" 65 | """ 66 | 67 | Scénario: Avec «malgjs», je peux lire l’exemple test_demander.malg. 68 | Le programme malgjs 69 | Avec argument exemples/test_demander.malg 70 | Ayant démarré 71 | Avec interaction tout le monde! 72 | Doit afficher « 73 | """ 74 | ""Votre nom ?"" 75 | tout le monde! 76 | ""Salut tout le monde!"" 77 | """ 78 | 79 | -------------------------------------------------------------------------------- /web/parenedit.css: -------------------------------------------------------------------------------- 1 | /* http://stackoverflow.com/questions/14043727/auto-resizing-textarea-is-bumpy-highlighting-parentheses */ 2 | /* http://jsfiddle.net/ACF8e/ */ 3 | 4 | .defaultEm { 5 | font-size: 1em; 6 | position: absolute; 7 | line-height: 1; 8 | padding: 0; 9 | visibility: hidden; 10 | } 11 | .richtext { 12 | display: inline-block; 13 | overflow: hidden; 14 | color: #282828; 15 | background: #fff; 16 | margin: 2px 0; 17 | padding: 0px; 18 | vertical-align: top; 19 | outline: 0; 20 | border: 1px solid #BABABA; 21 | } 22 | .richtext pre { 23 | display: inline-block; 24 | z-index: 1; 25 | position: absolute; 26 | overflow: hidden; 27 | min-height: 25; 28 | background: #fff; 29 | outline: 0; 30 | white-space: pre-wrap; 31 | word-wrap: break-word; 32 | color: transparent; 33 | } 34 | .richtext > textarea, .richtext > pre { 35 | font-family: 'Courier New', Courier, monospace; 36 | font-size: 100%; 37 | line-height: 1.5; 38 | tab-size: 4; 39 | -moz-tab-size: 4; 40 | -o-tab-size: 4; 41 | -webkit-tab-size: 4; 42 | } 43 | #test:focus, input:focus, .fake_focus { 44 | border: 1px solid #85B6DA; 45 | outline: 0; 46 | } 47 | #test:active, input:active, .richtext:active { 48 | border: 1px solid #3385C2; 49 | } 50 | 51 | /* http://jsfiddle.net/ojetot9k/ */ 52 | .unmatched { 53 | animation: blink 1s steps(1) infinite; 54 | -webkit-animation: blink 1s steps(1) infinite; 55 | } 56 | @keyframes blink { 50% { background: red; } } 57 | @-webkit-keyframes blink { 50% { background: red; } } 58 | 59 | /* paren_0 is after paren_6 */ 60 | .paren_1 { 61 | background: #fab; 62 | } 63 | .paren_2 { 64 | background: #fdb; 65 | } 66 | .paren_3 { 67 | background: #ffd; 68 | } 69 | .paren_4 { 70 | background: #dfb; 71 | } 72 | .paren_5 { 73 | background: #cef; 74 | } 75 | .paren_6 { 76 | background: #dcf; 77 | } 78 | .paren_0 { 79 | background: #bbe; 80 | } 81 | .selected_paren { 82 | background: #999 !important; 83 | } 84 | .text { 85 | border-bottom: 1px solid #aaa; 86 | } 87 | .richtext textarea, .richtext pre { 88 | resize: none !important; 89 | outline: 0 !important; 90 | margin: 0 !important; 91 | padding: 0 !important; 92 | border: 0 !important; 93 | white-space: pre-wrap !important; 94 | word-wrap: break-word !important; 95 | overflow: hidden !important; 96 | } 97 | .richtext textarea { 98 | height: 100%; 99 | } 100 | -------------------------------------------------------------------------------- /microalg_export.l: -------------------------------------------------------------------------------- 1 | (setq !cmdes_sans_retour 2 | '(!!! AV BC LC TD TG Affecter_a Afficher Ajouter_a Cercle Contour 3 | Declarer Definir Ellipse Epaisseur Exemples_de 4 | Faire Initialiser@ RAZ Rectangle Remplissage Repere Repeter Retirer_de 5 | Retourner Segment Si Tant_que Tester Triangle) ) 6 | 7 | (de proteger_source src (mapcar 'proteger_source_aux src (need (length src) T))) 8 | (de proteger_source_aux (src premier_niveau) 9 | (cond 10 | ((num? src) (list 'Litteral src)) 11 | ((str? src) (list 'Litteral src)) 12 | ((sym? src) (if (index src '(Vrai Faux Rien Alors Sinon Tant_que Faire 13 | En_position De_type Fois)) 14 | src 15 | (list 'Variable src))) 16 | (T (if (and (not premier_niveau) 17 | (index (car src) !cmdes_sans_retour)) 18 | (list 'indent 19 | (cons (car src) 20 | (mapcar 'proteger_source_aux (cdr src)))) 21 | (cons (car src) (mapcar 'proteger_source_aux (cdr src))) 22 | ) 23 | ) 24 | ) 25 | ) 26 | 27 | (de proteger_source_sans_indentation src (mapcar 'proteger_source_sans_indentation_aux src)) 28 | (de proteger_source_sans_indentation_aux (src) 29 | (cond 30 | ((num? src) (list 'Litteral src)) 31 | ((str? src) (list 'Litteral src)) 32 | ((sym? src) (if (index src '(Vrai Faux Rien Alors Sinon Tant_que Faire 33 | En_position De_type Fois)) 34 | src 35 | (list 'Variable src))) 36 | (T (cons (car src) (mapcar 'proteger_source_sans_indentation_aux (cdr src)))) 37 | ) 38 | ) 39 | 40 | # Default implementation, should be reimplemented for every textual language: 41 | (de indent (!instr) !instr) 42 | # Standard implementation, if needed: 43 | (de indent_std (!instr) 44 | (let (!lines_with_final_NIL (mapcar pack (split (chop !instr) "^J")) 45 | !lines (reverse (cdr (reverse !lines_with_final_NIL)))) 46 | (mapcar (list '(!line) 47 | (list 'pack " " '!line "^J")) !lines) 48 | ) 49 | ) 50 | 51 | (ifn glue 52 | (de glue (c l) 53 | (cond 54 | ((not (<> 0 (length l))) "") 55 | ((not (<> 1 (length l))) (car l)) 56 | (T (pack (car l) c (glue c (cdr l)))) 57 | ) 58 | ) 59 | ) 60 | 61 | (ifn caadr 62 | (de caadr (arg) 63 | (car (car (cdr arg))) 64 | ) 65 | ) 66 | 67 | (setq Somme '+) 68 | (setq Diff '-) 69 | (setq Produit '*) 70 | (setq Quotient '/) 71 | (setq Reste '%) 72 | (setq Puissance '^) -------------------------------------------------------------------------------- /emulisp/pil-rjs: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ':' //; exec java -jar $(dirname "$(readlink -f "$0")")/../jar/js.jar "$0" "$@" 3 | 4 | // Helper file to run EmuLisp on RhinoJS. 5 | 6 | // Fix the default print in Rhino and add println: 7 | // See http://mail.openjdk.java.net/pipermail/nashorn-dev/2013-September/001951.html 8 | function print(arg) { 9 | java.lang.System.out.print(arg); 10 | } 11 | function println(arg) { 12 | java.lang.System.out.println(arg); 13 | } 14 | 15 | // Override _stdPrint with the official mechanism. 16 | function stdPrint(text) { 17 | print(text); 18 | } 19 | // Override _warn with the official mechanism. 20 | function warn(msg) { 21 | print(msg); 22 | } 23 | 24 | var NO_DEBUG = "piljs -> no debug yet"; 25 | 26 | // Load EmuLisp. 27 | // Trick to give Rhino the MicroAlg path: 28 | var before_rhino_regex = new RegExp('^(.*)js\.jar.*'); 29 | var matches = before_rhino_regex.exec(environment["sun.java.command"]); 30 | var abs_path = matches[1] + "../"; 31 | load(abs_path + 'emulisp/int.js'); 32 | load(abs_path + 'emulisp/emulisp_core.js'); 33 | 34 | // Process command line args. 35 | // TODO http://www.software-lab.de/doc/refL.html#load 36 | var arglist = arguments; 37 | while (true) { 38 | var arg = arglist.shift(); 39 | if (typeof arg == 'undefined') { 40 | // Now all command line args have been consumed. 41 | break; 42 | } 43 | var src; 44 | if (arg.slice(0, 1) == '-') { 45 | // Interpret arg as source code. 46 | src = '(' + arg.slice(1) + ')'; 47 | } else { 48 | // Interpret arg as a file to read. 49 | var f = new java.io.File(arg) 50 | if(f.exists()) { 51 | src = readFile(arg); 52 | } else { 53 | if (arg == '+') { 54 | println("+ not supported (yet)"); 55 | } else { 56 | println(arg + " not found."); 57 | } 58 | } 59 | } 60 | try { 61 | EMULISP_CORE.eval(src); 62 | } catch(e) { 63 | println(e.message) 64 | EMULISP_CORE.eval("(run *Err)"); 65 | println("? (" + NO_DEBUG + ")"); 66 | } 67 | } 68 | 69 | // REPL 70 | importPackage(java.io); 71 | importPackage(java.lang); 72 | var stdin = new BufferedReader(new InputStreamReader(System['in'])); 73 | var user_input; 74 | while (true) { 75 | print(': '); 76 | user_input = stdin.readLine(); 77 | try { 78 | var result = EMULISP_CORE.eval(user_input); 79 | println('-> ' + result); 80 | } catch(e) { 81 | println("!? " + user_input) 82 | println(e.message) 83 | EMULISP_CORE.eval("(run *Err)"); 84 | println("? (" + NO_DEBUG + ")"); 85 | } 86 | } 87 | 88 | // vim: filetype=javascript 89 | -------------------------------------------------------------------------------- /features/cli.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from lettuce import world, step, before, after 3 | import pexpect 4 | 5 | @before.each_scenario 6 | def world_init(scenario): 7 | world.interp = '' # name of the interpreter 8 | world.arg_list = [] # list of strings to provide to the interpreter 9 | world.process = None # the process pexpect will spawn 10 | world.timeout = 5 # timeout in seconds 11 | world.inputs = [] # list of strings that the user may input 12 | world.output = '' # string that will be displayed 13 | 14 | @step(u'Le programme (.*)') 15 | def le_programme(step, interp): 16 | world.interp = interp 17 | 18 | @step(u'Avec argument (.*)') 19 | def avec_argument(step, arg): 20 | world.arg_list.append(arg) 21 | 22 | @step(u'Ayant démarré') 23 | def ayant_demarre(step): 24 | world.process = pexpect.spawn(world.interp, world.arg_list, 25 | timeout=world.timeout) 26 | 27 | @step(u'Avec interaction (.*)') 28 | def avec_interaction(step, user_input): 29 | world.inputs.append(user_input) 30 | 31 | @step(u'Doit afficher «([^»]*)(»?)') 32 | def doit_afficher(step, expected, singleline): 33 | try: 34 | user_input = None 35 | # Append first prompt: 36 | world.process.expect('.*') 37 | world.output += world.process.after 38 | # Process user inputs: 39 | for user_input in world.inputs: 40 | world.process.sendline(user_input) 41 | world.process.expect('.*') 42 | world.output += world.process.after # we see input + result, nice 43 | # The end: 44 | world.process.expect('.*') 45 | # We rstrip because Lettuce seems to do the same when parsing multiline. 46 | world.output += world.process.after.rstrip('\n') 47 | world.process.expect(pexpect.EOF) 48 | except KeyboardInterrupt: 49 | print "Killing process before reraising KeyboardInterrupt." 50 | world.process.close() 51 | raise KeyboardInterrupt 52 | except pexpect.EOF: 53 | world.process.close() 54 | if user_input is None: 55 | tpl = "Le programme etait deja fini avant toute interaction.\n" + \ 56 | "La sortie etait %s" 57 | raise AssertionError(tpl % world.output) 58 | else: 59 | tpl = "Le programme etait deja fini lors de %s. La sortie etait %s" 60 | raise AssertionError(tpl % (user_input, world.output)) 61 | except pexpect.TIMEOUT: 62 | world.process.close() 63 | tpl = "Le test dure + de %s s. La sortie etait %s" 64 | raise AssertionError(tpl % (world.timeout, world.output)) 65 | # Post process output: 66 | world.output = world.output.replace('\r', '') 67 | if not singleline: 68 | expected = step.multiline 69 | # Final check: 70 | assert world.output == expected, \ 71 | u"Devait afficher %s, mais on a eu %s." % (expected, world.output) 72 | -------------------------------------------------------------------------------- /faq.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FAQ - MicroAlg 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 26 | 62 | 73 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /editeurs/scite/malg.api: -------------------------------------------------------------------------------- 1 | + x1 x2 ...: Additionne les nombres fournis en paramètre. 2 | - x1 x2: Soustrait x2 de x1. 3 | * x1 x2 ...: Multiplie les nombres fournis en paramètre. 4 | / x1 x2: Divise x1 par x2. 5 | % n1 n2: Reste de la division euclidienne de n1 par n2. 6 | ** x1 x2: Met x1 à la puissance x2. 7 | ^ x1 x2: Met x1 à la puissance x2. 8 | !!! "texte": Commentaire. 9 | = val1 val2 ...: Comparaison : val1 = val2. 10 | =/ val1 val2 ...: Comparaison : val1 =/ val2. 11 | < val1 val2 ...: Comparaison : val1 < val2. 12 | <= val1 val2 ...: Comparaison : val1 <= val2. 13 | > val1 val2 ...: Comparaison : val1 > val2. 14 | >= val1 val2 ...: Comparaison : val1 >= val2. 15 | ? Symbole remplaçant la commande à tester dans `Exemples_de`. 16 | Affecter_a var val [En_position idx]: Affectation de la valeur `val` à la variable `var`. 17 | Afficher val: Affiche la valeur `val`. 18 | Aide sym: Aide sur le symbole `sym`. 19 | Ajouter_a obj: Affecte un nouvel élément à la fin de `obj` (après le dernier élément). 20 | Alors : Mot-clef intermédiaire d'un `Si`. 21 | Concatener val1 val2 ...: Met bout à bout les textes ou valeurs. 22 | Declarer var1 var2 ... De_type "type" : Déclare les variables `var...` du type `type`. 23 | Definir (commande args) doc auteur instructions : Permet de définir des commandes. 24 | Demander : Retourne le texte tapé par l'utilisateur. 25 | Demander_un_nombre : Convertit le texte tapé par l'utilisateur en nombre et le retourne. 26 | En_position : Mot-clef intermédiaire pour la commande `Affecter_a`. 27 | Entier@ min max : Retourne un entier pseudo-aléatoire entre `min` et `max`. 28 | Et b1 b2 ...: Opération logique. 29 | Exemples_de commande [liste d’exemples]: Permet de lire ou écrire les exemples-tests d’une commande. 30 | Faire instructions Tant_que test: Boucle où `instructions` s’exécutent tant que `test` est `Vrai`. 31 | Faux : Booléen. 32 | Initialiser@ [val]: Initialise le générateur de valeurs pseudo-aléatoires. 33 | Liste [élements] : Construit une liste avec les paramètres fournis. 34 | Longueur val: Donne la longueur d'une liste ou d'un texte. 35 | Millisecondes: Donne le nombre de millisecondes écoulées depuis le début de l’exécution du programme. 36 | Nieme val pos: Retourne l'élément à la position `pos` dans la valeur `val`. 37 | Nieme@ val : Retourne un élément pseudo-aléatoire dans `val`. 38 | Nombre val: Convertit `val` en nombre. 39 | Non b: Opération logique. 40 | Ou b1 b2 ...: Opération logique. 41 | Queue val: Retourne `val` (liste ou texte), privé de son premier élément. 42 | Repere x_min x_max y_min y_max: Change la zone que le carré graphique représente. 43 | Repeter n Fois instructions: Répète `n` fois les `instructions`. 44 | Retirer_de obj: Retire le dernier élément à la fin de `obj` et le retourne. 45 | Retourner val: À utiliser à la fin de la définition d'une commande. 46 | Rien : Valeur représentant l'absence de valeur. 47 | Si test Alors instructions1 [Sinon instructions2]: Exécution conditionnelle. 48 | Sinon : Mot-clef intermédiaire d'un `Si`. 49 | Tant_que test Faire instructions: Boucle où `instructions` s’exécutent tant que `test` est `Vrai`. 50 | Tester cmd: Vérifie que les exemples de la commande passée en argument sont conformes. 51 | Tete val: Retourne le premier élément de `val` (liste ou texte). 52 | Texte val: Convertit `val` en texte. 53 | Type val: Retourne le type de la valeur `val`. 54 | Vide? val: Teste si `val` est vide. 55 | Vrai : Booléen. 56 | -------------------------------------------------------------------------------- /dev/version_suivante.txt: -------------------------------------------------------------------------------- 1 | git co master; 2 | ./microalg_tests.sh 3 | git push origin master 4 | 5 | déployer sur galerie via 6 | cd www/domains/galerie.microalg.info/microalg/ 7 | git co master 8 | git pull origin master 9 | Ctrl+F5 10 | # si ok 11 | git br -d prod_old; git co prod; git br prod_old; git merge master; git co master 12 | test de quelques pages: 13 | http://galerie.microalg.info/profgra:tests:images # pas de chance, bug 14 | http://galerie.microalg.info/profgra:tests:pgcd 15 | http://galerie.microalg.info/profgra:peda:fonctions_pures 16 | Si nouvelle conf: 17 | Ajouter section sur http://galerie.microalg.info/microalg:config_echantillons 18 | 19 | dans ce fichier: 20 | :%s/0.4.07/0.4.08/g # puis incrémenter le second 21 | :%s/0.4.06/0.4.07/g # remettre à la ver précédente, exécuter, incrémenter le second 22 | 23 | git tag -a v0.4.07 -f -m v0.4.07 24 | git push --tags 25 | 26 | # check nouveaux fichiers ou renames pour update README 27 | git log v0.4.06..v0.4.07 --diff-filter=A --summary | less 28 | git log v0.4.06..v0.4.07 --diff-filter=D --summary | less 29 | git log v0.4.06..v0.4.07 --diff-filter=R --summary | less 30 | 31 | git diff v0.4.06 v0.4.07 # pour préparer le change log 32 | Sur github, click sur Releases, puis sur la dernière, puis «Edit tag» 33 | Pas de «Release title» 34 | 35 | C’est l’occaze de peaufiner la release. 36 | 37 | ««« 38 | Voir les [instructions d’installation](https://github.com/Microalg/Microalg/blob/v0.4.07/INSTALL.md) ou [télécharger directement](https://github.com/Microalg/Microalg/releases/download/v0.4.07/microalg_0.4.07.zip) la version pour Windows (contenant l’éditeur SciTE 3.5.3). 39 | 40 | Changements notables depuis 0.4.06 : 41 | 42 | En bref : 43 | 44 | * Langage 45 | 46 | En détail : 47 | »»» 48 | 49 | num version 50 | git co master 51 | bump version dans microalg.l et microalg_tests.malg 52 | ./microalg_tests.sh 53 | modif INSTALL.md (à plusieurs endroits: 8 dans 6 lignes) 54 | # modif scripts de démarrage 55 | vim malg* # 7 fichiers 56 | git ap 57 | git cm "v0.4.06 -> v0.4.07" 58 | git push origin master 59 | git lol # pour vérif 60 | 61 | # redéployer sur galerie: 62 | git pull origin master # depuis serveur, puis 63 | git co prod; git merge master; git co master 64 | 65 | # faux tag «latest» sur working dir 66 | git co latest; git merge master; git push origin latest; git co master 67 | git lol # pour vérif 68 | 69 | git tag -a v0.4.07 -f -m v0.4.07 70 | git push --tags -f 71 | git lol # pour vérif 72 | 73 | git rma dist-win; git archive HEAD --prefix=microalg_0.4.07/ --format=zip > microalg_0.4.07.zip; git co master 74 | ajouter le zip à la release, puis publier 75 | 76 | déployer sur microalg.info 77 | # aller dans microalg.github.info 78 | git st 79 | # depuis microalg/github 80 | ./dev_tools/diff.microalg.info.sh 81 | # faire les copies, puis 82 | # check suppressions aussi 83 | # et attention aux fontes google à conserver (doc, ide, tutos) 84 | git add .; git cm "MAJ MicroAlg 0.4.07." 85 | modifs de index.html si besoin 86 | git push origin master 87 | modifs de index.html si besoin 88 | git push origin master 89 | 90 | 91 | tweet 92 | 93 | déployer sur profgra.org via (long !) 94 | cd /media/MOUSQUE/data/txt/ 95 | cd input/static/microalg 96 | git co master 97 | git pull origin master 98 | git rma pg.org.prod 99 | cd - 100 | sh ./html.sh; 101 | sh ./sync.sh 102 | 103 | -------------------------------------------------------------------------------- /web/jquery.terminal.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This css file is part of jquery terminal 3 | * 4 | * Licensed under GNU LGPL Version 3 license 5 | * Copyright (c) 2011-2013 Jakub Jankiewicz 6 | * 7 | */ 8 | .terminal .terminal-output .format, .cmd .format, 9 | .cmd .prompt, .cmd .prompt div, .terminal .terminal-output div div{ 10 | display: inline-block; 11 | } 12 | .cmd .clipboard { 13 | position: absolute; 14 | bottom: 0; 15 | left: 0; 16 | opacity: 0.01; 17 | filter: alpha(opacity = 0.01); 18 | filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.01); 19 | width: 2px; 20 | } 21 | .cmd > .clipboard { 22 | position: fixed; 23 | } 24 | .terminal { 25 | padding: 10px; 26 | position: relative; 27 | overflow: hidden; 28 | } 29 | .cmd { 30 | padding: 0; 31 | margin: 0; 32 | height: 1.3em; 33 | /*margin-top: 3px; */ 34 | } 35 | .cmd .cursor.blink { 36 | -webkit-animation: blink 1s infinite steps(1, start); 37 | -moz-animation: blink 1s infinite steps(1, start); 38 | -ms-animation: blink 1s infinite steps(1, start); 39 | animation: blink 1s infinite steps(1, start); 40 | } 41 | @keyframes blink { 42 | 0%, 100% { 43 | background-color: #000; 44 | color: #aaa; 45 | } 46 | 50% { 47 | background-color: #bbb; /* not #aaa because it's seem there is Google Chrome bug */ 48 | color: #000; 49 | } 50 | } 51 | @-webkit-keyframes blink { 52 | 0%, 100% { 53 | background-color: #000; 54 | color: #aaa; 55 | } 56 | 50% { 57 | background-color: #bbb; 58 | color: #000; 59 | } 60 | } 61 | @-ms-keyframes blink { 62 | 0%, 100% { 63 | background-color: #000; 64 | color: #aaa; 65 | } 66 | 50% { 67 | background-color: #bbb; 68 | color: #000; 69 | } 70 | } 71 | @-moz-keyframes blink { 72 | 0%, 100% { 73 | background-color: #000; 74 | color: #aaa; 75 | } 76 | 50% { 77 | background-color: #bbb; 78 | color: #000; 79 | } 80 | } 81 | .terminal .terminal-output div div, .cmd .prompt { 82 | display: block; 83 | line-height: 14px; 84 | height: auto; 85 | } 86 | .cmd .prompt { 87 | float: left; 88 | } 89 | .terminal, .cmd { 90 | font-family: FreeMono, monospace; 91 | color: #aaa; 92 | background-color: #000; 93 | font-size: 12px; 94 | line-height: 14px; 95 | } 96 | .terminal-output > div { 97 | /*padding-top: 3px;*/ 98 | min-height: 14px; 99 | } 100 | .terminal .terminal-output div span { 101 | display: inline-block; 102 | } 103 | .cmd span { 104 | float: left; 105 | /*display: inline-block; */ 106 | } 107 | .terminal .inverted, .cmd .inverted, .cmd .cursor.blink { 108 | background-color: #aaa; 109 | color: #000; 110 | } 111 | .terminal .terminal-output div div::-moz-selection, 112 | .terminal .terminal-output div span::-moz-selection, 113 | .terminal .terminal-output div div a::-moz-selection { 114 | background-color: #aaa; 115 | color: #000; 116 | } 117 | .terminal .terminal-output div div::selection, 118 | .terminal .terminal-output div div a::selection, 119 | .terminal .terminal-output div span::selection, 120 | .cmd > span::selection, 121 | .cmd .prompt span::selection { 122 | background-color: #aaa; 123 | color: #000; 124 | } 125 | .terminal .terminal-output div.error, .terminal .terminal-output div.error div { 126 | color: red; 127 | } 128 | .tilda { 129 | position: fixed; 130 | top: 0; 131 | left: 0; 132 | width: 100%; 133 | z-index: 1100; 134 | } 135 | .clear { 136 | clear: both; 137 | } 138 | .terminal a { 139 | color: #0F60FF; 140 | } 141 | .terminal a:hover { 142 | color: red; 143 | } 144 | -------------------------------------------------------------------------------- /web/showup.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Showup.js jQuery Plugin 3 | * http://github.com/jonschlinkert/showup 4 | * 5 | * Copyright (c) 2013 Jon Schlinkert, contributors 6 | * Licensed under the MIT License (MIT). 7 | */ 8 | 9 | /** 10 | * Docs navbar transitions effects 11 | */ 12 | 13 | .navbar { 14 | -webkit-transition: -webkit-transform .5s .5s, background .5s, color .1s; 15 | -moz-transition: -moz-transform .5s .5s, background .5s, color .1s; 16 | -o-transition: -o-transform .5s .5s, background .5s, color .1s; 17 | transition: transform .5s .5s, background .5s, color .1s; 18 | -webkit-transform: translate(0, 0); 19 | -ms-transform: translate(0, 0); 20 | transform: translate(0, 0); 21 | } 22 | 23 | .navbar-tall, 24 | .navbar-show { 25 | opacity: 1; 26 | -webkit-transition: -webkit-transform .25s, background 2s, color .3s; 27 | -moz-transition: -moz-transform .25s, background 2s, color .3s; 28 | -o-transition: -o-transform .25s, background 2s, color .3s; 29 | transition: transform .25s, background 2s, color .3s; 30 | -webkit-transform: translate(0, 0); 31 | -ms-transform: translate(0, 0); 32 | transform: translate(0, 0); 33 | } 34 | 35 | .navbar-hide { 36 | opacity: 0; 37 | -webkit-transition: -webkit-transform .2s, background .3s, color .3s, opacity 0 .3s; 38 | -moz-transition: -moz-transform .2s, background .3s, color .3s, opacity 0 .3s; 39 | -o-transition: -o-transform .2s, background .3s, color .3s, opacity 0 .3s; 40 | transition: transform .2s, background .3s, color .3s, opacity 0 .3s; 41 | -webkit-transform: translate(0, -80px); 42 | -ms-transform: translate(0, -80px); 43 | transform: translate(0, -80px); 44 | } 45 | 46 | 47 | .navbar-tall, 48 | .navbar-short, 49 | .navbar-tall .navbar-brand, 50 | .navbar-short .navbar-brand, 51 | .navbar-tall .navbar-nav > li > a, 52 | .navbar-short .navbar-nav > li > a { 53 | -webkit-transition: all 0.2s linear; 54 | transition: all 0.2s linear; 55 | } 56 | 57 | .navbar-short { 58 | min-height: 40px; 59 | } 60 | .navbar-short .navbar-brand { 61 | font-size: 16px; 62 | padding: 13px 15px 10px; 63 | } 64 | .navbar-short .navbar-nav > li > a { 65 | padding-top: 12px; 66 | padding-bottom: 12px; 67 | } 68 | 69 | 70 | .navbar-tall { 71 | min-height: 70px; 72 | } 73 | .navbar-tall .navbar-brand { 74 | font-size: 24px; 75 | padding: 25px 15px; 76 | } 77 | .navbar-tall .navbar-nav > li > a { 78 | padding-top: 25px; 79 | } 80 | 81 | 82 | 83 | /** 84 | * Docs Buttons 85 | */ 86 | 87 | /* Demo buttons are all