Lexer and parser generators using CTFE

d coder dlang.coder at gmail.com
Sun May 27 10:53:37 PDT 2012


>
> I would like the parser to effect some side effects. For this purpose, I
> tried including the parser mixin into a class, but I got a strange error
> saying:
>
> Error: need 'this' to access member parse
>
>
Ok. I see my folly. At compile time, there would not be any "this" since
the class has not been instantiated yet.

I will have to think of other solutions. Basically, I am trying to use the
parser to create functions that I can use at run time. But I wanted to
create two functions from the same parser. I have succeeded with creating
one function. I do not want to create two separate parsers because each of
these parsers would add to memory footprint of the compiler.

Any ideas? Maybe I could use tuples here?

Regards
- Puneet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120527/bde3a13b/attachment-0001.html>


More information about the Digitalmars-d mailing list