[nem-en] Questions about macros
Kamil Skalski
kamil.skalski at gmail.com
Fri Jun 9 20:03:49 CEST 2006
I think it is not possible with current API. You would need to create
MainParser object with the token stream (the first token wrapped by
Token.BracesGroup) placed in
mutable stream : Token;
field.
I guess a new constructor or method Parse (GlobalEnv, Token) etc. in
MainParser should be created.
2006/6/9, Alejandro Serrano <trupill at yahoo.es>:
> 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
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list