On Fri, 6 Aug 1999, Kyle Jones wrote:
Adrian Aichner writes:
>
> Hello All,
>
> I try to define a syntax table for a language which uses " for
> string-quotes. Inside of strings " is used to char-quote ".
>
> To get a string of two consecutive double-quotes one would write:
>
> """"""
SQL, for example: Select "He said ""Quote me"".".
Particularly, it makes
escaping simple: s/"/""/.
Yuck! Unless the langauge disallows empty strings, your example
could be parsed four different ways!
Probably not. The language would most likely disallow two strings without
any intervening lexical tokens. I don't see any ambiguity.
""""""
"" """"
"""" ""
"" "" ""
2-4 are strings followed by strings. The first is a single string of two
double quotes.
> My conclusion is that this cannot be done with elisp syntax
tables.
> Am I correct?
Yes. The syntax you describe requires the " character
to be in two different syntax classes. Not possible.
> Any suggestions?
Hack XEmacs to add an ad hoc syntax class for this language.
It's not without precedent. The syntax class for ' is tailored
for Lisp usage.
You could treat "testing""123" as two strings concatenated:
"testing"
followed by "123". Unless you want to treat the "" specially, it
should
be easy enough the ignore the special language construct (ie: it becomes
"). Disclaimer: I know nothing about xemacs syntax tables.
-Justin
vallon(a)mindspring.com