<s>
A	O
structure	B-Application
editor	I-Application
,	O
also	O
structured	B-Application
editor	I-Application
or	O
projectional	B-Application
editor	I-Application
,	O
is	O
any	O
document	B-General_Concept
editor	I-General_Concept
that	O
is	O
cognizant	O
of	O
the	O
document	O
's	O
underlying	O
structure	O
.	O
</s>
<s>
Structure	B-Application
editors	I-Application
can	O
be	O
used	O
to	O
edit	O
hierarchical	O
or	O
marked	O
up	O
text	O
,	O
computer	B-Application
programs	I-Application
,	O
diagrams	O
,	O
chemical	O
formulas	O
,	O
and	O
any	O
other	O
type	O
of	O
content	O
with	O
clear	O
and	O
well-defined	O
structure	O
.	O
</s>
<s>
In	O
contrast	O
,	O
a	O
text	B-Application
editor	I-Application
is	O
any	O
document	B-General_Concept
editor	I-General_Concept
used	O
for	O
editing	O
plain	O
text	B-General_Concept
files	I-General_Concept
.	O
</s>
<s>
Typically	O
,	O
the	O
benefits	O
of	O
text	O
and	O
structure	B-Application
editing	I-Application
are	O
combined	O
in	O
the	O
user	B-Application
interface	I-Application
of	O
a	O
single	O
hybrid	O
tool	O
.	O
</s>
<s>
For	O
example	O
,	O
Emacs	B-Application
is	O
fundamentally	O
a	O
text	B-Application
editor	I-Application
,	O
but	O
supports	O
the	O
manipulation	O
of	O
words	O
,	O
sentences	O
,	O
and	O
paragraphs	O
as	O
structures	O
that	O
are	O
inferred	O
from	O
the	O
text	O
.	O
</s>
<s>
Conversely	O
,	O
Dreamweaver	B-Language
is	O
fundamentally	O
a	O
structure	B-Application
editor	I-Application
for	O
marked	O
up	O
web	O
documents	O
,	O
but	O
supports	O
the	O
display	O
and	O
manipulation	O
of	O
raw	O
HTML	B-Language
text	O
as	O
well	O
.	O
</s>
<s>
Similarly	O
,	O
molecule	B-Application
editors	I-Application
typically	O
support	O
both	O
graphical	O
and	O
textual	O
input	O
.	O
</s>
<s>
Structure	B-Application
editing	I-Application
predominates	O
when	O
content	O
is	O
graphical	O
and	O
textual	O
representations	O
are	O
awkward	O
,	O
e.g.	O
,	O
CAD	B-Application
systems	O
and	O
PowerPoint	B-Application
.	O
</s>
<s>
Text	B-Application
editing	I-Application
predominates	O
when	O
content	O
is	O
largely	O
devoid	O
of	O
structure	O
,	O
e.g.	O
,	O
text	O
fields	O
in	O
web	O
forms	O
.	O
</s>
<s>
WYSIWYG	B-Application
word	B-General_Concept
processing	I-General_Concept
systems	I-General_Concept
such	O
as	O
Word	B-Application
,	O
which	O
appear	O
to	O
edit	O
formatted	O
text	O
directly	O
,	O
are	O
essentially	O
structure	B-Application
editors	I-Application
for	O
the	O
underlying	O
marked-up	O
text	O
.	O
</s>
<s>
In	O
linguistics	O
,	O
syntax	B-Application
is	O
the	O
study	O
of	O
the	O
structure	O
of	O
grammatical	O
utterances	O
,	O
and	O
accordingly	O
syntax-directed	B-Application
editor	I-Application
is	O
a	O
synonym	O
for	O
structure	B-Application
editor	I-Application
.	O
</s>
<s>
For	O
example	O
,	O
language	O
sensitivity	O
in	O
Emacs	B-Application
is	O
implemented	O
in	O
the	O
Lisp	B-Language
definition	O
of	O
the	O
edit	O
mode	O
for	O
the	O
given	O
language	O
.	O
</s>
<s>
In	O
contrast	O
,	O
language	O
sensitivity	O
in	O
an	O
XML	B-Protocol
editor	I-Protocol
is	O
driven	O
by	O
a	O
formal	O
DTD	B-Language
schema	O
for	O
the	O
given	O
language	O
.	O
</s>
<s>
Although	O
structured	B-Application
editors	I-Application
allow	O
the	O
viewing	O
and	O
manipulation	O
of	O
the	O
underlying	O
document	O
in	O
a	O
structured	O
manner	O
,	O
the	O
file	O
format	O
in	O
which	O
the	O
document	O
is	O
stored	O
on	O
disk	O
may	O
or	O
may	O
not	O
be	O
heavily	O
structured	O
and	O
may	O
or	O
may	O
not	O
be	O
open	O
or	O
standardized	O
(	O
e.g.	O
,	O
plain	O
text	O
versus	O
Microsoft	B-Application
Word	I-Application
documents	O
)	O
.	O
</s>
<s>
Structure	B-Application
editing	I-Application
has	O
often	O
been	O
employed	O
in	O
source	B-Application
code	I-Application
editors	I-Application
,	O
as	O
source	O
code	O
is	O
naturally	O
structured	O
by	O
the	O
syntax	B-Application
of	O
the	O
computer	O
language	O
.	O
</s>
<s>
However	O
,	O
most	O
source	B-Application
code	I-Application
editors	I-Application
are	O
instead	O
text	B-Application
editors	I-Application
with	O
additional	O
features	O
such	O
as	O
syntax	B-Application
highlighting	O
and	O
code	B-Application
folding	I-Application
,	O
rather	O
than	O
structure	B-Application
editors	I-Application
.	O
</s>
<s>
The	O
editors	O
in	O
some	O
integrated	B-Application
development	I-Application
environments	I-Application
parse	O
the	O
source	O
code	O
and	O
generate	O
a	O
parse	O
tree	O
,	O
allowing	O
the	O
same	O
analysis	O
as	O
by	O
a	O
structure	B-Application
editor	I-Application
,	O
but	O
the	O
actual	O
editing	O
of	O
the	O
source	O
code	O
is	O
generally	O
done	O
as	O
raw	O
text	O
.	O
</s>
<s>
Each	O
programming	O
language	O
typically	O
has	O
a	O
well-defined	O
syntax	B-Application
given	O
by	O
a	O
context-free	O
grammar	O
,	O
and	O
accordingly	O
the	O
meaningful	O
structural	O
elements	O
in	O
source	O
code	O
written	O
in	O
the	O
language	O
correspond	O
to	O
the	O
grammatical	O
phrases	O
in	O
the	O
text	O
.	O
</s>
<s>
Early	O
syntax-directed	O
source	B-Application
code	I-Application
editors	I-Application
included	O
Interlisp-D	B-Language
(	O
for	O
Lisp	B-Language
’s	O
limited	O
syntax	B-Application
)	O
and	O
Emily	O
(	O
for	O
PL/I	B-Language
’	O
s	O
rich	O
syntax	B-Application
)	O
.	O
</s>
<s>
A	O
syntax-directed	B-Application
editor	I-Application
may	O
treat	O
grammar	O
rules	O
as	O
generative	O
(	O
e.g.	O
,	O
offering	O
the	O
user	O
templates	B-Protocol
that	O
correspond	O
to	O
one	O
or	O
more	O
steps	O
in	O
a	O
formal	O
derivation	O
of	O
program	O
text	O
)	O
or	O
proscriptive	O
(	O
e.g.	O
,	O
preventing	O
a	O
phrase	O
of	O
a	O
given	O
part	O
of	O
speech	O
from	O
being	O
moved	O
to	O
a	O
context	O
where	O
another	O
part	O
of	O
speech	O
is	O
required	O
)	O
or	O
analytic	O
(	O
e.g.	O
,	O
parsing	O
textual	O
edits	O
to	O
create	O
a	O
structured	O
representation	O
)	O
.	O
</s>
<s>
Structure	B-Application
editing	I-Application
features	O
in	O
source	B-Application
code	I-Application
editors	I-Application
make	O
it	O
harder	O
to	O
write	O
programs	O
with	O
invalid	O
syntax	B-Application
.	O
</s>
<s>
Language-sensitive	O
editors	O
may	O
impose	O
syntactic	O
correctness	O
as	O
an	O
absolute	O
requirement	O
(	O
e.g.	O
,	O
as	O
did	O
Mentor	O
)	O
,	O
or	O
may	O
tolerate	O
syntax	B-Application
errors	I-Application
after	O
issuing	O
a	O
warning	O
(	O
e.g.	O
,	O
as	O
did	O
the	O
Cornell	O
Program	O
Synthesizer	O
)	O
.	O
</s>
<s>
Strict	O
structured	B-Application
editors	I-Application
often	O
make	O
it	O
difficult	O
to	O
perform	O
edits	O
that	O
are	O
easy	O
to	O
perform	O
with	O
plain	O
text	B-Application
editors	I-Application
,	O
which	O
is	O
one	O
of	O
the	O
factors	O
contributing	O
to	O
the	O
lack	O
of	O
adoption	O
of	O
structured	B-Application
editing	I-Application
in	O
some	O
domains	O
,	O
such	O
as	O
source	O
code	O
editing	O
.	O
</s>
<s>
Some	O
syntax-directed	B-Application
editors	I-Application
monitor	O
compliance	O
with	O
the	O
context-sensitive	O
constraints	O
of	O
a	O
language	O
such	O
as	O
type	O
correctness	O
.	O
</s>
<s>
Such	O
static-semantic	O
constraints	O
may	O
be	O
specified	O
imperatively	B-Application
by	O
actions	O
(	O
e.g.	O
,	O
as	O
in	O
Gandalf	O
)	O
,	O
or	O
declaratively	B-Language
by	O
an	O
attribute	B-Application
grammar	I-Application
(	O
e.g.	O
,	O
as	O
in	O
the	O
Synthesizer	O
Generator	O
)	O
or	O
by	O
unification	O
in	O
a	O
many-sorted	O
algebra	O
(	O
e.g.	O
,	O
as	O
in	O
PSG	O
)	O
or	O
a	O
logic	B-Language
program	I-Language
(	O
e.g.	O
,	O
as	O
in	O
Centaur	O
and	O
Pan	O
)	O
,	O
with	O
compliance	O
checked	O
by	O
the	O
underlying	O
editing	O
machinery	O
.	O
</s>
<s>
Structured	B-Application
editors	I-Application
vary	O
in	O
the	O
degree	O
to	O
which	O
they	O
allow	O
their	O
users	O
to	O
perform	O
edits	O
that	O
cause	O
the	O
document	O
to	O
become	O
syntactically	O
or	O
semantically	O
incorrect	O
.	O
</s>
<s>
It	O
is	O
common	O
for	O
a	O
language	O
sensitive	O
editor	O
to	O
represent	O
a	O
document	O
as	O
a	O
parse	O
tree	O
with	O
respect	O
to	O
language	O
's	O
grammar	O
,	O
or	O
as	O
an	O
abstract	B-Data_Structure
syntax	I-Data_Structure
tree	I-Data_Structure
(	O
AST	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
DOM	B-General_Concept
tree	I-General_Concept
is	O
essentially	O
an	O
AST	O
with	O
respect	O
to	O
a	O
given	O
DTD	B-Language
.	O
</s>
<s>
Frequently	O
,	O
the	O
textual	O
view	O
of	O
that	O
underlying	O
tree	O
is	O
generated	O
by	O
prettyprinting	B-Application
the	O
underlying	O
tree	O
.	O
</s>
<s>
Editors	O
associated	O
with	O
intentional	B-Application
programming	I-Application
and	O
language-oriented	B-Application
programming	I-Application
for	O
general-purpose	O
languages	O
and	O
domain-specific	B-Language
languages	I-Language
share	O
many	O
of	O
the	O
features	O
of	O
language-sensitive	O
editors	O
,	O
but	O
aim	O
for	O
greater	O
separation	O
between	O
the	O
underlying	O
representation	O
(	O
the	O
intention	O
)	O
and	O
the	O
surface	O
representation	O
(	O
text	O
in	O
a	O
programming	O
language	O
)	O
.	O
</s>
