Compiling DMD parser?

Markus Koskimies markus at reaaliaika.net
Sun Jul 13 23:01:48 PDT 2008


On Mon, 14 Jul 2008 05:45:59 +0000, Markus Koskimies wrote:

> But that does not solve my problem to determine, which kind of statement
> type there is in the tree; I can currently extract only those, which
> have isXXXX functions in the Statement class.

Here is an example:

test.d:
---
import std.stdio;

void main()
{
    int x;
    
    writefln("%d", x);
    
    return;
}
---

When I walk through the module (test), I get following result:

---
test: module
    object: import
    std: import
    Func: void main()
    Function body:
        Compound statement:
            Compound statement:
                Decl statement: int x = x (in a declar Exp)=  0;

==>             Unknown statement: (writefln)("%d",(x));

                Compound statement:
==>                 Unknown statement: 0;

                    Return statement: return ;
---

I'm wondering how to extract the type of those statements... At least 
they are not any of the Statement.isXXXX -types.



More information about the Digitalmars-d mailing list