├── Documentation ├── part-user-manual.tex ├── part-interfaces.tex ├── chap-writing-backends.tex ├── chap-writing-syntax-analyzers.tex ├── part-appendices.tex ├── part-contributing.tex ├── other-macros.tex ├── chap-internals-common-lisp-mode.tex ├── part-internals.tex ├── codify ├── part-extension-writers-guide.tex ├── tex-dependencies ├── chap-mcclim-esa.tex ├── strip-dependence ├── fig-incomplete-expression.fig ├── Makefile ├── README.md ├── fig-extraneous-whitespace.fig ├── logos.tex ├── chap-suggested-contributions.tex ├── chap-intro.tex ├── chap-buffer-representation.tex ├── fig-wrong-indentation.fig ├── refmacros.tex ├── fig-wad.fig └── second-climacs.tex ├── .gitattributes ├── Code ├── Base │ ├── conditions.lisp │ ├── view-name.lisp │ ├── application.lisp │ ├── null-analyzer.lisp │ ├── view-class.lisp │ ├── fundamental-view.lisp │ ├── second-climacs-base.asd │ ├── packages.lisp │ ├── buffer.lisp │ ├── standard-buffer.lisp │ ├── analyzer.lisp │ └── window.lisp ├── Command │ ├── packages.lisp │ ├── second-climacs-command.asd │ ├── invocation.lisp │ └── command.lisp ├── GUI │ └── McCLIM-ESA │ │ ├── Simple-record │ │ ├── Test │ │ │ ├── packages.lisp │ │ │ ├── clim-simple-editor-record-test.disabled │ │ │ └── record-test.lisp │ │ ├── packages.lisp │ │ ├── clim-simple-editor-record.disabled │ │ └── line-output-records.lisp │ │ ├── Base │ │ ├── esa-buffer.lisp │ │ ├── with-current-cursor.lisp │ │ ├── text-pane.lisp │ │ ├── packages.lisp │ │ ├── second-climacs-clim-base.asd │ │ ├── insert-table.lisp │ │ ├── global-command-table.lisp │ │ ├── debug-table.lisp │ │ ├── climacs-clim-view.lisp │ │ ├── delete-table.lisp │ │ └── paredit-table.lisp │ │ ├── View │ │ ├── Fundamental │ │ │ ├── command-table.lisp │ │ │ ├── second-climacs-clim-fundamental-view.asd │ │ │ └── packages.lisp │ │ └── Common-Lisp │ │ │ ├── packages.lisp │ │ │ ├── indentation.lisp │ │ │ ├── second-climacs-clim-common-lisp-view.asd │ │ │ ├── utilities.lisp │ │ │ └── common-lisp-command-table.lisp │ │ ├── second-climacs-clim.asd │ │ └── io.lisp └── Syntax │ ├── Common-Lisp │ ├── set-mode.lisp │ ├── Buffer-compilation │ │ ├── packages.lisp │ │ └── second-climacs-buffer-compilation.asd │ ├── view.lisp │ ├── second-climacs-syntax-common-lisp.asd │ ├── packages.lisp │ ├── debug.lisp │ ├── Indentation │ │ ├── tagbody.lisp │ │ ├── block-etc.lisp │ │ ├── eval-when.lisp │ │ ├── the.lisp │ │ ├── check-type.lisp │ │ ├── locally.lisp │ │ ├── throw.lisp │ │ ├── define-modify-macro.lisp │ │ ├── multiple-value-setq.lisp │ │ ├── setf-and-setq.lisp │ │ ├── prog2.lisp │ │ ├── assert.lisp │ │ ├── defconstant.lisp │ │ ├── cond.lisp │ │ ├── prog1-etc.lisp │ │ ├── prog-progstar.lisp │ │ ├── destructuring-bind-etc.lisp │ │ ├── with-slots.lisp │ │ ├── handler-bind.lisp │ │ ├── defun.lisp │ │ ├── typecase.lisp │ │ ├── case.lisp │ │ ├── print-unreadable-object.lisp │ │ ├── dolist-dotimes.lisp │ │ ├── defmethod.lisp │ │ ├── second-climacs-syntax-common-lisp-indentation.asd │ │ ├── form.lisp │ │ ├── do-dostar.lisp │ │ ├── defsetf.lisp │ │ ├── make-instance-etc.lisp │ │ ├── handler-case.lisp │ │ ├── with-input-from-string.lisp │ │ ├── let-and-letstar.lisp │ │ ├── restart-case.lisp │ │ ├── flet-labels-macrolet.lisp │ │ └── type-specifier.lisp │ └── expression.lisp │ └── Fundamental │ ├── second-climacs-syntax-fundamental.asd │ ├── view.lisp │ └── packages.lisp ├── Papers └── Incremental-parsing │ ├── Talk │ ├── talk.tex │ ├── Logobx.pdf │ ├── labri-logo.pdf │ ├── Curves │ │ ├── insert-delete-double-quote.res │ │ ├── insert-delete-x.res │ │ ├── insert-delete-parenthesis.res │ │ ├── Makefile │ │ ├── insert-delete-x.gp │ │ ├── insert-delete-parenthesis.gp │ │ └── insert-delete-double-quote.gp │ ├── tex-dependencies │ ├── strip-dependence │ ├── fig-cache.fig │ ├── Makefile │ ├── logos.tex │ ├── fig-rehabilitation-a-1.fig │ ├── fig-invalidation-1.fig │ ├── fig-rehabilitation-b-4.fig │ ├── fig-rehabilitation-a-2.fig │ ├── fig-rehabilitation-b-5.fig │ ├── fig-rehabilitation-b-3.fig │ ├── fig-invalidation-2.fig │ ├── fig-rehabilitation-b-6.fig │ ├── fig-rehabilitation-a-3.fig │ ├── fig-rehabilitation-b-31.fig │ ├── fig-invalidation-3.fig │ ├── fig-rehabilitation-a.fig │ ├── fig-invalidation-4.fig │ ├── fig-invalidation-7.fig │ ├── fig-rehabilitation-b.fig │ ├── fig-rehabilitation.fig │ ├── fig-invalidation-5.fig │ ├── fig-invalidation.fig │ └── fig-invalidation-6.fig │ ├── sec-acknowledgements.tex │ ├── other-macros.tex │ ├── tex-dependencies │ ├── strip-dependence │ ├── Makefile │ ├── abstract.text │ ├── logos.tex │ ├── refmacros.tex │ ├── fig-general-instance.fig │ ├── app-reader-modification.tex │ ├── sec-conclusions.tex │ └── fig-after-invalidation.fig ├── .gitignore ├── get-dependencies.sh ├── LICENSE-BSD └── .github └── workflows └── build-binary.yml /Documentation/part-user-manual.tex: -------------------------------------------------------------------------------- 1 | \part{User manual} 2 | \inputtex{chap-user-cl-mode.tex} 3 | -------------------------------------------------------------------------------- /Documentation/part-interfaces.tex: -------------------------------------------------------------------------------- 1 | \part{User interfaces} 2 | 3 | \inputtex{chap-mcclim-esa.tex} 4 | -------------------------------------------------------------------------------- /Documentation/chap-writing-backends.tex: -------------------------------------------------------------------------------- 1 | \chapter{Writing backends} 2 | \label{chap-writing-backends} 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | Documentation/* linguist-documentation 2 | Papers/Incremental-parsing/* linguist-documentation 3 | -------------------------------------------------------------------------------- /Code/Base/conditions.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | (define-condition climacs-error (error) 4 | ()) 5 | -------------------------------------------------------------------------------- /Code/Command/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-command 2 | (:use 3 | #:common-lisp) 4 | 5 | (:export)) 6 | -------------------------------------------------------------------------------- /Documentation/chap-writing-syntax-analyzers.tex: -------------------------------------------------------------------------------- 1 | \chapter{Writing syntax analyzers} 2 | \label{chap-writing-syntax-analyzers} 3 | -------------------------------------------------------------------------------- /Documentation/part-appendices.tex: -------------------------------------------------------------------------------- 1 | \part{Appendices} 2 | \appendix 3 | 4 | \inputtex{app-internals-common-lisp-mode.tex} 5 | -------------------------------------------------------------------------------- /Code/Base/view-name.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | (defgeneric view-name (view) 4 | (:method (view) "Unknown")) 5 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/talk.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-strandh/Second-Climacs/HEAD/Papers/Incremental-parsing/Talk/talk.tex -------------------------------------------------------------------------------- /Code/Base/application.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | (defclass application () 4 | ((%views :initform '() :accessor views))) 5 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Logobx.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-strandh/Second-Climacs/HEAD/Papers/Incremental-parsing/Talk/Logobx.pdf -------------------------------------------------------------------------------- /Documentation/part-contributing.tex: -------------------------------------------------------------------------------- 1 | \part{Contributing} 2 | 3 | \inputtex{chap-general-coding-style.tex} 4 | \inputtex{chap-suggested-contributions.tex} 5 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/labri-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/robert-strandh/Second-Climacs/HEAD/Papers/Incremental-parsing/Talk/labri-logo.pdf -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/insert-delete-double-quote.res: -------------------------------------------------------------------------------- 1 | 120 10 1 18 2 | 80 15 1 15 3 | 60 20 1 17 4 | 24 100 1 33 5 | 36 100 1 50 6 | 120 10 30 70 7 | -------------------------------------------------------------------------------- /Documentation/other-macros.tex: -------------------------------------------------------------------------------- 1 | \def\sll{simply linked list} 2 | \def\Sll{Simply linked list} 3 | \def\dll{doubly linked list} 4 | \def\Dll{Doubly linked list} 5 | \def\ttt{2-3 tree} 6 | 7 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/insert-delete-x.res: -------------------------------------------------------------------------------- 1 | # nb forms & form size & ms 2 | 120 10 0.14 3 | 80 15 0.14 4 | 60 20 0.14 5 | 24 100 0.23 6 | 36 100 0.32 7 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Simple-record/Test/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:clim-simple-editor-record-test 2 | (:use 3 | #:common-lisp) 4 | 5 | (:shadow 6 | #:inspect) 7 | 8 | (:export)) 9 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/esa-buffer.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | (stealth-mixin:define-stealth-mixin 4 | buffer (esa-buffer:esa-buffer-mixin) 5 | base:buffer 6 | ()) 7 | -------------------------------------------------------------------------------- /Documentation/chap-internals-common-lisp-mode.tex: -------------------------------------------------------------------------------- 1 | \chapter{\commonlisp{} mode} 2 | 3 | \inputtex{sec-internals-common-lisp-mode-syntax.tex} 4 | \inputtex{sec-internals-common-lisp-mode-indentation.tex} 5 | -------------------------------------------------------------------------------- /Documentation/part-internals.tex: -------------------------------------------------------------------------------- 1 | \part{Internals} 2 | 3 | \inputtex{chap-buffer-representation.tex} 4 | \inputtex{chap-internals-control-structure.tex} 5 | \inputtex{chap-internals-common-lisp-mode.tex} 6 | -------------------------------------------------------------------------------- /Documentation/codify: -------------------------------------------------------------------------------- 1 | OUTFILE=$(echo $1 | sed -e 's/lisp/code/') 2 | echo -n "\\" >$OUTFILE 3 | echo "begin{Verbatim}[frame=single]" >>$OUTFILE 4 | expand $1 >>$OUTFILE 5 | echo "\\end{Verbatim}" >>$OUTFILE 6 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/insert-delete-parenthesis.res: -------------------------------------------------------------------------------- 1 | # nb forms & form size & ms 2 | 120 10 1.3 3 | 80 15 1.0 4 | 60 20 0.5 5 | 40 30 0.7 6 | 30 40 0.6 7 | 24 50 0.5 8 | 12 100 0.5 -------------------------------------------------------------------------------- /Documentation/part-extension-writers-guide.tex: -------------------------------------------------------------------------------- 1 | \part{Extension writer's guide} 2 | \inputtex{chap-general-structure.tex} 3 | \inputtex{chap-writing-backends.tex} 4 | \inputtex{chap-writing-syntax-analyzers.tex} 5 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/sec-acknowledgements.tex: -------------------------------------------------------------------------------- 1 | \section{Acknowledgments} 2 | 3 | We would like to thank Philipp Marek and Cyrus Harmon for providing 4 | valuable feedback on early versions of this paper. 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.fasl 2 | *~ 3 | *.fig.bak 4 | *.aux 5 | *.bbl 6 | *.blg 7 | *.cb 8 | *.cb2 9 | *.idx 10 | *.ilg 11 | *.ind 12 | *.log 13 | *.pdf 14 | *.pdf_t 15 | *.toc 16 | *.code 17 | *.dvi 18 | *.ps 19 | *.dot 20 | 21 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/set-mode.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (defun set-common-lisp-mode (view) 4 | (change-class (base:analyzer view) 'cache) 5 | (change-class view 'common-lisp-view)) 6 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Simple-record/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:clim-simple-editor-record 2 | (:use 3 | #:common-lisp) 4 | 5 | (:export 6 | #:relative-coordinates-output-record-mixin 7 | #:record 8 | #:line-count)) 9 | -------------------------------------------------------------------------------- /Documentation/tex-dependencies: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #set -x 4 | TEXFILES=$(./strip-dependence inputtex $1) 5 | echo -n $TEXFILES 6 | for i in $TEXFILES 7 | do 8 | echo -n " " $(./tex-dependencies $i) 9 | done 10 | echo 11 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/tex-dependencies: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -x 3 | echo -n "$1 " 4 | TEXFILES=$(./strip-dependence inputtex $1) 5 | for i in $TEXFILES 6 | do 7 | ./tex-dependencies $i 8 | done 9 | 10 | 11 | -------------------------------------------------------------------------------- /Documentation/chap-mcclim-esa.tex: -------------------------------------------------------------------------------- 1 | \chapter{McCLIM ESA} 2 | 3 | Currently, the only user interface for \sysname{} is based on McCLIM 4 | and the additional library ESA (Emacs Style Application) available in 5 | the McCLIM distribution. 6 | -------------------------------------------------------------------------------- /Code/Command/second-climacs-command.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-command" 2 | :depends-on ("acclimation") 3 | :serial t 4 | :components ((:file "packages") 5 | (:file "command") 6 | (:file "invocation"))) 7 | -------------------------------------------------------------------------------- /Documentation/strip-dependence: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | CHAINE=$1 3 | MOTIF="^\\\\$CHAINE\{.*\}" 4 | shift 5 | for i in $* 6 | do 7 | egrep $MOTIF $i \ 8 | | sed "s/^\\\\$CHAINE{\(.*\)}/\1/" \ 9 | | tr ['\n'] [' '] 10 | done 11 | 12 | 13 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/other-macros.tex: -------------------------------------------------------------------------------- 1 | \def\sll{simply linked list} 2 | \def\Sll{Simply linked list} 3 | \def\dll{doubly linked list} 4 | \def\Dll{Doubly linked list} 5 | \def\ttt{2-3 tree} 6 | \def\fixme#1{\footnote{\color{red}FIXME: #1}} 7 | 8 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/tex-dependencies: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #set -x 4 | TEXFILES=$(./strip-dependence inputtex $1) 5 | echo -n $TEXFILES 6 | for i in $TEXFILES 7 | do 8 | echo -n " " $(./tex-dependencies $i) 9 | done 10 | echo 11 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/strip-dependence: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CHAINE=$1 3 | MOTIF="^\\\\$CHAINE\{.*\}" 4 | shift 5 | for i in $* 6 | do 7 | egrep $MOTIF $i \ 8 | | sed "s/^\\\\$CHAINE{\(.*\)}/\1/" \ 9 | | tr ['\n'] [' '] 10 | done 11 | 12 | 13 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/strip-dependence: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | CHAINE=$1 3 | MOTIF="^\\\\$CHAINE\{.*\}" 4 | shift 5 | for i in $* 6 | do 7 | egrep $MOTIF $i \ 8 | | sed "s/^\\\\$CHAINE{\(.*\)}/\1/" \ 9 | | tr ['\n'] [' '] 10 | done 11 | 12 | 13 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Buffer-compilation/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-buffer-compilation 2 | (:use 3 | #:common-lisp) 4 | 5 | (:local-nicknames 6 | (#:ip #:incrementalist) 7 | (#:clo #:clostrum) 8 | (#:tru #:trucler)) 9 | 10 | (:export)) 11 | -------------------------------------------------------------------------------- /Code/Syntax/Fundamental/second-climacs-syntax-fundamental.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-syntax-fundamental" 2 | :depends-on ("cluffer" 3 | "second-climacs-base") 4 | :serial t 5 | :components ((:file "packages") 6 | (:file "analyzer") 7 | (:file "view"))) 8 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Fundamental/command-table.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-view-fundamental) 2 | 3 | (clim:define-command-table fundamental-table 4 | :inherit-from 5 | (clim-base:global-table 6 | clim-base:ascii-insert-table 7 | clim-base:delete-table 8 | clim-base:motion-table)) 9 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Simple-record/Test/clim-simple-editor-record-test.disabled: -------------------------------------------------------------------------------- 1 | (defsystem "clim-simple-editor-record-test" 2 | :depends-on ("mcclim" 3 | "clim-simple-editor-record" 4 | "clouseau") 5 | :serial t 6 | :components ((:file "packages") 7 | (:file "record-test"))) 8 | -------------------------------------------------------------------------------- /Code/Base/null-analyzer.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | ;;; A NULL-ANALYZER is an analyzer that does no analysis. 4 | 5 | (defclass null-analyzer (analyzer) ()) 6 | 7 | (defmethod update-analyzer-from-buffer ((analyzer null-analyzer) buffer) 8 | (declare (ignorable analyzer) (ignore buffer)) 9 | nil) 10 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Buffer-compilation/second-climacs-buffer-compilation.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-buffer-compilation" 2 | :depends-on ("second-climacs-syntax-common-lisp" 3 | "common-boot" 4 | "common-boot-macros" 5 | "trucler-native") 6 | :serial t 7 | :components ((:file "packages"))) 8 | -------------------------------------------------------------------------------- /Code/Base/view-class.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | (defparameter *view-classes* (make-hash-table :test #'equal)) 4 | 5 | (defun view-class (file-extension) 6 | (gethash file-extension *view-classes*)) 7 | 8 | (defun (setf view-class) (view-class file-extension) 9 | (setf (gethash file-extension *view-classes*) view-class)) 10 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Fundamental/second-climacs-clim-fundamental-view.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-clim-fundamental-view" 2 | :depends-on ("second-climacs-syntax-fundamental" 3 | "second-climacs-clim-base" 4 | "stealth-mixin") 5 | :serial t 6 | :components ((:file "packages") 7 | (:file "view") 8 | (:file "command-table"))) 9 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/Makefile: -------------------------------------------------------------------------------- 1 | FILES=$(wildcard *.res) 2 | TARGETS=$(FILES:.res=.eps) 3 | SCRIPTS=$(FILES:.res=.gp) 4 | PDF=$(FILES:.res=-eps-converted-to.pdf) 5 | 6 | all: $(TARGETFILES) 7 | echo $(PDF) 8 | for i in $(SCRIPTS) ; do \ 9 | gnuplot ./$$i ; \ 10 | done 11 | 12 | clean: 13 | -rm -f *~ 14 | 15 | spotless: 16 | -rm -f $(TARGETS) 17 | -rm -f $(PDF) 18 | -------------------------------------------------------------------------------- /Code/Syntax/Fundamental/view.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-fundamental) 2 | 3 | (defclass view (base:view) ()) 4 | 5 | (defmethod initialize-instance :after ((instance view) &key buffer) 6 | (let ((analyzer (make-instance 'analyzer :buffer buffer))) 7 | (reinitialize-instance instance :analyzer analyzer))) 8 | 9 | (defmethod base:view-name ((view view)) 10 | "Fundamental") 11 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/insert-delete-x.gp: -------------------------------------------------------------------------------- 1 | # gnuplot 2 | set terminal postscript eps color 3 | set output "insert-delete-x.eps" 4 | set title "Inserting and deleting a constituent character" 5 | set key off inside center # top 6 | set xlabel "Number of lines" 7 | set ylabel "Time in ms" 8 | set yrange [0:] 9 | 10 | plot "insert-delete-x.res" using ($1*$2):3 with lines lc rgb 'blue' 11 | 12 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/insert-delete-parenthesis.gp: -------------------------------------------------------------------------------- 1 | # gnuplot 2 | 3 | set terminal postscript eps color 4 | set output "insert-delete-parenthesis.eps" 5 | set title "Inserting and deleting a left parenthesis" 6 | set key off inside center top 7 | set yrange [0:] 8 | set xlabel "Number of forms" 9 | set ylabel "Time in ms" 10 | 11 | plot 'insert-delete-parenthesis.res' using 1:3 with lines lc rgb 'green' 12 | 13 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Fundamental/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-clim-view-fundamental 2 | (:use 3 | #:common-lisp) 4 | 5 | (:local-nicknames 6 | (#:edit #:text.editing) 7 | (#:base #:second-climacs-base) 8 | (#:fundamental-syntax #:second-climacs-syntax-fundamental) 9 | (#:clim-base #:second-climacs-clim-base)) 10 | 11 | (:export 12 | #:fundamental-view)) 13 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/Curves/insert-delete-double-quote.gp: -------------------------------------------------------------------------------- 1 | # gnuplot 2 | 3 | set terminal postscript eps color 4 | set output "insert-delete-double-quote.eps" 5 | set title "Inserting and deleting a double quote" 6 | set key off inside center top 7 | set xlabel "Number of characters" 8 | set ylabel "Time in ms" 9 | set yrange [0:] 10 | plot 'insert-delete-double-quote.res' using ($1*$2*$3):4 with lines lc rgb 'red' 11 | 12 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Common-Lisp/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-clim-view-common-lisp 2 | (:use 3 | #:common-lisp) 4 | 5 | (:local-nicknames 6 | (#:ip #:incrementalist) 7 | (#:edit #:text.editing) 8 | (#:edit.search #:text.editing.search) 9 | 10 | (#:base #:second-climacs-base) 11 | (#:cl-syntax #:second-climacs-syntax-common-lisp) 12 | (#:clim-base #:second-climacs-clim-base))) 13 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/second-climacs-clim.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-clim" 2 | :depends-on ("second-climacs-clim-base" 3 | "second-climacs-clim-fundamental-view" 4 | "second-climacs-clim-common-lisp-view") 5 | :serial t 6 | :components ((:file "gui") 7 | (:file "io")) 8 | ;; Executable 9 | :build-operation asdf:program-op 10 | :build-pathname "second-climacs" 11 | :entry-point "second-climacs-clim-base:climacs") 12 | -------------------------------------------------------------------------------- /Code/Base/fundamental-view.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | ;;; A FUNDAMENTAL-VIEW contains a NULL-ANALYZER. 4 | 5 | (defclass fundamental-view (view) ()) 6 | 7 | (defmethod initialize-instance :after ((instance fundamental-view) &key) 8 | (let* ((buffer (make-empty-standard-buffer)) 9 | (cursor (edit:point buffer)) 10 | (analyzer (make-instance 'null-analyzer :buffer buffer))) 11 | (reinitialize-instance instance :cursor cursor :analyzer analyzer))) 12 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/with-current-cursor.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | (defun current-view () 4 | (let ((clim-view (clim:stream-default-view (esa:current-window)))) 5 | (climacs-view clim-view))) 6 | 7 | (defun current-cursor () 8 | (edit:point (base:site (current-view)))) 9 | 10 | (defun current-buffer () 11 | (cluffer:buffer (current-cursor))) 12 | 13 | (defmacro with-current-cursor ((cursor-var) &body body) 14 | `(let ((,cursor-var (current-cursor))) 15 | ,@body)) 16 | -------------------------------------------------------------------------------- /Code/Syntax/Fundamental/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-syntax-fundamental 2 | (:use 3 | #:common-lisp) 4 | 5 | (:local-nicknames 6 | (#:base #:second-climacs-base)) 7 | 8 | (:shadow 9 | #:list-length) 10 | 11 | (:export 12 | #:analyzer 13 | #:view 14 | #:list-length 15 | #:contents 16 | #:prefix 17 | #:suffix 18 | #:push-to-prefix 19 | #:pop-from-prefix 20 | #:push-to-suffix 21 | #:pop-from-suffix 22 | #:prefix-to-suffix 23 | #:suffix-to-prefix 24 | #:adjust-prefix-and-suffix 25 | #:scavenge)) 26 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/view.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (defmethod base:buffer ((analyzer ip:analyzer)) 4 | (ip:buffer analyzer)) 5 | 6 | (defclass view (base:view) ()) 7 | 8 | (defmethod initialize-instance :after ((instance view) &key buffer) 9 | (let ((analyzer (make-instance 'ip:analyzer :buffer buffer))) 10 | (reinitialize-instance instance :analyzer analyzer))) 11 | 12 | (defmethod base:view-name ((view view)) 13 | "Common Lisp") 14 | 15 | (setf (base:view-class "lisp") 'view 16 | (base:view-class "asd") 'view) 17 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/second-climacs-syntax-common-lisp.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-syntax-common-lisp" 2 | :depends-on ("incrementalist" 3 | "second-climacs-base" 4 | ; "second-climacs-syntax-common-lisp-indentation" 5 | "concrete-syntax-tree" 6 | "utilities.print-tree") ; for debugging 7 | :serial t 8 | :components ((:file "packages") 9 | (:file "expression") 10 | (:file "view") 11 | (:file "set-mode") 12 | (:file "fill-paragraph") 13 | (:file "debug"))) 14 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-syntax-common-lisp 2 | (:use 3 | #:common-lisp) 4 | 5 | (:shadow 6 | #:package-name #:symbol-name) 7 | 8 | (:local-nicknames 9 | (#:edit #:text.editing) 10 | (#:edit.exp #:text.editing.expression) 11 | (#:ip #:incrementalist) 12 | 13 | (#:base #:second-climacs-base)) 14 | 15 | (:export 16 | #:line-length 17 | #:item 18 | #:common-lisp-view 19 | #:set-common-lisp-mode 20 | #:view 21 | 22 | #:indent-line 23 | 24 | #:fill-paragraph 25 | 26 | #:print-wad-tree 27 | #:first-top-level-wad)) 28 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Common-Lisp/indentation.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-view-common-lisp) 2 | 3 | (clim:define-command 4 | (com-indent-line :name t :command-table common-lisp-table) 5 | () 6 | (let* ((view (clim:stream-default-view (esa:current-window))) 7 | (climacs-view (clim-base:climacs-view view)) 8 | (analyzer (base:analyzer climacs-view)) 9 | (cache (ip:cache analyzer))) 10 | (ip:update analyzer) 11 | (clim-base:with-current-cursor (cursor) 12 | (cl-syntax:indent-line cache cursor)))) 13 | 14 | (esa:set-key `(com-indent-line) 'common-lisp-table '((#\i :control))) 15 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Common-Lisp/second-climacs-clim-common-lisp-view.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-clim-common-lisp-view" 2 | :depends-on ("second-climacs-clim-base" 3 | "second-climacs-syntax-common-lisp" 4 | "stealth-mixin") 5 | :serial t 6 | :components ((:file "packages") 7 | (:file "utilities") 8 | (:file "drawing-utilities") 9 | (:file "drawing-decorations") 10 | (:file "drawing-wads") 11 | (:file "common-lisp-view") 12 | (:file "common-lisp-command-table") 13 | #+(or) (:file "indentation"))) 14 | -------------------------------------------------------------------------------- /Documentation/fig-incomplete-expression.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 0 32 #ff6059 11 | 0 33 #cfcfcf 12 | 2 2 0 1 31 31 50 -1 20 0.000 0 0 -1 0 0 5 13 | 460 480 573 480 573 667 460 667 460 480 14 | 2 2 0 1 0 4 55 -1 -1 0.000 0 0 -1 0 0 5 15 | 225 225 6750 225 6750 1800 225 1800 225 225 16 | 4 0 0 50 -1 5 12 0.0000 0 150 1560 450 630 (defun ff (x)\001 17 | 4 0 0 50 -1 5 12 0.0000 0 165 960 450 825 (gg x)\001 18 | 4 0 0 50 -1 5 12 0.0000 0 165 1560 450 1215 (defun gg (y)\001 19 | 4 0 0 50 -1 5 12 0.0000 0 165 1080 450 1410 (ff y))\001 20 | -------------------------------------------------------------------------------- /Code/Base/second-climacs-base.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-base" 2 | :depends-on ("cluffer" 3 | 4 | "text.editing" 5 | 6 | "esa-mcclim") 7 | :serial t 8 | :components ((:file "packages") 9 | (:file "buffer") 10 | (:file "standard-buffer") 11 | (:file "analyzer") 12 | (:file "null-analyzer") 13 | (:file "view") 14 | (:file "view-class") 15 | (:file "view-name") 16 | (:file "fundamental-view") 17 | (:file "window") 18 | (:file "application") 19 | (:file "conditions"))) 20 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/debug.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; Return the first top-level wad, or NIL if there is no top-level 4 | ;;; wad. 5 | (defun first-top-level-wad (cache) 6 | (if (null (ip::prefix cache)) 7 | (if (null (ip::suffix cache)) 8 | nil 9 | (first (ip::suffix cache))) 10 | (first (last (ip::prefix cache))))) 11 | 12 | (defun print-wad-tree (root stream) 13 | (utilities.print-tree:print-tree 14 | stream root 15 | (utilities.print-tree:make-node-printer 16 | (lambda (stream depth node) 17 | (declare (ignore depth)) 18 | (princ node stream)) 19 | nil 20 | #'ip:children))) 21 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/text-pane.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | (defparameter *default-text-style* 4 | (clim:make-text-style :fix :roman 14)) 5 | 6 | (defclass text-pane (esa:esa-pane-mixin 7 | clim:application-pane) 8 | ((%left-gutter :initarg :left-gutter :reader left-gutter)) 9 | (:default-initargs 10 | :background clim:+white+ 11 | :text-style *default-text-style*)) 12 | 13 | (defmethod clim:stream-output-history ((stream text-pane)) 14 | (let ((view (clim:stream-default-view stream))) 15 | (if (typep view 'climacs-clim-view) 16 | (output-history (clim:stream-default-view stream)) 17 | (call-next-method)))) 18 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/tagbody.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-tagbody-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | tag-or-form 10 | (if (atom (cst:raw current-wad)) 11 | ;; We have a label. 12 | (maybe-assign-indentation 2 4) 13 | ;; We have a form. 14 | (progn 15 | (maybe-assign-indentation 4 4) 16 | (compute-form-indentation current-wad nil client))) 17 | (next) 18 | (go tag-or-form))) 19 | 20 | (define-form-indentation-method 21 | ('#:common-lisp '#:tagbody) compute-tagbody-indentations) 22 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/View/Common-Lisp/utilities.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-view-common-lisp) 2 | 3 | (defmacro with-current-cursor-and-cache 4 | ((cursor-variable cache-variable) &body body) 5 | (let ((view-variable (gensym)) 6 | (climacs-view-variable (gensym)) 7 | (analyzer-variable (gensym))) 8 | `(let* ((,view-variable (clim:stream-default-view (esa:current-window))) 9 | (,climacs-view-variable (clim-base:climacs-view ,view-variable)) 10 | (,analyzer-variable (base:analyzer ,climacs-view-variable)) 11 | (,cache-variable (ip:cache ,analyzer-variable))) 12 | (base:update-view ,climacs-view-variable) 13 | (clim-base:with-current-cursor (,cursor-variable) 14 | ,@body)))) 15 | -------------------------------------------------------------------------------- /Code/Base/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-base 2 | (:use 3 | #:common-lisp) 4 | 5 | (:local-nicknames 6 | (#:edit #:text.editing) 7 | (#:edit.search #:text.editing.search)) 8 | 9 | (:export 10 | #:buffer 11 | #:standard-buffer 12 | #:make-empty-standard-buffer 13 | #:fill-buffer-from-stream 14 | #:analyzer 15 | #:update-analyzer-from-buffer 16 | #:update-analyzer 17 | #:null-analyzer 18 | #:view 19 | #:view-class 20 | #:view-name 21 | #:site 22 | #:window 23 | #:update-view-from-analyzer 24 | #:update-view 25 | #:hide-view 26 | #:expose-view 27 | #:fundamental-view 28 | #:update-window-from-view 29 | #:update-window 30 | #:application 31 | #:views 32 | #:climacs-error)) 33 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/block-etc.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-block-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to be the block name. We don't do 10 | ;; anything in particular with it. 11 | (maybe-assign-indentation 4 2) 12 | (next) 13 | form 14 | ;; We should now be among the remaining forms. 15 | (maybe-assign-indentation 2 2) 16 | (compute-form-indentation current-wad nil client) 17 | (next) 18 | (go form))) 19 | 20 | (define-form-indentation-method 21 | ('#:common-lisp '#:block) compute-block-indentations) 22 | -------------------------------------------------------------------------------- /Code/Base/buffer.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | ;;; A BUFFER is an object that holds data to be operated on and 4 | ;;; displayed. An instance of this class typically contains a 5 | ;;; reference to another object, perhaps provided by an external 6 | ;;; library. 7 | ;;; 8 | ;;; A typical situation would be that a subclass of BUFFER contains a 9 | ;;; slot holding a reference to a Cluffer buffer object. 10 | 11 | (defclass buffer () 12 | ()) 13 | 14 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 15 | ;;; 16 | ;;; Generic function FILL-BUFFER-FROM-STREAM. 17 | ;;; 18 | ;;; This function takes a cursor, and inserts the contents of the 19 | ;;; character stream STREAM at the position of the cursor. 20 | 21 | (defgeneric fill-buffer-from-stream (cursor stream)) 22 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/eval-when.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-eval-when-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to represent the list of situations. We 10 | ;; think it is unlikely that situations will be separated by 11 | ;; newlines, so we do nothing special for this list. 12 | (maybe-assign-indentation 4 2) 13 | (next) 14 | form 15 | (maybe-assign-indentation 2 2) 16 | (compute-form-indentation current-wad nil client) 17 | (next) 18 | (go form))) 19 | 20 | (define-form-indentation-method 21 | ('#:common-lisp '#:eval-when) compute-eval-when-indentations) 22 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/the.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-the-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to be a type specifier. 10 | (maybe-assign-indentation 4 2) 11 | (compute-type-specifier-indentation current-wad nil client) 12 | (next) 13 | form 14 | (maybe-assign-indentation 2 2) 15 | (compute-form-indentation current-wad nil client) 16 | (next) 17 | ;; There should be just one form, but we indent any extraneous 18 | ;; expressions as forms. 19 | (go form))) 20 | 21 | (define-form-indentation-method 22 | ('#:common-lisp '#:the) compute-the-indentations) 23 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/check-type.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-check-type-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to represent the place. 10 | (maybe-assign-indentation 4 2) 11 | (compute-form-indentation current-wad nil client) 12 | (next) 13 | ;; The current wad ought to represent the type specifier. 14 | (maybe-assign-indentation 2 2) 15 | (compute-type-specifier-indentation current-wad nil client) 16 | (next) 17 | ;; If we come here, it's because the optional string is present. 18 | (maybe-assign-indentation 2 2))) 19 | 20 | (define-form-indentation-method 21 | ('#:common-lisp '#:check-type) compute-check-type-indentations) 22 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/locally.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-locally-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | declaration-or-form 10 | (when (and (consp (cst:raw current-wad)) 11 | (wad-represents-symbol-p 12 | (first (ip:children current-wad)) 13 | 'declare)) 14 | (maybe-assign-indentation 4 2) 15 | (compute-declare-indentation current-wad client) 16 | (next) 17 | (go declaration-or-form)) 18 | form 19 | (maybe-assign-indentation 2 2) 20 | (compute-form-indentation current-wad nil client) 21 | (next) 22 | (go form))) 23 | 24 | (define-form-indentation-method 25 | ('#:common-lisp '#:locally) compute-locally-indentations) 26 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/throw.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-throw-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to be the tag which is a form. 10 | (maybe-assign-indentation 4 2) 11 | (compute-form-indentation current-wad nil client) 12 | (next) 13 | ;; The current wad ought to be the result form. 14 | (maybe-assign-indentation 2 2) 15 | (compute-form-indentation current-wad nil client))) 16 | 17 | (define-form-indentation-method 18 | ('#:common-lisp '#:catch) compute-throw-indentations) 19 | 20 | (define-form-indentation-method 21 | ('#:common-lisp '#:throw) compute-throw-indentations) 22 | 23 | (define-form-indentation-method 24 | ('#:common-lisp '#:return-from) compute-throw-indentations) 25 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/define-modify-macro.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-define-modify-macro-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 6) 8 | (next) 9 | ;; The current wad ought to be the name. 10 | (maybe-assign-indentation 6 4) 11 | (next) 12 | ;; The current wad ought to be the lambda list. 13 | (maybe-assign-indentation 4 2) 14 | (compute-lambda-list-indentation current-wad client) 15 | (next) 16 | ;; The current wad ought to be the function symbol. 17 | (maybe-assign-indentation 2 2) 18 | (next) 19 | ;; Come here if the optional documentation is given 20 | (maybe-assign-indentation 2 2))) 21 | 22 | (define-form-indentation-method 23 | ('#:common-lisp '#:define-modify-macro) 24 | compute-define-modify-macro-indentations) 25 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/packages.lisp: -------------------------------------------------------------------------------- 1 | (cl:defpackage #:second-climacs-clim-base 2 | (:use 3 | #:common-lisp) 4 | 5 | (:local-nicknames 6 | (#:edit #:text.editing) 7 | (#:edit.search #:text.editing.search) 8 | (#:edit.exp #:text.editing.expression) 9 | (#:ip #:incrementalist) 10 | 11 | (#:base #:second-climacs-base) 12 | (#:fundamental-syntax #:second-climacs-syntax-fundamental) 13 | (#:cl-syntax #:second-climacs-syntax-common-lisp)) 14 | 15 | (:export 16 | #:climacs 17 | #:text-pane 18 | #:global-table 19 | #:motion-table 20 | #:ascii-insert-table 21 | #:insert-table 22 | #:delete-table 23 | #:make-climacs-clim-view 24 | #:climacs-clim-view 25 | #:climacs-view 26 | #:update-view 27 | #:command-table 28 | #:left-gutter 29 | #:with-current-cursor) 30 | 31 | (:export 32 | #:move-viewport-to-cursor 33 | #:move-cursor-to-viewport)) 34 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Makefile: -------------------------------------------------------------------------------- 1 | NAME=incremental-parsing 2 | 3 | TEXFILES=$(NAME).tex $(shell ./tex-dependencies $(NAME).tex) 4 | BIBFILES=$(NAME).bib 5 | PDF_T=$(shell ./strip-dependence inputfig $(TEXFILES)) 6 | VERBATIM=$(shell ./strip-dependence verbatimtabinput $(TEXFILES)) 7 | CODEFILES=$(shell ./strip-dependence inputcode $(TEXFILES)) 8 | PDF=$(subst .pdf_t,.pdf,$(PDF_T)) 9 | 10 | all : $(NAME).pdf 11 | 12 | %.pdf: %.fig 13 | fig2dev -Lpdftex -m 0.5 $< $@ 14 | 15 | %.pdf_t: %.fig %.pdf 16 | fig2dev -Lpdftex_t -m 0.5 -p $(basename $<).pdf $< $@ 17 | 18 | %.code: %.lisp 19 | ./codify $< 20 | 21 | $(NAME).pdf: $(TEXFILES) $(PDF) $(PDF_T) $(VERBATIM) $(CODEFILES) $(BIBFILES) 22 | pdflatex $< 23 | bibtex $(NAME) 24 | pdflatex $< 25 | pdflatex $< 26 | 27 | view: $(NAME).pdf 28 | xpdf $< 29 | 30 | clean: 31 | rm -f *.aux *.log *~ *.pdf *.pdf *.pdf_t *.bbl *.blg 32 | 33 | spotless: clean 34 | rm -f *.ps *.dvi *.pdf *.pdf_t *.toc *.idx *.ilg *.ind *.fig.bak 35 | rm -f *.out *.cb *.cb2 36 | -------------------------------------------------------------------------------- /Documentation/Makefile: -------------------------------------------------------------------------------- 1 | NAME=second-climacs 2 | 3 | TEXFILES=$(NAME).tex $(shell ./tex-dependencies $(NAME).tex) 4 | BIBFILES=$(NAME).bib 5 | PDF_T=$(shell ./strip-dependence inputfig $(TEXFILES)) 6 | VERBATIM=$(shell ./strip-dependence verbatimtabinput $(TEXFILES)) 7 | CODEFILES=$(shell ./strip-dependence inputcode $(TEXFILES)) 8 | PDF=$(subst .pdf_t,.pdf,$(PDF_T)) 9 | 10 | all : $(NAME).pdf 11 | 12 | %.pdf: %.fig 13 | fig2dev -Lpdftex -m 0.75 $< $@ 14 | 15 | %.pdf_t: %.fig %.pdf 16 | fig2dev -Lpdftex_t -m 0.75 -p $(basename $<).pdf $< $@ 17 | 18 | %.code: %.lisp 19 | ./codify $< 20 | 21 | $(NAME).pdf: $(TEXFILES) $(PDF) $(PDF_T) $(VERBATIM) $(CODEFILES) $(BIBFILES) 22 | pdflatex $< 23 | makeindex $(NAME) 24 | bibtex $(NAME) 25 | pdflatex $< 26 | pdflatex $< 27 | 28 | view: $(NAME).pdf 29 | xpdf $< 30 | 31 | clean: 32 | rm -f *.aux *.log *~ *.pdf *.pdf *.pdf_t *.bbl *.blg 33 | 34 | spotless: clean 35 | rm -f *.ps *.dvi *.pdf *.pdf_t *.toc *.idx *.ilg *.ind *.fig.bak 36 | rm -f *.cb *.cb2 37 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/abstract.text: -------------------------------------------------------------------------------- 1 | In a text editor for writing Common Lisp source code, it is desirable 2 | to have an accurate analysis of the buffer contents, so that the role 3 | of the elements of the code can be indicated to the programmer. 4 | Furthermore, the buffer contents should preferably be analyzed after 5 | each keystroke so that the programmer has up-to-date information 6 | resulting from the analysis. 7 | 8 | We describe an incremental parser that can be used as a key component 9 | of such an analyzer. The parser, itself written in Common Lisp, uses 10 | a special-purpose implementation of the Common Lisp READ function in 11 | combination with a cache that stores existing results of calling the 12 | reader. 13 | 14 | Since the parser uses the standard Common Lisp reader, the resulting 15 | analysis is very accurate. Furthermore, the cache makes the parser 16 | very fast in most common cases; re-parsing a buffer in which a single 17 | character has been altered takes only a few milliseconds. 18 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/second-climacs-clim-base.asd: -------------------------------------------------------------------------------- 1 | (defsystem "second-climacs-clim-base" 2 | :depends-on ("mcclim" 3 | "second-climacs-base" 4 | "clouseau" 5 | "stealth-mixin" 6 | "second-climacs-syntax-fundamental" 7 | "second-climacs-syntax-common-lisp") 8 | :serial t 9 | :components ((:file "packages") 10 | (:file "climacs-clim-view") 11 | (:file "esa-buffer") 12 | (:file "text-pane") 13 | (:file "with-current-cursor") 14 | (:file "cursor-visibility") 15 | ;; Command tables 16 | (:file "macros") 17 | (:file "insert-table") 18 | (:file "delete-table") 19 | (:file "motion-table") 20 | (:file "search-table") 21 | (:file "transform-table") 22 | (:file "paredit-table") 23 | (:file "debug-table") 24 | (:file "global-command-table"))) 25 | -------------------------------------------------------------------------------- /Documentation/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | ## Quick Start 4 | 5 | 1. Make sure you have installed the dependencies: 6 | 7 | [the Cluffer repository]:https://github.com/robert-strandh/Cluffer 8 | [the text.editing repository]:https://github.com/robert-strandh/cluffer-emacs-compatibility 9 | [the Stealth mixin repository]:https://github.com/robert-strandh/Stealth-mixin 10 | [the Eclector repository]:https://github.com/s-expressionists/Eclector 11 | [the Incrementalist repository]:https://github.com/robert-strandh/incrementalist 12 | 13 | * A LaTeX editor: (Debian) `sudo apt-get install texlive-full` or (macOS) `brew install mactex` 14 | * fig2dev: (Debian) `sudo apt-get install fig2dev` or (macOS) `brew install fig2dev` 15 | * xpdf: (Debian) `sudo apt-get install xpdf` or (macOS) `brew install xpdf` 16 | * (If you just installed a LaTeX editor, you may need to restart your terminal) 17 | 18 | 2. Change directory to the Documentation directory: 19 | ``` 20 | $ cd Documentation 21 | ``` 22 | 3. Run make command: `make` 23 | 4. Run make command: `make view` 24 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/multiple-value-setq.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; MULTIPLE-VALUE-SETQ does not have a body, only a single form. But 4 | ;;; we must do something reasonable even if the programmer got the 5 | ;;; syntax wrong, so we indent as if several forms were allowed. 6 | 7 | (define-indentation-automaton compute-multiple-value-setq-indentations 8 | (tagbody 9 | (next) 10 | ;; The current wad is the operator. 11 | (maybe-assign-indentation 1 4) 12 | (next) 13 | ;; The current wad ought to represent the list of variables. We 14 | ;; think it is unlikely that the variables will be separated by 15 | ;; newlines, so we do nothing special for this list. 16 | (maybe-assign-indentation 4 2) 17 | (next) 18 | form 19 | (maybe-assign-indentation 2 2) 20 | (compute-form-indentation current-wad nil client) 21 | (next) 22 | (go form))) 23 | 24 | (define-form-indentation-method 25 | ('#:common-lisp '#:multiple-value-setq) 26 | compute-multiple-value-setq-indentations) 27 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/setf-and-setq.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-setq-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 2) 8 | (next) 9 | place 10 | ;; We indent a place as a form, because in general, it can take 11 | ;; the shape of a form. 12 | (maybe-assign-indentation 2 4) 13 | (compute-form-indentation current-wad nil client) 14 | (next) 15 | form 16 | (maybe-assign-indentation 4 2) 17 | (compute-form-indentation current-wad nil client) 18 | (next) 19 | (go place))) 20 | 21 | (define-form-indentation-method 22 | ('#:common-lisp '#:setq) compute-setq-indentations) 23 | 24 | (define-form-indentation-method 25 | ('#:common-lisp '#:setf) compute-setq-indentations) 26 | 27 | (define-form-indentation-method 28 | ('#:common-lisp '#:psetq) compute-setq-indentations) 29 | 30 | (define-form-indentation-method 31 | ('#:common-lisp '#:psetf) compute-setq-indentations) 32 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/prog2.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-prog2-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to be the first form to be indented a 10 | ;; bit more. 11 | (maybe-assign-indentation 4 4) 12 | (compute-form-indentation current-wad nil client) 13 | (next) 14 | ;; The current wad ought to be the second form to be indented a 15 | ;; bit more. 16 | (maybe-assign-indentation 4 2) 17 | (compute-form-indentation current-wad nil client) 18 | (next) 19 | form 20 | ;; We should now be among the remaining forms. 21 | (maybe-assign-indentation 2 2) 22 | (compute-form-indentation current-wad nil client) 23 | (next) 24 | (go form))) 25 | 26 | (define-form-indentation-method 27 | ('#:common-lisp '#:prog2) compute-prog2-indentations) 28 | 29 | (define-form-indentation-method 30 | ('#:common-lisp '#:progv) compute-prog2-indentations) 31 | -------------------------------------------------------------------------------- /Code/Base/standard-buffer.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | ;;; A STANDARD-BUFFER is a buffer that is restricted to contain a 4 | ;;; Cluffer buffer. 5 | 6 | (defclass standard-buffer (edit.search:search-state-mixin 7 | edit:multiple-site-mixin 8 | edit:site-mixin 9 | cluffer-standard-buffer:buffer 10 | buffer) 11 | ()) 12 | 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | ;;; 15 | ;;; Function MAKE-EMPTY-STANDARD-BUFFER. 16 | 17 | (defun make-empty-standard-buffer () 18 | (let* ((line (make-instance 'cluffer-standard-line::closed-line :first-line-p t :last-line-p t)) 19 | (buffer (make-instance 'standard-buffer :initial-line line))) 20 | buffer)) 21 | 22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 23 | ;;; 24 | ;;; Method on FILL-BUFFER-FROM-STREAM. 25 | 26 | (defmethod fill-buffer-from-stream ((cursor cluffer:cursor) stream) 27 | (loop for char = (read-char stream nil nil) 28 | until (null char) 29 | do (edit::insert-item cursor char))) 30 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/assert.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-assert-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 8) 8 | (next) 9 | ;; The current wad ought to represent the test form. 10 | (maybe-assign-indentation 8 6) 11 | (compute-form-indentation current-wad nil client) 12 | (next) 13 | ;; The current wad ought to represent the list of places. 14 | (maybe-assign-indentation 6 4) 15 | (compute-list-indentation 16 | current-wad client 17 | (lambda (wad client) 18 | (compute-form-indentation wad nil client))) 19 | (next) 20 | ;; The current wad ought to represent the datum form. 21 | (maybe-assign-indentation 4 2) 22 | (compute-form-indentation current-wad nil client) 23 | (next) 24 | form 25 | (maybe-assign-indentation 2 2) 26 | (compute-form-indentation current-wad nil client) 27 | (next) 28 | (go form))) 29 | 30 | (define-form-indentation-method 31 | ('#:common-lisp '#:assert) compute-assert-indentations) 32 | -------------------------------------------------------------------------------- /Code/Command/invocation.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-command) 2 | 3 | (defclass invocation () 4 | ()) 5 | 6 | (defclass pass-numeric-argument-as-argument (invocation) 7 | ()) 8 | 9 | (defclass repeat-according-to-numeric-argument (invocation) 10 | ()) 11 | 12 | (defclass pass-gesture-as-argument (invocation) 13 | ()) 14 | 15 | (defgeneric invoke (command invocation gesture numeric-arg numeric-arg-p)) 16 | 17 | (defmethod invoke (command 18 | (invocation pass-numeric-argument-as-argument) 19 | gesture 20 | numeric-arg 21 | numeric-arg-p) 22 | (declare (ignore gesture numeric-arg-p)) 23 | (invoke-command command (list numeric-arg))) 24 | 25 | (defmethod invoke (command 26 | (invocation repeat-according-to-numeric-argument) 27 | gesture 28 | numeric-arg 29 | numeric-arg-p) 30 | (declare (ignore gesture numeric-arg-p)) 31 | (loop repeat numeric-arg 32 | do (invoke-command command '()))) 33 | 34 | (defmethod invoke (command 35 | (invocation pass-gesture-as-argument) 36 | gesture 37 | numeric-arg 38 | numeric-arg-p) 39 | (declare (ignore numeric-arg numeric-arg-p)) 40 | (invoke-command command (list gesture))) 41 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/defconstant.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-defconstant-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to represent the name. 10 | (maybe-assign-indentation 4 2) 11 | (next) 12 | ;; The current wad ought to represent the initial value. 13 | (maybe-assign-indentation 2 2) 14 | (compute-form-indentation current-wad nil client) 15 | (next) 16 | ;; If we come here, it's because the optional documentation is 17 | ;; present. 18 | (maybe-assign-indentation 2 2))) 19 | 20 | (define-form-indentation-method 21 | ('#:common-lisp '#:defconstant) compute-defconstant-indentations) 22 | 23 | (define-form-indentation-method 24 | ('#:common-lisp '#:defvar) compute-defconstant-indentations) 25 | 26 | (define-form-indentation-method 27 | ('#:common-lisp '#:defparameter) compute-defconstant-indentations) 28 | 29 | (define-form-indentation-method 30 | ('#:common-lisp '#:define-symbol-macro) compute-defconstant-indentations) 31 | -------------------------------------------------------------------------------- /get-dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # 5 | # Add dependencies URLs here 6 | # 7 | DEPENDENCIES=" 8 | https://github.com/robert-strandh/cluffer 9 | https://github.com/scymtym/text.editing 10 | https://github.com/s-expressionists/Eclector 11 | https://github.com/s-expressionists/incrementalist 12 | " 13 | 14 | PROJECTS_DIRECTORY=${1:-"$HOME/quicklisp/local-projects/"} 15 | 16 | if [ ! -d "$PROJECTS_DIRECTORY" ]; then 17 | cat <increase-font-size 33 | (clim:blank-area com-set-font-size global-table 34 | :gesture :increase-font-size) 35 | (object) 36 | '(:larger)) 37 | 38 | (clim:define-gesture-name :decrease-font-size :pointer-scroll 39 | (:wheel-down :control)) 40 | 41 | (clim:define-presentation-to-command-translator blank-area->decrease-font-size 42 | (clim:blank-area com-set-font-size global-table 43 | :gesture :decrease-font-size) 44 | (object) 45 | '(:smaller)) 46 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-b-4.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8487.471 3489.070 7245 4950 8325 5400 9675 4995 15 | 0 0 1.00 60.00 120.00 16 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 17 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 18 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 19 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 20 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 21 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 22 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 33 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 34 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 35 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 36 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 37 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 38 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 39 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 40 | 4 1 0 50 -1 5 16 0.0000 0 210 2310 8460 5715 remove-overlap\001 41 | -------------------------------------------------------------------------------- /Code/Base/window.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-base) 2 | 3 | ;;; A WINDOW is an object supplied by the underlying interface 4 | ;;; manager. We do not define a window class here, because we want to 5 | ;;; allow the use of existing classes in the interface manager. 6 | ;;; 7 | ;;; Similarly, an APPLICATION is a representation of the application 8 | ;;; that contains some windows, and for the same reasons, we do not 9 | ;;; define a class for applications. 10 | 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | ;;; 13 | ;;; Generic function UPDATE-WINDOW-FROM-VIEW. 14 | ;;; 15 | ;;; Client code will define a primary method on this generic function, 16 | ;;; specialized to the class of the window used by the interface 17 | ;;; manager for displaying the buffer contents according to the view. 18 | 19 | (defgeneric update-window-from-view (window view)) 20 | 21 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 22 | ;;; 23 | ;;; Generic function UPDATE-WINDOW. 24 | ;;; 25 | ;;; This function is called from the main application command loop or 26 | ;;; event loop in order to update a visible window. A :BEFORE method 27 | ;;; makes sure that the analyzer and the view of the window are 28 | ;;; updated. The default method on this function ignores the 29 | ;;; application object and calls UPDATE-WINDOW-FROM-VIEW with the 30 | ;;; window and the view of the window. 31 | 32 | (defgeneric update-window (application window)) 33 | 34 | (defmethod update-window (application window) 35 | (declare (ignore application)) 36 | (update-window-from-view window (view window))) 37 | 38 | (defmethod update-window :before (application window) 39 | (update-analyzer (analyzer (view window))) 40 | (update-view (view window))) 41 | 42 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 43 | ;;; 44 | ;;; Generic function VIEW. 45 | ;;; 46 | ;;; Given a window, return the Climacs view for that window. 47 | 48 | (defgeneric view (window)) 49 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/defsetf.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-defsetf-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad is the operator. 7 | (maybe-assign-indentation 1 6) 8 | (next) 9 | ;; The current wad ought to be the name of the access function. 10 | (maybe-assign-indentation 6 4) 11 | (next) 12 | ;; If the current wad represents a CONS, then we have the long 13 | ;; form. Otherwise we have the short form. 14 | (when (atom (cst:raw current-wad)) 15 | (go short-form)) 16 | ;; The current wad ought to be the lambda list. 17 | (maybe-assign-indentation 4 2) 18 | (compute-lambda-list-indentation current-wad client) 19 | (next) 20 | ;; The current wad ought to be a list of store variables. 21 | (compute-list-indentation current-wad client (constantly nil)) 22 | (next) 23 | declaration-or-documentation-or-form 24 | (when (and (consp (cst:raw current-wad)) 25 | (wad-represents-symbol-p 26 | (first (ip:children current-wad)) 27 | 'declare)) 28 | (maybe-assign-indentation 3 2) 29 | (compute-declare-indentation current-wad client) 30 | (next) 31 | (go declaration-or-documentation-or-form)) 32 | documentation-or-form 33 | (when (stringp (cst:raw current-wad)) 34 | (maybe-assign-indentation 3 2) 35 | (next)) 36 | form 37 | (maybe-assign-indentation 2 2) 38 | (compute-form-indentation current-wad nil client) 39 | (next) 40 | (go form) 41 | short-form 42 | ;; The current wad ought to be the update function. 43 | (maybe-assign-indentation 4 2) 44 | (next) 45 | ;; If we come here, it probably means the optional documentation 46 | ;; was given. 47 | (maybe-assign-indentation 2 2))) 48 | 49 | (define-form-indentation-method 50 | ('#:common-lisp '#:defsetf) compute-defsetf-indentations) 51 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/debug-table.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | (clim:define-command-table debug-table) 4 | 5 | ;;; Printing commands 6 | 7 | (defun print-expression-tree (cursor &key (stream *trace-output*)) 8 | (let ((toplevel-expression (edit.exp:innermost-expression-containing-cursor 9 | cursor :ast))) 10 | (fresh-line stream) 11 | (utilities.print-tree:print-tree 12 | stream toplevel-expression 13 | (utilities.print-tree:make-node-printer 14 | (lambda (stream depth node) 15 | (declare (ignore depth)) 16 | (princ node stream)) 17 | nil #'edit.exp:children)))) 18 | 19 | (define-buffer-command (com-print-expression-tree debug-table) 20 | () 21 | (edit:perform buffer 'print-expression-tree)) 22 | 23 | ;;; Inspection commands 24 | 25 | (clim:define-command (com-inspect :name t :command-table debug-table) () 26 | (clouseau:inspect clim:*application-frame* :new-process t)) 27 | 28 | (clim:define-command (com-inspect-buffer :name t :command-table debug-table) 29 | () 30 | (clouseau:inspect (current-buffer) :new-process t)) 31 | 32 | (clim:define-command (com-inspect-analyzer :name t :command-table debug-table) 33 | () 34 | (let* ((view (current-view)) 35 | (analyzer (base:analyzer view))) 36 | (clouseau:inspect analyzer :new-process t))) 37 | 38 | ;;; Test commands 39 | 40 | (clim:define-command (com-random-edits :name t :command-table debug-table) 41 | ((count 'integer :default 10)) 42 | (loop :with buffer = (current-buffer) 43 | :with point = (edit:point buffer) 44 | :repeat count 45 | :for line-number = (random (cluffer:line-count buffer)) 46 | :for line = (cluffer:find-line buffer line-number) 47 | :do (edit:move-cursor-to-line 48 | point line (random (1+ (cluffer:item-count line)))) 49 | (case (random 5) 50 | (0 (cluffer:split-line point)) 51 | ((1 2 3 4) (cluffer:insert-item point #\a))))) 52 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-a-2.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8579.955 5731.791 9675 4455 8550 4050 7200 4770 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 15 | 0 0 1.00 60.00 120.00 16 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 17 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 18 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 19 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 20 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 21 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 22 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 35 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 36 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 37 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 38 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 39 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 40 | 4 1 0 50 -1 5 16 0.0000 0 120 990 8370 3870 access\001 41 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 42 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 43 | -------------------------------------------------------------------------------- /Documentation/refmacros.tex: -------------------------------------------------------------------------------- 1 | \newcommand{\refalgo}[1]{algorithm~\ref{#1}}% 2 | \newcommand{\refAlgo}[1]{Algorithm~\ref{#1}}% 3 | \newcommand{\seealgo}[1]{(See \refAlgo{#1}.)}% 4 | \newcommand{\seealgox}[2]{(See \refAlgo{#1} #2.)}% 5 | 6 | \newcommand{\refpart}[1]{part~\ref{#1}}% 7 | \newcommand{\refPart}[1]{Part~\ref{#1}}% 8 | \newcommand{\seepart}[1]{(See \refPart{#1}.)}% 9 | \newcommand{\seepartx}[2]{(See \refPart{#1} #2.)}% 10 | 11 | \newcommand{\refchap}[1]{chapter~\ref{#1}}% 12 | \newcommand{\refChap}[1]{Chapter~\ref{#1}}% 13 | \newcommand{\seechap}[1]{(See \refChap{#1}.)}% 14 | \newcommand{\seechapx}[2]{(See \refChap{#1} #2.)}% 15 | 16 | \newcommand{\refapp}[1]{appendix~\ref{#1}}% 17 | \newcommand{\refApp}[1]{Appendix~\ref{#1}}% 18 | \newcommand{\seeapp}[1]{(See \refApp{#1}.)}% 19 | \newcommand{\seeappx}[2]{(See \refApp{#1} #2.)}% 20 | 21 | \newcommand{\refsec}[1]{section~\ref{#1}}% 22 | \newcommand{\refSec}[1]{Section~\ref{#1}}% 23 | \newcommand{\seesec}[1]{(See \refSec{#1}.)}% 24 | \newcommand{\seesecx}[2]{(See \refSec{#1} #2.)}% 25 | 26 | \newcommand{\reffig}[1]{figure~\ref{#1}}% 27 | \newcommand{\refFig}[1]{Figure~\ref{#1}}% 28 | \newcommand{\seefig}[1]{(See \refFig{#1}.)}% 29 | \newcommand{\seefigx}[2]{(See \refFig{#1} #2.)}% 30 | 31 | \newcommand{\refdef}[1]{definition~\ref{#1}}% 32 | \newcommand{\refDef}[1]{Definition~\ref{#1}}% 33 | \newcommand{\seedef}[1]{(See \refDef{#1}.)}% 34 | \newcommand{\seedefx}[2]{(See \refDef{#1} #2.)}% 35 | 36 | \newcommand{\reftheo}[1]{theorem~\ref{#1}}% 37 | \newcommand{\refTheo}[1]{Theorem~\ref{#1}}% 38 | \newcommand{\seetheo}[1]{(See \refTheo{#1}.)}% 39 | \newcommand{\seetheox}[2]{(See \refTheo{#1} #2.)}% 40 | 41 | \newcommand{\refexo}[1]{exercise~\ref{#1}}% 42 | \newcommand{\refExo}[1]{Exercise~\ref{#1}}% 43 | \newcommand{\seeexo}[1]{(See \refExo{#1}.)}% 44 | \newcommand{\seeexox}[2]{(See \refExo{#1} #2.)}% 45 | 46 | \newcommand{\refcode}[1]{code fragment~\ref{#1}}% 47 | \newcommand{\refCode}[1]{Code fragment~\ref{#1}}% 48 | \newcommand{\seecode}[1]{(See \refCode{#1}.)}% 49 | \newcommand{\seecodex}[2]{(See \refCode{#1} #2.)}% 50 | 51 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/make-instance-etc.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; We indent MAKE-INSTANCE in a special way, because we can then 4 | ;;; often both save horizontal space and make the form more readable. 5 | ;;; The first argument to MAKE-INSTANCE (i.e. the CLASS form) is 6 | ;;; indented by 6 columns in case it is not on the same line as the 7 | ;;; MAKE-INSTANCE symbol. Each keyword form is indented by 2 8 | ;;; positions compared to the entire form and each value form is 9 | ;;; indented by 4 positions. That way, if there are many long keyword 10 | ;;; arguments, it is possible to put the keyword form on one line and 11 | ;;; the value form on the next one. Here is an example: 12 | ;;; 13 | ;;; (make-instance 14 | ;;; :first-keyword 15 | ;;; (cond ... 16 | ;;; ... 17 | ;;; ...) 18 | ;;; :second-keyword 19 | ;;; (case ... 20 | ;;; ...)) 21 | 22 | (define-indentation-automaton compute-make-instance-indentations 23 | (tagbody 24 | (next) 25 | ;; The current wad is the operator. 26 | (maybe-assign-indentation 1 4) 27 | (next) 28 | ;; The current wad ought to be the form that computes the class 29 | ;; or the instance argument. 30 | (maybe-assign-indentation 4 2) 31 | (compute-form-indentation current-wad nil client) 32 | (next) 33 | initarg 34 | ;; The current wad ought to be a form that computes an 35 | ;; initialization argument. 36 | (maybe-assign-indentation 2 4) 37 | (compute-form-indentation current-wad nil client) 38 | (next) 39 | ;; The current wad ought to be a form that computes the value of 40 | ;; the initialization argument. 41 | (maybe-assign-indentation 4 2) 42 | (compute-form-indentation current-wad nil client) 43 | (next) 44 | (go initarg))) 45 | 46 | (define-form-indentation-method 47 | ('#:common-lisp '#:make-instance) 48 | compute-make-instance-indentations) 49 | 50 | (define-form-indentation-method 51 | ('#:common-lisp '#:reinitialize-instance) 52 | compute-make-instance-indentations) 53 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/climacs-clim-view.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | ;;; When a visible window is updated, we need to know what is on 4 | ;;; display in that window. This information can be read and written 5 | ;;; by the STREAM-DEFAULT-VIEW accessor for CLIM stream panes. But 6 | ;;; Climacs view classes are independent of the underlying GUI 7 | ;;; library, so we can't have Climacs view classes be subclasses of 8 | ;;; the CLIM:VIEW class. 9 | ;;; 10 | ;;; We solve this problem by defining a class CLIMACS-CLIM-VIEW which 11 | ;;; is a subclass of CLIM:VIEW and that contains a slot holding an 12 | ;;; instance of the Climacs view. 13 | ;;; 14 | ;;; When a Climacs view is no longer on display in a pane, we simply 15 | ;;; discard the instance of this class referred to by the pane by 16 | ;;; setting the STREAM-DEFAULT-VIEW to +TEXTUAL-VIEW+. In order for 17 | ;;; a Climacs view to be displayed in some pane, we allocate a new 18 | ;;; instance of this class. 19 | 20 | (defgeneric climacs-view (clim-view)) 21 | 22 | (defgeneric (setf climacs-view) (climacs-view clim-view)) 23 | 24 | (defgeneric timestamp (clim-view)) 25 | 26 | (defgeneric (setf timestamp) (time-stamp clim-view)) 27 | 28 | (defclass climacs-clim-view (clim:view) 29 | ((%climacs-view :initarg :climacs-view :accessor climacs-view) 30 | ;; This slot contains the output history to be used to 31 | ;; display the pane that this view is the default-view of. 32 | (%output-history :initarg :output-history :accessor output-history) 33 | ;; This slot contains the timestamp corresponding to the 34 | ;; last time this view was updated from the Cluffer buffer. 35 | (%timestamp :initform nil :accessor timestamp))) 36 | 37 | ;;; This function takes an instance of a Climacs view and returns an 38 | ;;; instance of the corresponding subclass of CLIMACS-CLIM-VIEW. 39 | 40 | (defgeneric make-climacs-clim-view (climacs-view)) 41 | 42 | ;;; This generic function takes an instance of a Climacs view, and 43 | ;;; returns a command table to be used for this particular view. 44 | 45 | (defgeneric command-table (climacs-view)) 46 | 47 | (defgeneric update-view (pane clim-view)) 48 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/handler-case.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; Compute the indentations for a single LET binding. 4 | (define-indentation-automaton compute-handler-case-clause-indentations 5 | (tagbody 6 | (next) 7 | ;; The current wad represents a type specifier (if this clause is 8 | ;; an error clause) or the symbol :NO-ERROR if it is a no-error 9 | ;; clauase. But we can indent :NO-ERROR as if it is a type 10 | ;; specifier, so we avoid a special case here. 11 | (maybe-assign-indentation 1 5) 12 | (compute-type-specifier-indentation current-wad nil client) 13 | (next) 14 | ;;; The current wad ought to represent something that looks like 15 | ;;; a lambda list, so we indent it as such. 16 | (maybe-assign-indentation 5 3) 17 | (compute-lambda-list-indentation current-wad client) 18 | (next) 19 | declaration-or-form 20 | (when (and (consp (cst:raw current-wad)) 21 | (wad-represents-symbol-p 22 | (first (ip:children current-wad)) 23 | 'declare)) 24 | (maybe-assign-indentation 4 3) 25 | (compute-declare-indentation current-wad client) 26 | (next) 27 | (go declaration-or-form)) 28 | form 29 | (maybe-assign-indentation 3 3) 30 | (compute-form-indentation current-wad nil client) 31 | (next) 32 | (go form))) 33 | 34 | ;;; Compute the indentation of a single LET binding. 35 | (defun compute-handler-case-clause-indentation (wad client) 36 | (compute-and-assign-indentations 37 | client wad compute-handler-case-clause-indentations)) 38 | 39 | (define-indentation-automaton compute-handler-case-indentations 40 | (tagbody 41 | (next) 42 | ;; The current wad is the operator. 43 | (maybe-assign-indentation 1 4) 44 | (next) 45 | ;; The current wad ought to represent the expression. 46 | (maybe-assign-indentation 4 2) 47 | (next) 48 | clause 49 | (maybe-assign-indentation 2 2) 50 | (compute-handler-case-clause-indentation current-wad client) 51 | (next) 52 | (go clause))) 53 | 54 | (define-form-indentation-method 55 | ('#:common-lisp '#:handler-case) compute-handler-case-indentations) 56 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-b-5.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8487.471 3489.070 7245 4950 8325 5400 9675 4995 15 | 0 0 1.00 60.00 120.00 16 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 17 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 18 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 19 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 20 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 21 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 22 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 35 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 36 | 11025 5400 11475 5400 11475 5625 11025 5625 11025 5400 37 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 38 | 10800 5175 11475 5175 11475 5850 10800 5850 10800 5175 39 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 40 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 41 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 42 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 43 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 44 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 45 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 46 | 4 1 0 50 -1 5 16 0.0000 0 165 990 8460 5670 insert\001 47 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-b-3.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 7222.500 5827.500 6525 5220 6300 5895 6615 6525 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6218.438 5897.812 6975 6525 7200 5850 6930 5220 17 | 0 0 1.00 60.00 120.00 18 | 6 4545 5895 6210 6345 19 | 4 0 0 50 -1 5 16 0.0000 0 120 1155 4545 6030 access-\001 20 | 4 0 0 50 -1 5 16 0.0000 0 165 1650 4545 6315 characters\001 21 | -6 22 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 24 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 41 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 42 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 43 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 44 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 45 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 46 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 47 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 48 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/refmacros.tex: -------------------------------------------------------------------------------- 1 | \newcommand{\refalgo}[1]{algorithm~\ref{#1}}% 2 | \newcommand{\refAlgo}[1]{Algorithm~\ref{#1}}% 3 | \newcommand{\seealgo}[1]{(See \refAlgo{#1}.)}% 4 | \newcommand{\seealgox}[2]{(See \refAlgo{#1} #2.)}% 5 | 6 | \newcommand{\refpart}[1]{part~\ref{#1}}% 7 | \newcommand{\refPart}[1]{Part~\ref{#1}}% 8 | \newcommand{\seepart}[1]{(See \refPart{#1}.)}% 9 | \newcommand{\seepartx}[2]{(See \refPart{#1} #2.)}% 10 | 11 | \newcommand{\refchap}[1]{chapter~\ref{#1}}% 12 | \newcommand{\refChap}[1]{Chapter~\ref{#1}}% 13 | \newcommand{\seechap}[1]{(See \refChap{#1}.)}% 14 | \newcommand{\seechapx}[2]{(See \refChap{#1} #2.)}% 15 | 16 | \newcommand{\refapp}[1]{appendix~\ref{#1}}% 17 | \newcommand{\refApp}[1]{Appendix~\ref{#1}}% 18 | \newcommand{\seeapp}[1]{(See \refApp{#1}.)}% 19 | \newcommand{\seeappx}[2]{(See \refApp{#1} #2.)}% 20 | 21 | \newcommand{\refsec}[1]{section~\ref{#1}}% 22 | \newcommand{\refSec}[1]{Section~\ref{#1}}% 23 | \newcommand{\seesec}[1]{(See \refSec{#1}.)}% 24 | \newcommand{\seesecx}[2]{(See \refSec{#1} #2.)}% 25 | 26 | \newcommand{\reffig}[1]{figure~\ref{#1}}% 27 | \newcommand{\refFig}[1]{Figure~\ref{#1}}% 28 | \newcommand{\seefig}[1]{(See \refFig{#1}.)}% 29 | \newcommand{\seefigx}[2]{(See \refFig{#1} #2.)}% 30 | 31 | \newcommand{\reftab}[1]{table~\ref{#1}}% 32 | \newcommand{\refTab}[1]{Table~\ref{#1}}% 33 | \newcommand{\seetab}[1]{(See \refTab{#1}.)}% 34 | \newcommand{\seetabx}[2]{(See \refTab{#1} #2.)}% 35 | 36 | \newcommand{\refdef}[1]{definition~\ref{#1}}% 37 | \newcommand{\refDef}[1]{Definition~\ref{#1}}% 38 | \newcommand{\seedef}[1]{(See \refDef{#1}.)}% 39 | \newcommand{\seedefx}[2]{(See \refDef{#1} #2.)}% 40 | 41 | \newcommand{\reftheo}[1]{theorem~\ref{#1}}% 42 | \newcommand{\refTheo}[1]{Theorem~\ref{#1}}% 43 | \newcommand{\seetheo}[1]{(See \refTheo{#1}.)}% 44 | \newcommand{\seetheox}[2]{(See \refTheo{#1} #2.)}% 45 | 46 | \newcommand{\refexo}[1]{exercise~\ref{#1}}% 47 | \newcommand{\refExo}[1]{Exercise~\ref{#1}}% 48 | \newcommand{\seeexo}[1]{(See \refExo{#1}.)}% 49 | \newcommand{\seeexox}[2]{(See \refExo{#1} #2.)}% 50 | 51 | \newcommand{\refcode}[1]{code fragment~\ref{#1}}% 52 | \newcommand{\refCode}[1]{Code fragment~\ref{#1}}% 53 | \newcommand{\seecode}[1]{(See \refCode{#1}.)}% 54 | \newcommand{\seecodex}[2]{(See \refCode{#1} #2.)}% 55 | 56 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/with-input-from-string.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton 4 | compute-with-input-from-string-arguments-indentations 5 | (tagbody 6 | (next) 7 | ;; The current wad ought to be the variable name. 8 | (maybe-assign-indentation 1 1) 9 | (next) 10 | ;; The current wad ought to be a form. 11 | (maybe-assign-indentation 1 1) 12 | (compute-form-indentation current-wad nil client) 13 | (next) 14 | keyword-argument 15 | (maybe-assign-indentation 1 3) 16 | (compute-form-indentation current-wad nil client) 17 | (next) 18 | (maybe-assign-indentation 3 1) 19 | (compute-form-indentation current-wad nil client) 20 | (next) 21 | (go keyword-argument))) 22 | 23 | (defun compute-with-input-from-string-arguments-indentation 24 | (wad client) 25 | (compute-and-assign-indentations 26 | client wad compute-with-input-from-string-arguments-indentations)) 27 | 28 | (define-indentation-automaton compute-with-input-from-string-indentations 29 | (tagbody 30 | (next) 31 | ;; The current wad is the operator. 32 | (maybe-assign-indentation 1 4) 33 | (next) 34 | ;; The current wad ought to be the distinguished arguments. 35 | (maybe-assign-indentation 4 2) 36 | (compute-with-input-from-string-arguments-indentation current-wad client) 37 | (next) 38 | declaration-or-form 39 | (when (and (consp (cst:raw current-wad)) 40 | (wad-represents-symbol-p 41 | (first (ip:children current-wad)) 42 | 'declare)) 43 | (maybe-assign-indentation 3 2) 44 | (compute-declare-indentation current-wad client) 45 | (next) 46 | (go declaration-or-form)) 47 | form 48 | (maybe-assign-indentation 2 2) 49 | (compute-form-indentation current-wad nil client) 50 | (next) 51 | (go form))) 52 | 53 | (define-form-indentation-method 54 | ('#:common-lisp '#:with-input-from-tring) 55 | compute-with-input-from-string-indentations) 56 | 57 | ;;; WITH-OUTPUT-TO-STRING can probably be indented the same way as 58 | ;;; WITH-INPUT-FROM-STRING. 59 | (define-form-indentation-method 60 | ('#:common-lisp '#:with-output-to-tring) 61 | compute-with-input-from-string-indentations) 62 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation-2.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 15 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 16 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 17 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 18 | 10575 2700 11475 2700 11475 3825 10575 3825 10575 2700 19 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 20 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 21 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 22 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 5400 11475 5400 11475 5850 10800 5850 10800 5400 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10800 5850 11475 5850 11475 6300 10800 6300 10800 5850 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 10575 5175 11475 5175 11475 6750 10575 6750 10575 5175 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 41 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 42 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 43 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 44 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 45 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 46 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 47 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 48 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 49 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/let-and-letstar.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; Compute the indentations for a single LET binding. 4 | (define-indentation-automaton compute-binding-indentations 5 | (tagbody 6 | (next) 7 | ;; The current wad represents the variable introduced by the 8 | ;; binding. But it is not the role of the indentation code 9 | ;; to verify the nature of this wad. Here, we just assume 10 | ;; that there are no sub-indentation to be computed in this 11 | ;; wad. 12 | (maybe-assign-indentation 1 3) 13 | (next) 14 | ;; Come here when the current wad represents the initialization 15 | ;; form for the variable being bound. This expression should be 16 | ;; a form, so we compute the indentation that way. 17 | (maybe-assign-indentation 3 3) 18 | (compute-form-indentation current-wad nil client))) 19 | 20 | ;;; Compute the indentation of a single LET binding. 21 | (defun compute-binding-indentation (wad client) 22 | (compute-and-assign-indentations client wad compute-binding-indentations)) 23 | 24 | ;;; Compute the indentation of a list of LET bindings. 25 | (defun compute-bindings-indentation (wad client) 26 | (compute-list-indentation wad client #'compute-binding-indentation)) 27 | 28 | (define-indentation-automaton compute-let-indentations 29 | (tagbody 30 | (next) 31 | ;; The current wad is the operator. 32 | (maybe-assign-indentation 1 4) 33 | (next) 34 | ;; The current wad ought to represent the list of bindings. 35 | (maybe-assign-indentation 4 2) 36 | (compute-bindings-indentation current-wad client) 37 | (next) 38 | declaration-or-form 39 | (when (and (consp (cst:raw current-wad)) 40 | (wad-represents-symbol-p 41 | (first (ip:children current-wad)) 42 | 'declare)) 43 | (maybe-assign-indentation 3 2) 44 | (compute-declare-indentation current-wad client) 45 | (next) 46 | (go declaration-or-form)) 47 | form 48 | (maybe-assign-indentation 2 2) 49 | (compute-form-indentation current-wad nil client) 50 | (next) 51 | (go form))) 52 | 53 | (define-form-indentation-method 54 | ('#:common-lisp '#:let) compute-let-indentations) 55 | 56 | (define-form-indentation-method 57 | ('#:common-lisp '#:let*) compute-let-indentations) 58 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/fig-general-instance.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5b 2 | Landscape 3 | Center 4 | Inches 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 1 1 0 7 50 -1 -1 4.000 0 0 1 0 3091.072 798.214 3000 525 3300 600 3375 750 11 | 0 0 1.00 60.00 120.00 12 | 5 1 1 1 0 7 50 -1 -1 4.000 0 1 1 0 2190.000 922.500 2250 525 1950 600 1800 825 13 | 0 0 1.00 60.00 120.00 14 | 5 1 1 1 0 7 50 -1 -1 4.000 0 1 1 0 3112.500 2962.500 3525 3825 3825 3600 3975 3375 15 | 0 0 1.00 60.00 120.00 16 | 5 1 1 1 0 7 50 -1 -1 4.000 0 0 1 0 2987.500 3329.167 2850 3825 2550 3600 2475 3375 17 | 0 0 1.00 60.00 120.00 18 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 19 | 1500 900 2100 900 2100 1500 1500 1500 1500 900 20 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 21 | 3000 900 3600 900 3600 1500 3000 1500 3000 900 22 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 23 | 3600 1800 4200 1800 4200 3300 3600 3300 3600 1800 24 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 25 | 0 0 1.00 60.00 120.00 26 | 1800 1050 3000 1050 27 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 3 28 | 0 0 1.00 60.00 120.00 29 | 1800 1350 2400 1350 2400 1800 30 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 31 | 0 0 1.00 60.00 120.00 32 | 3300 1050 4200 1050 33 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 3 34 | 0 0 1.00 60.00 120.00 35 | 3300 1350 3900 1350 3900 1800 36 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 37 | 1500 1200 2100 1200 38 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 39 | 2100 2100 2700 2100 40 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 41 | 2100 2400 2700 2400 42 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 43 | 2100 3000 2700 3000 44 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 45 | 3600 2100 4200 2100 46 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 47 | 3600 2400 4200 2400 48 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 49 | 3600 3000 4200 3000 50 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 51 | 3000 1200 3600 1200 52 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 53 | 2100 1800 2700 1800 2700 3300 2100 3300 2100 1800 54 | 2 4 1 1 0 7 50 -1 -1 4.000 0 0 7 0 0 5 55 | 2775 3600 2775 825 1425 825 1425 3600 2775 3600 56 | 2 4 1 1 0 7 50 -1 -1 4.000 0 0 7 0 0 5 57 | 4275 3600 4275 825 2925 825 2925 3600 4275 3600 58 | 4 1 0 50 -1 4 12 0.0000 0 150 585 2625 525 header\001 59 | 4 1 0 50 -1 4 12 0.0000 0 150 735 2025 3975 instance\001 60 | 4 1 0 50 -1 4 12 0.0000 0 150 375 3225 3900 rack\001 61 | 4 1 0 50 -1 4 12 0.0000 0 150 465 3900 3975 class\001 62 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-b-6.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5040.000 3766.500 5805 4950 4995 5175 4275 4950 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3465.643 3920.786 4095 4365 4230 3825 3960 3330 17 | 0 0 1.00 60.00 120.00 18 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 19 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 20 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 21 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 22 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 37 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 38 | 11025 5400 11475 5400 11475 5625 11025 5625 11025 5400 39 | 2 2 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 40 | 10800 5175 11475 5175 11475 5850 10800 5850 10800 5175 41 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 42 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 43 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 44 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 45 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 46 | 4 1 0 50 -1 5 16 0.0000 0 150 990 5040 5490 return\001 47 | 4 0 0 50 -1 5 16 0.0000 0 150 990 4275 3555 return\001 48 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 49 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 50 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-a-3.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 7036.731 5405.192 7200 4995 7470 5490 6660 5175 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5040.000 3766.500 5805 4950 4995 5175 4275 4950 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3465.643 3920.786 4095 4365 4230 3825 3960 3330 19 | 0 0 1.00 60.00 120.00 20 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 21 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 22 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 39 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 40 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 41 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 42 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 43 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 44 | 4 0 0 50 -1 5 16 0.0000 0 210 1155 7650 5400 update-\001 45 | 4 0 0 50 -1 5 16 0.0000 0 210 1320 7650 5685 position\001 46 | 4 1 0 50 -1 5 16 0.0000 0 150 990 5040 5490 return\001 47 | 4 0 0 50 -1 5 16 0.0000 0 150 990 4275 3555 return\001 48 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 49 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 50 | -------------------------------------------------------------------------------- /.github/workflows/build-binary.yml: -------------------------------------------------------------------------------- 1 | name: build-binary 2 | 3 | on: [push] 4 | 5 | jobs: 6 | 7 | test: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: install-platform-dependencies 12 | run: | 13 | DEBIAN_FRONTEND=noninteractive sudo apt-get -qq update \ 14 | && DEBIAN_FRONTEND=noninteractive sudo apt-get -qq --assume-yes install \ 15 | sbcl 16 | 17 | - name: checkout 18 | uses: actions/checkout@v4 19 | with: 20 | fetch-depth: 0 21 | 22 | - name: install-quicklisp 23 | run: | 24 | wget https://beta.quicklisp.org/quicklisp.lisp 25 | sbcl --noinform --disable-debugger \ 26 | --load quicklisp.lisp \ 27 | --eval '(quicklisp-quickstart:install)' \ 28 | --quit 29 | pwd 30 | ls $HOME 31 | 32 | - name: dependencies-in-local-projects 33 | run: | 34 | cd "${HOME}/quicklisp/local-projects" \ 35 | && git clone -b master https://github.com/robert-strandh/cluffer \ 36 | && git clone -b master https://github.com/s-expressionists/eclector \ 37 | && git clone -b main https://github.com/s-expressionists/spell \ 38 | && git clone -b main https://github.com/s-expressionists/incrementalist \ 39 | && git clone -b main https://github.com/scymtym/text.editing 40 | 41 | - name: build-binary 42 | run: | 43 | sbcl --noinform --disable-debugger \ 44 | --load "${HOME}/quicklisp/setup.lisp" \ 45 | --eval '(asdf:initialize-source-registry (quote (:source-registry (:tree "'"$(pwd)"'") :ignore-inherited-configuration)))' \ 46 | --eval '(ql:quickload "second-climacs-clim")' \ 47 | --eval '(asdf:make "second-climacs-clim")' 48 | 49 | - name: gather-artifacts 50 | run: | 51 | mkdir -p artifacts 52 | mv -v Code/GUI/McCLIM-ESA/second-climacs artifacts/ 53 | 54 | - name: upload-artifacts 55 | uses: actions/upload-artifact@v4 56 | with: 57 | name: second-climacs 58 | path: artifacts 59 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-b-31.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 7222.500 5827.500 6525 5220 6300 5895 6615 6525 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6218.438 5897.812 6975 6525 7200 5850 6930 5220 17 | 0 0 1.00 60.00 120.00 18 | 6 4545 5895 6210 6345 19 | 4 0 0 50 -1 5 16 0.0000 0 120 1155 4545 6030 access-\001 20 | 4 0 0 50 -1 5 16 0.0000 0 165 1650 4545 6315 characters\001 21 | -6 22 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 24 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 41 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 42 | 11025 5400 11475 5400 11475 5625 11025 5625 11025 5400 43 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 44 | 10800 5175 11475 5175 11475 5850 10800 5850 10800 5175 45 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 46 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 47 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 48 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 49 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 50 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 51 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 52 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/delete-table.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | (clim:define-command-table delete-table) 4 | 5 | (defmacro define-delete-command (name (&rest extra-parameters) &body body) 6 | `(define-buffer-command (,name delete-table) ,extra-parameters 7 | ,@body)) 8 | 9 | (define-delete-command com-delete (&key (unit 'unit) (direction 'direction)) 10 | (edit:perform buffer 'edit:delete unit direction)) 11 | 12 | (define-command-specializations (delete-table com-delete) 13 | (com-kill-region (:unit edit:region-or-item :direction :forward) (#\w :control)) 14 | ;; Buffer structure units 15 | (com-delete-item (:unit edit:item :direction :forward) (#\d :control)) 16 | (com-erase-item (:unit edit:item :direction :backward) #\Backspace) 17 | (com-kill-line (:unit edit:semi-line :direction :forward) (#\k :control)) 18 | ;; TODO line backward is C-0 C-k in Emacs 19 | (com-erase-buffer (:unit edit:buffer :direction :forward)) 20 | ;; Prose units 21 | (com-delete-word (:unit edit:word :direction :forward) (#\d :meta)) 22 | (com-erase-word (:unit edit:word :direction :backward) (#\Backspace :meta)) 23 | (com-delete-sentence (:unit edit:sentence :direction :forward)) 24 | (com-erase-sentence (:unit edit:sentence :direction :backward)) 25 | (com-delete-paragraph (:unit edit:paragraph :direction :forward)) 26 | (com-erase-paragraph (:unit edit:paragraph :direction :backward)) 27 | ;; Expression 28 | (com-delete-expression-forward (:unit edit.exp:expression :direction :forward) (#\k :control :meta)) 29 | (com-delete-expression-backward (:unit edit.exp:expression :direction :backward) (#\Backspace :control :meta))) 30 | 31 | (define-delete-command com-delete-indentation () 32 | (edit:perform buffer 'edit:delete-indentation)) 33 | (bind-key 'delete-table '(#\^ :meta) 'com-delete-indentation) 34 | 35 | (define-delete-command com-delete-trailing-spaces () 36 | (edit:perform buffer 'edit:delete-trailing-whitespace)) 37 | 38 | (define-delete-command com-fixup-whitespace () 39 | (edit:perform buffer 'edit:fixup-whitespace)) 40 | 41 | ;;; Copying and inserting 42 | 43 | (define-delete-command com-copy () 44 | (edit:perform buffer 'edit:copy edit:region :forward)) 45 | (bind-key 'delete-table '(#\w :meta) 'com-copy) 46 | 47 | (define-delete-command com-unkill () 48 | (edit:perform buffer 'edit:yank :forward)) 49 | (bind-key 'delete-table '(#\y :control) 'com-unkill) 50 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation-3.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6641.413 5096.739 6300 6525 5355 5805 5175 5175 15 | 0 0 1.00 60.00 120.00 16 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 17 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 18 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 19 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 20 | 10575 2700 11475 2700 11475 3825 10575 3825 10575 2700 21 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 22 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 23 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 24 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10800 5400 11475 5400 11475 5850 10800 5850 10800 5400 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 10800 5850 11475 5850 11475 6300 10800 6300 10800 5850 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 10575 5175 11475 5175 11475 6750 10575 6750 10575 5175 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 41 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 42 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 43 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 44 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 45 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 46 | 4 1 0 50 -1 0 16 0.0000 0 240 990 5355 4815 Compare\001 47 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 48 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 49 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 50 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 51 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 52 | -------------------------------------------------------------------------------- /Code/Command/command.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-command) 2 | 3 | ;;; A COMMAND consists of two parts: 4 | ;;; 5 | ;;; * A FUNCTION that is called to execute some code that may modify 6 | ;;; the model or the view. This function can either be called 7 | ;;; directly as a normal Common Lisp function, or through the 8 | ;;; process of COMMAND INVOCATION. 9 | ;;; 10 | ;;; * A list of TYPE NAMES, one for each required parameter of the 11 | ;;; function. 12 | ;;; 13 | ;;; When a command is invoked, the arguments are first acquired 14 | ;;; according to the types. The function is then called with those 15 | ;;; arguments. 16 | ;;; 17 | ;;; In order to keep the two parts of a command together, we define a 18 | ;;; class COMMAND to be a subclass of STANDARD-GENERIC-FUNCTION. That 19 | ;;; way, we can add new slots for keeping track of the list of type 20 | ;;; names and perhaps of other information as well. 21 | 22 | (defclass command (standard-generic-function) 23 | ((%types :initarg :types :reader types)) 24 | (:metaclass #.(class-name (class-of (find-class 'standard-generic-function))))) 25 | 26 | (defun split-lambda-list (lambda-list) 27 | (let* ((position-or-nil (position '&optional lambda-list)) 28 | (position (if (null position-or-nil) 29 | (length lambda-list) 30 | position-or-nil))) 31 | (values (subseq lambda-list 0 position) 32 | (subseq lambda-list position)))) 33 | 34 | (defun extract-lambda-lists (lambda-list) 35 | (multiple-value-bind (required optional) 36 | (split-lambda-list lambda-list) 37 | (let ((ordinary-required 38 | (loop for req in required 39 | collect (if (symbolp req) req (first req)))) 40 | (gf-optionals 41 | (if (null optional) 42 | '() 43 | (cons '&optional 44 | (loop for opt in (rest optional) 45 | collect (if (symbolp opt) opt (first opt))))))) 46 | (values (loop for req in required 47 | collect (if (symbolp req) t (second req))) 48 | (append ordinary-required gf-optionals) 49 | (append ordinary-required optional))))) 50 | 51 | (defmacro define-command (name lambda-list &body body) 52 | (multiple-value-bind (types gf-lambda-list method-lambda-list) 53 | (extract-lambda-lists lambda-list) 54 | `(progn (defgeneric ,name ,gf-lambda-list 55 | (:method ,method-lambda-list ,@body) 56 | (:generic-function-class command)) 57 | (reinitialize-instance #',name 58 | :types ',types)))) 59 | 60 | (defgeneric command-pretty-name (command-name language) 61 | (:method (command-name language) nil)) 62 | -------------------------------------------------------------------------------- /Documentation/fig-wad.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 11 | 2025 450 2025 1350 12 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 13 | 450 675 2025 675 14 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 15 | 450 900 2025 900 16 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 17 | 450 1125 2025 1125 18 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 19 | 3375 900 2025 900 20 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 21 | 450 450 3375 450 3375 1350 450 1350 450 450 22 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 23 | 0 0 1.00 60.00 120.00 24 | 2700 1125 2700 1800 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 2475 1800 3375 1800 3375 2250 2475 2250 2475 1800 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 3600 1800 4500 1800 4500 2250 3600 2250 3600 1800 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 4950 1800 5850 1800 5850 2250 4950 2250 4950 1800 31 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 32 | 0 0 1.00 60.00 120.00 33 | 3150 2025 3600 2025 34 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 35 | 2925 1800 2925 2250 36 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 37 | 4050 1800 4050 2250 38 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 39 | 5400 1800 5400 2250 40 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 41 | 0 0 1.00 60.00 120.00 42 | 2700 2025 2700 2700 43 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 44 | 0 0 1.00 60.00 120.00 45 | 3825 2025 3825 2700 46 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 47 | 0 0 1.00 60.00 120.00 48 | 5175 2025 5175 2700 49 | 3 1 0 1 0 7 50 -1 -1 0.000 0 0 0 9 50 | 2520 2880 2295 3105 2565 3375 2610 3060 2970 3240 3015 2970 51 | 2745 2970 2835 2880 2610 2745 52 | 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 53 | 1.000 54 | 3 1 0 1 0 7 50 -1 -1 0.000 0 0 0 9 55 | 3645 2880 3420 3105 3690 3375 3735 3060 4095 3240 4140 2970 56 | 3870 2970 3960 2880 3735 2745 57 | 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 58 | 1.000 59 | 3 1 0 1 0 7 50 -1 -1 0.000 0 0 0 9 60 | 4995 2880 4770 3105 5040 3375 5085 3060 5445 3240 5490 2970 61 | 5220 2970 5310 2880 5085 2745 62 | 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 63 | 1.000 64 | 4 1 0 50 -1 5 12 0.0000 0 120 1440 1260 855 start-column\001 65 | 4 1 0 50 -1 5 12 0.0000 0 120 1200 1260 630 start-line\001 66 | 4 1 0 50 -1 5 12 0.0000 0 120 960 1260 1080 end-line\001 67 | 4 1 0 50 -1 5 12 0.0000 0 120 1200 1260 1305 end-column\001 68 | 4 1 0 50 -1 5 12 0.0000 0 165 1200 2700 720 expression\001 69 | 4 1 0 50 -1 5 12 0.0000 0 120 960 2700 1080 children\001 70 | 4 1 0 50 -1 5 12 0.0000 0 30 360 4725 2070 ...\001 71 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/restart-case.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; Compute the indentations for a single LET binding. 4 | (define-indentation-automaton compute-restart-case-clause-indentations 5 | (tagbody 6 | (next) 7 | ;; The current wad represents the case name. 8 | (maybe-assign-indentation 1 4) 9 | (next) 10 | ;; The current wad represent the lambda list. 11 | (maybe-assign-indentation 4 2) 12 | (compute-lambda-list-indentation current-wad client) 13 | (next) 14 | option-or-declaration-or-form 15 | (let ((expression (cst:raw current-wad))) 16 | (when (member expression '(:interactive :report :test) :test #'eq) 17 | ;; We have an option. 18 | (maybe-assign-indentation 2 4) 19 | (next) 20 | ;; The current wad represents the expression associated with 21 | ;; the option. But we can compute the indentation as if it 22 | ;; is a form, because it is either an atom or a lambda 23 | ;; expression. 24 | (maybe-assign-indentation 4 2) 25 | (compute-form-indentation current-wad nil client) 26 | (next) 27 | (go option-or-declaration-or-form))) 28 | declaration-or-form 29 | (when (and (consp (cst:raw current-wad)) 30 | (wad-represents-symbol-p 31 | (first (ip:children current-wad)) 32 | 'declare)) 33 | (maybe-assign-indentation 3 2) 34 | (compute-declare-indentation current-wad client) 35 | (next) 36 | (go declaration-or-form)) 37 | form 38 | (maybe-assign-indentation 2 2) 39 | (compute-form-indentation current-wad nil client) 40 | (next) 41 | (go form))) 42 | 43 | ;;; Compute the indentation of a single LET binding. 44 | (defun compute-restart-case-clause-indentation (wad client) 45 | (compute-and-assign-indentations 46 | client wad compute-restart-case-clause-indentations)) 47 | 48 | (define-indentation-automaton compute-restart-case-indentations 49 | (tagbody 50 | (next) 51 | ;; The current wad is the operator. 52 | (maybe-assign-indentation 1 4) 53 | (next) 54 | ;; The current wad ought to represent the restartable form. 55 | (maybe-assign-indentation 4 2) 56 | (compute-form-indentation current-wad nil client) 57 | (next) 58 | clause 59 | (maybe-assign-indentation 2 2) 60 | (compute-restart-case-clause-indentation current-wad client) 61 | (next) 62 | (go clause))) 63 | 64 | (define-form-indentation-method 65 | ('#:common-lisp '#:restart-case) compute-restart-case-indentations) 66 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-a.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8579.955 5731.791 9675 4455 8550 4050 7200 4770 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 7036.731 5405.192 7200 4995 7470 5490 6660 5175 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5040.000 3766.500 5805 4950 4995 5175 4275 4950 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 19 | 0 0 1.00 60.00 120.00 20 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3465.643 3920.786 4095 4365 4230 3825 3960 3330 21 | 0 0 1.00 60.00 120.00 22 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 24 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 25 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 26 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 27 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 28 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 29 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 30 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 31 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 32 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 41 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 42 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 43 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 44 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 45 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 46 | 4 1 0 50 -1 5 16 0.0000 0 120 990 8370 3870 access\001 47 | 4 0 0 50 -1 5 16 0.0000 0 210 1155 7650 5400 update-\001 48 | 4 0 0 50 -1 5 16 0.0000 0 210 1320 7650 5685 position\001 49 | 4 1 0 50 -1 5 16 0.0000 0 150 990 5040 5490 return\001 50 | 4 0 0 50 -1 5 16 0.0000 0 150 990 4275 3555 return\001 51 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 52 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 53 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/expression.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; Expression interface 4 | 5 | (defmethod edit.exp:range ((expression ip:wad)) 6 | (let* ((start-line (ip:absolute-start-line expression)) 7 | (start-column (ip:start-column expression)) 8 | (end-line (+ start-line (ip:height expression))) 9 | (end-column (ip:end-column expression))) 10 | (values start-line start-column end-line end-column))) 11 | 12 | (defmethod edit.exp:children ((expression ip:wad)) 13 | (ip:children expression)) 14 | 15 | (defmethod edit.exp:children ((expression ip:atom-wad)) 16 | ;; Present a pathname as an atom with potential `text-wad' children, 17 | ;; but skip the `atom-wad' for the string in between. 18 | (if (typep (cst:raw expression) 'pathname) 19 | (alexandria:mappend #'ip:children (ip:children expression)) 20 | (ip:children expression))) 21 | 22 | (defmethod edit.exp:map-expressions-containing-cursor-using-buffer 23 | ((function t) 24 | (buffer base:standard-buffer) 25 | (cursor cluffer:cursor) 26 | (syntax-tree t) 27 | &key (start-relation '<=) (end-relation '<)) 28 | (let* ((view (uiop:symbol-call '#:second-climacs-clim-base '#:current-view)) ; TODO 29 | (analyzer (base:analyzer view)) 30 | (cache (ip:cache analyzer)) 31 | (cursor-line (cluffer:line-number cursor)) 32 | (cursor-column (cluffer:cursor-position cursor)) 33 | ;; Defer reporting some wads so that we can filter based on 34 | ;; the parent. The use case is not reporting the string 35 | ;; `atom-wad' child of a pathname `atom-wad'. 36 | (deferred nil) 37 | (innermostp t)) 38 | (flet ((flush () 39 | (when (not (null deferred)) 40 | (funcall function deferred) 41 | (setf deferred nil)))) 42 | (ip:map-wads-containing-position 43 | (lambda (absolute-line-number wad) 44 | (declare (ignore absolute-line-number)) 45 | (cond ((not innermostp) 46 | (when (not (null deferred)) 47 | (if (and (typep wad 'ip:atom-wad) 48 | (typep (cst:raw wad) 'pathname)) 49 | (setf deferred nil) 50 | (flush))) 51 | (funcall function wad)) 52 | ((typep wad 'ip:text-wad)) ; filter out `text-wad's 53 | (t 54 | (setf deferred wad 55 | innermostp nil)))) 56 | cache cursor-line cursor-column :start-relation start-relation 57 | :end-relation end-relation) 58 | (flush)))) 59 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation-4.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6641.413 5096.739 6300 6525 5355 5805 5175 5175 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6821.330 4128.989 5850 5085 6750 5490 7695 5175 17 | 0 0 1.00 60.00 120.00 18 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 19 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 20 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 21 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 7875 4725 855 450 7875 4725 8730 5175 22 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 23 | 10575 2700 11475 2700 11475 3825 10575 3825 10575 2700 24 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 25 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 26 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 27 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 28 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 29 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 30 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 31 | 10800 5400 11475 5400 11475 5850 10800 5850 10800 5400 32 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 33 | 10800 5850 11475 5850 11475 6300 10800 6300 10800 5850 34 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 35 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 36 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 37 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 38 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 39 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 40 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 41 | 10575 5175 11475 5175 11475 6750 10575 6750 10575 5175 42 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 43 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 44 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 45 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 46 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 47 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 48 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 49 | 4 1 0 50 -1 0 16 0.0000 0 240 990 5355 4815 Compare\001 50 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 51 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 52 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 53 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 54 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 55 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6525 5760 modify\001 56 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6045 insert\001 57 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6330 delete\001 58 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation-7.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6641.413 5096.739 6300 6525 5355 5805 5175 5175 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8918.805 4835.543 8325 4320 8955 4050 9630 4500 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6821.330 4128.989 5850 5085 6750 5490 7695 5175 19 | 0 0 1.00 60.00 120.00 20 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8865.000 4278.750 9675 5175 8550 5445 8055 5175 21 | 0 0 1.00 60.00 120.00 22 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 24 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 25 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 7875 4725 855 450 7875 4725 8730 5175 26 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 27 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 28 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 29 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 30 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 31 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 32 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 33 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 34 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 35 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 36 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 37 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 38 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 39 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 40 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 41 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 42 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 43 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 44 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 45 | 4 1 0 50 -1 0 16 0.0000 0 240 990 5355 4815 Compare\001 46 | 4 1 0 50 -1 0 16 0.0000 0 180 900 7875 4815 Remove\001 47 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 48 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 49 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 50 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 51 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 52 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6525 5760 modify\001 53 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6045 insert\001 54 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6330 delete\001 55 | 4 1 0 50 -1 5 16 0.0000 0 120 825 8865 5760 acess\001 56 | 4 0 0 50 -1 5 16 0.0000 0 120 990 8550 3645 remove\001 57 | 4 0 0 50 -1 5 16 0.0000 0 210 825 8550 3930 split\001 58 | -------------------------------------------------------------------------------- /Documentation/second-climacs.tex: -------------------------------------------------------------------------------- 1 | \documentclass[11pt]{book} 2 | \newcommand{\Comment}[1]{\begin{center}\tt #1 \end{center}} 3 | % \usepackage{doublespace} 4 | \usepackage[paperwidth=7.5in, paperheight=9.25in, 5 | inner=35mm, outer=25mm, 6 | tmargin=25mm, bmargin=30mm]{geometry} 7 | \usepackage[T1]{fontenc} 8 | \usepackage[utf8]{inputenc} 9 | \usepackage{alltt} 10 | \usepackage{moreverb} 11 | \usepackage{fancyvrb} 12 | \usepackage{epsfig} 13 | \usepackage{makeidx} 14 | \usepackage{float} 15 | \usepackage{color} 16 | \usepackage{amsthm} 17 | \usepackage{changebar} 18 | \usepackage{tabularx} 19 | \usepackage[nottoc]{tocbibind} 20 | \usepackage{shadow} 21 | \setlength\sdim{2mm} 22 | 23 | \floatplacement{figure}{!htbp} 24 | 25 | \newfloat{codefragment}{!htbp}{cod}[chapter] 26 | \floatname{codefragment}{Code fragment} 27 | 28 | \newtheorem{theorem}{Theorem}[chapter] 29 | \newtheorem{exercise}{Exercise}[chapter] 30 | \newtheorem{definition}{Definition}[chapter] 31 | 32 | \setlength{\parskip}{0.3cm} 33 | \setlength{\parindent}{0cm} 34 | 35 | \def\lispout#1{\underline{#1}} 36 | 37 | \def\mop{MOP} 38 | \def\bs{$\backslash$} 39 | \def\lispobj#1{\textsl{#1}} 40 | \def\lispobjindex#1{\lispobj{#1}\index{#1@\lispobj{#1}}} 41 | \def\syntax#1{\texttt{#1}} 42 | \def\metavar#1{\textit{#1}} 43 | \def\keyword#1{\code{\textbf{#1}}} 44 | \def\code#1{\textsf{#1}} 45 | \def\fixme#1{\footnote{\color{red}FIXME: #1}} 46 | 47 | \def\sysname{Second Climacs} 48 | 49 | \def\inputfig#1{\input #1} 50 | \def\inputtex#1{\input #1} 51 | \def\inputal#1{\input #1} 52 | \def\inputcode#1{\input #1} 53 | 54 | \inputtex{logos.tex} 55 | \inputtex{refmacros.tex} 56 | \inputtex{spec-macros.tex} 57 | \inputtex{other-macros.tex} 58 | 59 | \newenvironment{itemize0}{ 60 | \begin{itemize} 61 | \setlength{\parskip}{0cm}% 62 | } 63 | {\end{itemize}} 64 | 65 | \newenvironment{enumerate0}{ 66 | \begin{enumerate} 67 | \setlength{\parskip}{0cm}% 68 | } 69 | {\end{enumerate}} 70 | 71 | \newenvironment{smalltt}{ 72 | \begin{alltt} 73 | \small 74 | } 75 | {\end{alltt}} 76 | 77 | %UPDATE version number when it changes. 78 | \def\majorversion{0} 79 | \def\minorversion{1} 80 | \def\bookversion{\majorversion{}.\minorversion{}} 81 | \title{{\Huge \sysname{}}\\ 82 | Version 2 of the Climacs text editor.} 83 | 84 | \author{Robert Strandh} 85 | 86 | \date{2013} 87 | 88 | \makeindex 89 | \begin{document} 90 | \pagenumbering{roman} 91 | 92 | \maketitle 93 | 94 | \newpage 95 | 96 | {\setlength{\parskip}{0cm} 97 | \tableofcontents} 98 | 99 | \inputtex{chap-intro.tex} 100 | \inputtex{part-user-manual.tex} 101 | \inputtex{part-extension-writers-guide.tex} 102 | \inputtex{part-internals.tex} 103 | \inputtex{part-interfaces.tex} 104 | \inputtex{part-contributing.tex} 105 | \inputtex{part-appendices.tex} 106 | 107 | \bibliography{second-climacs}{} 108 | \bibliographystyle{alpha} 109 | 110 | \printindex 111 | 112 | \end{document} 113 | 114 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/app-reader-modification.tex: -------------------------------------------------------------------------------- 1 | \section{Reader customization} 2 | \label{app-reader-customization} 3 | 4 | In order for it to be possible for the \commonlisp{} \texttt{read} 5 | function to serve as a basis for the incremental parser described in 6 | this paper, it must be adapted in the ways described below. 7 | 8 | \subsection{Returning parse results} 9 | 10 | In addition to the nested expressions returned by an unmodified 11 | \texttt{read} function, it must also return a nested structure of 12 | \emph{parse results}, i.e. expressions wrapped in standard instances 13 | that also contain information about the location in the source code of 14 | the wrapped expressions. 15 | 16 | To accomplish this additional functionality, it is not possible to 17 | create a custom \texttt{read} function that returns parse results 18 | \emph{instead of} expressions, simply because the function must handle 19 | custom reader macros, and those reader macros return expressions, and 20 | not parse results. Also, it would create unnecessary maintenance work 21 | if all standard reader macros had to be modified in order to return 22 | parse results instead of expressions. 23 | 24 | It is also not possible to modify the \texttt{read} function to return 25 | the parse result as a second value, in addition to the normal 26 | expression. One reason is that we would like for the modified 27 | \texttt{read} function to be compatible with the standard version, and 28 | it is not permitted by the \commonlisp{} standard to return additional 29 | values. 30 | 31 | Instead, the modified \texttt{read} function maintains an explicit 32 | stack of parse results in parallel with the expressions that are 33 | normally returned. This explicit stack is kept as the value of a 34 | special variable that our parser accesses after a call to 35 | \texttt{read}. 36 | 37 | \subsection{Returning parse results for comments} 38 | 39 | The modified \texttt{read} function must return parse results that 40 | correspond to source code that the standard \texttt{read} function 41 | does not return, such as comments and expressions that are not 42 | selected by a read-time conditional. We solve this problem by 43 | checking when a reader macro returns no values, and in that case, a 44 | corresponding parse result is pushed onto the explicit stack mentioned 45 | in the previous section. 46 | 47 | \subsection{Intercepting symbol creation} 48 | 49 | The modified \texttt{read} function must not call \texttt{intern} in 50 | all situations that the ordinary \texttt{read} function would, and it 51 | must not signal an error when a symbol with an explicit package prefix 52 | does not exist. For that reason, the modified reader calls a generic 53 | function with the characters of a potential token instead. The 54 | unmodified \texttt{read} function just calls \texttt{intern}, whereas 55 | the custom \texttt{read} function creates a particular parse result 56 | that represents the token, and that can be exploited by the 57 | editor. 58 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation-b.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8579.955 5731.791 9675 4455 8550 4050 7200 4770 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5040.000 3766.500 5805 4950 4995 5175 4275 4950 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3465.643 3920.786 4095 4365 4230 3825 3960 3330 19 | 0 0 1.00 60.00 120.00 20 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 7222.500 5827.500 6525 5220 6300 5895 6615 6525 21 | 0 0 1.00 60.00 120.00 22 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6218.438 5897.812 6975 6525 7200 5850 6930 5220 23 | 0 0 1.00 60.00 120.00 24 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8487.471 3489.070 7245 4950 8325 5400 9675 4995 25 | 0 0 1.00 60.00 120.00 26 | 6 4545 5895 6210 6345 27 | 4 0 0 50 -1 5 16 0.0000 0 120 1155 4545 6030 access-\001 28 | 4 0 0 50 -1 5 16 0.0000 0 165 1650 4545 6315 characters\001 29 | -6 30 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 31 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 32 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 41 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 42 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 43 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 44 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 45 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 46 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 47 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 48 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 49 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 50 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 51 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 52 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 53 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 54 | 4 1 0 50 -1 5 16 0.0000 0 120 990 8370 3870 access\001 55 | 4 1 0 50 -1 5 16 0.0000 0 150 990 5040 5490 return\001 56 | 4 0 0 50 -1 5 16 0.0000 0 150 990 4275 3555 return\001 57 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 58 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 59 | 4 1 0 50 -1 5 16 0.0000 0 210 2310 8460 5715 remove-overlap\001 60 | 4 1 0 50 -1 5 16 0.0000 0 165 990 8460 6000 insert\001 61 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-rehabilitation.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5083.430 5361.802 4365 4545 5130 4275 5850 4590 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8579.955 5731.791 9675 4455 8550 4050 7200 4770 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5040.000 3766.500 5805 4950 4995 5175 4275 4950 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3358.019 3915.849 3150 3285 2700 3825 2970 4455 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 3465.643 3920.786 4095 4365 4230 3825 3960 3330 19 | 0 0 1.00 60.00 120.00 20 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 7222.500 5827.500 6525 5220 6300 5895 6615 6525 21 | 0 0 1.00 60.00 120.00 22 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6218.438 5897.812 6975 6525 7200 5850 6930 5220 23 | 0 0 1.00 60.00 120.00 24 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 8487.471 3489.070 7245 4950 8325 5400 9675 4995 25 | 0 0 1.00 60.00 120.00 26 | 6 4545 5895 6210 6345 27 | 4 0 0 50 -1 5 16 0.0000 0 120 1155 4545 6030 access-\001 28 | 4 0 0 50 -1 5 16 0.0000 0 165 1650 4545 6315 characters\001 29 | -6 30 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 31 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 32 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3600 2925 855 450 3600 2925 4455 3375 33 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 34 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 35 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 36 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 37 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 38 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 39 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 40 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 41 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 42 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 43 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 44 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 45 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 46 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 47 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 48 | 5850 4275 7200 4275 7200 5175 5850 5175 5850 4275 49 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 50 | 4 1 0 50 -1 0 16 0.0000 0 240 540 6525 4590 Gray\001 51 | 4 1 0 50 -1 0 16 0.0000 0 150 720 6525 4905 stream\001 52 | 4 1 0 50 -1 5 16 0.0000 0 165 660 5130 4095 read\001 53 | 4 1 0 50 -1 0 16 0.0000 0 180 765 3600 4770 Reader\001 54 | 4 1 0 50 -1 5 16 0.0000 0 120 990 8370 3870 access\001 55 | 4 1 0 50 -1 5 16 0.0000 0 150 990 5040 5490 return\001 56 | 4 0 0 50 -1 5 16 0.0000 0 150 990 4275 3555 return\001 57 | 4 0 0 50 -1 5 16 0.0000 0 165 660 2880 3870 call\001 58 | 4 1 0 50 -1 0 16 0.0000 0 180 1380 3555 3060 Rehabilitate\001 59 | 4 1 0 50 -1 5 16 0.0000 0 210 2310 8460 5715 remove-overlap\001 60 | 4 1 0 50 -1 5 16 0.0000 0 165 990 8460 6000 insert\001 61 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation-5.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6641.413 5096.739 6300 6525 5355 5805 5175 5175 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6821.330 4128.989 5850 5085 6750 5490 7695 5175 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8865.000 4278.750 9675 5175 8550 5445 8055 5175 19 | 0 0 1.00 60.00 120.00 20 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 21 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 22 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 7875 4725 855 450 7875 4725 8730 5175 24 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 25 | 10575 2700 11475 2700 11475 3825 10575 3825 10575 2700 26 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 27 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 28 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 29 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 30 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 31 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 32 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 33 | 10800 5400 11475 5400 11475 5850 10800 5850 10800 5400 34 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 35 | 10800 5850 11475 5850 11475 6300 10800 6300 10800 5850 36 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 37 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 38 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 39 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 40 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 41 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 42 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 43 | 10575 5175 11475 5175 11475 6750 10575 6750 10575 5175 44 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 45 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 46 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 47 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 48 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 49 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 50 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 51 | 4 1 0 50 -1 0 16 0.0000 0 240 990 5355 4815 Compare\001 52 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 53 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 54 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 55 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 56 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 57 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6525 5760 modify\001 58 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6045 insert\001 59 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6330 delete\001 60 | 4 1 0 50 -1 5 16 0.0000 0 120 825 8865 5760 acess\001 61 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/flet-labels-macrolet.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | (define-indentation-automaton compute-local-function-indentations 4 | (tagbody 5 | (next) 6 | ;; The current wad ought to be the name. 7 | (maybe-assign-indentation 1 4) 8 | (next) 9 | ;; The current wad ought to be the lambda list. 10 | (maybe-assign-indentation 4 2) 11 | (compute-lambda-list-indentation current-wad client) 12 | (next) 13 | declaration-or-documentation-or-form 14 | (when (and (consp (cst:raw current-wad)) 15 | (wad-represents-symbol-p 16 | (first (ip:children current-wad)) 17 | 'declare)) 18 | (maybe-assign-indentation 3 2) 19 | (compute-declare-indentation current-wad client) 20 | (next) 21 | (go declaration-or-documentation-or-form)) 22 | documentation-or-form 23 | (when (stringp (cst:raw current-wad)) 24 | (maybe-assign-indentation 3 2) 25 | (next)) 26 | form 27 | (maybe-assign-indentation 2 2) 28 | (compute-form-indentation current-wad nil client) 29 | (next) 30 | (go form))) 31 | 32 | ;;; Compute the indentation of a single local function definition. 33 | (defun compute-local-function-indentation (wad client) 34 | (compute-and-assign-indentations 35 | client wad compute-local-function-indentations)) 36 | 37 | ;;; Compute the indentation of a uniform list of local function 38 | ;;; definitions. 39 | (defun compute-local-functions-indentation (wad client) 40 | (compute-list-indentation wad client #'compute-local-function-indentation)) 41 | 42 | (define-indentation-automaton compute-flet-indentations 43 | (tagbody 44 | (next) 45 | ;; The current wad is the operator. 46 | (maybe-assign-indentation 1 4) 47 | (next) 48 | ;; The current wad ought to be the list of local function 49 | ;; definitions. 50 | (maybe-assign-indentation 4 2) 51 | (compute-local-functions-indentation current-wad client) 52 | (next) 53 | declaration-or-documentation-or-form 54 | (when (and (consp (cst:raw current-wad)) 55 | (wad-represents-symbol-p 56 | (first (ip:children current-wad)) 57 | 'declare)) 58 | (maybe-assign-indentation 3 2) 59 | (compute-declare-indentation current-wad client) 60 | (next) 61 | (go declaration-or-documentation-or-form)) 62 | documentation-or-form 63 | (when (stringp (cst:raw current-wad)) 64 | (maybe-assign-indentation 3 2) 65 | (next)) 66 | form 67 | (maybe-assign-indentation 2 2) 68 | (compute-form-indentation current-wad nil client) 69 | (next) 70 | (go form))) 71 | 72 | (define-form-indentation-method 73 | ('#:common-lisp '#:flet) compute-flet-indentations) 74 | 75 | (define-form-indentation-method 76 | ('#:common-lisp '#:labels) compute-flet-indentations) 77 | 78 | (define-form-indentation-method 79 | ('#:common-lisp '#:macrolet) compute-flet-indentations) 80 | 81 | (define-form-indentation-method 82 | ('#:common-lisp '#:lambda) compute-local-function-indentations) 83 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/sec-conclusions.tex: -------------------------------------------------------------------------------- 1 | \section{Conclusions and future work} 2 | 3 | Currently, parse results that are not part of the final structure of 4 | the buffer are discarded. When the user is not using an editor mode 5 | that automatically balances characters such as parentheses and double 6 | quotes, inserting such a character often results in a large number of 7 | parse results being discarded, only to have to be created again soon 8 | afterward, when the user inserts the balancing character of the pair. 9 | We can avoid this situation by keeping parse results that are not part 10 | of the final structure in the cache, in the hopes that they will again 11 | be required later. We then also need a strategy for removing such 12 | parse results from the cache after some time, so as to avoid that the 13 | cache grows without limits. 14 | 15 | Parsing \commonlisp{} source code is only the first step in the 16 | analysis of its structure. In order to determine the role of each 17 | symbol and other information such as indentation, further analysis is 18 | required. Such analysis requires a \emph{code walker}, because the 19 | role of a symbol may depend on the definitions of macros to which it 20 | is an argument. Similarly, computing standard 21 | \emph{indentation}, also requires further analysis. To implement this 22 | code walker, we consider using the first phase of the \cleavir{} 23 | compiler framework.% 24 | \footnote{\cleavir{} is currently part of \sicl{}. See the directory 25 | named \texttt{Code/Cleavir} in the \sicl{} repository.} 26 | 27 | We plan to investigate the use of a new implementation of 28 | \emph{first-class global environments} 29 | \cite{Strandh:2015:ELS:Environments}. This new implementation of the 30 | existing \clos{} protocol would use \emph{incremental differences} to 31 | the \emph{startup environment}% 32 | \footnote{Recall that the startup environment is the environment in 33 | which the compiler was invoked.} 34 | so as to define a \emph{compilation environment}% 35 | \footnote{Recall that the compilation environment is the environment 36 | used by the compiler for definitions and side effects of the 37 | compilation process.} 38 | that is different for each top-level form in the editor buffer. This 39 | technique would allow us to restart the compiler in an appropriate 40 | environment without having to process the entire buffer from the 41 | beginning. 42 | 43 | The combination of the use of the first pass of the \cleavir{} 44 | compiler framework and the use of incremental first-class global 45 | environments will allow us to handle compile-time evaluation of 46 | certain top-level forms in a way that corresponds to the semantics of 47 | the file compiler. In particular, imperative environment operations 48 | such as changing the current package or modifying the readtable in the 49 | middle of a buffer will have the expected consequences, but only to 50 | subsequent forms in the buffer. 51 | 52 | A more precise analysis of \commonlisp{} code opens the 53 | possibility for additional functionality that requires knowledge about 54 | the role of each expression. In particular, such an analysis could be 55 | the basis for sophisticated code transformations such as variable 56 | renaming and code refactoring. 57 | -------------------------------------------------------------------------------- /Code/Syntax/Common-Lisp/Indentation/type-specifier.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-syntax-common-lisp) 2 | 3 | ;;; As usual, we don't really compute the indentation of the 4 | ;;; expression itself, in this case the type specifier. Instead, we 5 | ;;; compute the indentation of the sub-expressions of that expression. 6 | (defgeneric compute-type-specifier-indentation (wad pawn client)) 7 | 8 | ;;; This method is applicable when the caller specifies NIL for the 9 | ;;; pawn, meaning that we do not know the nature of the wad att all, 10 | ;;; only that it ought to be a type specifier. It could be an atomic 11 | ;;; wad, in which case it should not have its indentation computed at 12 | ;;; all. Or it could be a compound wad, but with an unknown type 13 | ;;; identifier, in which case we also do not compute its indentation. 14 | (defmethod compute-type-specifier-indentation (wad (pawn null) client) 15 | (when (typep wad 'ip:cst-wad) 16 | (let ((expression (cst:raw wad))) 17 | (when (consp expression) 18 | (compute-type-specifier-indentation 19 | wad (first expression) client))))) 20 | 21 | ;;; This method is applicable when we are given a pawn, but there is 22 | ;;; no more specific method applicable, meaning we have not defined a 23 | ;;; method for this particular pawn. So we do nothing. 24 | (defmethod compute-type-specifier-indentation (wad (pawn pawn) client) 25 | nil) 26 | 27 | ;;; This method is applicable when we are not given a pawn. So we do 28 | ;;; nothing. 29 | (defmethod compute-type-specifier-indentation (wad pawn client) 30 | nil) 31 | 32 | ;;; This macro is used to define a typical indentation method that 33 | ;;; computes indentation units and calls an automaton function. 34 | (defmacro define-type-specifier-indentation-method (pawn automaton) 35 | `(defmethod compute-type-specifier-indentation 36 | (wad (pawn (eql (intern-pawn ,@pawn))) client) 37 | (compute-and-assign-indentations client wad ,automaton))) 38 | 39 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 40 | ;;; 41 | ;;; Type specifiers AND, OR, NOT, CONS. 42 | ;;; 43 | ;;; While some of these type specifiers take a bounded number of 44 | ;;; arguments, we still treat them as if they can take an arbitrary 45 | ;;; number, because it is not the purpose of the indentation code to 46 | ;;; detect syntax violations like this. 47 | 48 | (define-indentation-automaton compute-type-and-etc-indentations 49 | (tagbody 50 | (next) 51 | ;; The current wad must be the type identifier. 52 | (maybe-assign-indentation 1 3) 53 | (next) 54 | ;; The remaining wads represent type specifiers. 55 | type-specifier 56 | (maybe-assign-indentation 3 3) 57 | (compute-type-specifier-indentation current-wad nil client) 58 | (next) 59 | (go type-specifier))) 60 | 61 | (define-type-specifier-indentation-method 62 | ('#:common-lisp '#:and) compute-type-and-etc-indentations) 63 | 64 | (define-type-specifier-indentation-method 65 | ('#:common-lisp '#:or) compute-type-and-etc-indentations) 66 | 67 | (define-type-specifier-indentation-method 68 | ('#:common-lisp '#:not) compute-type-and-etc-indentations) 69 | 70 | (define-type-specifier-indentation-method 71 | ('#:common-lisp '#:cons) compute-type-and-etc-indentations) 72 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6641.413 5096.739 6300 6525 5355 5805 5175 5175 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8918.805 4835.543 8325 4320 8955 4050 9630 4500 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6821.330 4128.989 5850 5085 6750 5490 7695 5175 19 | 0 0 1.00 60.00 120.00 20 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8865.000 4278.750 9675 5175 8550 5445 8055 5175 21 | 0 0 1.00 60.00 120.00 22 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 24 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 25 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 7875 4725 855 450 7875 4725 8730 5175 26 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 27 | 10575 2700 11475 2700 11475 3825 10575 3825 10575 2700 28 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 29 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 30 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 31 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 32 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 33 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 34 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 35 | 10800 5400 11475 5400 11475 5850 10800 5850 10800 5400 36 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 37 | 10800 5850 11475 5850 11475 6300 10800 6300 10800 5850 38 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 39 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 40 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 41 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 42 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 43 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 44 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 45 | 10575 5175 11475 5175 11475 6750 10575 6750 10575 5175 46 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 47 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 48 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 49 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 50 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 51 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 52 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 53 | 4 1 0 50 -1 0 16 0.0000 0 240 990 5355 4815 Compare\001 54 | 4 1 0 50 -1 0 16 0.0000 0 180 900 7875 4815 Remove\001 55 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 56 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 57 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 58 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 59 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 60 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6525 5760 modify\001 61 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6045 insert\001 62 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6330 delete\001 63 | 4 1 0 50 -1 5 16 0.0000 0 120 825 8865 5760 acess\001 64 | 4 0 0 50 -1 5 16 0.0000 0 120 990 8550 3645 remove\001 65 | 4 0 0 50 -1 5 16 0.0000 0 210 825 8550 3930 split\001 66 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/Talk/fig-invalidation-6.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Metric 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6723.409 6406.071 3600 4230 5085 2970 6075 2655 11 | 0 0 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 4543.954 2424.244 6570 2655 6210 3600 5400 4275 13 | 0 0 1.00 60.00 120.00 14 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 6641.413 5096.739 6300 6525 5355 5805 5175 5175 15 | 0 0 1.00 60.00 120.00 16 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8918.805 4835.543 8325 4320 8955 4050 9630 4500 17 | 0 0 1.00 60.00 120.00 18 | 5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 6821.330 4128.989 5850 5085 6750 5490 7695 5175 19 | 0 0 1.00 60.00 120.00 20 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 8865.000 4278.750 9675 5175 8550 5445 8055 5175 21 | 0 0 1.00 60.00 120.00 22 | 1 2 0 1 0 7 50 -1 -1 0.000 1 0.0000 11025 4612 1350 3262 9675 1350 12375 7875 23 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 3555 4725 855 450 3555 4725 4410 5175 24 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 5355 4725 855 450 5355 4725 6210 5175 25 | 1 1 0 1 0 7 50 -1 -1 0.000 1 0.0000 7875 4725 855 450 7875 4725 8730 5175 26 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 27 | 10575 2700 11475 2700 11475 3825 10575 3825 10575 2700 28 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 29 | 10800 2880 11475 2880 11475 3375 10800 3375 10800 2880 30 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 31 | 10800 3375 11475 3375 11475 3825 10800 3825 10800 3375 32 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 33 | 10575 4275 11475 4275 11475 4725 10575 4725 10575 4275 34 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 35 | 10800 5400 11475 5400 11475 5850 10800 5850 10800 5400 36 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 37 | 10800 5850 11475 5850 11475 6300 10800 6300 10800 5850 38 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 39 | 10800 6300 11475 6300 11475 6750 10800 6750 10800 6300 40 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 41 | 11025 5625 11475 5625 11475 5850 11025 5850 11025 5625 42 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 43 | 11025 6480 11475 6480 11475 6750 11025 6750 11025 6480 44 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 45 | 10575 5175 11475 5175 11475 6750 10575 6750 10575 5175 46 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 47 | 5850 1350 8550 1350 8550 2655 5850 2655 5850 1350 48 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 49 | 5850 6525 8550 6525 8550 7830 5850 7830 5850 6525 50 | 4 1 0 50 -1 0 16 0.0000 0 180 1410 7155 2160 Editor buffer\001 51 | 4 1 0 50 -1 0 16 0.0000 0 240 2010 7200 7290 Editor buffer copy\001 52 | 4 1 0 50 -1 0 16 0.0000 0 180 1080 3555 4815 Invalidate\001 53 | 4 1 0 50 -1 0 16 0.0000 0 240 990 5355 4815 Compare\001 54 | 4 1 0 50 -1 0 16 0.0000 0 180 900 7875 4815 Remove\001 55 | 4 1 0 50 -1 5 16 0.0000 0 210 990 3780 3195 update\001 56 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6615 3330 modify\001 57 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6615 3615 insert\001 58 | 4 0 0 50 -1 5 16 0.0000 0 210 660 6615 3900 skip\001 59 | 4 0 0 50 -1 5 16 0.0000 0 165 660 6615 4185 sync\001 60 | 4 0 0 50 -1 5 16 0.0000 0 210 990 6525 5760 modify\001 61 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6045 insert\001 62 | 4 0 0 50 -1 5 16 0.0000 0 165 990 6525 6330 delete\001 63 | 4 1 0 50 -1 5 16 0.0000 0 120 825 8865 5760 acess\001 64 | 4 0 0 50 -1 5 16 0.0000 0 120 990 8550 3645 remove\001 65 | 4 0 0 50 -1 5 16 0.0000 0 210 825 8550 3930 split\001 66 | -------------------------------------------------------------------------------- /Papers/Incremental-parsing/fig-after-invalidation.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5c 2 | Landscape 3 | Center 4 | Inches 5 | A4 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 11 | 1200 600 2400 600 2400 1200 1200 1200 1200 600 12 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 13 | 1200 2400 2400 2400 2400 3000 1200 3000 1200 2400 14 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 15 | 3300 600 4500 600 4500 1200 3300 1200 3300 600 16 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 17 | 3300 1500 4500 1500 4500 2100 3300 2100 3300 1500 18 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 19 | 3300 2400 4500 2400 4500 3000 3300 3000 3300 2400 20 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 21 | 3300 6000 4500 6000 4500 6600 3300 6600 3300 6000 22 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 23 | 3300 6900 4500 6900 4500 7500 3300 7500 3300 6900 24 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 25 | 5100 6900 6300 6900 6300 7500 5100 7500 5100 6900 26 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 27 | 5100 1500 6300 1500 6300 2100 5100 2100 5100 1500 28 | 2 2 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 29 | 5100 2400 6300 2400 6300 3000 5100 3000 5100 2400 30 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 3 31 | 0 0 1.00 60.00 120.00 32 | 1200 3300 1800 3300 1800 3000 33 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 34 | 0 0 1.00 60.00 120.00 35 | 1800 2400 1800 1200 36 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 37 | 0 0 1.00 60.00 120.00 38 | 2400 900 3300 900 39 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 40 | 0 0 1.00 60.00 120.00 41 | 3900 1200 3900 1500 42 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 43 | 0 0 1.00 60.00 120.00 44 | 2400 2700 3300 2700 45 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 46 | 0 0 1.00 60.00 120.00 47 | 4500 1800 5100 1800 48 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 49 | 0 0 1.00 60.00 120.00 50 | 5700 2100 5700 2400 51 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 52 | 0 0 1.00 60.00 120.00 53 | 2400 6300 3300 6300 54 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 55 | 0 0 1.00 60.00 120.00 56 | 3900 6600 3900 6900 57 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 2 58 | 0 0 1.00 60.00 120.00 59 | 4500 7200 5100 7200 60 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 61 | 1200 6000 2400 6000 2400 6600 1200 6600 1200 6000 62 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 3 63 | 0 0 1.00 60.00 120.00 64 | 1200 5700 1800 5700 1800 6000 65 | 2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 1 0 3 66 | 0 0 1.00 60.00 120.00 67 | 1200 3900 1800 3900 1800 4200 68 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 69 | 1200 4200 2400 4200 2400 4800 1200 4800 1200 4200 70 | 4 0 0 50 -1 1 12 0.0000 0 180 480 375 3375 prefix\001 71 | 4 0 0 50 -1 5 12 0.0000 0 150 960 1350 975 (a (b c)\001 72 | 4 1 0 50 -1 5 12 0.0000 0 75 120 3900 975 a\001 73 | 4 1 0 50 -1 5 12 0.0000 0 150 600 3900 1875 (b c)\001 74 | 4 1 0 50 -1 5 12 0.0000 0 120 120 5700 1875 b\001 75 | 4 1 0 50 -1 5 12 0.0000 0 75 120 5700 2775 c\001 76 | 4 1 0 50 -1 5 12 0.0000 0 150 360 1800 2775 (d)\001 77 | 4 1 0 50 -1 5 12 0.0000 0 120 120 3900 2775 d\001 78 | 4 1 0 50 -1 5 12 0.0000 0 165 720 1800 6375 (g (h)\001 79 | 4 1 0 50 -1 5 12 0.0000 0 120 120 3900 6375 g\001 80 | 4 1 0 50 -1 5 12 0.0000 0 150 360 3900 7275 (h)\001 81 | 4 1 0 50 -1 5 12 0.0000 0 120 120 5700 7275 h\001 82 | 4 0 0 50 -1 1 12 0.0000 0 135 465 375 5775 suffix\001 83 | 4 0 0 50 -1 1 12 0.0000 0 135 585 375 3975 residue\001 84 | 4 1 0 50 -1 5 12 0.0000 0 75 120 1800 4575 e\001 85 | -------------------------------------------------------------------------------- /Code/GUI/McCLIM-ESA/Base/paredit-table.lisp: -------------------------------------------------------------------------------- 1 | (cl:in-package #:second-climacs-clim-base) 2 | 3 | (clim:define-command-table paredit-table) 4 | 5 | (defmacro define-paredit-command (name (&rest extra-parameters) &body body) 6 | `(define-buffer-command (,name paredit-table) ,extra-parameters 7 | ,@body)) 8 | 9 | ;;; Delimiter pairs 10 | 11 | (define-paredit-command com-insert-delimiter-pair 12 | ((opening 'character)) 13 | (edit:perform buffer 'edit:insert-delimiter-pair opening)) 14 | (define-command-specializations (paredit-table com-insert-delimiter-pair) 15 | (com-insert-parentheses-pair (#\() #\()) 16 | 17 | (define-paredit-command com-move-past-closing-delimiter 18 | ((closing 'character)) 19 | (edit:perform buffer 'edit:move-past-closing-delimiter closing)) 20 | (bind-key 'paredit-table #\) 'com-move-past-closing-delimiter #\)) 21 | 22 | (define-paredit-command 23 | com-move-past-closing-delimiter-or-insert-delimiter-pair 24 | ((opening 'character)) 25 | (edit:perform 26 | buffer 'edit:move-past-closing-delimiter-or-insert-delimiter-pair opening)) 27 | (define-command-specializations 28 | (paredit-table com-move-past-closing-delimiter-or-insert-delimiter-pair) 29 | (com-move-past-closing-double-quote-or-insert-double-quote-pair 30 | (#\") #\") 31 | (com-move-past-closing-vertical-line-or-insert-vertical-line-pair 32 | (#\|) #\|)) 33 | 34 | (define-paredit-command com-delete-delimiter-pair-or-item 35 | (&key (direction 'direction)) 36 | (edit:perform 37 | buffer 'edit:delete-delimiter-pair-or-item direction 38 | :if-not-empty (lambda (cursor obstacle) 39 | (ecase obstacle 40 | (:outside 41 | (edit:move cursor edit:item direction)) 42 | (:inside 43 | (let ((direction (edit:opposite-direction direction))) 44 | (edit:delete cursor edit:item direction))))))) 45 | (define-command-specializations 46 | (paredit-table com-delete-delimiter-pair-or-item) 47 | (com-delete-delimiter-pair-or-item-forward 48 | (:direction :forward) (#\d :control)) 49 | (com-delete-delimiter-pair-or-item-backward 50 | (:direction :backward) #\Backspace)) 51 | 52 | (define-paredit-command com-delete-semi-line-or-expression 53 | (&key (direction 'direction)) 54 | (edit:perform buffer 'edit.exp:delete-semi-line-or-expressions direction)) 55 | (define-command-specializations 56 | (paredit-table com-delete-semi-line-or-expression) 57 | (com-delete-semi-line-or-expression-forward 58 | (:direction :forward) (#\k :control)) 59 | #+later (com-delete-semi-line-or-expression-backward 60 | (:direction :backward))) 61 | 62 | (define-paredit-command com-surround-with-delimiter-pair 63 | (&key (unit 'unit) 64 | (direction 'direction) 65 | (opening 'character) 66 | (count '(integer 1) :default 1)) 67 | (edit:perform buffer 'edit:surround-with-delimiter-pair 68 | unit direction opening :count count)) 69 | (define-command-specializations (paredit-table com-surround-with-delimiter-pair) 70 | (com-surrround-expression-with-left-parenthesis 71 | (:unit edit.exp:expression :direction :forward :opening #\() (#\( :meta)) 72 | (com-surrround-expression-with-double-quote 73 | (:unit edit.exp:expression :direction :forward :opening #\") (#\" :meta)) 74 | (com-surrround-expression-with-vertical-line 75 | (:unit edit.exp:expression :direction :forward :opening #\|) (#\| :meta))) 76 | --------------------------------------------------------------------------------