S-expressions: Difference between revisions

Content added Content deleted
(→‎{{header|TXR}}: Added explicit parser.)
(→‎{{header|TXR}}: Disclaimer about string literal lexing.)
Line 2,741: Line 2,741:
The following solution avoids "cheating" in this way with the built-in parser; it implements a from-scratch S-exp parser which treats <code>!@#</code> as just a symbol.
The following solution avoids "cheating" in this way with the built-in parser; it implements a from-scratch S-exp parser which treats <code>!@#</code> as just a symbol.


The grammar is as follows:
The grammar is roughly as follows:


<pre>
<pre>
Line 2,836: Line 2,836:
junk:
junk:
</pre>
</pre>

TODO: Note that the recognizer for string literals does not actually process the interior escape sequences <code>\"</code>; these remain as part of the string data. The only processing is the stripping of the outer quotes from the lexeme.


{{omit from|Brlcad}}
{{omit from|Brlcad}}