[antlr-interest] Re: While using preliminary C# code generator.

dinurp dinurp at yahoo.com
Mon Apr 29 20:47:52 PDT 2002


Hello Micheal,
I have another change I made to share:
lib\csharp\antlr\debug\miscJTreeASTPanel.cs
        public ASTTreeNode(AST a)
        {
            ASTNode_ = a;
            //this.Text = a.getText();
            this.Text = a.ToString(); //DINU
            this.Nodes.Add("Loading.....");
        }

The tree was not behaving like in the Java version. This change I am 
not too sure. But it started behaving the way I wanted it to.

Some clarifications on the earlier post:

> > 1) new MyLexer(System.In) //did not compile
> 
> System.In is a Java-ism. In C# you need to use System.Console.In 
> instead. See the CSharp examples for more info.

Granted, the mistake crept in the post. I meant Console.In

> 
> A StreamReader is a TextReader. It's a subclass of TextReader.
> CharBuffer would accept a StreamReader in any case.
> No need for this change AFAICT.
> 

The problem is in the generated Parser class, it misses the 
constructor with TextReader as a parameter. The closest one takes 
StreamReader as an argument. The suggestion is to change this 
constructor. Nothing major.


Thanks
Dinu



 

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



More information about the antlr-interest mailing list