[nem-en] Macros and syntax extensions.

Sergei Tulentsev sergei.tulentsev at gmail.com
Mon Apr 30 02:01:17 CEST 2007


Now I bumped into this couple.

In order to format the code, I get bodies of methods as PExpr's. There is
PExpr.MacroCall.
Fine.
Almost. :-)

This is its definition:
    // macros stuff
    | MacroCall       { name : Name; ns : NamespaceTree.Node;
                        parms : list [SyntaxElement]; }

We see no sign of custom syntax that was probably introduced by the macro.
For example, the "if" macro.
if(cond)
  true
else
  false

In this case we will have two elements in parms, literals "true" and
"false". But I also need to get parse information about "if" and "else"
(more specifically, locations)
Or... I need a way to get custom syntax description of that macro.  So that
I can manually lookup parts of it in the token stream.

Any ideas?

-- 
Best wishes,
Sergei Tulentsev
Senior software engineer.

SITRONICS Telecom Solutions, Moscow
http://www.sitels.ru
mob: + 7 916 507 7112
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20070430/ce29443e/attachment.html


More information about the devel-en mailing list