[erlang-questions] some lexical questions

Richard O'Keefe ok@REDACTED
Tue Jul 13 01:22:45 CEST 2010


On Jul 13, 2010, at 2:10 AM, Joe Armstrong wrote:
> 1) Is there a "definitive" reference for the meaning of the
> allowed escape sequences within a string?

I would expect \^ to allow any of the ASCII characters
in the range 16#3F to 16#5F after it ($? to $_) with the
meaning \^x = ($x - 16#40) band 127, so that
\^? is DEL, \^@ is NUL, \^L if FF, \^Z is SUB, \^_ is US.
And in particular, \^[ should be ESC.

> This seems far easier to understand than a yacc or LL(k) grammar :-)

Since it's for lexical structure, it should be simpler;
the right comparison would be with lex.

(And it's not _really_ a fair comparison until there's some
semantics in there.)  Come to think of it, where does that
grammar recognise any of (,)[|]{;} or any operator?



More information about the erlang-questions mailing list