Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
papers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
climacs
papers
Commits
c3e98d3d
Commit
c3e98d3d
authored
19 years ago
by
Robert Strandh
Browse files
Options
Downloads
Patches
Plain Diff
Corrected some statements about the current implementation that were
incorrect. Added conclusions and future work.
parent
845c5eaa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
climacssyntax.tex
+90
-12
90 additions, 12 deletions
climacssyntax.tex
with
90 additions
and
12 deletions
climacssyntax.tex
+
90
−
12
View file @
c3e98d3d
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
The Climacs text editor is a CLIM implementation of a text editor in
The Climacs text editor is a CLIM implementation of a text editor in
the Emacs tradition. Climacs was designed to allow for incremental
the Emacs tradition. Climacs was designed to allow for incremental
parsing of the buffer contents, so that a sophisticated analysis of
parsing of the buffer contents, so that a sophisticated analysis of
the
buffer
contents can be performed without impacting performance.
the contents can be performed without impacting performance.
We describe two different syntax modules: a module for a
We describe two different syntax modules: a module for a
sequentially-defined syntax of a typical programming language, doing
sequentially-defined syntax of a typical programming language, doing
the bulk of its parsing in a per-window function; and an interactive
the bulk of its parsing in a per-window function; and an interactive
...
@@ -103,20 +103,21 @@ name. Even if the regular expression parses the whole block comment
...
@@ -103,20 +103,21 @@ name. Even if the regular expression parses the whole block comment
correctly, other expressions can still match on the contents of the
correctly, other expressions can still match on the contents of the
comment, leading to issues when the first character in a column in the
comment, leading to issues when the first character in a column in the
block comment is the start of a definition. Emacs users quickly learn
block comment is the start of a definition. Emacs users quickly learn
to insert a space before the open paren to work around Emacs'
to insert a space before the open paren
thesis
to work around Emacs'
font-lock deficiencies.
font-lock deficiencies.
The Climacs text editor is a combination of frameworks for buffer
The Climacs text editor is a combination of frameworks for buffer
representation and parsing, loosely coupled with a CLIM-based display
representation and parsing, loosely coupled with a CLIM-based display
engine. It includes the Flexichain library
\cite
{
flexichain
}
, which
engine. It includes the Flexichain library
\cite
{
flexichain
}
, which
provides an editable sequence representation and mark (cursor)
provides an editable sequence representation and mark (cursor)
management using a simple linked lists used for implementing the
management using a simple linked list for implementing the buffer
buffer protocol; and an implementation of a slight modification of the
protocol. Climacs also includes an implementation of a slight
Earley parsing algorithm
\cite
{
earley
}
, to assist in the creation of
modification of the Earley parsing algorithm
\cite
{
earley
}
, to assist
syntax-aware editing modes. An application can combine a particular
in the creation of syntax-aware editing modes, though such modes can
implementation of the buffer protocol, the syntax protocol, and its
use any appropriate parsing algorithm. An application can combine a
own display methods to produce a sophisticated editor for a particular
particular implementation of the buffer protocol, the syntax protocol,
language.
and its own display methods to produce a sophisticated editor for a
particular language.
The Climacs buffer protocol, which provides a standard interface to
The Climacs buffer protocol, which provides a standard interface to
common text editor buffer operations, uses the Flexichain library; we
common text editor buffer operations, uses the Flexichain library; we
...
@@ -125,7 +126,7 @@ syntax protocol, which we discuss in section \ref{sec:syntax},
...
@@ -125,7 +126,7 @@ syntax protocol, which we discuss in section \ref{sec:syntax},
provides a method for interfacing a lexical analyzer and parser with
provides a method for interfacing a lexical analyzer and parser with
the text editor, and provides for defining methods to draw syntax
the text editor, and provides for defining methods to draw syntax
objects in the Climacs window. In section
\ref
{
sec:syntaxes
}
we
objects in the Climacs window. In section
\ref
{
sec:syntaxes
}
we
discuss the implementation of syntactic analys
i
s for various
discuss the implementation of syntactic analys
e
s for various
programming languages, including Common Lisp; in section
programming languages, including Common Lisp; in section
\ref
{
sec:tabeditor
}
, we discuss an application with Climacs at its
\ref
{
sec:tabeditor
}
, we discuss an application with Climacs at its
core to support editing a textual representation of lute tablature.
core to support editing a textual representation of lute tablature.
...
@@ -257,6 +258,36 @@ text is up-to-date at every point during an edit. The per-buffer
...
@@ -257,6 +258,36 @@ text is up-to-date at every point during an edit. The per-buffer
approach is appropriate when the parse tree will also be used for some
approach is appropriate when the parse tree will also be used for some
other display or analysis of the text in the buffer.
other display or analysis of the text in the buffer.
Climacs includes a parser that uses the Earley
\cite
{
earley
}
parsing
algorithm. There are many advantages of this algorithm in the context
of text editing. Perhaps most importantly, it does not require any
preprocessing of the grammar, which makes it necessary for the entire
grammar to be known ahead of time. This means that the user can
load Lisp files containing additional syntax rules to complete the
existing ones without having to apply any costly grammar analysis.
Other advantages include the possibility of using ambiguous grammars,
since the Earley parsing algorithm accepts the full class of
context-free grammars. This feature is crucial in certain
applications, for instance in a grammar checker for natural
languages. The Climacs syntax protocol can, but is not required
to, use the provided Earley parser. It can use any algorithm with an
explicit representation of the parser state, which is a necessary, but
not sufficient, requirement for making the parsing algorithm
incremental.
However, the Earley parsing algorithm is relatively slow compared to
table-based algorithms such as the LR shift/reduce algorithm.
Worst-case complexity is
$
O
(
n
^
3
)
$
where
$
n
$
is the size of the input.
It drops to
$
O
(
n
^
2
)
$
for unambiguous grammars and to
$
O
(
n
)
$
for a
large class of grammars suitable for parsing programming langauges.
Even so, the complexity is often proportional to the size of the
grammar (which is considered a constant by Earley), which can be
problematic in a text editor. We have yet to determine whether the
implementation of the Earley algorithm that we provide will turn out
to be sufficiently fast for most Climacs syntax modules. Other
possibilities include the Tomita parsing algorithm which provides more
generality than LR, but which is nearly as fast in most cases.
\section
{
Syntaxes
}
\section
{
Syntaxes
}
\label
{
sec:syntaxes
}
\label
{
sec:syntaxes
}
...
@@ -428,8 +459,55 @@ documented CoreMIDI framework; a port to alsalib is on the cards.
...
@@ -428,8 +459,55 @@ documented CoreMIDI framework; a port to alsalib is on the cards.
\section
{
Future Work and Conclusions
}
\section
{
Future Work and Conclusions
}
\label
{
sec:conclusions
}
\label
{
sec:conclusions
}
I like Jello. Jello is good. We should enable people to make better
Given the relatively small amount of work (only a few person-months)
Jello.
that has been put into Climacs so far, it is already a very competent
and stable editor. Using CLIM (and in particular the McCLIM
implementation) as the display engine has allowed the project to
progress much more rapidly than what would have been possible
otherwise. However, Climacs has also revealed some serious
limitations and performance problems of the McCLIM library. We
maintain that using CLIM and McCLIM was the best choice, and in fact
advantageous to other McCLIM users as well, since work is being done
to correct and improve it for use with Climacs.
Due to its reliance on fairly well-defined protocols, the Climacs text
editor framework is flexible enough to allow for different future
directions. Turning the Common Lisp syntax module into an excellent
programming tool for Lisp programmers is high on the list of
priorities, for many reasons. First, it will encourage further work
on Climacs. Second, the Common Lisp syntax module is likely to become
one of the more advanced ones to exist for Climacs, given that Climacs
has unique and direct access to the features of the underlying Common
Lisp implementation. Thus, the Common Lisp syntax module is likely to
exercise the Climacs protocols to a very high degree. This will allow
us to improve those protocols as well as their corresponding
implementations.
Another future direction high up on the list of priorites is the
planned implementation of the buffer protocol. Representing a line
being editied as a flexichain can greatly improve the performance of
some crucial operations that currently require looping over each
buffer object until a newline character is found. Other operations
that are currently prohibitive include knowing the line- and column
number of a given mark.
However, our plans for Climacs go further than creating an improved
implementation of Emacs. We intend to make Climacs a fully-integrated
CLIM application. This implies among other things using the
presentation-type system of CLIM to exchange objects between Climacs
and other CLIM appliations such as an inspector application, a
debugger pane, etc. We also hope that implementors of other CLIM
applications such as mail readers, news readers, etc, will consider
using Climacs for creating messages.
We are often asked whether applications such as VM and Gnus for GNU
Emacs will be available for Climacs. Our opinion is that such
applications currenltly run as GNU Emacs subsystems, simply because
GNU Emacs does not have an independent substrate such as CLIM for
creating user interfaces. Climacs is itself a CLIM application, and
applications such as mail readers and news readers that do not require
editable buffers should instead be implemented directly as CLIM
applications, perhaps calling Climacs to write messages.
\nocite
{
*
}
\nocite
{
*
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment