[antlr-interest] Good papers for C#/Java parser stages

Alex Sedow alexsedow at mail.ru
Tue May 25 11:34:26 PDT 2004


Hello Jim!

I have one question. C# type resolution depends on using directives. And
because C# types maybe defined in any order this assumes that type
resolution not fully top-down (like C++), but partly down-top.
Example:

namespace Case2
{
    class D : B
    { T x; } // <- point 1
}

namespace Case2
{
    using Case2.N;
    class B : A // <- point 2
    {}
}

namespace Case2.N
{
    class A // <- point3
    {
        public class T
        {}
    }
}

Type resolution algorithm must:
1. Process all base classes for looking type T (point1, top-down).
2. Process all enclosing namespaces and types, plus references to namespaces
and types declared in using directives (point2, down-top).
3. Process nested types (point3, top-down).

Question about point 2:
What better: store info about using directives in entity model on first
pass, or walk down-top through AST for looking using directives on second
pass?

Alex.

----- Original Message -----
From: Jim O'Connor
To: antlr-interest at yahoogroups.com
Sent: Monday, May 24, 2004 6:05 PM
Subject: Re: [antlr-interest] Good papers for C#/Java parser stages


Hi Alex,
  There is a Java Cross Referencer in the File Sharing section of antlr.org.
Check out Main.java, CodeProject.java and MyOutput.java.  Let me know if
this is helpful or if you have any other questions.
Jim



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list