[wg-camlp4] My uses of syntax extension
Fabrice Le Fessant
Fabrice.Le_fessant at inria.fr
Mon Jan 28 17:01:14 GMT 2013
On 01/28/2013 05:51 PM, Alain Frisch wrote:
> On 01/28/2013 05:44 PM, Fabrice Le Fessant wrote:
>> Of course. For that, anyway, you need a "standard" of quotations and
>> anti-quotations, i.e. all parsers must obey the rule that
>> anti-quotations are between $...$ and quotations between <:XXX< ... >>.
>> Then, you don't need to know the syntax within the (anti-)quotations,
>> you can delegate parsing at the time the parsetree is needed.
>
> We need to be careful about lexical conventions: do we lex strings and
> comments as the standard lexer within quotations, for instance? Do we
> provide a mechanism to escape the closing delimiters?
You would probably want to have "$$" => "$" to escape it, and
something similar for "<:" and ">>".
I think you have two sets of alternative levels, i.e. "even" and "odd"
levels, $...$ can only appear in "even" levels, and <:...<...>> in "odd"
levels, so you only need to escape delimiters in the levels where they
can appear, no ?
--Fabrice
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fabrice_le_fessant.vcf
Type: text/x-vcard
Size: 380 bytes
Desc: not available
URL: <http://lists.ocaml.org/pipermail/wg-camlp4/attachments/20130128/af16089f/attachment-0001.vcf>
More information about the wg-camlp4
mailing list