[nem-en] Questions about macros

Alejandro Serrano trupill at yahoo.es
Fri Jun 9 19:39:42 CEST 2006


Thanks for the quick response. In the example you point to, the tokens 
are just added to a list and converted to strings. In my case, how could 
I use the tokens again, for getting the expression "x + 1", for example?

Kamil Skalski escribió:
> Probably 'syntax' is indeed too weak for your needs. You should try
> the token stream feature:
> http://nemerle.org/Syntax_extensions
>
> You can take a look in ncc/testsuite/positive/macrolib.n and
> macroprog.n for the example with XML literals.
>
> I guess my approach would be to define macro with raw token syntax
> extension, which begins with 'from' keyword. It would take the stream,
> cut it into parts delimited by query syntax keywords (like 'select',
> 'orderby', 'where') and then try to use standard parser's methods to
> parse those partial token streams into PExpr.

		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com




More information about the devel-en mailing list