[antlr-interest] A problem with loading AST Node type occured.

Micheal J open.zone at virgin.net
Tue Feb 7 02:15:29 PST 2006


Does the heteroAST example work on your system?. If yes, that would be a good starting point for developing your own language processor using heterogenous AST node class(es).
 
Also not sure that (off the top of my head) it's a good idea to override the initialize() methods to do nothing.
 
Micheal

-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ëï¼Í¸Õ Jigang (Robert) Sun
Sent: 07 February 2006 08:40
To: antlr-interest at antlr.org
Subject: [antlr-interest] A problem with loading AST Node type occured.


A problem with loading AST Node type occured.
 
Here is my simplest grammar:
 
 primaryExp
  :
   INTEGER_LITERAL <AST=INTNode>
  ;

 
INTNode class
 
 public abstract class Expr : antlr.BaseAST{
  public abstract int value();
 }
 
 public class INTNode:Expr{
  int val=0;
  public INTNode(Token tok){
   val=int.Parse(tok.getText());
   }
  public override int value(){
   return val;
  }
  
  public override  void initialize(AST t){
  }
  public override  void initialize(IToken t){
  }
  public override  void initialize(int i,string s){
  }
 }
 
I have just newly downloaded Microsoft Framework 2.0, but the problem is still persisted.
 
Jigang



  _____  

雅虎1G免费邮箱百分百防垃圾信 <http://cn.mail.yahoo.com> 
雅虎助手-搜索、杀毒、防骚扰 <http://cn.zs.yahoo.com>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060207/7add03ba/attachment.html


More information about the antlr-interest mailing list